Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-17 Thread Paolo Bonzini
On 17/01/2018 18:21, Tom Lendacky wrote: > On 1/8/2018 11:01 AM, Paolo Bonzini wrote: >> On 08/01/2018 17:48, Dr. David Alan Gilbert wrote: If your hypervisor is lying to you about the primary family, then all bets are off.  I don't expect there will be any production systems doing t

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-17 Thread Tom Lendacky
On 1/8/2018 11:01 AM, Paolo Bonzini wrote: > On 08/01/2018 17:48, Dr. David Alan Gilbert wrote: >>> If your hypervisor is lying to you about the primary family, then all >>> bets are off.  I don't expect there will be any production systems doing >>> this. >> It's not that an unusual thing to do on

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Thomas Gleixner
On Mon, 8 Jan 2018, Tom Lendacky wrote: > So now I'm also concerned about setting the retpoline method and using > LFENCE as the speculation barrier. If we go back to the original > statement: > > - the hypervisor did not set the LFENCE to serializing on the host > - the hypervisor does not a

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Paolo Bonzini
On 08/01/2018 18:39, Tom Lendacky wrote: > On 1/8/2018 11:01 AM, Paolo Bonzini wrote: >> On 08/01/2018 17:48, Dr. David Alan Gilbert wrote: If your hypervisor is lying to you about the primary family, then all bets are off.  I don't expect there will be any production systems doing t

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Tom Lendacky
On 1/8/2018 11:01 AM, Paolo Bonzini wrote: > On 08/01/2018 17:48, Dr. David Alan Gilbert wrote: >>> If your hypervisor is lying to you about the primary family, then all >>> bets are off.  I don't expect there will be any production systems doing >>> this. >> It's not that an unusual thing to do on

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Tom Lendacky
On 1/8/2018 9:15 AM, Thomas Gleixner wrote: > On Mon, 8 Jan 2018, Tom Lendacky wrote: >> On 1/8/2018 5:10 AM, Thomas Gleixner wrote: > Second thoughts on that. As pointed out by someone in one of the insane > long threads: > > What happens if the kernel runs as a guest and > >>>

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Paolo Bonzini
On 08/01/2018 17:48, Dr. David Alan Gilbert wrote: >> If your hypervisor is lying to you about the primary family, then all >> bets are off.  I don't expect there will be any production systems doing >> this. > It's not that an unusual thing to do on qemu/kvm - to specify the lowest > common denomi

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Dr. David Alan Gilbert
* Andrew Cooper (andrew.coop...@citrix.com) wrote: > On 08/01/18 14:47, Tom Lendacky wrote: > > On 1/8/2018 5:10 AM, Thomas Gleixner wrote: > >> On Mon, 8 Jan 2018, Andrew Cooper wrote: > >> > >>> On 08/01/18 10:08, Thomas Gleixner wrote: > On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: >

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Andrew Cooper
On 08/01/18 14:47, Tom Lendacky wrote: > On 1/8/2018 5:10 AM, Thomas Gleixner wrote: >> On Mon, 8 Jan 2018, Andrew Cooper wrote: >> >>> On 08/01/18 10:08, Thomas Gleixner wrote: On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: > Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Thomas Gleixner
On Mon, 8 Jan 2018, Tom Lendacky wrote: > On 1/8/2018 5:10 AM, Thomas Gleixner wrote: > >>> Second thoughts on that. As pointed out by someone in one of the insane > >>> long threads: > >>> > >>> What happens if the kernel runs as a guest and > >>> > >>> - the hypervisor did not set the LFENCE to

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread David Woodhouse
> Ok, I can add the read-back check before setting the feature flag(s). > > But... what about the case where the guest is a different family than > hypervisor? If we're on, say, a Fam15h hypervisor but the guest is started > as a Fam0fh guest where the MSR doesn't exist and LFENCE is supposed to b

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Tom Lendacky
On 1/8/2018 5:10 AM, Thomas Gleixner wrote: > On Mon, 8 Jan 2018, Andrew Cooper wrote: > >> On 08/01/18 10:08, Thomas Gleixner wrote: >>> On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: >>> Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 Gitweb: https://git.kernel.org/

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Thomas Gleixner
On Mon, 8 Jan 2018, Andrew Cooper wrote: > On 08/01/18 10:08, Thomas Gleixner wrote: > > On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: > > > >> Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 > >> Gitweb: > >> https://git.kernel.org/tip/0bf17c102177d5da9363bf8b1e4704b9996d5079 > >>

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Andrew Cooper
On 08/01/18 10:08, Thomas Gleixner wrote: > On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: > >> Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 >> Gitweb: >> https://git.kernel.org/tip/0bf17c102177d5da9363bf8b1e4704b9996d5079 >> Author: Tom Lendacky >> AuthorDate: Fri, 5 Jan 201

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Thomas Gleixner
On Mon, 8 Jan 2018, Woodhouse, David wrote: > On Mon, 2018-01-08 at 11:08 +0100, Thomas Gleixner wrote: > > I'm dropping these patches until this question is answered. > > I've rebased my retpoline tree on top of tip/x86/pti from before those > patches (from my BUG_SPECTRE_Vx patch). That's not

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Woodhouse, David
On Mon, 2018-01-08 at 11:08 +0100, Thomas Gleixner wrote: > I'm dropping these patches until this question is answered. I've rebased my retpoline tree on top of tip/x86/pti from before those patches (from my BUG_SPECTRE_Vx patch). smime.p7s Description: S/MIME cryptographic signature

Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-08 Thread Thomas Gleixner
On Sat, 6 Jan 2018, tip-bot for Tom Lendacky wrote: > Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 > Gitweb: > https://git.kernel.org/tip/0bf17c102177d5da9363bf8b1e4704b9996d5079 > Author: Tom Lendacky > AuthorDate: Fri, 5 Jan 2018 10:07:56 -0600 > Committer: Thomas Gleixner >

[tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC

2018-01-06 Thread tip-bot for Tom Lendacky
Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 Gitweb: https://git.kernel.org/tip/0bf17c102177d5da9363bf8b1e4704b9996d5079 Author: Tom Lendacky AuthorDate: Fri, 5 Jan 2018 10:07:56 -0600 Committer: Thomas Gleixner CommitDate: Sat, 6 Jan 2018 21:57:40 +0100 x86/cpu/AMD: Use LFENCE_