public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
Date: Tue, 17 Jul 2007 23:37:17 +1000	[thread overview]
Message-ID: <1184679437.10380.31.camel@localhost.localdomain> (raw)
In-Reply-To: <1184679256.10380.27.camel@localhost.localdomain>

Intel manual (and KVM definition) say it's TPR is 4 bits wide.  Also fix
CR8_RESEVED_BITS typo.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff -r 6ef0b4c0d6f7 drivers/kvm/kvm_main.c
--- a/drivers/kvm/kvm_main.c	Tue Jul 17 18:07:48 2007 +1000
+++ b/drivers/kvm/kvm_main.c	Tue Jul 17 18:20:22 2007 +1000
@@ -92,7 +92,7 @@ static struct dentry *debugfs_dir;
 			  | X86_CR4_PGE | X86_CR4_PCE | X86_CR4_OSFXSR	\
 			  | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE))
 
-#define CR8_RESEVED_BITS (~0x0fULL)
+#define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR)
 #define EFER_RESERVED_BITS 0xfffffffffffff2fe
 
 #ifdef CONFIG_X86_64
@@ -633,7 +633,7 @@ EXPORT_SYMBOL_GPL(set_cr3);
 
 void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr8)
 {
-	if ( cr8 & CR8_RESEVED_BITS) {
+	if (cr8 & CR8_RESERVED_BITS) {
 		printk(KERN_DEBUG "set_cr8: #GP, reserved bits 0x%lx\n", cr8);
 		inject_gp(vcpu);
 		return;
diff -r 6ef0b4c0d6f7 include/asm-i386/processor-flags.h
--- a/include/asm-i386/processor-flags.h	Tue Jul 17 18:07:48 2007 +1000
+++ b/include/asm-i386/processor-flags.h	Tue Jul 17 18:12:54 2007 +1000
@@ -63,7 +63,7 @@
 /*
  * x86-64 Task Priority Register, CR8
  */
-#define X86_CR8_TPR	0x00000007 /* task priority register */
+#define X86_CR8_TPR	0x0000000F /* task priority register */
 
 /*
  * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h>



       reply	other threads:[~2007-07-17 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1184677946.10380.4.camel@localhost.localdomain>
     [not found] ` <1184678060.10380.7.camel@localhost.localdomain>
     [not found]   ` <1184678129.10380.10.camel@localhost.localdomain>
     [not found]     ` <1184678171.10380.12.camel@localhost.localdomain>
     [not found]       ` <1184678216.10380.14.camel@localhost.localdomain>
     [not found]         ` <1184678275.10380.16.camel@localhost.localdomain>
     [not found]           ` <1184678348.10380.19.camel@localhost.localdomain>
     [not found]             ` <1184679175.10380.25.camel@localhost.localdomain>
     [not found]               ` <1184679256.10380.27.camel@localhost.localdomain>
2007-07-17 13:37                 ` Rusty Russell [this message]
2007-07-17 13:44                   ` [PATCH 10/10] Use standard CR8 flags, and fix TPR definition Avi Kivity
2007-07-17 16:01                     ` H. Peter Anvin
2007-07-17 16:00                   ` H. Peter Anvin
2007-07-18 18:09                     ` Avi Kivity

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=1184679437.10380.31.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=avi@qumranet.com \
    --cc=hpa@zytor.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@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