Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145821
b: refs/heads/master
c: 3ce5fa7
h: refs/heads/master
i:
  145819: b6afe33
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed Mar 30, 2009
1 parent 5520360 commit d6b79fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: 6ed6bf428aff64fe37cdc54b239d598fee6016f1
refs/heads/master: 3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85
14 changes: 6 additions & 8 deletions trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,18 @@ static void xen_set_ldt(const void *addr, unsigned entries)

static void xen_load_gdt(const struct desc_ptr *dtr)
{
unsigned long *frames;
unsigned long va = dtr->address;
unsigned int size = dtr->size + 1;
unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE;
unsigned long frames[pages];
int f;
struct multicall_space mcs;

/* A GDT can be up to 64k in size, which corresponds to 8192
8-byte entries, or 16 4k pages.. */

BUG_ON(size > 65536);
BUG_ON(va & ~PAGE_MASK);

mcs = xen_mc_entry(sizeof(*frames) * pages);
frames = mcs.args;

for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
int level;
pte_t *ptep = lookup_address(va, &level);
Expand All @@ -314,13 +310,15 @@ static void xen_load_gdt(const struct desc_ptr *dtr)

frames[f] = mfn;

printk("xen_load_gdt: %d va=%p mfn=%lx pfn=%lx va'=%p\n",
f, (void *)va, mfn, pfn, virt);

make_lowmem_page_readonly((void *)va);
make_lowmem_page_readonly(virt);
}

MULTI_set_gdt(mcs.mc, frames, size / sizeof(struct desc_struct));

xen_mc_issue(PARAVIRT_LAZY_CPU);
if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct)))
BUG();
}

static void load_TLS_descriptor(struct thread_struct *t,
Expand Down

0 comments on commit d6b79fc

Please sign in to comment.