qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 03/21] i386/kvm: handle Xen HVM cpuid leaves


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH 03/21] i386/kvm: handle Xen HVM cpuid leaves
Date: Mon, 5 Dec 2022 22:58:40 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

Hi David,

On 5/12/22 18:31, David Woodhouse wrote:
From: Joao Martins <joao.m.martins@oracle.com>

Introduce support for emulating CPUID for Xen HVM guests via
xen, xen_vapic as changeable params.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Obtain xen_version from machine property]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
  target/i386/cpu.c     |  2 ++
  target/i386/cpu.h     |  3 ++
  target/i386/kvm/kvm.c | 72 +++++++++++++++++++++++++++++++++++++++++++
  target/i386/xen.h     |  8 +++++
  4 files changed, 85 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 22b681ca37..45aa9e40a5 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -7069,6 +7069,8 @@ static Property x86_cpu_properties[] = {
       * own cache information (see x86_cpu_load_def()).
       */
      DEFINE_PROP_BOOL("legacy-cache", X86CPU, legacy_cache, true),
+    DEFINE_PROP_BOOL("xen", X86CPU, xen, false),

Maybe name it 'xen-hvm'?

+    DEFINE_PROP_BOOL("xen-vapic", X86CPU, xen_vapic, false),

What happens if we use -cpu host,-kvm,+xen,-xen-vapic ?

Is -cpu host,-kvm,-xen,+xen-vapic meaningful? Otherwise we need to error
out (eventually displaying some hint).

/*
       * From "Requirements for Implementing the Microsoft
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index d4bc19577a..5ddd14467e 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1964,6 +1964,9 @@ struct ArchCPU {
      int32_t thread_id;
int32_t hv_max_vps;
+
+    bool xen;
+    bool xen_vapic;
  };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]