Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104431
b: refs/heads/master
c: e176d36
h: refs/heads/master
i:
  104429: 1ad57f9
  104427: dd9dff7
  104423: 0967978
  104415: 2793a41
v: v3
  • Loading branch information
Eduardo Habkost authored and Ingo Molnar committed Jul 16, 2008
1 parent e6784a1 commit 25bce7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 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: 836fe2f291cb450a6193fa713878efe7d32bec6e
refs/heads/master: e176d367d0cc8b8efd2e0960c9edf5d2fe7cd9f1
26 changes: 10 additions & 16 deletions trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,23 +401,18 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
preempt_enable();
}

static int cvt_gate_to_trap(int vector, u32 low, u32 high,
static int cvt_gate_to_trap(int vector, const gate_desc *val,
struct trap_info *info)
{
u8 type, dpl;

type = (high >> 8) & 0x1f;
dpl = (high >> 13) & 3;

if (type != 0xf && type != 0xe)
if (val->type != 0xf && val->type != 0xe)
return 0;

info->vector = vector;
info->address = (high & 0xffff0000) | (low & 0x0000ffff);
info->cs = low >> 16;
info->flags = dpl;
info->address = gate_offset(*val);
info->cs = gate_segment(*val);
info->flags = val->dpl;
/* interrupt gates clear IF */
if (type == 0xe)
if (val->type == 0xe)
info->flags |= 4;

return 1;
Expand All @@ -444,11 +439,10 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)

if (p >= start && (p + 8) <= end) {
struct trap_info info[2];
u32 *desc = (u32 *)g;

info[1].address = 0;

if (cvt_gate_to_trap(entrynum, desc[0], desc[1], &info[0]))
if (cvt_gate_to_trap(entrynum, g, &info[0]))
if (HYPERVISOR_set_trap_table(info))
BUG();
}
Expand All @@ -461,13 +455,13 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
{
unsigned in, out, count;

count = (desc->size+1) / 8;
count = (desc->size+1) / sizeof(gate_desc);
BUG_ON(count > 256);

for (in = out = 0; in < count; in++) {
const u32 *entry = (u32 *)(desc->address + in * 8);
gate_desc *entry = (gate_desc*)(desc->address) + in;

if (cvt_gate_to_trap(in, entry[0], entry[1], &traps[out]))
if (cvt_gate_to_trap(in, entry, &traps[out]))
out++;
}
traps[out].address = 0;
Expand Down

0 comments on commit 25bce7a

Please sign in to comment.