* Using MSR load/store areas
@ 2009-07-03 14:04 Nipun sehrawat
0 siblings, 0 replies; 3+ messages in thread
From: Nipun sehrawat @ 2009-07-03 14:04 UTC (permalink / raw)
To: kvm
Hi Everyone,
I am trying to use the MSR load and store areas in vmx. I did following:
1. Setting vm_entry_msr_load_count:
vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, 1);
2. Setting up vm_entry_msr_load_addr :
static struct page *vmx_msr_load;
Then in vmx_init() :
vmx_msr_load = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
va=kmap(vmx_msr_load);
memset(va, MSR_P6_PERFCTR0, 32); /*Bits 31:0 contain msr's address*/
memset(va+32, 0x0, 32); /*Bits 63:32 are reserved and shall be all Zeros*/
memset(va+64, 0x0, 64); /*The data to be loaded on VM-Entry*/
And then:
vmcs_write64(VM_ENTRY_MSR_LOAD_ADDR, page_to_phys(vms_msr_load));
-------
Now, this results in VM-exit with following on terminal :
unhandled vm exit: 0x80000022 vcpu_id 0
rax 0000000000000000 rbx 0000000000000000 rcx 0000000000000000 rdx
0000000000000623
rsi 0000000000000000 rdi 0000000000000000 rsp 0000000000000000 rbp
0000000000000000
r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11
0000000000000000
r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15
0000000000000000
rip 000000000000fff0 rflags 00023002
cs f000 (000f0000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ds 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
es 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
fs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
tr 0000 (fffbd000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
gdt 0/ffff
idt 0/ffff
cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
Aborted
-------
Does anyone has any idea of whats wrong in what I am doing?
Cheers,
Nipun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Using MSR Load/Store Areas
@ 2009-07-03 21:42 Sehrawat Nipun
2009-07-05 8:02 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Sehrawat Nipun @ 2009-07-03 21:42 UTC (permalink / raw)
To: kvm@vger.kernel.org
Hi Everyone,
I am trying to use the MSR load and store areas in vmx. I did following:
1. Setting vm_entry_msr_load_count:
vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, 1);
2. Setting up vm_entry_msr_load_addr :
static struct page *vmx_msr_load;
Then in vmx_init() :
vmx_msr_load = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
va=kmap(vmx_msr_load);
memset(va, MSR_P6_PERFCTR0, 32); /*Bits 31:0 contain msr's address*/
memset(va+32, 0x0, 32); /*Bits 63:32 are reserved and shall be all Zeros*/
memset(va+64, 0x0, 64); /*The data to be loaded on VM-Entry*/
And then:
vmcs_write64(VM_ENTRY_MSR_LOAD_ADDR, page_to_phys(vms_msr_load));
-------
Now, this results in VM-exit with following on terminal :
unhandled vm exit: 0x80000022 vcpu_id 0
rax 0000000000000000 rbx 0000000000000000 rcx 0000000000000000 rdx
0000000000000623
rsi 0000000000000000 rdi 0000000000000000 rsp 0000000000000000 rbp
0000000000000000
r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11
0000000000000000
r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15
0000000000000000
rip 000000000000fff0 rflags 00023002
cs f000 (000f0000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ds 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
es 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
fs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
tr 0000 (fffbd000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
gdt 0/ffff
idt 0/ffff
cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
Aborted
-------
Does anyone has any idea of whats wrong in what I am doing?
Cheers,
Nipun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using MSR Load/Store Areas
2009-07-03 21:42 Using MSR Load/Store Areas Sehrawat Nipun
@ 2009-07-05 8:02 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2009-07-05 8:02 UTC (permalink / raw)
To: Sehrawat Nipun; +Cc: kvm@vger.kernel.org
On 07/04/2009 12:42 AM, Sehrawat Nipun wrote:
> Hi Everyone,
>
> I am trying to use the MSR load and store areas in vmx. I did following:
>
> 1. Setting vm_entry_msr_load_count:
>
> vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, 1);
>
> 2. Setting up vm_entry_msr_load_addr :
>
> static struct page *vmx_msr_load;
>
> Then in vmx_init() :
>
> vmx_msr_load = alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
>
Don't use highmem for pages you give to vmx -- some implementations only
support 32-bit physical addresses.
> va=kmap(vmx_msr_load);
> memset(va, MSR_P6_PERFCTR0, 32); /*Bits 31:0 contain msr's address*/
>
This doesn't do what you think it does. Look at the resulting memory
pattern. Use ordinary assignment instead.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-05 8:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-03 21:42 Using MSR Load/Store Areas Sehrawat Nipun
2009-07-05 8:02 ` Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2009-07-03 14:04 Using MSR load/store areas Nipun sehrawat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox