From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934420AbeAHRBo (ORCPT + 1 other); Mon, 8 Jan 2018 12:01:44 -0500 Received: from mail-wr0-f179.google.com ([209.85.128.179]:41659 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932659AbeAHRBm (ORCPT ); Mon, 8 Jan 2018 12:01:42 -0500 X-Google-Smtp-Source: ACJfBovj0idOSfbw0YNtxxHjxq63lCDbdcP4fIovJBdgo+9YbH2adt5PTB2YQJcmqikNZcbr956awg== Subject: Re: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC To: "Dr. David Alan Gilbert" , Andrew Cooper Cc: Tom Lendacky , Thomas Gleixner , bp@alien8.de, dwmw@amazon.co.uk, gregkh@linux-foundation.org, pjt@google.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tim.c.chen@linux.intel.com, torvalds@linux-foundation.org, peterz@infradead.org, dave.hansen@intel.com, linux-tip-commits@vger.kernel.org References: <20180105160756.23786.4220.stgit@tlendack-t1.amdoffice.net> <1b179b8b-6cc8-d736-81dc-2445be4baf02@citrix.com> <4d9a1f0d-a401-3f0f-9ee2-dd42f4b4716a@amd.com> <929a34a1-e3bc-b1c8-4c71-196610c0d02a@citrix.com> <20180108164803.GF2462@work-vm> From: Paolo Bonzini Message-ID: <0be27b7e-7285-b23b-7eda-55a70338d16c@redhat.com> Date: Mon, 8 Jan 2018 18:01:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180108164803.GF2462@work-vm> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 denominator of the set of CPUs in your data centre (for any one > vendor); it does tend to get some weird combinations. Agreed. But on a hypervisor we pretty much know that: - the MSR_AMD64_DE_CFG doesn't exist unless you have a fix - setting the MSR_AMD64_DE_CFG bit to 1 if you have a fix can be done independent of the family So all KVM needs is a X86_FEATURE_LFENCE_SERIALIZE, it doesn't matter if it's because of the family or because Linux has set MSR_F10H_DE_CFG. The guest will either try setting the MSR bit and #GP, or it will find it already set and do nothing. Of course no code for this has been written yet. Paolo