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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Dec 2021 09:21:22 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0t/AQ7k5EF/1vmQtiavEWRj7cd1SzdmnnGJDbmiyFCA=; b=hBL8l6bKmpdyUaVh2rtODVxqZg57XUWwJaH0UMWVQ5XoKBeYFf4il6pfTexN1wWv8NCf+S7CX0erng0NxGaw/MwottDI1XsyX2a8/Zgesk/Y/nmrnrDhUqhzwLETT1gDWt3wKuTizru/5FQGapnKkZ9x4nmHohkgvGV41UQBvqqoOm5CYQ9eJjvThMMLGLlhpQEoDB2Abs4eXojQuIwZPZWUy980kMaoQgxGGvWG9q+LyhfBuhNJM53lYKZSZTEJk9CB5I43Nb12ftb4dbcKLWrgINFl+Ha64LEB8ukbXWw84ogdd9qPM8sZ6tse/p8yQ66B/qKHf0dPwLecjxBDNA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cq8aTeYdR9F0/YWEhjyD2tEeB4DvnOQ20diVCeaArMP9GtHqg+kU5qCNyqUNbDC7/MZKJXkx6Q2nL9GC+hN0uvVkzpqc5eO9CM0WXNmy8tTku2Xq+l82IDJejMb3YhoMY6j070jA+M3q8XOyBDVrBs1qMYxXjlQe/oYSTODfUXJZ12mh6OzG9HWmhYGk+3bhDR/p1VLlMci+t7b1KddO32UgSoJsDpKmDb6qMXOXa+K201YU4mJGkbZkuymP+sSWvuAX3VRKvuXmDjO7c6qMZ8apt4arj/p26sIhuPaESYwn3RK0rBPUMP6PAGrojQ8qoeLHgUtYtj2JUt+7BSv17Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 14 Dec 2021 08:21:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>

--- 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);




 


Rackspace

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