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

[xen master] revert "hvmloader: PA range 0xfc000000-0xffffffff should be UC"



commit ea187c0b7a73c26258c0e91e4f3656989804555f
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Dec 17 08:56:15 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Dec 17 08:56:15 2021 +0100

    revert "hvmloader: PA range 0xfc000000-0xffffffff should be UC"
    
    This reverts commit c22bd567ce22f6ad9bd93318ad0d7fd1c2eadb0d.
    
    While its description is correct from an abstract or real hardware pov,
    the range is special inside HVM guests. The range being UC in particular
    gets in the way of OVMF, which places itself at [FFE00000,FFFFFFFF].
    While this is benign to epte_get_entry_emt() as long as the IOMMU isn't
    enabled for a guest, it becomes a very noticable problem otherwise: It
    takes about half a minute for OVMF to decompress itself into its
    designated address range.
    
    And even beyond OVMF there's no reason to have e.g. the ACPI memory
    range marked UC.
    
    Fixes: c22bd567ce22 ("hvmloader: PA range 0xfc000000-0xffffffff should be 
UC")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 tools/firmware/hvmloader/cacheattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/cacheattr.c 
b/tools/firmware/hvmloader/cacheattr.c
index 1ac6656c70..1c67819748 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -98,12 +98,12 @@ void cacheattr_init(void)
     {
         uint64_t base = pci_mem_start, size;
 
-        for ( i = 0; !(base >> 32) && (i < nr_var_ranges); i++ )
+        for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ )
         {
             size = PAGE_SIZE;
             while ( !(base & size) )
                 size <<= 1;
-            while ( ((base + size) < base) || ((base + size - 1) >> 32) )
+            while ( ((base + size) < base) || ((base + size) > pci_mem_end) )
                 size >>= 1;
 
             wrmsr(MSR_MTRRphysBase(i), base);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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