]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Redefine PAGE_FLAG_UNCACHED to PAGE_FLAG_DEVICE
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 12 Oct 2014 14:13:49 +0000 (16:13 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 8 Jan 2015 12:01:23 +0000 (13:01 +0100)
All (x86) users of this page flag map devices into the hypervisor
address space. We will do the same for ARM when mapping the debug UART.
For this we need a generic flag with the same semantics. As uncached is
different from device mappings, redefine the semantic of UNCACHED flag
for this purpose.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/include/asm/paging.h
hypervisor/arch/x86/apic.c
hypervisor/arch/x86/include/asm/paging.h
hypervisor/arch/x86/ioapic.c
hypervisor/arch/x86/svm.c
hypervisor/arch/x86/vtd.c
hypervisor/pci.c

index 872bdb8615a9ae2a34476a8cf3d203e4151173da..240a8a53f9bb9de828ca0779eee4bfcff7d9bfcb 100644 (file)
                                | S1_PTE_ACCESS_EL0)
 
 /* Macros used by the core, only for the EL2 stage-1 mappings */
-#define PAGE_FLAG_UNCACHED     S1_PTE_FLAG_NC
+#define PAGE_FLAG_DEVICE       S1_PTE_FLAG_DEVICE
 #define PAGE_DEFAULT_FLAGS     (S1_DEFAULT_FLAGS | S1_PTE_ACCESS_RW)
 #define PAGE_READONLY_FLAGS    (S1_DEFAULT_FLAGS | S1_PTE_ACCESS_RO)
 #define PAGE_PRESENT_FLAGS     PTE_FLAG_VALID
index 8fdf9e1d298f167d2c76fc9f828847a057811ace..50a6fdc177f60596ddfb0a7049ed66fd23365f4a 100644 (file)
@@ -175,7 +175,7 @@ int apic_init(void)
                        return -ENOMEM;
                err = paging_create(&hv_paging_structs, XAPIC_BASE, PAGE_SIZE,
                                    (unsigned long)xapic_page,
-                                   PAGE_DEFAULT_FLAGS | PAGE_FLAG_UNCACHED,
+                                   PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE,
                                    PAGING_NON_COHERENT);
                if (err)
                        return err;
index 49dd5ba74186d59ce8ac6ea6cc2df2d3a7c44cd5..adde5f6ba909f0549dd5fe138e769a01cd3dee63 100644 (file)
@@ -25,7 +25,7 @@
 #define PAGE_FLAG_PRESENT      0x01
 #define PAGE_FLAG_RW           0x02
 #define PAGE_FLAG_US           0x04
-#define PAGE_FLAG_UNCACHED     0x10
+#define PAGE_FLAG_DEVICE       0x10    /* uncached */
 #define PAGE_FLAG_EXECUTE      0x8000000000000000
 
 #define PAGE_DEFAULT_FLAGS     (PAGE_FLAG_PRESENT | PAGE_FLAG_RW)
index eb675be9e24470e47c3857750e0e3c40b277cfaf..cb921c7096828e09273532cf8a7215ab4e599ec3 100644 (file)
@@ -186,7 +186,7 @@ int ioapic_init(void)
                return -ENOMEM;
        err = paging_create(&hv_paging_structs, IOAPIC_BASE_ADDR, PAGE_SIZE,
                            (unsigned long)ioapic_page,
-                           PAGE_DEFAULT_FLAGS | PAGE_FLAG_UNCACHED,
+                           PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE,
                            PAGING_NON_COHERENT);
        if (err)
                return err;
index 03843bc5226253bcb28c6623fc86119c35c467b7..0161268c2dd13743ebcb68b275d17af5a556f39c 100644 (file)
@@ -326,15 +326,13 @@ int vcpu_vendor_cell_init(struct cell *cell)
                /*
                 * Map xAPIC as is; reads are passed, writes are trapped.
                 */
-               flags = PAGE_READONLY_FLAGS |
-                       PAGE_FLAG_US |
-                       PAGE_FLAG_UNCACHED;
+               flags = PAGE_READONLY_FLAGS | PAGE_FLAG_US | PAGE_FLAG_DEVICE;
                err = paging_create(&cell->svm.npt_structs, XAPIC_BASE,
                                    PAGE_SIZE, XAPIC_BASE,
                                    flags,
                                    PAGING_NON_COHERENT);
        } else {
-               flags = PAGE_DEFAULT_FLAGS | PAGE_FLAG_UNCACHED;
+               flags = PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE;
                err = paging_create(&cell->svm.npt_structs,
                                    paging_hvirt2phys(avic_page),
                                    PAGE_SIZE, XAPIC_BASE,
index 15ec0ef9741e5b17198457388dfc31aa30baa420..b2bba64b8e9d7c932e39f5999ed7025977402c93 100644 (file)
@@ -481,7 +481,7 @@ int iommu_init(void)
 
                err = paging_create(&hv_paging_structs, base_addr, PAGE_SIZE,
                                    (unsigned long)reg_base,
-                                   PAGE_DEFAULT_FLAGS | PAGE_FLAG_UNCACHED,
+                                   PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE,
                                    PAGING_NON_COHERENT);
                if (err)
                        return err;
index 918fa029be3748498a80d827fdd610a34a432e5d..49d8ad9fe70567c28865b96451d3ecb8eace5fad 100644 (file)
@@ -325,7 +325,7 @@ int pci_init(void)
 
        return paging_create(&hv_paging_structs, mmcfg_start, mmcfg_size,
                             (unsigned long)pci_space,
-                            PAGE_DEFAULT_FLAGS | PAGE_FLAG_UNCACHED,
+                            PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE,
                             PAGING_NON_COHERENT);
 }
 
@@ -559,7 +559,7 @@ static int pci_add_device(struct cell *cell, struct pci_device *device)
                err = paging_create(&hv_paging_structs,
                                    device->info->msix_address, size,
                                    (unsigned long)device->msix_table,
-                                   PAGE_DEFAULT_FLAGS | PAGE_FLAG_UNCACHED,
+                                   PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE,
                                    PAGING_NON_COHERENT);
                if (err)
                        goto error_page_free;