Re: [Xen-devel] [PATCH v2 5/7] xen/arm32: Invalidate BTB on guest exit for Cortex A17 and 12

2018-01-31 Thread Julien Grall
On 31/01/18 17:39, Stefano Stabellini wrote: On Wed, 31 Jan 2018, Julien Grall wrote: Hi, On 31/01/18 16:53, Julien Grall wrote: +GLOBAL(hyp_traps_vector_bp_inv) +/* + * We encode the exception entry in the bottom 3 bits of + * SP, and we have to guarantee to be 8 byt

Re: [Xen-devel] [PATCH v2 5/7] xen/arm32: Invalidate BTB on guest exit for Cortex A17 and 12

2018-01-31 Thread Stefano Stabellini
On Wed, 31 Jan 2018, Julien Grall wrote: > Hi, > > On 31/01/18 16:53, Julien Grall wrote: > > +GLOBAL(hyp_traps_vector_bp_inv) > > +/* > > + * We encode the exception entry in the bottom 3 bits of > > + * SP, and we have to guarantee to be 8 bytes aligned. > > + */

Re: [Xen-devel] [PATCH v2 5/7] xen/arm32: Invalidate BTB on guest exit for Cortex A17 and 12

2018-01-31 Thread Julien Grall
Hi, On 31/01/18 16:53, Julien Grall wrote: +GLOBAL(hyp_traps_vector_bp_inv) +/* + * We encode the exception entry in the bottom 3 bits of + * SP, and we have to guarantee to be 8 bytes aligned. + */ +add sp, sp, #1 /* Reset7 */

[Xen-devel] [PATCH v2 5/7] xen/arm32: Invalidate BTB on guest exit for Cortex A17 and 12

2018-01-31 Thread Julien Grall
From: Julien Grall In order to avoid aliasing attackes agains the branch predictor, let's invalidate the BTB on guest exist. This is made complicated by the fact that we cannot take a branch invalidating the BTB. This is based on the first version posrted by Marc Zyngier on Linux-arm mailing lis