From: Boris Ostrovsky Subject: Re: [PATCH v3 13/17] x86/xen: enable Hygon support to Xen Date: Fri, 17 Aug 2018 00:37:53 -0400 Message-ID: <5ce011d7-3905-8b0b-e13e-0ee5163ad5bb@oracle.com> References: <2747ad959f07459000f2693a98d237e2b3149ca1.1533989493.git.puwen@hygon.cn> <0aa44410-47ec-27e2-10d9-c0dc5d2e457a@suse.com> <150f6a8d-33e8-a84d-f34b-17bdb7264ebe@oracle.com> <16c21c53-2a03-d5fe-9232-8c0e377566a7@hygon.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <16c21c53-2a03-d5fe-9232-8c0e377566a7@hygon.cn> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Pu Wen , Juergen Gross , tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, thomas.lendacky@amd.com, bp@alien8.de, pbonzini@redhat.com, JBeulich@suse.com Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org List-Id: linux-arch.vger.kernel.org On 08/16/2018 09:29 AM, Pu Wen wrote: > On 2018/8/12 21:26, Boris Ostrovsky wrote: >> On 08/12/2018 04:55 AM, Juergen Gross wrote: >>> On 11/08/18 16:34, Boris Ostrovsky wrote: >>>> On 08/11/2018 09:29 AM, Pu Wen wrote: >>>>>   bool pmu_msr_read(unsigned int msr, uint64_t *val, int *err) >>>>>   { >>>>> -    if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { >>>>> +    if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || >>>>> +        boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) { >>>> >>>> 'if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)' please. >>> Really? Xen supports Centaur, too. >> >> VPMU doesn't --- hypervisor will not initialize it. Besides, the >> existing code will steer non-AMD execution to Intel, which is not right >> either. >> >> I'll add a check to bail if VPMU is not initialized properly, we seem to >> ignore xen_pmu_init() failures. Which, BTW, makes this patch rather >> pointless until there is support for Hygon Xen. > > So should it still need to test vendor Hygon here or wait for your check > done? I'd prefer checking for !Intel, as I suggested above. Centaur will fail either way, but because we use safe versions of MSR access I now think we don't need any extra checks for xen_pmu_init() result. -boris