Re: [PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-10-01 Thread Jan Beulich
On 01.10.2024 12:02, Jan Beulich wrote: > On 01.10.2024 11:45, Andrew Cooper wrote: >> On 01/10/2024 9:12 am, Jan Beulich wrote: >>> On 30.09.2024 18:40, Andrew Cooper wrote: On 30/09/2024 4:08 pm, Jan Beulich wrote: > --- a/xen/arch/x86/include/asm/msr.h > +++ b/xen/arch/x86/include/a

Re: [PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-10-01 Thread Andrew Cooper
On 01/10/2024 11:02 am, Jan Beulich wrote: > On 01.10.2024 11:45, Andrew Cooper wrote: >> On 01/10/2024 9:12 am, Jan Beulich wrote: >>> On 30.09.2024 18:40, Andrew Cooper wrote: On 30/09/2024 4:08 pm, Jan Beulich wrote: > --- a/xen/arch/x86/include/asm/msr.h > +++ b/xen/arch/x86/includ

Re: [PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-10-01 Thread Jan Beulich
On 30.09.2024 18:40, Andrew Cooper wrote: > On 30/09/2024 4:08 pm, Jan Beulich wrote: >> If available, its use is supposed to be cheaper than LFENCE+RDTSC, and >> is virtually guaranteed to be cheaper than MFENCE+RDTSC. >> >> Unlike in rdtsc() use 64-bit local variables, eliminating the need for >

Re: [PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-10-01 Thread Jan Beulich
On 01.10.2024 11:45, Andrew Cooper wrote: > On 01/10/2024 9:12 am, Jan Beulich wrote: >> On 30.09.2024 18:40, Andrew Cooper wrote: >>> On 30/09/2024 4:08 pm, Jan Beulich wrote: --- a/xen/arch/x86/include/asm/msr.h +++ b/xen/arch/x86/include/asm/msr.h @@ -108,18 +108,30 @@ static inli

Re: [PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-10-01 Thread Andrew Cooper
On 01/10/2024 9:12 am, Jan Beulich wrote: > On 30.09.2024 18:40, Andrew Cooper wrote: >> On 30/09/2024 4:08 pm, Jan Beulich wrote: >>> --- a/xen/arch/x86/include/asm/msr.h >>> +++ b/xen/arch/x86/include/asm/msr.h >>> @@ -108,18 +108,30 @@ static inline uint64_t rdtsc(void) >>> >>> static inline

Re: [PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-09-30 Thread Andrew Cooper
On 30/09/2024 4:08 pm, Jan Beulich wrote: > If available, its use is supposed to be cheaper than LFENCE+RDTSC, and > is virtually guaranteed to be cheaper than MFENCE+RDTSC. > > Unlike in rdtsc() use 64-bit local variables, eliminating the need for I'd drop this reference to rdtsc() seeing as you

[PATCH] x86: prefer RDTSCP in rdtsc_ordered()

2024-09-30 Thread Jan Beulich
If available, its use is supposed to be cheaper than LFENCE+RDTSC, and is virtually guaranteed to be cheaper than MFENCE+RDTSC. Unlike in rdtsc() use 64-bit local variables, eliminating the need for the compiler to emit a zero-extension insn for %eax (that's a cheap MOV, yet still pointless to hav