linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maran Wilson <maran.wilson@oracle.com>
To: pbonzini@redhat.com, jgross@suse.com, boris.ostrovsky@oracle.com,
	roger.pau@citrix.com, andrew.cooper3@citrix.com,
	hch@infradead.org, x86@kernel.org,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	rkrcmar@redhat.com, JBeulich@suse.com
Subject: [RFC PATCH v2 1/2] xen/pvh: Add memory map pointer to hvm_start_info struct
Date: Thu,  7 Dec 2017 14:45:14 -0800	[thread overview]
Message-ID: <1512686715-11488-2-git-send-email-maran.wilson@oracle.com> (raw)
In-Reply-To: <1512686715-11488-1-git-send-email-maran.wilson@oracle.com>

The start info structure that is defined as part of the x86/HVM direct
boot ABI and used for starting Xen PVH guests would be more versatile if
it also included a way to efficiently pass information about the memory
map to the guest.

That way Xen PVH guests would not be forced to use a hypercall to get the
information and would make it easier for KVM guests to share the PVH
entry point.
---
 include/xen/interface/hvm/start_info.h | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/include/xen/interface/hvm/start_info.h b/include/xen/interface/hvm/start_info.h
index 6484159..60206bb 100644
--- a/include/xen/interface/hvm/start_info.h
+++ b/include/xen/interface/hvm/start_info.h
@@ -33,7 +33,7 @@
  *    | magic          | Contains the magic value XEN_HVM_START_MAGIC_VALUE
  *    |                | ("xEn3" with the 0x80 bit of the "E" set).
  *  4 +----------------+
- *    | version        | Version of this structure. Current version is 0. New
+ *    | version        | Version of this structure. Current version is 1. New
  *    |                | versions are guaranteed to be backwards-compatible.
  *  8 +----------------+
  *    | flags          | SIF_xxx flags.
@@ -48,6 +48,12 @@
  * 32 +----------------+
  *    | rsdp_paddr     | Physical address of the RSDP ACPI data structure.
  * 40 +----------------+
+ *    | memmap_paddr   | Physical address of the memory map. Only present in
+ *    |                | version 1 and newer of the structure.
+ * 48 +----------------+
+ *    | memmap_entries | Number of entries in the memory map table. Only
+ *    |                | present in version 1 and newer of the structure.
+ * 52 +----------------+
  *
  * The layout of each entry in the module structure is the following:
  *
@@ -62,6 +68,17 @@
  *    | reserved       |
  * 32 +----------------+
  *
+ * The layout of each entry in the memory map table is as follows and no
+ * padding is used between entries in the array:
+ *
+ *  0 +----------------+
+ *    | addr           | Base address
+ *  8 +----------------+
+ *    | size           | Size of mapping
+ * 16 +----------------+
+ *    | type           | E820_TYPE_xxx
+ * 20 +----------------|
+ *
  * The address and sizes are always a 64bit little endian unsigned integer.
  *
  * NB: Xen on x86 will always try to place all the data below the 4GiB
@@ -86,13 +103,24 @@ struct hvm_start_info {
     uint64_t cmdline_paddr;     /* Physical address of the command line.     */
     uint64_t rsdp_paddr;        /* Physical address of the RSDP ACPI data    */
                                 /* structure.                                */
-};
+    uint64_t memmap_paddr;	/* Physical address of an array of           */
+				/* hvm_memmap_table_entry. Only present in   */
+				/* Ver 1 or later. For e820 mem map table.   */
+    uint32_t memmap_entries;	/* Only present in Ver 1 or later. Number of */
+				/* entries in the memmap table.              */
+} __attribute__((packed));
 
 struct hvm_modlist_entry {
     uint64_t paddr;             /* Physical address of the module.           */
     uint64_t size;              /* Size of the module in bytes.              */
     uint64_t cmdline_paddr;     /* Physical address of the command line.     */
     uint64_t reserved;
-};
+} __attribute__((packed));
+
+struct hvm_memmap_table_entry {
+    uint64_t addr;		/* Base address of the memory region         */
+    uint64_t size;		/* Size of the memory region                 */
+    uint32_t type;		/* E820_TYPE_xxx of the memory region        */
+} __attribute__((packed));
 
 #endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */
-- 
1.8.3.1

  reply	other threads:[~2017-12-07 22:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 22:45 [RFC PATCH v2 0/2] KVM: x86: Allow Qemu/KVM to use PVH entry point Maran Wilson
2017-12-07 22:45 ` Maran Wilson [this message]
2017-12-08  8:49   ` [RFC PATCH v2 1/2] xen/pvh: Add memory map pointer to hvm_start_info struct Jan Beulich
2017-12-08 19:05     ` Maran Wilson
2017-12-11  9:25       ` Jan Beulich
2017-12-11 21:59     ` Paolo Bonzini
2017-12-12  8:06       ` Jan Beulich
2017-12-12  9:54         ` Paolo Bonzini
2017-12-07 22:45 ` [RFC PATCH v2 2/2] KVM: x86: Allow Qemu/KVM to use PVH entry point Maran Wilson
2017-12-08 19:21 ` [RFC PATCH v2 0/2] " Boris Ostrovsky

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=1512686715-11488-2-git-send-email-maran.wilson@oracle.com \
    --to=maran.wilson@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=roger.pau@citrix.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).