Skip to content

Commit

Permalink
xen: add xen_set_domain_pte()
Browse files Browse the repository at this point in the history
Add xen_set_domain_pte() to allow setting a pte mapping a page from
another domain.  The common case is to map from DOMID_IO, the pseudo
domain which owns all IO pages, but will also be used in the privcmd
interface to map other domain pages.

[ Impact: new Xen-internal API for cross-domain mappings ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
  • Loading branch information
Jeremy Fitzhardinge authored and Jeremy Fitzhardinge committed Oct 20, 2010
1 parent 655d406 commit eba3ff8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/x86/include/asm/xen/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ static inline pte_t __pte_ma(pteval_t x)

#define pgd_val_ma(x) ((x).pgd)

void xen_set_domain_pte(pte_t *ptep, pte_t pteval, unsigned domid);

xmaddr_t arbitrary_virt_to_machine(void *address);
unsigned long arbitrary_virt_to_mfn(void *vaddr);
Expand Down
10 changes: 8 additions & 2 deletions arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static bool xen_iomap_pte(pte_t pte)
return pte_flags(pte) & _PAGE_IOMAP;
}

static void xen_set_iomap_pte(pte_t *ptep, pte_t pteval)
void xen_set_domain_pte(pte_t *ptep, pte_t pteval, unsigned domid)
{
struct multicall_space mcs;
struct mmu_update *u;
Expand All @@ -407,10 +407,16 @@ static void xen_set_iomap_pte(pte_t *ptep, pte_t pteval)
u->ptr = arbitrary_virt_to_machine(ptep).maddr;
u->val = pte_val_ma(pteval);

MULTI_mmu_update(mcs.mc, mcs.args, 1, NULL, DOMID_IO);
MULTI_mmu_update(mcs.mc, mcs.args, 1, NULL, domid);

xen_mc_issue(PARAVIRT_LAZY_MMU);
}
EXPORT_SYMBOL_GPL(xen_set_domain_pte);

static void xen_set_iomap_pte(pte_t *ptep, pte_t pteval)
{
xen_set_domain_pte(ptep, pteval, DOMID_IO);
}

static void xen_extend_mmu_update(const struct mmu_update *update)
{
Expand Down

0 comments on commit eba3ff8

Please sign in to comment.