* [PATCH 0/11] KVM updates for 2.6.21
@ 2007-01-30 14:35 Avi Kivity
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:35 UTC (permalink / raw)
To: kvm-devel; +Cc: Andrew Morton, linux-kernel
This patchset contains an assortment of guest and host fixes for kvm.
Andrew, please queue for 2.6.21.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/11] KVM: optimize inline assembly
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-01-30 14:37 ` Avi Kivity
2007-01-30 14:38 ` [PATCH 2/11] KVM: Fix asm constraint for lldt instruction Avi Kivity
` (9 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:37 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
forms like "0(%rsp)" generate an instruction with an unnecessary one byte
displacement under certain circumstances. replace with the equivalent
"(%rsp)".
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/vmx.c
===================================================================
--- linux-2.6.orig/drivers/kvm/vmx.c
+++ linux-2.6/drivers/kvm/vmx.c
@@ -1784,10 +1784,10 @@ again:
"kvm_vmx_return: "
/* Save guest registers, load host registers, keep flags */
#ifdef CONFIG_X86_64
- "xchg %3, 0(%%rsp) \n\t"
+ "xchg %3, (%%rsp) \n\t"
"mov %%rax, %c[rax](%3) \n\t"
"mov %%rbx, %c[rbx](%3) \n\t"
- "pushq 0(%%rsp); popq %c[rcx](%3) \n\t"
+ "pushq (%%rsp); popq %c[rcx](%3) \n\t"
"mov %%rdx, %c[rdx](%3) \n\t"
"mov %%rsi, %c[rsi](%3) \n\t"
"mov %%rdi, %c[rdi](%3) \n\t"
@@ -1802,24 +1802,24 @@ again:
"mov %%r15, %c[r15](%3) \n\t"
"mov %%cr2, %%rax \n\t"
"mov %%rax, %c[cr2](%3) \n\t"
- "mov 0(%%rsp), %3 \n\t"
+ "mov (%%rsp), %3 \n\t"
"pop %%rcx; pop %%r15; pop %%r14; pop %%r13; pop %%r12;"
"pop %%r11; pop %%r10; pop %%r9; pop %%r8;"
"pop %%rbp; pop %%rdi; pop %%rsi;"
"pop %%rdx; pop %%rbx; pop %%rax \n\t"
#else
- "xchg %3, 0(%%esp) \n\t"
+ "xchg %3, (%%esp) \n\t"
"mov %%eax, %c[rax](%3) \n\t"
"mov %%ebx, %c[rbx](%3) \n\t"
- "pushl 0(%%esp); popl %c[rcx](%3) \n\t"
+ "pushl (%%esp); popl %c[rcx](%3) \n\t"
"mov %%edx, %c[rdx](%3) \n\t"
"mov %%esi, %c[rsi](%3) \n\t"
"mov %%edi, %c[rdi](%3) \n\t"
"mov %%ebp, %c[rbp](%3) \n\t"
"mov %%cr2, %%eax \n\t"
"mov %%eax, %c[cr2](%3) \n\t"
- "mov 0(%%esp), %3 \n\t"
+ "mov (%%esp), %3 \n\t"
"pop %%ecx; popa \n\t"
#endif
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/11] KVM: Fix asm constraint for lldt instruction
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-30 14:37 ` [PATCH 1/11] KVM: optimize inline assembly Avi Kivity
@ 2007-01-30 14:38 ` Avi Kivity
2007-01-30 14:55 ` Avi Kivity
2007-01-30 14:39 ` [PATCH 3/11] KVM: Fix gva_to_gpa() Avi Kivity
` (8 subsequent siblings)
10 siblings, 1 reply; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:38 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
From: S.Çağlar Onur <caglar-caicS1wCkhO6A22drWdTBw@public.gmane.org>
lldt does not accept immediate operands, which "g" allows.
Signed-off-by: S.Çağlar Onur <caglar-caicS1wCkhO6A22drWdTBw@public.gmane.org>
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/kvm.h
===================================================================
--- linux-2.6.orig/drivers/kvm/kvm.h
+++ linux-2.6/drivers/kvm/kvm.h
@@ -558,7 +558,7 @@ static inline void load_gs(u16 sel)
#ifndef load_ldt
static inline void load_ldt(u16 sel)
{
- asm ("lldt %0" : : "g"(sel));
+ asm ("lldt %0" : : "rm"(sel));
}
#endif
[-- Attachment #2: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/11] KVM: Fix gva_to_gpa()
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-30 14:37 ` [PATCH 1/11] KVM: optimize inline assembly Avi Kivity
2007-01-30 14:38 ` [PATCH 2/11] KVM: Fix asm constraint for lldt instruction Avi Kivity
@ 2007-01-30 14:39 ` Avi Kivity
2007-01-30 14:40 ` [PATCH 4/11] KVM: vmx: handle triple faults by returning EXIT_REASON_SHUTDOWN to userspace Avi Kivity
` (7 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:39 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
gva_to_gpa() needs to be updated to the new walk_addr() calling convention,
otherwise it may oops under some circumstances.
Use the opportunity to remove all the code duplication in gva_to_gpa(), which
essentially repeats the calculations in walk_addr().
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/paging_tmpl.h
===================================================================
--- linux-2.6.orig/drivers/kvm/paging_tmpl.h
+++ linux-2.6/drivers/kvm/paging_tmpl.h
@@ -443,31 +443,17 @@ static int FNAME(page_fault)(struct kvm_
static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr)
{
struct guest_walker walker;
- pt_element_t guest_pte;
- gpa_t gpa;
+ gpa_t gpa = UNMAPPED_GVA;
+ int r;
- FNAME(walk_addr)(&walker, vcpu, vaddr, 0, 0, 0);
- guest_pte = *walker.ptep;
- FNAME(release_walker)(&walker);
-
- if (!is_present_pte(guest_pte))
- return UNMAPPED_GVA;
-
- if (walker.level == PT_DIRECTORY_LEVEL) {
- ASSERT((guest_pte & PT_PAGE_SIZE_MASK));
- ASSERT(PTTYPE == 64 || is_pse(vcpu));
+ r = FNAME(walk_addr)(&walker, vcpu, vaddr, 0, 0, 0);
- gpa = (guest_pte & PT_DIR_BASE_ADDR_MASK) | (vaddr &
- (PT_LEVEL_MASK(PT_PAGE_TABLE_LEVEL) | ~PAGE_MASK));
-
- if (PTTYPE == 32 && is_cpuid_PSE36())
- gpa |= (guest_pte & PT32_DIR_PSE36_MASK) <<
- (32 - PT32_DIR_PSE36_SHIFT);
- } else {
- gpa = (guest_pte & PT_BASE_ADDR_MASK);
- gpa |= (vaddr & ~PAGE_MASK);
+ if (r) {
+ gpa = (gpa_t)walker.gfn << PAGE_SHIFT;
+ gpa |= vaddr & ~PAGE_MASK;
}
+ FNAME(release_walker)(&walker);
return gpa;
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 4/11] KVM: vmx: handle triple faults by returning EXIT_REASON_SHUTDOWN to userspace
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (2 preceding siblings ...)
2007-01-30 14:39 ` [PATCH 3/11] KVM: Fix gva_to_gpa() Avi Kivity
@ 2007-01-30 14:40 ` Avi Kivity
2007-01-30 14:41 ` [PATCH 5/11] KVM: fix what looks like an obvious typo in the file drivers/kvm/svm.c Avi Kivity
` (6 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:40 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
Just like svm.
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/vmx.c
===================================================================
--- linux-2.6.orig/drivers/kvm/vmx.c
+++ linux-2.6/drivers/kvm/vmx.c
@@ -1373,6 +1373,11 @@ static int handle_external_interrupt(str
return 1;
}
+static int handle_triple_fault(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
+{
+ kvm_run->exit_reason = KVM_EXIT_SHUTDOWN;
+ return 0;
+}
static int get_io_count(struct kvm_vcpu *vcpu, u64 *count)
{
@@ -1633,6 +1638,7 @@ static int (*kvm_vmx_exit_handlers[])(st
struct kvm_run *kvm_run) = {
[EXIT_REASON_EXCEPTION_NMI] = handle_exception,
[EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt,
+ [EXIT_REASON_TRIPLE_FAULT] = handle_triple_fault,
[EXIT_REASON_IO_INSTRUCTION] = handle_io,
[EXIT_REASON_CR_ACCESS] = handle_cr,
[EXIT_REASON_DR_ACCESS] = handle_dr,
Index: linux-2.6/drivers/kvm/vmx.h
===================================================================
--- linux-2.6.orig/drivers/kvm/vmx.h
+++ linux-2.6/drivers/kvm/vmx.h
@@ -180,6 +180,7 @@ enum vmcs_field {
#define EXIT_REASON_EXCEPTION_NMI 0
#define EXIT_REASON_EXTERNAL_INTERRUPT 1
+#define EXIT_REASON_TRIPLE_FAULT 2
#define EXIT_REASON_PENDING_INTERRUPT 7
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 5/11] KVM: fix what looks like an obvious typo in the file drivers/kvm/svm.c
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (3 preceding siblings ...)
2007-01-30 14:40 ` [PATCH 4/11] KVM: vmx: handle triple faults by returning EXIT_REASON_SHUTDOWN to userspace Avi Kivity
@ 2007-01-30 14:41 ` Avi Kivity
2007-01-30 14:42 ` [PATCH 6/11] KVM: Fix mmu going crazy of guest sets cr0.wp == 0 Avi Kivity
` (5 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:41 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: Robert P. J. Day <rpjday-mn4gwa5WIIQysxA8WJXlww@public.gmane.org>
Signed-off-by: Robert P. J. Day <rpjday-mn4gwa5WIIQysxA8WJXlww@public.gmane.org>
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/svm.c
===================================================================
--- linux-2.6.orig/drivers/kvm/svm.c
+++ linux-2.6/drivers/kvm/svm.c
@@ -1163,7 +1163,7 @@ static int svm_set_msr(struct kvm_vcpu *
case MSR_K6_STAR:
vcpu->svm->vmcb->save.star = data;
break;
-#ifdef CONFIG_X86_64_
+#ifdef CONFIG_X86_64
case MSR_LSTAR:
vcpu->svm->vmcb->save.lstar = data;
break;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 6/11] KVM: Fix mmu going crazy of guest sets cr0.wp == 0
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (4 preceding siblings ...)
2007-01-30 14:41 ` [PATCH 5/11] KVM: fix what looks like an obvious typo in the file drivers/kvm/svm.c Avi Kivity
@ 2007-01-30 14:42 ` Avi Kivity
2007-01-30 14:43 ` [PATCH 7/11] KVM: SVM: Hack initial cpu csbase to be consistent with intel Avi Kivity
` (4 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:42 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
The kvm mmu relies on cr0.wp being set even if the guest does not set it. The
vmx code correctly forces cr0.wp at all times, the svm code does not, so it
can't boot solaris without this patch.
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/svm.c
===================================================================
--- linux-2.6.orig/drivers/kvm/svm.c
+++ linux-2.6/drivers/kvm/svm.c
@@ -723,7 +723,7 @@ static void svm_set_cr0(struct kvm_vcpu
}
#endif
vcpu->svm->cr0 = cr0;
- vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK;
+ vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK | CR0_WP_MASK;
vcpu->cr0 = cr0;
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 7/11] KVM: SVM: Hack initial cpu csbase to be consistent with intel
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (5 preceding siblings ...)
2007-01-30 14:42 ` [PATCH 6/11] KVM: Fix mmu going crazy of guest sets cr0.wp == 0 Avi Kivity
@ 2007-01-30 14:43 ` Avi Kivity
2007-01-30 14:44 ` [PATCH 8/11] KVM: Two-way apic tpr synchronization Avi Kivity
` (3 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:43 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
This allows us to run the mmu testsuite on amd.
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/svm.c
===================================================================
--- linux-2.6.orig/drivers/kvm/svm.c
+++ linux-2.6/drivers/kvm/svm.c
@@ -528,7 +528,13 @@ static void init_vmcb(struct vmcb *vmcb)
save->cs.attrib = SVM_SELECTOR_READ_MASK | SVM_SELECTOR_P_MASK |
SVM_SELECTOR_S_MASK | SVM_SELECTOR_CODE_MASK;
save->cs.limit = 0xffff;
- save->cs.base = 0xffff0000;
+ /*
+ * cs.base should really be 0xffff0000, but vmx can't handle that, so
+ * be consistent with it.
+ *
+ * Replace when we have real mode working for vmx.
+ */
+ save->cs.base = 0xf0000;
save->gdtr.limit = 0xffff;
save->idtr.limit = 0xffff;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 8/11] KVM: Two-way apic tpr synchronization
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (6 preceding siblings ...)
2007-01-30 14:43 ` [PATCH 7/11] KVM: SVM: Hack initial cpu csbase to be consistent with intel Avi Kivity
@ 2007-01-30 14:44 ` Avi Kivity
2007-01-30 14:45 ` [PATCH 9/11] KVM: VMX: Reload ds and es even in 64-bit mode Avi Kivity
` (2 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:44 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
We report the value of cr8 to userspace on an exit. Also let userspace change
cr8 when we re-enter the guest. The lets 64-bit guest code maintain the tpr
correctly.
Thanks for Yaniv Kamay for the idea.
Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/kvm_main.c
===================================================================
--- linux-2.6.orig/drivers/kvm/kvm_main.c
+++ linux-2.6/drivers/kvm/kvm_main.c
@@ -1360,6 +1360,9 @@ static int kvm_dev_ioctl_run(struct kvm
if (!vcpu)
return -ENOENT;
+ /* re-sync apic's tpr */
+ vcpu->cr8 = kvm_run->cr8;
+
if (kvm_run->emulated) {
kvm_arch_ops->skip_emulated_instruction(vcpu);
kvm_run->emulated = 0;
Index: linux-2.6/include/linux/kvm.h
===================================================================
--- linux-2.6.orig/include/linux/kvm.h
+++ linux-2.6/include/linux/kvm.h
@@ -65,6 +65,8 @@ struct kvm_run {
__u8 ready_for_interrupt_injection;
__u8 if_flag;
__u16 padding2;
+
+ /* in (pre_kvm_run), out (post_kvm_run) */
__u64 cr8;
__u64 apic_base;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 9/11] KVM: VMX: Reload ds and es even in 64-bit mode
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (7 preceding siblings ...)
2007-01-30 14:44 ` [PATCH 8/11] KVM: Two-way apic tpr synchronization Avi Kivity
@ 2007-01-30 14:45 ` Avi Kivity
2007-01-30 14:46 ` [PATCH 10/11] KVM: Fix mismatch between 32-bit and 64-bit abi Avi Kivity
2007-01-30 14:47 ` [PATCH 11/11] KVM: fix vcpu freeing bug Avi Kivity
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:45 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
Or 32-bit userspace will get confused.
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/vmx.c
===================================================================
--- linux-2.6.orig/drivers/kvm/vmx.c
+++ linux-2.6/drivers/kvm/vmx.c
@@ -1863,9 +1863,7 @@ again:
fx_restore(vcpu->host_fx_image);
vcpu->interrupt_window_open = (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0;
-#ifndef CONFIG_X86_64
asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
-#endif
/*
* Profile KVM exit RIPs:
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 10/11] KVM: Fix mismatch between 32-bit and 64-bit abi
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (8 preceding siblings ...)
2007-01-30 14:45 ` [PATCH 9/11] KVM: VMX: Reload ds and es even in 64-bit mode Avi Kivity
@ 2007-01-30 14:46 ` Avi Kivity
2007-01-30 14:47 ` [PATCH 11/11] KVM: fix vcpu freeing bug Avi Kivity
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:46 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
Unfortunately requiring a version bump.
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/include/linux/kvm.h
===================================================================
--- linux-2.6.orig/include/linux/kvm.h
+++ linux-2.6/include/linux/kvm.h
@@ -11,7 +11,7 @@
#include <asm/types.h>
#include <linux/ioctl.h>
-#define KVM_API_VERSION 2
+#define KVM_API_VERSION 3
/*
* Architectural interrupt line count, and the size of the bitmap needed
@@ -187,6 +187,7 @@ struct kvm_translation {
__u8 valid;
__u8 writeable;
__u8 usermode;
+ __u8 pad[5];
};
/* for KVM_INTERRUPT */
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 11/11] KVM: fix vcpu freeing bug
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
` (9 preceding siblings ...)
2007-01-30 14:46 ` [PATCH 10/11] KVM: Fix mismatch between 32-bit and 64-bit abi Avi Kivity
@ 2007-01-30 14:47 ` Avi Kivity
10 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:47 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA
From: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
vcpu_load() can return NULL and it sometimes does in failure paths (for
example when the userspace ABI version is too old) - causing a
preemption count underflow in the ->vcpu_free() later on. So check for
NULL.
Signed-off-by: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Index: linux-2.6/drivers/kvm/kvm_main.c
===================================================================
--- linux-2.6.orig/drivers/kvm/kvm_main.c
+++ linux-2.6/drivers/kvm/kvm_main.c
@@ -272,7 +272,9 @@ static void kvm_free_physmem(struct kvm
static void kvm_free_vcpu(struct kvm_vcpu *vcpu)
{
- vcpu_load(vcpu->kvm, vcpu_slot(vcpu));
+ if (!vcpu_load(vcpu->kvm, vcpu_slot(vcpu)))
+ return;
+
kvm_mmu_destroy(vcpu);
vcpu_put(vcpu);
kvm_arch_ops->vcpu_free(vcpu);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/11] KVM: Fix asm constraint for lldt instruction
2007-01-30 14:38 ` [PATCH 2/11] KVM: Fix asm constraint for lldt instruction Avi Kivity
@ 2007-01-30 14:55 ` Avi Kivity
0 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2007-01-30 14:55 UTC (permalink / raw)
To: akpm; +Cc: kvm-devel, linux-kernel, mingo
Avi Kivity wrote:
> From: S.Çağlar Onur <caglar@pardus.org.tr>
> Signed-off-by: Avi Kivity <avi@qumranet.com>
>
>
The mangled name is actually S.Çağlar Onur <caglar@pardus.org.tr>.
Apologies to S.Çağlar and Andrew. Will fix my script to include charset
info.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-01-30 14:55 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-30 14:35 [PATCH 0/11] KVM updates for 2.6.21 Avi Kivity
[not found] ` <45BF57C9.7000103-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-30 14:37 ` [PATCH 1/11] KVM: optimize inline assembly Avi Kivity
2007-01-30 14:38 ` [PATCH 2/11] KVM: Fix asm constraint for lldt instruction Avi Kivity
2007-01-30 14:55 ` Avi Kivity
2007-01-30 14:39 ` [PATCH 3/11] KVM: Fix gva_to_gpa() Avi Kivity
2007-01-30 14:40 ` [PATCH 4/11] KVM: vmx: handle triple faults by returning EXIT_REASON_SHUTDOWN to userspace Avi Kivity
2007-01-30 14:41 ` [PATCH 5/11] KVM: fix what looks like an obvious typo in the file drivers/kvm/svm.c Avi Kivity
2007-01-30 14:42 ` [PATCH 6/11] KVM: Fix mmu going crazy of guest sets cr0.wp == 0 Avi Kivity
2007-01-30 14:43 ` [PATCH 7/11] KVM: SVM: Hack initial cpu csbase to be consistent with intel Avi Kivity
2007-01-30 14:44 ` [PATCH 8/11] KVM: Two-way apic tpr synchronization Avi Kivity
2007-01-30 14:45 ` [PATCH 9/11] KVM: VMX: Reload ds and es even in 64-bit mode Avi Kivity
2007-01-30 14:46 ` [PATCH 10/11] KVM: Fix mismatch between 32-bit and 64-bit abi Avi Kivity
2007-01-30 14:47 ` [PATCH 11/11] KVM: fix vcpu freeing bug Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox