Skip to contentSkip to conversation

tools/pvh: set coherent MTRR state for all vCPUs

PATCH New Roger Pau Monne 1 participant 1 message Oct 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools/pvh: set coherent MTRR state for all vCPUs

Instead of just doing it for the BSP. This requires storing the maximum number of possible vCPUs in xc_dom_image.

This has been a latent bug so far because PVH doesn't yet support pci-passthrough, so the effective memory cache attribute is forced to WB by the hypervisor. Note also that even without this in place vCPU#0 is preferred in certain scenarios in order to calculate the memory cache attributes.

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Andrew Cooper <[email protected]>
---
Changes since v1:
- s/nr_vcpus/max_vcpus/.
- assert max_vcpus is set.

---
 tools/libxc/include/xc_dom.h |  3 ++
 tools/libxc/xc_dom_x86.c     | 71 +++++++++++++++++++++++++-----------
 tools/libxl/libxl_dom.c      |  2 +
 3 files changed, 54 insertions(+), 22 deletions(-)
tools/libxc/include/xc_dom.h +3 -0
index 0b5a632d3c..5900bbe8fa 100644
@@ -230,6 +230,9 @@ struct xc_dom_image {
 #endif
 
     xen_pfn_t vuart_gfn;
+
+    /* Number of vCPUs */
+    unsigned int max_vcpus;
 };
 
 /* --- pluggable kernel loader ------------------------------------- */
tools/libxc/xc_dom_x86.c +49 -22

101 lines not on this page · raw message

tools/libxl/libxl_dom.c +2 -0
index 8a8a32c699..c66f3893d7 100644
@@ -803,6 +803,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     dom->xenstore_evtchn = state->store_port;
     dom->xenstore_domid = state->store_domid;
     dom->claim_enabled = libxl_defbool_val(info->claim_mode);
+    dom->max_vcpus = info->max_vcpus;
 
     if (info->num_vnuma_nodes != 0) {
         unsigned int i;
@@ -1256,6 +1257,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     dom->mmio_start = mmio_start;
     dom->vga_hole_size = device_model ? LIBXL_VGA_HOLE_SIZE : 0;
     dom->device_model = device_model;
+    dom->max_vcpus = info->max_vcpus;
 
     rc = libxl__domain_device_construct_rdm(gc, d_config,
                                             info->u.hvm.rdm_mem_boundary_memkb*1024,
Signature · 7 lines
2.19.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel