From: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
To: lkml - Kernel Mailing List
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Zachary Amsden <zach-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>,
Jeremy Fitzhardinge <jeremy-TSDbQ3PG+2Y@public.gmane.org>,
kvm-devel
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Andi Kleen <ak-h9bWGtP8wOw@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: [PATCH 3/3] i386: Replace struct Xgt_desc_struct with struct desc_ptr
Date: Wed, 18 Jul 2007 17:30:12 +1000 [thread overview]
Message-ID: <1184743812.10380.120.camel@localhost.localdomain> (raw)
In-Reply-To: <1184743422.10380.114.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
Remove i386's Xgt_desc_struct definition and use desc_def.h's desc_ptr.
The offsets in asm-offsets.c do not seem to be used anywhere, so I
simply removed them.
Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
diff -r 0b03f449c0b3 arch/i386/kernel/asm-offsets.c
--- a/arch/i386/kernel/asm-offsets.c Wed Jul 18 16:34:04 2007 +1000
+++ b/arch/i386/kernel/asm-offsets.c Wed Jul 18 16:55:36 2007 +1000
@@ -61,11 +61,6 @@ void foo(void)
OFFSET(TI_sysenter_return, thread_info, sysenter_return);
BLANK();
- OFFSET(GDS_size, Xgt_desc_struct, size);
- OFFSET(GDS_address, Xgt_desc_struct, address);
- OFFSET(GDS_pad, Xgt_desc_struct, pad);
- BLANK();
-
OFFSET(PT_EBX, pt_regs, ebx);
OFFSET(PT_ECX, pt_regs, ecx);
OFFSET(PT_EDX, pt_regs, edx);
diff -r 0b03f449c0b3 arch/i386/kernel/cpu/common.c
--- a/arch/i386/kernel/cpu/common.c Wed Jul 18 16:34:04 2007 +1000
+++ b/arch/i386/kernel/cpu/common.c Wed Jul 18 16:56:08 2007 +1000
@@ -642,7 +642,7 @@ struct pt_regs * __devinit idle_regs(str
* it's on the real one. */
void switch_to_new_gdt(void)
{
- struct Xgt_desc_struct gdt_descr;
+ struct desc_ptr gdt_descr;
gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id());
gdt_descr.size = GDT_SIZE - 1;
diff -r 0b03f449c0b3 arch/i386/kernel/doublefault.c
--- a/arch/i386/kernel/doublefault.c Wed Jul 18 16:34:04 2007 +1000
+++ b/arch/i386/kernel/doublefault.c Wed Jul 18 16:56:34 2007 +1000
@@ -17,7 +17,7 @@ static unsigned long doublefault_stack[D
static void doublefault_fn(void)
{
- struct Xgt_desc_struct gdt_desc = {0, 0};
+ struct desc_ptr gdt_desc = {0, 0};
unsigned long gdt, tss;
store_gdt(&gdt_desc);
diff -r 0b03f449c0b3 arch/i386/kernel/efi.c
--- a/arch/i386/kernel/efi.c Wed Jul 18 16:34:04 2007 +1000
+++ b/arch/i386/kernel/efi.c Wed Jul 18 16:56:43 2007 +1000
@@ -69,7 +69,7 @@ static void efi_call_phys_prelog(void) _
{
unsigned long cr4;
unsigned long temp;
- struct Xgt_desc_struct gdt_descr;
+ struct desc_ptr gdt_descr;
spin_lock(&efi_rt_lock);
local_irq_save(efi_rt_eflags);
@@ -111,7 +111,7 @@ static void efi_call_phys_epilog(void) _
static void efi_call_phys_epilog(void) __releases(efi_rt_lock)
{
unsigned long cr4;
- struct Xgt_desc_struct gdt_descr;
+ struct desc_ptr gdt_descr;
gdt_descr.address = (unsigned long)get_cpu_gdt_table(0);
gdt_descr.size = GDT_SIZE - 1;
diff -r 0b03f449c0b3 arch/i386/kernel/machine_kexec.c
--- a/arch/i386/kernel/machine_kexec.c Wed Jul 18 16:34:04 2007 +1000
+++ b/arch/i386/kernel/machine_kexec.c Wed Jul 18 16:56:54 2007 +1000
@@ -31,7 +31,7 @@ static u32 kexec_pte1[1024] PAGE_ALIGNED
static void set_idt(void *newidt, __u16 limit)
{
- struct Xgt_desc_struct curidt;
+ struct desc_ptr curidt;
/* ia32 supports unaliged loads & stores */
curidt.size = limit;
@@ -43,7 +43,7 @@ static void set_idt(void *newidt, __u16
static void set_gdt(void *newgdt, __u16 limit)
{
- struct Xgt_desc_struct curgdt;
+ struct desc_ptr curgdt;
/* ia32 supports unaligned loads & stores */
curgdt.size = limit;
diff -r 0b03f449c0b3 arch/i386/kernel/reboot.c
--- a/arch/i386/kernel/reboot.c Wed Jul 18 16:34:04 2007 +1000
+++ b/arch/i386/kernel/reboot.c Wed Jul 18 16:56:59 2007 +1000
@@ -155,7 +155,7 @@ real_mode_gdt_entries [3] =
0x000092000100ffffULL /* 16-bit real-mode 64k data at 0x00000100 */
};
-static struct Xgt_desc_struct
+static struct desc_ptr
real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, (long)real_mode_gdt_entries },
real_mode_idt = { 0x3ff, 0 },
no_idt = { 0, 0 };
diff -r 0b03f449c0b3 drivers/kvm/svm.c
--- a/drivers/kvm/svm.c Wed Jul 18 16:34:04 2007 +1000
+++ b/drivers/kvm/svm.c Wed Jul 18 17:10:13 2007 +1000
@@ -290,11 +290,7 @@ static void svm_hardware_enable(void *ga
struct svm_cpu_data *svm_data;
uint64_t efer;
-#ifdef CONFIG_X86_64
struct desc_ptr gdt_descr;
-#else
- struct Xgt_desc_struct gdt_descr;
-#endif
struct desc_struct *gdt;
int me = raw_smp_processor_id();
diff -r 0b03f449c0b3 include/asm-i386/desc.h
--- a/include/asm-i386/desc.h Wed Jul 18 16:34:04 2007 +1000
+++ b/include/asm-i386/desc.h Wed Jul 18 16:47:34 2007 +1000
@@ -12,12 +12,6 @@
#include <asm/mmu.h>
-struct Xgt_desc_struct {
- unsigned short size;
- unsigned long address __attribute__((packed));
- unsigned short pad;
-} __attribute__ ((packed));
-
struct gdt_page
{
struct desc_struct gdt[GDT_ENTRIES];
@@ -29,7 +23,7 @@ static inline struct desc_struct *get_cp
return per_cpu(gdt_page, cpu).gdt;
}
-extern struct Xgt_desc_struct idt_descr;
+extern struct desc_ptr idt_descr;
extern struct desc_struct idt_table[];
extern void set_intr_gate(unsigned int irq, void * addr);
@@ -107,22 +101,22 @@ static inline void native_load_tr_desc(v
asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8));
}
-static inline void native_load_gdt(const struct Xgt_desc_struct *dtr)
+static inline void native_load_gdt(const struct desc_ptr *dtr)
{
asm volatile("lgdt %0"::"m" (*dtr));
}
-static inline void native_load_idt(const struct Xgt_desc_struct *dtr)
+static inline void native_load_idt(const struct desc_ptr *dtr)
{
asm volatile("lidt %0"::"m" (*dtr));
}
-static inline void native_store_gdt(struct Xgt_desc_struct *dtr)
+static inline void native_store_gdt(struct desc_ptr *dtr)
{
asm ("sgdt %0":"=m" (*dtr));
}
-static inline void native_store_idt(struct Xgt_desc_struct *dtr)
+static inline void native_store_idt(struct desc_ptr *dtr)
{
asm ("sidt %0":"=m" (*dtr));
}
diff -r 0b03f449c0b3 include/asm-i386/paravirt.h
--- a/include/asm-i386/paravirt.h Wed Jul 18 16:34:04 2007 +1000
+++ b/include/asm-i386/paravirt.h Wed Jul 18 16:49:02 2007 +1000
@@ -20,7 +20,7 @@
struct page;
struct thread_struct;
-struct Xgt_desc_struct;
+struct desc_ptr;
struct tss_struct;
struct mm_struct;
struct desc_struct;
@@ -121,10 +121,10 @@ struct paravirt_ops
/* Segment descriptor handling */
void (*load_tr_desc)(void);
- void (*load_gdt)(const struct Xgt_desc_struct *);
- void (*load_idt)(const struct Xgt_desc_struct *);
- void (*store_gdt)(struct Xgt_desc_struct *);
- void (*store_idt)(struct Xgt_desc_struct *);
+ void (*load_gdt)(const struct desc_ptr *);
+ void (*load_idt)(const struct desc_ptr *);
+ void (*store_gdt)(struct desc_ptr *);
+ void (*store_idt)(struct desc_ptr *);
void (*set_ldt)(const void *desc, unsigned entries);
unsigned long (*store_tr)(void);
void (*load_tls)(struct thread_struct *t, unsigned int cpu);
@@ -583,11 +583,11 @@ static inline void load_TR_desc(void)
{
PVOP_VCALL0(load_tr_desc);
}
-static inline void load_gdt(const struct Xgt_desc_struct *dtr)
+static inline void load_gdt(const struct desc_ptr *dtr)
{
PVOP_VCALL1(load_gdt, dtr);
}
-static inline void load_idt(const struct Xgt_desc_struct *dtr)
+static inline void load_idt(const struct desc_ptr *dtr)
{
PVOP_VCALL1(load_idt, dtr);
}
@@ -595,11 +595,11 @@ static inline void set_ldt(const void *a
{
PVOP_VCALL2(set_ldt, addr, entries);
}
-static inline void store_gdt(struct Xgt_desc_struct *dtr)
+static inline void store_gdt(struct desc_ptr *dtr)
{
PVOP_VCALL1(store_gdt, dtr);
}
-static inline void store_idt(struct Xgt_desc_struct *dtr)
+static inline void store_idt(struct desc_ptr *dtr)
{
PVOP_VCALL1(store_idt, dtr);
}
diff -r 0b03f449c0b3 include/asm-i386/processor.h
--- a/include/asm-i386/processor.h Wed Jul 18 16:34:04 2007 +1000
+++ b/include/asm-i386/processor.h Wed Jul 18 16:49:14 2007 +1000
@@ -748,7 +748,7 @@ extern int sysenter_setup(void);
extern int sysenter_setup(void);
/* Defined in head.S */
-extern struct Xgt_desc_struct early_gdt_descr;
+extern struct desc_ptr early_gdt_descr;
extern void cpu_set_gdt(int);
extern void switch_to_new_gdt(void);
diff -r 0b03f449c0b3 include/asm-i386/suspend.h
--- a/include/asm-i386/suspend.h Wed Jul 18 16:34:04 2007 +1000
+++ b/include/asm-i386/suspend.h Wed Jul 18 16:49:20 2007 +1000
@@ -12,8 +12,8 @@ struct saved_context {
struct saved_context {
u16 es, fs, gs, ss;
unsigned long cr0, cr2, cr3, cr4;
- struct Xgt_desc_struct gdt;
- struct Xgt_desc_struct idt;
+ struct desc_ptr gdt;
+ struct desc_ptr idt;
u16 ldt;
u16 tss;
unsigned long tr;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
next prev parent reply other threads:[~2007-07-18 7:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-18 7:22 [PATCH 1/3] Standardize x86_64's desc_defs.h in preparation for exposure to i386 Rusty Russell
[not found] ` <1184743355.10380.112.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-18 7:23 ` [PATCH 2/3] i386: use x86_64's desc_def.h Rusty Russell
[not found] ` <1184743422.10380.114.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-18 7:30 ` Rusty Russell [this message]
[not found] ` <1184743812.10380.120.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-21 1:33 ` [PATCH 3/3] i386: Replace struct Xgt_desc_struct with struct desc_ptr Chris Wright
2007-07-18 16:19 ` [PATCH 2/3] i386: use x86_64's desc_def.h Zachary Amsden
[not found] ` <469E3DA1.3010600-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2007-07-18 23:27 ` Rusty Russell
[not found] ` <1184801261.10380.174.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-18 23:29 ` Rusty Russell
[not found] ` <1184801383.10380.176.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-21 1:32 ` Chris Wright
2007-07-19 0:00 ` Andi Kleen
2007-07-18 9:03 ` [PATCH 1/3] Standardize x86_64's desc_defs.h in preparation for exposure to i386 Andi Kleen
[not found] ` <20070718090302.GA67073-h9bWGtP8wOw@public.gmane.org>
2007-07-18 11:44 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1184743812.10380.120.camel@localhost.localdomain \
--to=rusty-8n+1lvoiyb80n/f98k4iww@public.gmane.org \
--cc=ak-h9bWGtP8wOw@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=jeremy-TSDbQ3PG+2Y@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=zach-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox