mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Damato <ice799@gmail.com>
To: linux-x86_64@vger.kernel.org, linux-newbie@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Joe Damato <ice799@gmail.com>
Subject: [PATCH 03/12] x86: Cleanup usage of struct desc_struct
Date: Fri, 24 Oct 2008 20:15:23 -0700	[thread overview]
Message-ID: <4810cc08c12cd78612b53f9b52d7ba93a9b03fd0.1224903712.git.ice799@gmail.com> (raw)
In-Reply-To: <03269a2e8f455b431612a32e8cce048e98c75b27.1224903712.git.ice799@gmail.com>
In-Reply-To: <52f8491fb5d55c0171840b01638ea6db0a98f3be.1224903712.git.ice799@gmail.com>

Use gate_desc typedef for IDT entries instead of struct desc_struct.

Signed-off-by: Joe Damato <ice799@gmail.com>
---
 arch/x86/kernel/vmi_32.c              |    2 +-
 drivers/lguest/interrupts_and_traps.c |   12 ++++++------
 drivers/lguest/lg.h                   |    2 +-
 include/asm-x86/lguest.h              |    4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 8b6c393..8c87b9b 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -63,7 +63,7 @@ static struct {
 	void (*cpuid)(void /* non-c */);
 	void (*_set_ldt)(u32 selector);
 	void (*set_tr)(u32 selector);
-	void (*write_idt_entry)(struct desc_struct *, int, u32, u32);
+	void (*write_idt_entry)(gate_desc *, int, u32, u32);
 	void (*write_gdt_entry)(struct desc_struct *, int, u32, u32);
 	void (*write_ldt_entry)(struct desc_struct *, int, u32, u32);
 	void (*set_kernel_stack)(u32 selector, u32 sp0);
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index a103906..48aa15b 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -133,7 +133,7 @@ void maybe_do_interrupt(struct lg_cpu *cpu)
 {
 	unsigned int irq;
 	DECLARE_BITMAP(blk, LGUEST_IRQS);
-	struct desc_struct *idt;
+	gate_desc *idt;
 
 	/* If the Guest hasn't even initialized yet, we can do nothing. */
 	if (!cpu->lg->lguest_data)
@@ -353,7 +353,7 @@ void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages)
 
 /*H:235 This is the routine which actually checks the Guest's IDT entry and
  * transfers it into the entry in "struct lguest": */
-static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap,
+static void set_trap(struct lg_cpu *cpu, gate_desc *trap,
 		     unsigned int num, u32 lo, u32 hi)
 {
 	u8 type = idt_type(lo, hi);
@@ -404,10 +404,10 @@ void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi)
 /* The default entry for each interrupt points into the Switcher routines which
  * simply return to the Host.  The run_guest() loop will then call
  * deliver_trap() to bounce it back into the Guest. */
-static void default_idt_entry(struct desc_struct *idt,
+static void default_idt_entry(gate_desc *idt,
 			      int trap,
 			      const unsigned long handler,
-			      const struct desc_struct *base)
+			      const gate_desc *base)
 {
 	/* A present interrupt gate. */
 	u32 flags = 0x8e00;
@@ -439,7 +439,7 @@ void setup_default_idt_entries(struct lguest_ro_state *state,
 /*H:240 We don't use the IDT entries in the "struct lguest" directly, instead
  * we copy them into the IDT which we've set up for Guests on this CPU, just
  * before we run the Guest.  This routine does that copy. */
-void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
+void copy_traps(const struct lg_cpu *cpu, gate_desc *idt,
 		const unsigned long *def)
 {
 	unsigned int i;
@@ -447,7 +447,7 @@ void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
 	/* We can simply copy the direct traps, otherwise we use the default
 	 * ones in the Switcher: they will return to the Host. */
 	for (i = 0; i < ARRAY_SIZE(cpu->arch.idt); i++) {
-		const struct desc_struct *gidt = &cpu->arch.idt[i];
+		const gate_desc *gidt = &cpu->arch.idt[i];
 
 		/* If no Guest can ever override this trap, leave it alone. */
 		if (!direct_trap(i))
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
index 5faefea..4377488 100644
--- a/drivers/lguest/lg.h
+++ b/drivers/lguest/lg.h
@@ -147,7 +147,7 @@ void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages);
 void pin_stack_pages(struct lg_cpu *cpu);
 void setup_default_idt_entries(struct lguest_ro_state *state,
 			       const unsigned long *def);
-void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
+void copy_traps(const struct lg_cpu *cpu, gate_desc *idt,
 		const unsigned long *def);
 void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta);
 void init_clockdev(struct lg_cpu *cpu);
diff --git a/include/asm-x86/lguest.h b/include/asm-x86/lguest.h
index 7505e94..9ccf6f4 100644
--- a/include/asm-x86/lguest.h
+++ b/include/asm-x86/lguest.h
@@ -61,7 +61,7 @@ struct lguest_ro_state {
 	struct desc_ptr guest_idt_desc;
 	struct desc_ptr guest_gdt_desc;
 	struct x86_hw_tss guest_tss;
-	struct desc_struct guest_idt[IDT_ENTRIES];
+	gate_desc guest_idt[IDT_ENTRIES];
 	struct desc_struct guest_gdt[GDT_ENTRIES];
 };
 
@@ -70,7 +70,7 @@ struct lg_cpu_arch {
 	struct desc_struct gdt[GDT_ENTRIES];
 
 	/* The IDT entries: some copied into lguest_ro_state when running. */
-	struct desc_struct idt[IDT_ENTRIES];
+	gate_desc idt[IDT_ENTRIES];
 
 	/* The address of the last guest-visible pagefault (ie. cr2). */
 	unsigned long last_pagefault;
-- 
1.5.4.3


  reply	other threads:[~2008-10-25  3:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25  3:15 [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs Joe Damato
2008-10-25  3:15 ` [PATCH 01/12] x86: Cleanup x86 descriptors, remove a/b fields from structs Joe Damato
2008-10-25  3:15   ` [PATCH 02/12] x86: Use new gate_struct for gate_desc Joe Damato
2008-10-25  3:15     ` Joe Damato [this message]
2008-10-25  3:15       ` [PATCH 04/12] x86: Add macros " Joe Damato
2008-10-25  3:15         ` [PATCH 05/12] x86: Refactor pack_gate " Joe Damato
2008-10-25  3:15           ` [PATCH 06/12] x86: Refactor pack_descriptor Joe Damato
2008-10-25  3:15             ` [PATCH 07/12] x86: Add a static initializer for IDTs Joe Damato
2008-10-25  3:15               ` [PATCH 08/12] x86: Use static intializer for IDT entries Joe Damato
2008-10-25  3:15                 ` [PATCH 09/12] x86: Add static initiazlier for descriptors Joe Damato
2008-10-25  3:15                   ` [PATCH 10/12] x86: Use static initializers " Joe Damato
2008-10-25  3:15                     ` [PATCH 11/12] x86: Use macros for getting/setting descriptors Joe Damato
2008-10-25  3:15                       ` [PATCH 12/12] x86: Use struct fields instead of bitmasks Joe Damato
2008-10-29 12:56                         ` Jeremy Fitzhardinge
2008-10-29 12:58                   ` [PATCH 09/12] x86: Add static initiazlier for descriptors Jeremy Fitzhardinge
2008-10-29 12:54         ` [PATCH 04/12] x86: Add macros for gate_desc Jeremy Fitzhardinge
2008-10-29 12:52       ` [PATCH 03/12] x86: Cleanup usage of struct desc_struct Jeremy Fitzhardinge
2008-10-29 12:53     ` [PATCH 02/12] x86: Use new gate_struct for gate_desc Jeremy Fitzhardinge
2008-10-25  5:40 ` [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs Willy Tarreau
2008-10-27 10:57   ` Ingo Molnar
2008-10-25  9:39 ` walter harms
2008-10-27 10:55 ` Ingo Molnar
2008-10-27 14:34   ` H. Peter Anvin
2008-10-27 21:15   ` Joe Damato
2008-10-27 23:02     ` Jeremy Fitzhardinge

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=4810cc08c12cd78612b53f9b52d7ba93a9b03fd0.1224903712.git.ice799@gmail.com \
    --to=ice799@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=linux-x86_64@vger.kernel.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

all inboxes | Powered by JetHome®