From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: ehabkost@redhat.com, ak@suse.de,
virtualization@lists.linux-foundation.org, chrisw@sous-sol.org,
tglx@linutronix.de, anthony@codemonkey.ws, hpa@zytor.com,
akpm@linux-foundation.org,
Glauber de Oliveira Costa <gcosta@redhat.com>,
mingo@elte.hu, roland@redhat.com
Subject: [PATCH 6/10] provide read and write cr8 paravirt hooks
Date: Fri, 18 Jan 2008 15:20:21 -0200 [thread overview]
Message-ID: <12006768631010-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1200676857691-git-send-email-gcosta@redhat.com>
Since the cr8 manipulation functions ended up staying in the tree,
they can't be defined just when PARAVIRT is off: In this patch,
those functions are defined for the PARAVIRT case too.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
---
include/asm-x86/system.h | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index 692c28c..a33c3f4 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -236,6 +236,20 @@ static inline void native_write_cr4(unsigned long val)
asm volatile("mov %0,%%cr4": :"r" (val), "m" (__force_order));
}
+#ifdef CONFIG_X86_64
+static inline unsigned long native_read_cr8(void)
+{
+ unsigned long cr8;
+ asm volatile("movq %%cr8,%0" : "=r" (cr8));
+ return cr8;
+}
+
+static inline void native_write_cr8(unsigned long val)
+{
+ asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
+}
+#endif
+
static inline void native_wbinvd(void)
{
asm volatile("wbinvd": : :"memory");
@@ -253,21 +267,9 @@ static inline void native_wbinvd(void)
#define read_cr4_safe() (native_read_cr4_safe())
#define write_cr4(x) (native_write_cr4(x))
#define wbinvd() (native_wbinvd())
-
#ifdef CONFIG_X86_64
-
-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 read_cr8() (native_read_cr8())
+#define write_cr8(x) (native_write_cr8(x))
#endif
/* Clear the 'TS' bit */
--
1.4.4.2
WARNING: multiple messages have this Message-ID (diff)
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, zach@vmware.com, roland@redhat.com,
mtosatti@redhat.com,
Glauber de Oliveira Costa <gcosta@redhat.com>
Subject: [PATCH 6/10] provide read and write cr8 paravirt hooks
Date: Fri, 18 Jan 2008 15:20:21 -0200 [thread overview]
Message-ID: <12006768631010-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1200676857691-git-send-email-gcosta@redhat.com>
Since the cr8 manipulation functions ended up staying in the tree,
they can't be defined just when PARAVIRT is off: In this patch,
those functions are defined for the PARAVIRT case too.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
---
include/asm-x86/system.h | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index 692c28c..a33c3f4 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -236,6 +236,20 @@ static inline void native_write_cr4(unsigned long val)
asm volatile("mov %0,%%cr4": :"r" (val), "m" (__force_order));
}
+#ifdef CONFIG_X86_64
+static inline unsigned long native_read_cr8(void)
+{
+ unsigned long cr8;
+ asm volatile("movq %%cr8,%0" : "=r" (cr8));
+ return cr8;
+}
+
+static inline void native_write_cr8(unsigned long val)
+{
+ asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
+}
+#endif
+
static inline void native_wbinvd(void)
{
asm volatile("wbinvd": : :"memory");
@@ -253,21 +267,9 @@ static inline void native_wbinvd(void)
#define read_cr4_safe() (native_read_cr4_safe())
#define write_cr4(x) (native_write_cr4(x))
#define wbinvd() (native_wbinvd())
-
#ifdef CONFIG_X86_64
-
-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 read_cr8() (native_read_cr8())
+#define write_cr8(x) (native_write_cr8(x))
#endif
/* Clear the 'TS' bit */
--
1.4.4.2
next prev parent reply other threads:[~2008-01-18 17:20 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-18 17:20 [PATCH 0/10] Tree fixes for PARAVIRT Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 1/10] add missing parameter for lookup_address Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 2/10] add stringify header Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 3/10] provide a native_init_IRQ function to x86_64 Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 4/10] put generic mm_hooks include into PARAVIRT Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 5/10] puts read and write cr8 into pv_cpu_ops Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa [this message]
2008-01-18 17:20 ` [PATCH 6/10] provide read and write cr8 paravirt hooks Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 7/10] fill pv_cpu_ops structure with cr8 fields Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 8/10] add asm_offset PARAVIRT constants Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 9/10] provide __parainstructions section Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 17:20 ` [PATCH 10/10] change function orders in paravirt.h Glauber de Oliveira Costa
2008-01-18 17:20 ` Glauber de Oliveira Costa
2008-01-18 20:24 ` Jeremy Fitzhardinge
2008-01-18 20:24 ` Jeremy Fitzhardinge
2008-01-18 20:41 ` [PATCH 9/10] provide __parainstructions section Sam Ravnborg
2008-01-18 22:47 ` Jeremy Fitzhardinge
2008-01-18 22:47 ` Jeremy Fitzhardinge
2008-01-18 20:41 ` Sam Ravnborg
2008-01-18 17:20 ` [PATCH 4/10] put generic mm_hooks include into PARAVIRT Glauber de Oliveira Costa
2008-01-18 20:26 ` [PATCH 1/10] add missing parameter for lookup_address Chris Wright
2008-01-18 20:26 ` Chris Wright
2008-01-19 1:16 ` Andi Kleen
2008-01-19 1:16 ` Andi Kleen
2008-01-18 20:32 ` [PATCH 0/10] Tree fixes for PARAVIRT Ingo Molnar
2008-01-18 21:37 ` Ingo Molnar
2008-01-18 21:37 ` Ingo Molnar
2008-01-18 21:54 ` Zachary Amsden
2008-01-18 21:54 ` Zachary Amsden
2008-01-18 22:02 ` Ingo Molnar
2008-01-19 1:24 ` Glauber de Oliveira Costa
2008-01-19 1:24 ` Glauber de Oliveira Costa
2008-01-22 12:20 ` Ingo Molnar
2008-01-22 12:20 ` Ingo Molnar
2008-01-18 22:02 ` Ingo Molnar
2008-01-18 22:31 ` Jeremy Fitzhardinge
2008-01-18 22:31 ` Jeremy Fitzhardinge
2008-01-18 20:32 ` Ingo Molnar
2008-01-19 18:19 ` [PATCH] fill in missing pv_mmu_ops entries for PAGETABLE_LEVELS >= 3 Marcelo Tosatti
2008-01-20 5:05 ` Jeremy Fitzhardinge
2008-01-21 20:44 ` Eduardo Pereira Habkost
2008-01-21 21:19 ` Jeremy Fitzhardinge
2008-01-22 12:30 ` Ingo Molnar
2008-01-28 22:33 ` Glauber de Oliveira Costa
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=12006768631010-git-send-email-gcosta@redhat.com \
--to=gcosta@redhat.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=anthony@codemonkey.ws \
--cc=chrisw@sous-sol.org \
--cc=ehabkost@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.