From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, glommer@gmail.com, tglx@linutronix.de,
mingo@elte.hu, ehabkost@redhat.com, jeremy@goop.org,
avi@qumranet.com, anthony@codemonkey.ws,
virtualization@lists.linux-foundation.org, rusty@rustcorp.com.au,
ak@suse.de, chrisw@sous-sol.org, rostedt@goodmis.org,
hpa@zytor.com, Glauber de Oliveira Costa <gcosta@redhat.com>
Subject: [PATCH 4/9] remove references to cr8 register
Date: Wed, 5 Dec 2007 13:08:28 -0200 [thread overview]
Message-ID: <1196867333728-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <11968673291072-git-send-email-gcosta@redhat.com>
As pointed out by Andi, linux never really uses this register
so saving and restoring is not really necessary. This patch
removes all references to it.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
---
arch/x86/kernel/asm-offsets_64.c | 1 -
arch/x86/kernel/suspend_64.c | 2 --
include/asm-x86/suspend_64.h | 2 +-
include/asm-x86/system_64.h | 12 ------------
4 files changed, 1 insertions(+), 16 deletions(-)
Index: linux-2.6-x86/arch/x86/kernel/asm-offsets_64.c
===================================================================
--- linux-2.6-x86.orig/arch/x86/kernel/asm-offsets_64.c
+++ linux-2.6-x86/arch/x86/kernel/asm-offsets_64.c
@@ -107,7 +107,6 @@ int main(void)
ENTRY(cr2);
ENTRY(cr3);
ENTRY(cr4);
- ENTRY(cr8);
BLANK();
#undef ENTRY
DEFINE(TSS_ist, offsetof(struct tss_struct, ist));
Index: linux-2.6-x86/arch/x86/kernel/suspend_64.c
===================================================================
--- linux-2.6-x86.orig/arch/x86/kernel/suspend_64.c
+++ linux-2.6-x86/arch/x86/kernel/suspend_64.c
@@ -53,7 +53,6 @@ void __save_processor_state(struct saved
ctxt->cr2 = read_cr2();
ctxt->cr3 = read_cr3();
ctxt->cr4 = read_cr4();
- ctxt->cr8 = read_cr8();
}
void save_processor_state(void)
@@ -75,7 +74,6 @@ void __restore_processor_state(struct sa
* control registers
*/
wrmsrl(MSR_EFER, ctxt->efer);
- write_cr8(ctxt->cr8);
write_cr4(ctxt->cr4);
write_cr3(ctxt->cr3);
write_cr2(ctxt->cr2);
Index: linux-2.6-x86/include/asm-x86/suspend_64.h
===================================================================
--- linux-2.6-x86.orig/include/asm-x86/suspend_64.h
+++ linux-2.6-x86/include/asm-x86/suspend_64.h
@@ -20,7 +20,7 @@ struct saved_context {
struct pt_regs regs;
u16 ds, es, fs, gs, ss;
unsigned long gs_base, gs_kernel_base, fs_base;
- unsigned long cr0, cr2, cr3, cr4, cr8;
+ unsigned long cr0, cr2, cr3, cr4;
unsigned long efer;
u16 gdt_pad;
u16 gdt_limit;
Index: linux-2.6-x86/include/asm-x86/system_64.h
===================================================================
--- linux-2.6-x86.orig/include/asm-x86/system_64.h
+++ linux-2.6-x86/include/asm-x86/system_64.h
@@ -95,18 +95,6 @@ static inline void write_cr4(unsigned lo
asm volatile("movq %0,%%cr4" :: "r" (val) : "memory");
}
-static inline unsigned long read_cr8(void)
-{
- unsigned long cr8;
- asm volatile("movq %%cr8,%0" : "=r" (cr8));
- return cr8;
-}
-
-static inline void write_cr8(unsigned long val)
-{
- asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
-}
-
#define stts() write_cr0(8 | read_cr0())
#define wbinvd() \
next prev parent reply other threads:[~2007-12-05 17:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-05 15:08 [PATCH 0/9 - v2] Integrate system.h Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 1/9] remove volatile keyword from clflush Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 2/9] put together equal pieces of system.h Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 3/9] unify load_segment macro Glauber de Oliveira Costa
2007-12-05 15:08 ` Glauber de Oliveira Costa [this message]
2007-12-05 15:08 ` [PATCH 5/9] unify paravirt parts of system.h Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 6/9] remove unused macro Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 7/9] unify smp parts of system.h Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 8/9] move switch_to macro to system.h Glauber de Oliveira Costa
2007-12-05 15:08 ` [PATCH 9/9] unify system.h Glauber de Oliveira Costa
2007-12-06 21:11 ` [PATCH 1/9] remove volatile keyword from clflush Jeremy Fitzhardinge
2007-12-05 20:22 ` [PATCH 0/9 - v2] Integrate system.h Ingo Molnar
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=1196867333728-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=anthony@codemonkey.ws \
--cc=avi@qumranet.com \
--cc=chrisw@sous-sol.org \
--cc=ehabkost@redhat.com \
--cc=glommer@gmail.com \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux-foundation.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