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

[PATCH 10/17] hvmloader: Add support for HVMOP_set|get_ecam_space hypercalls



This patch adds wrappers in hvmloader for the hypercalls used to set and
get the ECAM space base address and size.

Signed-off-by: Thierry Escande <thierry.escande@xxxxxxxxxx>
---
 tools/firmware/hvmloader/util.c | 26 ++++++++++++++++++++++++++
 tools/firmware/hvmloader/util.h |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 45519ea583..ee7a09b5bc 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -690,6 +690,32 @@ error:
     BUG();
 }
 
+int hvm_set_ecam_space(uint64_t addr, uint32_t size)
+{
+    xen_hvm_ecam_space_t ecam;
+
+    ecam.domid = DOMID_SELF;
+    ecam.addr = addr;
+    ecam.size = size;
+    return hypercall_hvm_op(HVMOP_set_ecam_space, &ecam);
+}
+
+int hvm_get_ecam_space(uint64_t *addr, uint32_t *size)
+{
+    struct xen_hvm_ecam_space e = { };
+    int ret;
+
+    e.domid = DOMID_SELF;
+
+    ret = hypercall_hvm_op(HVMOP_get_ecam_space, &e);
+    if ( ret == 0 ) {
+        *addr = e.addr;
+        *size = e.size;
+    }
+
+    return ret;
+}
+
 static void validate_hvm_info(struct hvm_info_table *t)
 {
     uint8_t *ptr = (uint8_t *)t;
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 4641ca0c46..f63fdd3fbf 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -403,6 +403,10 @@ struct acpi_config;
 void hvmloader_acpi_build_tables(struct acpi_config *config,
                                  unsigned int physical);
 
+/* Pass ecam space information to Xen */
+int hvm_get_ecam_space(uint64_t *addr, uint32_t *size);
+int hvm_set_ecam_space(uint64_t addr, uint32_t size);
+
 #endif /* __HVMLOADER_UTIL_H__ */
 
 /*
-- 
2.51.0



--
Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.