public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
       [not found]               ` <1184679256.10380.27.camel@localhost.localdomain>
@ 2007-07-17 13:37                 ` Rusty Russell
  2007-07-17 13:44                   ` Avi Kivity
  2007-07-17 16:00                   ` H. Peter Anvin
  0 siblings, 2 replies; 5+ messages in thread
From: Rusty Russell @ 2007-07-17 13:37 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel, lkml - Kernel Mailing List, H. Peter Anvin

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>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
  2007-07-17 13:37                 ` [PATCH 10/10] Use standard CR8 flags, and fix TPR definition Rusty Russell
@ 2007-07-17 13:44                   ` Avi Kivity
  2007-07-17 16:01                     ` H. Peter Anvin
  2007-07-17 16:00                   ` H. Peter Anvin
  1 sibling, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-07-17 13:44 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm-devel, lkml - Kernel Mailing List, H. Peter Anvin

Rusty Russell wrote:
> 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 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>
>
>
>   


X86_CR8_TPR is not used in the kernel.  But is this meant to be a mask, 
or something else?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
  2007-07-17 13:37                 ` [PATCH 10/10] Use standard CR8 flags, and fix TPR definition Rusty Russell
  2007-07-17 13:44                   ` Avi Kivity
@ 2007-07-17 16:00                   ` H. Peter Anvin
  2007-07-18 18:09                     ` Avi Kivity
  1 sibling, 1 reply; 5+ messages in thread
From: H. Peter Anvin @ 2007-07-17 16:00 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Avi Kivity, kvm-devel, lkml - Kernel Mailing List

Rusty Russell wrote:
> 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>

Indeed it is.

Acked-by: H. Peter Anvin <hpa@zytor.com>

	-hpa

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
  2007-07-17 13:44                   ` Avi Kivity
@ 2007-07-17 16:01                     ` H. Peter Anvin
  0 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2007-07-17 16:01 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Rusty Russell, kvm-devel, lkml - Kernel Mailing List

Avi Kivity wrote:
> 
> X86_CR8_TPR is not used in the kernel.  But is this meant to be a mask,
> or something else?
> 

Yes, a mask.

And no, it's not used, except for KVM...

	-hpa

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 10/10] Use standard CR8 flags, and fix TPR definition
  2007-07-17 16:00                   ` H. Peter Anvin
@ 2007-07-18 18:09                     ` Avi Kivity
  0 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2007-07-18 18:09 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Rusty Russell, kvm-devel, lkml - Kernel Mailing List

H. Peter Anvin wrote:
> Rusty Russell wrote:
>   
>> 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>
>>     
>
> Indeed it is.
>
> Acked-by: H. Peter Anvin <hpa@zytor.com>
>
>   

Applied-by: Avi Kivity <avi@qumranet.com>

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-18 18:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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                 ` [PATCH 10/10] Use standard CR8 flags, and fix TPR definition Rusty Russell
2007-07-17 13:44                   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox