thopre01Good morning everyone08:48
thopre01Had a nice WE?08:49
clyonrainy, but yes08:50
clyonhow about you?08:50
thopre01Busy with housework, not very relaxing but at least I didn't waste it :-)09:03
ardbclyon: thanks! (forgot to say that in the email)13:22
clyonardb, no pb. the i386 version is not as simple as the rs6000 one, though13:28
ardbclyon: no i am playing around with a variation on the rs6000 one atm13:28
maximkardb: iiuc, you want to make it so that stack_protect_set_<mode> is always used with [x18] as argument?14:26
maximkardb: i.e., (match_scratch:PTR 2 "=&r") would always return x18?14:29
maximkardb: ah, no, you want (match_operand:PTR 1 "memory_operand" "m") to be [x18]14:31
maximkardb: [aside from the question of "why you need that"] I think you should add a new constraint for memory_operand to only allow x18 register.14:34
maximkardb: that would be simplest14:34
ardbmaximk: ok thanks14:42
ardb(although i don't fully grasp what you said there)14:42
rengolinrovka: psmith_ maximk FYI: https://projects.linaro.org/browse/TCWG-133715:07
rovka^ yroux, thopre01 as well :)15:09
rengolinrovka: yup, thanks! :)15:32
yrouxThanks :)15:41
maximkardb: operand constraint is the "m" after "memory_operand"15:47
maximkardb: see aarch64/constraints.md, e.g. "Q" constraint.15:47
maximkardb: I suspect you want to copy "Q" constraint into, say, "T" constraint, and add REGNO==18 as another condition.15:48
maximkardb: then tell match_operand to use "memory_operand" "T")15:48
ardbmaximk: interesting15:49
ardbmaximk: i will try that15:49
maximkardb: you will surely get a crash somewhere due to some other register being in the operand (constraints don't tell how to generate, they only assert of what should be generated)15:50
maximkardb: so then you'll have to play with register classes, I suppose.15:50
ardbmaximk: oof15:51
ardbmaximk: my head hurts already :-)15:51
ardbmaximk: but thanks for the lesson15:51
maximkardb: what's your goal?15:53
ardbmaximk: the goal is to use a different stack canary value per thread in the kernel15:53
ardbmaximk: currently, all processes during the lifetime of the entire boot use the same value15:54
maximkah, and x18 holds thread's canary15:54
ardbwhich is not good for security15:54
ardbmaximk: yes, or the address in this case15:54
maximkardb: proper implementation would be via register classes (see aarch64/aarch64.h), I believe.  You can hack-up a prototype just by changing (define_insn) to something like15:57
maximk(define_insn "stack_protect_set_<mode>"15:59
maximk  [(set (match_operand:PTR 0 "memory_operand" "=m")15:59
maximk(unspec:PTR [(const_int 0)]15:59
maximk UNSPEC_SP_SET))15:59
maximk   (set (match_scratch:PTR 2 "=&r") (const_int 0))]15:59
maximk  ""15:59
maximk  "ldr\\t%<w>2, [x18]\;str\\t%<w>2, %0\;mov\t%<w>2,0"15:59
maximk  [(set_attr "length" "12")15:59
maximk   (set_attr "type" "multiple")])15:59
maximkardb: and use "-fixed-reg x18"16:00
ardbmaximk: this seems to work as well https://pastebin.com/rsQhct9016:00
ardbmaximk: but i need some experimentation, also to decide which register, offset symbol etc to use16:01
maximkardb: looks OK16:02
maximk… fwiw16:02
ardbmaximk: thanks16:02

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!