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

[Xen-changelog] [xen master] libxl: don't needlessly report "highmem" in use



commit 3840e98f3e72b7b92071089a042cd7cf5be72732
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jan 8 15:04:36 2020 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jan 8 15:04:36 2020 +0100

    libxl: don't needlessly report "highmem" in use
    
    Due to the unconditional updating of dom->highmem_end in
    libxl__domain_device_construct_rdm() I've observed on a 2Gb HVM guest
    with a passed through device (without overly large BARs, and with no RDM
    ranges at all)
    
    (d2) RAM in high memory; setting high_mem resource base to 100000000
    ...
    (d2) E820 table:
    (d2)  [00]: 00000000:00000000 - 00000000:000a0000: RAM
    (d2)  HOLE: 00000000:000a0000 - 00000000:000d0000
    (d2)  [01]: 00000000:000d0000 - 00000000:00100000: RESERVED
    (d2)  [02]: 00000000:00100000 - 00000000:7f800000: RAM
    (d2)  HOLE: 00000000:7f800000 - 00000000:fc000000
    (d2)  [03]: 00000000:fc000000 - 00000001:00000000: RESERVED
    (d2)  [04]: 00000001:00000000 - 00000001:00000000: RAM
    
    both of which aren't really appropriate in this case. Arrange for this
    to not happen.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
---
 tools/libxl/libxl_dm.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index dac1b8ddb8..e92e412c1b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -432,7 +432,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
     uint16_t seg;
     uint8_t bus, devfn;
     uint64_t rdm_start, rdm_size;
-    uint64_t highmem_end = dom->highmem_end ? dom->highmem_end : (1ull<<32);
+    uint64_t highmem_end = dom->highmem_end;
 
     /*
      * We just want to construct RDM once since RDM is specific to the
@@ -557,6 +557,8 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
              * We will move downwards lowmem_end so we have to expand
              * highmem_end.
              */
+            if (!highmem_end)
+                highmem_end = 1ull << 32;
             highmem_end += (dom->lowmem_end - rdm_start);
             /* Now move downwards lowmem_end. */
             dom->lowmem_end = rdm_start;
@@ -577,9 +579,10 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
         conflict = overlaps_rdm(0, dom->lowmem_end,
                                 rdm_start, rdm_size);
         /* Does this entry conflict with highmem? */
-        conflict |= overlaps_rdm((1ULL<<32),
-                                 dom->highmem_end - (1ULL<<32),
-                                 rdm_start, rdm_size);
+        if (highmem_end)
+            conflict |= overlaps_rdm((1ULL << 32),
+                                     highmem_end - (1ULL << 32),
+                                     rdm_start, rdm_size);
 
         if (!conflict)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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