public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paul Durrant <pdurrant@amazon.com>
Cc: x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v6 2/2] KVM: x86/xen: update Xen CPUID Leaf 4 (tsc info) sub-leaves, if present
Date: Wed, 4 Jan 2023 19:40:14 +0000	[thread overview]
Message-ID: <Y7XWHr1kb4AHd4Lv@google.com> (raw)
In-Reply-To: <20221220134053.15591-3-pdurrant@amazon.com>

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@google.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@google.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
-- 

  parent reply	other threads:[~2023-01-04 19:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 13:40 [PATCH v6 0/2] KVM: x86/xen: update Xen CPUID Leaf 4 Paul Durrant
2022-12-20 13:40 ` [PATCH v6 1/2] KVM: x86/cpuid: generalize kvm_update_kvm_cpuid_base() and also capture limit Paul Durrant
2023-01-03 16:20   ` David Woodhouse
2023-01-04 19:34   ` Sean Christopherson
2023-01-05 10:38     ` Paul Durrant
2023-01-05 18:09       ` Sean Christopherson
2023-01-06  9:20         ` Paul Durrant
2022-12-20 13:40 ` [PATCH v6 2/2] KVM: x86/xen: update Xen CPUID Leaf 4 (tsc info) sub-leaves, if present Paul Durrant
2023-01-03 16:20   ` David Woodhouse
2023-01-04 19:40   ` Sean Christopherson [this message]
2023-01-04 20:09     ` David Woodhouse
2023-01-04 20:20       ` Sean Christopherson
2023-01-04 21:03         ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7XWHr1kb4AHd4Lv@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pdurrant@amazon.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox