Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217836
b: refs/heads/master
c: 5e941c0
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed Oct 22, 2010
1 parent f6446a4 commit 4e1d2d6
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 749 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9387377eb79a44f453fd27c3d00a2e5da587e369
refs/heads/master: 5e941c093989dfb6b67148d2410d79b1be8debfe
5 changes: 5 additions & 0 deletions trunk/arch/x86/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ void *extend_brk(size_t size, size_t align);
: : "i" (sz)); \
}

/* Helper for reserving space for arrays of things */
#define RESERVE_BRK_ARRAY(type, name, entries) \
type *name; \
RESERVE_BRK(name, sizeof(type) * entries)

#ifdef __i386__

void __init i386_start_kernel(void);
Expand Down
17 changes: 0 additions & 17 deletions trunk/arch/x86/include/asm/xen/hypercall.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,23 +200,6 @@ extern struct { char _entry[32]; } hypercall_page[];
(type)__res; \
})

static inline long
privcmd_call(unsigned call,
unsigned long a1, unsigned long a2,
unsigned long a3, unsigned long a4,
unsigned long a5)
{
__HYPERCALL_DECLS;
__HYPERCALL_5ARG(a1, a2, a3, a4, a5);

asm volatile("call *%[call]"
: __HYPERCALL_5PARAM
: [call] "a" (&hypercall_page[call])
: __HYPERCALL_CLOBBER5);

return (long)__res;
}

static inline int
HYPERVISOR_set_trap_table(struct trap_info *table)
{
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/include/asm/xen/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ 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
76 changes: 2 additions & 74 deletions trunk/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;
}

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

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

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 Expand Up @@ -2265,72 +2259,6 @@ void __init xen_hvm_init_mmu_ops(void)
}
#endif

#define REMAP_BATCH_SIZE 16

struct remap_data {
unsigned long mfn;
pgprot_t prot;
struct mmu_update *mmu_update;
};

static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token,
unsigned long addr, void *data)
{
struct remap_data *rmd = data;
pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot));

rmd->mmu_update->ptr = arbitrary_virt_to_machine(ptep).maddr;
rmd->mmu_update->val = pte_val_ma(pte);
rmd->mmu_update++;

return 0;
}

int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
unsigned long addr,
unsigned long mfn, int nr,
pgprot_t prot, unsigned domid)
{
struct remap_data rmd;
struct mmu_update mmu_update[REMAP_BATCH_SIZE];
int batch;
unsigned long range;
int err = 0;

prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP);

vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;

rmd.mfn = mfn;
rmd.prot = prot;

while (nr) {
batch = min(REMAP_BATCH_SIZE, nr);
range = (unsigned long)batch << PAGE_SHIFT;

rmd.mmu_update = mmu_update;
err = apply_to_page_range(vma->vm_mm, addr, range,
remap_area_mfn_pte_fn, &rmd);
if (err)
goto out;

err = -EFAULT;
if (HYPERVISOR_mmu_update(mmu_update, batch, NULL, domid) < 0)
goto out;

nr -= batch;
addr += range;
}

err = 0;
out:

flush_tlb_all();

return err;
}
EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);

#ifdef CONFIG_XEN_DEBUG_FS

static struct dentry *d_mmu_debug;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/xen/xenbus/xenbus_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@


int xen_store_evtchn;
EXPORT_SYMBOL_GPL(xen_store_evtchn);
EXPORT_SYMBOL(xen_store_evtchn);

struct xenstore_domain_interface *xen_store_interface;
EXPORT_SYMBOL_GPL(xen_store_interface);

static unsigned long xen_store_mfn;

static BLOCKING_NOTIFIER_HEAD(xenstore_chain);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/xen/xenfs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
obj-$(CONFIG_XENFS) += xenfs.o

xenfs-y = super.o xenbus.o privcmd.o
xenfs-$(CONFIG_XEN_DOM0) += xenstored.o
xenfs-objs = super.o xenbus.o
Loading

0 comments on commit 4e1d2d6

Please sign in to comment.