Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-05 Thread Peter Zijlstra
On Thu, Feb 04, 2021 at 04:11:12PM -0800, Andy Lutomirski wrote: > I'm wondering if a more mild violation is possible: > > Initialize *addr = 0. > > mov $1, (addr) > wrmsr > > remote cpu's IDT vector: > > mov (addr), %rax > %rax == 0! > > There's no

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-05 Thread Peter Zijlstra
On Fri, Feb 05, 2021 at 11:02:10AM +0100, Peter Zijlstra wrote: > And presumably it is still allowed to do that when we write it like: > > mov $1, ([x]) > mfence > wrmsr > > because, mfence only has dependencies to memops and (fast) wrmsr is not > a memop. > > Which then

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-05 Thread Andrew Cooper
On 05/02/2021 10:02, Peter Zijlstra wrote: > On Thu, Feb 04, 2021 at 04:11:12PM -0800, Andy Lutomirski wrote: >> I'm wondering if a more mild violation is possible: >> >> Initialize *addr = 0. >> >> mov $1, (addr) >> wrmsr >> >> remote cpu's IDT vector: >> >> mov (addr), %rax >> %rax == 0! >> >>

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-04 Thread Andy Lutomirski
On Thu, Feb 4, 2021 at 3:37 PM Andrew Cooper wrote: > > On 05/03/2020 17:47, Dave Hansen wrote: > > Jan Kiszka reported that the x2apic_wrmsr_fence() function uses a > > plain "mfence" while the Intel SDM (10.12.3 MSR Access in x2APIC > > Mode) calls for "mfence;lfence". > > > > Short summary: we

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-04 Thread Andrew Cooper
On 05/03/2020 17:47, Dave Hansen wrote: > Jan Kiszka reported that the x2apic_wrmsr_fence() function uses a > plain "mfence" while the Intel SDM (10.12.3 MSR Access in x2APIC > Mode) calls for "mfence;lfence". > > Short summary: we have special MSRs that have weaker ordering > than all the rest.

Re: [RFC][PATCH 2/2] x86: add extra serialization for non-serializing MSRs

2021-02-04 Thread Dave Hansen
... > Reported-by: Jan Kiszka > Cc: x...@kernel.org > Cc: Peter Zijlstra Don't know how I managed to miss it in the first place, but: Signed-off-by: Dave Hansen