|
@@ -51,6 +51,7 @@
|
|
#include <asm/mmu_context.h>
|
|
#include <asm/mmu_context.h>
|
|
#include <asm/setup.h>
|
|
#include <asm/setup.h>
|
|
#include <asm/paravirt.h>
|
|
#include <asm/paravirt.h>
|
|
|
|
+#include <asm/e820.h>
|
|
#include <asm/linkage.h>
|
|
#include <asm/linkage.h>
|
|
|
|
|
|
#include <asm/xen/hypercall.h>
|
|
#include <asm/xen/hypercall.h>
|
|
@@ -381,7 +382,7 @@ static bool xen_page_pinned(void *ptr)
|
|
|
|
|
|
static bool xen_iomap_pte(pte_t pte)
|
|
static bool xen_iomap_pte(pte_t pte)
|
|
{
|
|
{
|
|
- return xen_initial_domain() && (pte_flags(pte) & _PAGE_IOMAP);
|
|
|
|
|
|
+ return pte_flags(pte) & _PAGE_IOMAP;
|
|
}
|
|
}
|
|
|
|
|
|
static void xen_set_iomap_pte(pte_t *ptep, pte_t pteval)
|
|
static void xen_set_iomap_pte(pte_t *ptep, pte_t pteval)
|
|
@@ -583,10 +584,21 @@ PV_CALLEE_SAVE_REGS_THUNK(xen_pgd_val);
|
|
|
|
|
|
pte_t xen_make_pte(pteval_t pte)
|
|
pte_t xen_make_pte(pteval_t pte)
|
|
{
|
|
{
|
|
- if (unlikely(xen_initial_domain() && (pte & _PAGE_IOMAP)))
|
|
|
|
|
|
+ phys_addr_t addr = (pte & PTE_PFN_MASK);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Unprivileged domains are allowed to do IOMAPpings for
|
|
|
|
+ * PCI passthrough, but not map ISA space. The ISA
|
|
|
|
+ * mappings are just dummy local mappings to keep other
|
|
|
|
+ * parts of the kernel happy.
|
|
|
|
+ */
|
|
|
|
+ if (unlikely(pte & _PAGE_IOMAP) &&
|
|
|
|
+ (xen_initial_domain() || addr >= ISA_END_ADDRESS)) {
|
|
pte = iomap_pte(pte);
|
|
pte = iomap_pte(pte);
|
|
- else
|
|
|
|
|
|
+ } else {
|
|
|
|
+ pte &= ~_PAGE_IOMAP;
|
|
pte = pte_pfn_to_mfn(pte);
|
|
pte = pte_pfn_to_mfn(pte);
|
|
|
|
+ }
|
|
|
|
|
|
return native_make_pte(pte);
|
|
return native_make_pte(pte);
|
|
}
|
|
}
|