Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PATCH: Fix SVM MSR indexes for 32bit kernel

 
   Soft32 Home -> Linux -> Kernel RSS
Next:  [1/2] 2.6.22-rc6: known regressions v2  
Author Message
H. J. Lu

External


Since: Dec 06, 2006
Posts: 3



(Msg. 1) Posted: Fri Jun 29, 2007 12:50 pm
Post subject: PATCH: Fix SVM MSR indexes for 32bit kernel
Archived from groups: linux>kernel (more info?)

Hi,

MSR index is 32bit not 64bit. All other MSR indexes are defined
without the ULL suffix. Otherwise, you will get

[hjl@gnu-5 tmp]$ cat foo.c
typedef unsigned long long u64;

int is_disabled(void)
{
u64 vm_cr;

do { unsigned long l__,h__; __asm__ __volatile__("rdmsr" : "=a" (l__),
"=d" (h__) : "c" (0xc0010114ULL)); vm_cr = l__; vm_cr |=
((u64)h__<<32); } while(0);
if (vm_cr & (1 << 4))
return 1;

return 0;
}
[hjl@gnu-5 tmp]$ gcc -m32 -S foo.c
foo.c: In function â_disabledâfoo.c:7: error: impossible register
constraint in âmâoo.c:12: confused by earlier errors, bailing out
[hjl@gnu-5 tmp]$

on 32bit. This patch removes the ULL suffix in SVM MSR indexes.


H.J.
--- linux-2.6.21.i686/drivers/kvm/svm.h.msr 2007-06-28 22:42:12.000000000 -0700
+++ linux-2.6.21.i686/drivers/kvm/svm.h 2007-06-29 08:03:09.000000000 -0700
@@ -175,8 +175,8 @@ struct __attribute__ ((__packed__)) vmcb
#define SVM_CPUID_FUNC 0x8000000a

#define MSR_EFER_SVME_MASK (1ULL << 12)
-#define MSR_VM_CR 0xc0010114ULL
-#define MSR_VM_HSAVE_PA 0xc0010117ULL
+#define MSR_VM_CR 0xc0010114
+#define MSR_VM_HSAVE_PA 0xc0010117

#define SVM_VM_CR_SVM_DISABLE 4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
H. Peter Anvin

External


Since: Feb 01, 2007
Posts: 973



(Msg. 2) Posted: Fri Jun 29, 2007 3:30 pm
Post subject: Re: PATCH: Fix SVM MSR indexes for 32bit kernel [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

H. J. Lu wrote:
> }
> [hjl@gnu-5 tmp]$ gcc -m32 -S foo.c
> foo.c: In function â_disabledâfoo.c:7: error: impossible register
> constraint in âmâoo.c:12: confused by earlier errors, bailing out
> [hjl@gnu-5 tmp]$
>
> on 32bit. This patch removes the ULL suffix in SVM MSR indexes.
>
>
> H.J.
> --- linux-2.6.21.i686/drivers/kvm/svm.h.msr 2007-06-28 22:42:12.000000000 -0700
> +++ linux-2.6.21.i686/drivers/kvm/svm.h 2007-06-29 08:03:09.000000000 -0700
> @@ -175,8 +175,8 @@ struct __attribute__ ((__packed__)) vmcb
> #define SVM_CPUID_FUNC 0x8000000a
>
> #define MSR_EFER_SVME_MASK (1ULL << 12)
> -#define MSR_VM_CR 0xc0010114ULL
> -#define MSR_VM_HSAVE_PA 0xc0010117ULL
> +#define MSR_VM_CR 0xc0010114
> +#define MSR_VM_HSAVE_PA 0xc0010117
>

Please take the MSR indicies out of this file and move them to
include/asm-i386/msr-index.h.

-hpa

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo RemoveThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[PATCH] Turn on new termios for x86 32bit systems. - I've been running this way on my laptop for some time with no problems so it's time to turn it on for everyone. Unless....

[PATCH] diskquota: 32bit quota tools on 64bit architectures - From: Vasily Tarasov <vtaras@openvz.org> OpenVZ Linux kernel team has discovered the problem with 32bit quota t...

[PATCH] diskquota: 32bit quota tools on 64bit architectures - From: Vasily Tarasov <vtaras@openvz.org> OpenVZ Linux kernel team has discovered the problem with 32bit quota t...

[PATCH] diskquota: 32bit quota tools on 64bit architectures - From: Vasily Tarasov <vtaras@openvz.org> This patch should be applied after Arnd Bergmann's patch, that intoduce...

NonExecutable Bit in 32Bit - Hey, is it right, that the NX Bit is not used under i386-Arch but under x86_64-Arch? When yes, is there a special..

[PATCH 1/3] kernel-doc: add fusion and i2o to kernel-api b.. - From: Randy Dunlap <randy.dunlap@oracle.com> Add Fusion and I2O message-based device interfaces to kernel-api bo...
       Soft32 Home -> Linux -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]