lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7XWHr1kb4AHd4Lv@google.com>
Date:   Wed, 4 Jan 2023 19:40:14 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Paul Durrant <pdurrant@...zon.com>
Cc:     x86@...nel.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH v6 2/2] KVM: x86/xen: update Xen CPUID Leaf 4 (tsc info)
 sub-leaves, if present

On Tue, Dec 20, 2022, Paul Durrant wrote:
> @@ -143,6 +148,8 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu);
>  #include <asm/xen/interface.h>
>  #include <xen/interface/vcpu.h>
>  
> +#define XEN_SIGNATURE "XenVMMXenVMM"

arch/x86/include/asm/xen/hypervisor.h also open codes the signature.  Rather than
add a KVM-specific define, what about putting in xen/cpuid.h?  (I've had a version
of this series sitting in my todo pile for far too long, sorry).

--
From: Sean Christopherson <seanjc@...gle.com>
Date: Mon, 11 Jul 2022 15:18:42 -0700
Subject: [PATCH] xen: Add a #define to provide Xen's CPUID signature as a
 string

Add XEN_SIGNATURE instead of open coding it in xen_cpuid_base() so
that KVM can reuse the definition when querying a VM's CPUID.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@...gle.com>
---
 arch/x86/include/asm/xen/cpuid.h      | 1 +
 arch/x86/include/asm/xen/hypervisor.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/xen/cpuid.h b/arch/x86/include/asm/xen/cpuid.h
index 6daa9b0c8d11..38f1bd153f42 100644
--- a/arch/x86/include/asm/xen/cpuid.h
+++ b/arch/x86/include/asm/xen/cpuid.h
@@ -49,6 +49,7 @@
  * EBX-EDX: "XenVMMXenVMM" signature, allowing positive identification
  *      of a Xen host.
  */
+#define XEN_SIGNATURE     "XenVMMXenVMM"
 #define XEN_CPUID_SIGNATURE_EBX 0x566e6558 /* "XenV" */
 #define XEN_CPUID_SIGNATURE_ECX 0x65584d4d /* "MMXe" */
 #define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */
diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
index 16f548a661cf..32ff6583b3d9 100644
--- a/arch/x86/include/asm/xen/hypervisor.h
+++ b/arch/x86/include/asm/xen/hypervisor.h
@@ -37,10 +37,11 @@ extern struct shared_info *HYPERVISOR_shared_info;
 extern struct start_info *xen_start_info;
 
 #include <asm/processor.h>
+#include <asm/xen/cpuid.h>
 
 static inline uint32_t xen_cpuid_base(void)
 {
-	return hypervisor_cpuid_base("XenVMMXenVMM", 2);
+	return hypervisor_cpuid_base(XEN_SIGNATURE, 2);
 }
 
 struct pci_dev;

base-commit: 91dc252b0dbb6879e4067f614df1e397fec532a1
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ