Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 24 Feb 2019 14:23:32 -0000 Received: from mga06.intel.com ([134.134.136.31]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gxugj-0000Uh-UV for speck@linutronix.de; Sun, 24 Feb 2019 15:23:31 +0100 Date: Sun, 24 Feb 2019 06:23:26 -0800 From: Andi Kleen Subject: [MODERATED] Re: Some microperf tests Message-ID: <20190224142326.GH16922@tassilo.jf.intel.com> References: <8e57a8b6-15e7-9dc3-be10-15270e984e9d@citrix.com> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: > So it would be good to verify that > > (a) yes, this is the intended performance profile from intel > > (b) we probably should give a NUL descriptor for the workaround AFAIK %ds was expected to be faster than 0. I can ask about why this benchmark disagrees. The Intel recommendation was to use (%rsp). There are also other CPUs with slightly different microcode than what was tested here. > > (c) it hurts the vmverw case, but maybe we can only do vmverw when we > notice we are actually running under vmware. > > Is there any way to do that vmware detection? We already have VMWare detection I thought arch/x86/kernel/cpu/vmware.c: static uint32_t __init vmware_platform(void) { if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { unsigned int eax; unsigned int hyper_vendor_id[3]; cpuid(CPUID_VMWARE_INFO_LEAF, &eax, &hyper_vendor_id[0], &hyper_vendor_id[1], &hyper_vendor_id[2]); if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) return CPUID_VMWARE_INFO_LEAF; } else if (dmi_available && dmi_name_in_serial("VMware") && __vmware_platform()) return 1; return 0; } BTW it could be also some other hypervisor which doesn't export the CPUID. Even in KVM/qemu it will need a configuration change and update. I suppose it could be just made conditionaly on X86_FEATURE_HYPERVISOR -Andi