aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:12 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:12 -0500
commit8d947344c47a40626730bb80d136d8daac9f2060 (patch)
tree3987eb84706b2f4e968d6838da9d2d1f6888e34e /arch
parent010d4f8221cf51a2ab8b037d0149506b397d073f (diff)
x86: change write_idt_entry signature
this patch changes write_idt_entry signature. It now takes a gate_desc instead of the a and b parameters. It will allow it to be later unified between i386 and x86_64. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> CC: Zachary Amsden <zach@vmware.com> CC: Jeremy Fitzhardinge <Jeremy.Fitzhardinge.citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/paravirt_32.c2
-rw-r--r--arch/x86/kernel/vmi_32.c10
-rw-r--r--arch/x86/lguest/boot.c9
-rw-r--r--arch/x86/xen/enlighten.c8
4 files changed, 19 insertions, 10 deletions
diff --git a/arch/x86/kernel/paravirt_32.c b/arch/x86/kernel/paravirt_32.c
index f4e3a8e01cf2..13bbc99b639b 100644
--- a/arch/x86/kernel/paravirt_32.c
+++ b/arch/x86/kernel/paravirt_32.c
@@ -381,7 +381,7 @@ struct pv_cpu_ops pv_cpu_ops = {
381 .load_tls = native_load_tls, 381 .load_tls = native_load_tls,
382 .write_ldt_entry = write_dt_entry, 382 .write_ldt_entry = write_dt_entry,
383 .write_gdt_entry = write_dt_entry, 383 .write_gdt_entry = write_dt_entry,
384 .write_idt_entry = write_dt_entry, 384 .write_idt_entry = native_write_idt_entry,
385 .load_sp0 = native_load_sp0, 385 .load_sp0 = native_load_sp0,
386 386
387 .irq_enable_syscall_ret = native_irq_enable_syscall_ret, 387 .irq_enable_syscall_ret = native_irq_enable_syscall_ret,
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 4cfda7dbe90f..a635b22de25f 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -62,6 +62,7 @@ static struct {
62 void (*cpuid)(void /* non-c */); 62 void (*cpuid)(void /* non-c */);
63 void (*_set_ldt)(u32 selector); 63 void (*_set_ldt)(u32 selector);
64 void (*set_tr)(u32 selector); 64 void (*set_tr)(u32 selector);
65 void (*write_idt_entry)(struct desc_struct *, int, u32, u32);
65 void (*set_kernel_stack)(u32 selector, u32 sp0); 66 void (*set_kernel_stack)(u32 selector, u32 sp0);
66 void (*allocate_page)(u32, u32, u32, u32, u32); 67 void (*allocate_page)(u32, u32, u32, u32, u32);
67 void (*release_page)(u32, u32); 68 void (*release_page)(u32, u32);
@@ -214,6 +215,12 @@ static void vmi_set_tr(void)
214 vmi_ops.set_tr(GDT_ENTRY_TSS*sizeof(struct desc_struct)); 215 vmi_ops.set_tr(GDT_ENTRY_TSS*sizeof(struct desc_struct));
215} 216}
216 217
218static void vmi_write_idt_entry(gate_desc *dt, int entry, const gate_desc *g)
219{
220 u32 *idt_entry = (u32 *)g;
221 vmi_ops.write_idt_entry(dt, entry, idt_entry[0], idt_entry[2]);
222}
223
217static void vmi_load_sp0(struct tss_struct *tss, 224static void vmi_load_sp0(struct tss_struct *tss,
218 struct thread_struct *thread) 225 struct thread_struct *thread)
219{ 226{
@@ -792,7 +799,8 @@ static inline int __init activate_vmi(void)
792 pv_cpu_ops.load_tls = vmi_load_tls; 799 pv_cpu_ops.load_tls = vmi_load_tls;
793 para_fill(pv_cpu_ops.write_ldt_entry, WriteLDTEntry); 800 para_fill(pv_cpu_ops.write_ldt_entry, WriteLDTEntry);
794 para_fill(pv_cpu_ops.write_gdt_entry, WriteGDTEntry); 801 para_fill(pv_cpu_ops.write_gdt_entry, WriteGDTEntry);
795 para_fill(pv_cpu_ops.write_idt_entry, WriteIDTEntry); 802 para_wrap(pv_cpu_ops.write_idt_entry, vmi_write_idt_entry,
803 write_idt_entry, WriteIDTEntry);
796 para_wrap(pv_cpu_ops.load_sp0, vmi_load_sp0, set_kernel_stack, UpdateKernelStack); 804 para_wrap(pv_cpu_ops.load_sp0, vmi_load_sp0, set_kernel_stack, UpdateKernelStack);
797 para_fill(pv_cpu_ops.set_iopl_mask, SetIOPLMask); 805 para_fill(pv_cpu_ops.set_iopl_mask, SetIOPLMask);
798 para_fill(pv_cpu_ops.io_delay, IODelay); 806 para_fill(pv_cpu_ops.io_delay, IODelay);
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index aa0bdd5fc4bb..b50c8ad25ab4 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -217,13 +217,14 @@ static void irq_enable(void)
217 * address of the handler, and... well, who cares? The Guest just asks the 217 * address of the handler, and... well, who cares? The Guest just asks the
218 * Host to make the change anyway, because the Host controls the real IDT. 218 * Host to make the change anyway, because the Host controls the real IDT.
219 */ 219 */
220static void lguest_write_idt_entry(struct desc_struct *dt, 220static void lguest_write_idt_entry(gate_desc *dt,
221 int entrynum, u32 low, u32 high) 221 int entrynum, const gate_desc *g)
222{ 222{
223 u32 *desc = (u32 *)g;
223 /* Keep the local copy up to date. */ 224 /* Keep the local copy up to date. */
224 write_dt_entry(dt, entrynum, low, high); 225 native_write_idt_entry(dt, entrynum, g);
225 /* Tell Host about this new entry. */ 226 /* Tell Host about this new entry. */
226 hcall(LHCALL_LOAD_IDT_ENTRY, entrynum, low, high); 227 hcall(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]);
227} 228}
228 229
229/* Changing to a different IDT is very rare: we keep the IDT up-to-date every 230/* Changing to a different IDT is very rare: we keep the IDT up-to-date every
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index c32e0fd0f838..b7b7346d8cdc 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -399,8 +399,7 @@ static DEFINE_PER_CPU(struct desc_ptr, idt_desc);
399 399
400/* Set an IDT entry. If the entry is part of the current IDT, then 400/* Set an IDT entry. If the entry is part of the current IDT, then
401 also update Xen. */ 401 also update Xen. */
402static void xen_write_idt_entry(struct desc_struct *dt, int entrynum, 402static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
403 u32 low, u32 high)
404{ 403{
405 unsigned long p = (unsigned long)&dt[entrynum]; 404 unsigned long p = (unsigned long)&dt[entrynum];
406 unsigned long start, end; 405 unsigned long start, end;
@@ -412,14 +411,15 @@ static void xen_write_idt_entry(struct desc_struct *dt, int entrynum,
412 411
413 xen_mc_flush(); 412 xen_mc_flush();
414 413
415 write_dt_entry(dt, entrynum, low, high); 414 native_write_idt_entry(dt, entrynum, g);
416 415
417 if (p >= start && (p + 8) <= end) { 416 if (p >= start && (p + 8) <= end) {
418 struct trap_info info[2]; 417 struct trap_info info[2];
418 u32 *desc = (u32 *)g;
419 419
420 info[1].address = 0; 420 info[1].address = 0;
421 421
422 if (cvt_gate_to_trap(entrynum, low, high, &info[0])) 422 if (cvt_gate_to_trap(entrynum, desc[0], desc[1], &info[0]))
423 if (HYPERVISOR_set_trap_table(info)) 423 if (HYPERVISOR_set_trap_table(info))
424 BUG(); 424 BUG();
425 } 425 }