Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-17 Thread Andrew Cooper
On 17/03/2022 10:43, Jan Beulich wrote: > On 17.03.2022 11:02, Andrew Cooper wrote: >> For livepatching, we need to look at a potentially clobbered function and >> determine whether it used to have an ENDBR64 instruction. >> >> Use a non-default 4-byte P6 long nop, not emitted by toolchains, and

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-17 Thread Jan Beulich
On 17.03.2022 11:02, Andrew Cooper wrote: > For livepatching, we need to look at a potentially clobbered function and > determine whether it used to have an ENDBR64 instruction. > > Use a non-default 4-byte P6 long nop, not emitted by toolchains, and extend > check-endbr.sh to look for it. > >

[PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-17 Thread Andrew Cooper
For livepatching, we need to look at a potentially clobbered function and determine whether it used to have an ENDBR64 instruction. Use a non-default 4-byte P6 long nop, not emitted by toolchains, and extend check-endbr.sh to look for it. The choice of nop has some complicated consequences.

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-10 Thread Jan Beulich
On 10.03.2022 19:42, Andrew Cooper wrote: > On 08/03/2022 16:03, Andrew Cooper wrote: >> --- a/xen/arch/x86/include/asm/endbr.h >> +++ b/xen/arch/x86/include/asm/endbr.h >> @@ -52,4 +52,16 @@ static inline void place_endbr64(void *ptr) >> *(uint32_t *)ptr = gen_endbr64();

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-10 Thread Andrew Cooper
On 08/03/2022 16:03, Andrew Cooper wrote: > --- a/xen/arch/x86/include/asm/endbr.h > +++ b/xen/arch/x86/include/asm/endbr.h > @@ -52,4 +52,16 @@ static inline void place_endbr64(void *ptr) > *(uint32_t *)ptr = gen_endbr64(); > } > > +/* > + * After

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-09 Thread Doebel, Bjoern
On 08.03.22 15:01, Andrew Cooper wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe. For livepatching, we need to look at a potentially clobbered function and

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Andrew Cooper
On 08/03/2022 15:36, Jan Beulich wrote: > On 08.03.2022 16:19, Andrew Cooper wrote: >> On 08/03/2022 14:37, Jan Beulich wrote: >>> On 08.03.2022 15:01, Andrew Cooper wrote: For livepatching, we need to look at a potentially clobbered function and determine whether it used to have an

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Jan Beulich
On 08.03.2022 16:19, Andrew Cooper wrote: > On 08/03/2022 14:37, Jan Beulich wrote: >> On 08.03.2022 15:01, Andrew Cooper wrote: >>> For livepatching, we need to look at a potentially clobbered function and >>> determine whether it used to have an ENDBR64 instruction. >>> >>> Use a non-default

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Andrew Cooper
On 08/03/2022 14:37, Jan Beulich wrote: > On 08.03.2022 15:01, Andrew Cooper wrote: >> For livepatching, we need to look at a potentially clobbered function and >> determine whether it used to have an ENDBR64 instruction. >> >> Use a non-default 4-byte P6 long nop, not emitted by toolchains, and

Re: [PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Jan Beulich
On 08.03.2022 15:01, Andrew Cooper wrote: > For livepatching, we need to look at a potentially clobbered function and > determine whether it used to have an ENDBR64 instruction. > > Use a non-default 4-byte P6 long nop, not emitted by toolchains, and introduce > the was_endbr64() predicate. Did

[PATCH] x86/cet: Use dedicated NOP4 for cf_clobber

2022-03-08 Thread Andrew Cooper
For livepatching, we need to look at a potentially clobbered function and determine whether it used to have an ENDBR64 instruction. Use a non-default 4-byte P6 long nop, not emitted by toolchains, and introduce the was_endbr64() predicate. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: