All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v4 6/6] x86/HVM: report the set of enabled emulated devices through CPUID
Date: Thu, 21 Jan 2016 17:51:32 +0100	[thread overview]
Message-ID: <1453395092-88090-7-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1453395092-88090-1-git-send-email-roger.pau@citrix.com>

Add a new HVM-specific feature flag that signals the presence of a bitmap
that contains the current set of enabled emulated devices. The bitmap is
placed in the ecx register. The bit fields used in the bitmap are the same
as the ones used in the xen_arch_domainconfig emulation_flags field, and
their meaning can be found at arch-x86/xen.h.

This will allow Xen to enable emulated devices for HVMlite guests in the
future, by having a proper ABI for reporting which devices are enabled.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c              | 4 ++++
 xen/include/public/arch-x86/cpuid.h | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 674feea..f0145f6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4536,6 +4536,10 @@ void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
         /* Indicate presence of vcpu id and set it in ebx */
         *eax |= XEN_HVM_CPUID_VCPU_ID_PRESENT;
         *ebx = current->vcpu_id;
+
+        /* Indicate the presence of the devices bitmap in ecx. */
+        *eax |= XEN_HVM_CPUID_DEVICES_BITMAP;
+        *ecx = current->domain->arch.emulation_flags;
     }
 }
 
diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h
index d709340..7222483 100644
--- a/xen/include/public/arch-x86/cpuid.h
+++ b/xen/include/public/arch-x86/cpuid.h
@@ -78,12 +78,17 @@
  * HVM-specific features
  * EAX: Features
  * EBX: vcpu id (iff EAX has XEN_HVM_CPUID_VCPU_ID_PRESENT flag)
+ * ECX: bitmap of enabled devices, according to the bit fields defined in
+ *      arch-x86/xen.h. All unused bits have undefined values. The contents
+ *      of this register is only valid if EAX has the
+ *      XEN_HVM_CPUID_DEVICES_BITMAP flag set.
  */
 #define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers */
 #define XEN_HVM_CPUID_X2APIC_VIRT      (1u << 1) /* Virtualized x2APIC accesses */
 /* Memory mapped from other domains has valid IOMMU entries */
 #define XEN_HVM_CPUID_IOMMU_MAPPINGS   (1u << 2)
 #define XEN_HVM_CPUID_VCPU_ID_PRESENT  (1u << 3) /* vcpu id is present in EBX */
+#define XEN_HVM_CPUID_DEVICES_BITMAP   (1u << 4) /* device bitmap in ECX */
 
 #define XEN_CPUID_MAX_NUM_LEAVES 4
 
-- 
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-01-21 16:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 16:51 [PATCH v4 0/6] HVMlite: DomU fixes and a Dom0 preparatory patch Roger Pau Monne
2016-01-21 16:51 ` [PATCH v4 1/6] libelf: rewrite symtab/strtab loading for Dom0 Roger Pau Monne
2016-01-21 17:29   ` Ian Jackson
2016-01-21 17:55     ` Roger Pau Monné
2016-01-21 18:44       ` Ian Jackson
2016-01-22  8:11       ` Jan Beulich
2016-01-22  9:58         ` Roger Pau Monné
2016-01-21 16:51 ` [PATCH v4 2/6] libxl: introduce LIBXL_VGA_INTERFACE_TYPE_UNKNOWN Roger Pau Monne
2016-01-22 10:59   ` Ian Campbell
2016-01-21 16:51 ` [PATCH v4 3/6] libxl: initialise the build info before calling prepare_config Roger Pau Monne
2016-01-22 11:00   ` Ian Campbell
2016-01-21 16:51 ` [PATCH v4 4/6] x86/PV: allow PV guests to have an emulated PIT Roger Pau Monne
2016-01-22 10:48   ` Jan Beulich
2016-01-22 11:03     ` Ian Campbell
2016-01-21 16:51 ` [PATCH v4 5/6] libxl: add options to enable/disable emulated devices Roger Pau Monne
2016-01-22 17:04   ` Roger Pau Monné
2016-01-25  9:33     ` Ian Campbell
2016-01-21 16:51 ` Roger Pau Monne [this message]
2016-01-22 10:57   ` [PATCH v4 6/6] x86/HVM: report the set of enabled emulated devices through CPUID Jan Beulich
2016-01-22 12:43     ` Roger Pau Monné
2016-01-22 13:24       ` Jan Beulich
2016-01-22 14:41         ` Roger Pau Monné
2016-01-22 15:02           ` Jan Beulich
2016-01-22 15:41             ` Roger Pau Monné
2016-01-22 13:34       ` Andrew Cooper
2016-01-22 14:59         ` Roger Pau Monné
2016-01-22 15:31           ` Jan Beulich
2016-01-22 15:51             ` Roger Pau Monné
2016-01-25 11:23               ` Jan Beulich

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=1453395092-88090-7-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.