From: Maran Wilson <maran.wilson@oracle.com>
To: jbeulich@suse.com, andrew.cooper3@citrix.com,
xen-devel@lists.xen.org, maran.wilson@oracle.com,
boris.ostrovsky@oracle.com, roger.pau@citrix.com,
ian.jackson@eu.citrix.com, wei.liu2@citrix.com
Subject: [PATCH v2 4/4] libxc: Pass e820 map to PVH guest via hvm_start_info
Date: Tue, 13 Mar 2018 16:31:40 -0700 [thread overview]
Message-ID: <1520983900-13977-5-git-send-email-maran.wilson@oracle.com> (raw)
In-Reply-To: <1520983900-13977-1-git-send-email-maran.wilson@oracle.com>
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
tools/libxc/xc_dom_x86.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 0b65dab..4f4b26e 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -640,6 +640,8 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
dom->cmdline_size = ROUNDUP(strlen(dom->cmdline) + 1, 8);
start_info_size += dom->cmdline_size;
}
+
+ start_info_size += dom->e820_entries * sizeof(*(dom->e820));
}
else
{
@@ -1666,7 +1668,7 @@ static int bootlate_hvm(struct xc_dom_image *dom)
uint32_t domid = dom->guest_domid;
xc_interface *xch = dom->xch;
struct hvm_start_info *start_info;
- size_t start_info_size;
+ size_t start_info_size, modsize;
struct hvm_modlist_entry *modlist;
unsigned int i;
@@ -1693,6 +1695,8 @@ static int bootlate_hvm(struct xc_dom_image *dom)
if ( !dom->device_model )
{
+ struct hvm_memmap_table_entry *memmap;
+
if ( dom->cmdline )
{
char *cmdline = (void*)(start_info + 1);
@@ -1718,6 +1722,20 @@ static int bootlate_hvm(struct xc_dom_image *dom)
/* ACPI module 0 is the RSDP */
start_info->rsdp_paddr = dom->acpi_modules[0].guest_addr_out ? : 0;
+
+ modsize = HVMLOADER_MODULE_MAX_COUNT *
+ (sizeof(*modlist) + HVMLOADER_MODULE_CMDLINE_SIZE);
+ memmap = (void*)modlist + modsize;
+
+ start_info->memmap_paddr = (dom->start_info_seg.pfn << PAGE_SHIFT) +
+ ((uintptr_t)modlist - (uintptr_t)start_info) + modsize;
+ start_info->memmap_entries = dom->e820_entries;
+ for ( i = 0; i < dom->e820_entries; i++ )
+ {
+ memmap[i].addr = dom->e820[i].addr;
+ memmap[i].size = dom->e820[i].size;
+ memmap[i].type = dom->e820[i].type;
+ }
}
else
{
@@ -1732,6 +1750,7 @@ static int bootlate_hvm(struct xc_dom_image *dom)
}
start_info->magic = XEN_HVM_START_MAGIC_VALUE;
+ start_info->version = 1;
munmap(start_info, start_info_size);
--
1.8.3.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
prev parent reply other threads:[~2018-03-13 23:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-13 23:31 [PATCH v2 0/4] x86/PVHv2: Add memory map pointer to hvm_start_info struct Maran Wilson
2018-03-13 23:31 ` [PATCH v2 1/4] " Maran Wilson
2018-03-14 7:55 ` Jan Beulich
2018-03-14 17:28 ` Boris Ostrovsky
2018-03-14 20:07 ` Maran Wilson
2018-03-15 7:22 ` Jan Beulich
2018-03-15 9:31 ` Roger Pau Monné
2018-03-15 7:12 ` Jan Beulich
2018-03-13 23:31 ` [PATCH v2 2/4] libxl: Move libxl__arch_domain_construct_memmap() earlier Maran Wilson
2018-03-13 23:31 ` [PATCH v2 3/4] libxl: Store PVH guest's e820 map in xc_dom_image Maran Wilson
2018-03-13 23:31 ` Maran Wilson [this message]
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=1520983900-13977-5-git-send-email-maran.wilson@oracle.com \
--to=maran.wilson@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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).