24 Oct, 2010
40 commits
-
The following patch
commit 57ce1659316f4ca298919649f9b1b55862ac3826
KVM: x86: In DM_LOWEST, only deliver interrupts to vcpus with enabled LAPIC'signored the fact that kvm_irq_delivery_to_apic() was also used by ia64.
We define kvm_lapic_enabled() to fix a compile error caused by this.
This will have the same effect as reverting the problematic patch for ia64.Signed-off-by: Takuya Yoshikawa
Signed-off-by: Avi Kivity -
The audit is very high overhead, so we need lower the frequency to assure
the guest is running.Signed-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
Both audit_mappings() and audit_sptes_have_rmaps() need to walk vcpu's page
table, so we can do these checking in a spte walkingSigned-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
Both audit_rmap() and audit_write_protection() need to walk all active sp, so
we can do these checking in a sp walkingSigned-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
Move the audit code from arch/x86/kvm/mmu.c to arch/x86/kvm/mmu_audit.c
Signed-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
Add a r/w module parameter named 'mmu_audit', it can control audit
enable/disable:enable:
echo 1 > /sys/module/kvm/parameters/mmu_auditdisable:
echo 0 > /sys/module/kvm/parameters/mmu_auditThis patch not change the logic
Signed-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
MSR_K7_CLK_CTL is a no longer documented MSR, which is only relevant
on said old AMD CPU models. This change returns the expected value,
which the Linux kernel is expecting to avoid writing back the MSR,
plus it ignores all writes to the MSR.Signed-off-by: Jes Sorensen
Signed-off-by: Avi Kivity -
ICW is not a full reset, instead it resets a limited number of registers
in the PIC. Change ICW1 emulation to only reset those registers.Signed-off-by: Avi Kivity
-
x86_emulate_insn() is full of things like
if (rc != X86EMUL_CONTINUE)
goto done;
break;consolidate all of those at the end of the switch statement.
Signed-off-by: Avi Kivity
-
These are all undefined.
Signed-off-by: Avi Kivity
-
Signed-off-by: Avi Kivity
-
It is read/only; restoring it only results in annoying messages.
Signed-off-by: Avi Kivity
-
Otherwise EFER_LMA bit is retained across a SIPI reset.
Fixes guest cpu onlining.
Signed-off-by: Marcelo Tosatti
Signed-off-by: Avi Kivity -
Since commit aad827034e419fa no mmu reinitialization is performed
via init_vmcb.Zero vcpu->arch.cr0 and pass the reset value as a parameter to
kvm_set_cr0.Signed-off-by: Marcelo Tosatti
Signed-off-by: Avi Kivity -
out = write, in = read, not the other way round.
Signed-off-by: Avi Kivity
-
Nothing is checked in count_rmaps(), so remove it
Signed-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
There is a bugs in this function, we call gfn_to_pfn() and kvm_mmu_gva_to_gpa_read() in
atomic context(kvm_mmu_audit() is called under the spinlock(mmu_lock)'s protection).This patch fix it by:
- introduce gfn_to_pfn_atomic instead of gfn_to_pfn
- get the mapping gfn from kvm_mmu_page_get_gfn()And it adds 'notrap' ptes check in unsync/direct sps
Signed-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
The audit code reports some sp not write protected in current code, it's just the
bug in audit_write_protection(), since:- the invalid sp not need write protected
- using uninitialize local variable('gfn')
- call kvm_mmu_audit() out of mmu_lock's protectionSigned-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
The read-only spte also has reverse mapping, so fix the code to check them,
also modify the function name to fit its doingSigned-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
fix:
arch/x86/kvm/mmu.c: In function ‘kvm_mmu_unprotect_page’:
arch/x86/kvm/mmu.c:1741: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘gfn_t’
arch/x86/kvm/mmu.c:1745: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘gfn_t’
arch/x86/kvm/mmu.c: In function ‘mmu_unshadow’:
arch/x86/kvm/mmu.c:1761: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘gfn_t’
arch/x86/kvm/mmu.c: In function ‘set_spte’:
arch/x86/kvm/mmu.c:2005: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘gfn_t’
arch/x86/kvm/mmu.c: In function ‘mmu_set_spte’:
arch/x86/kvm/mmu.c:2033: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 7 has type ‘gfn_t’Signed-off-by: Xiao Guangrong
Signed-off-by: Avi Kivity -
Pit interrupt injection was done by workqueue, so no need to check
pending pit timer in vcpu thread which could lead unnecessary
unblocking of vcpu.Signed-off-by: Jason Wang
Signed-off-by: Avi Kivity -
When CONFIG_KVM_GUEST is selected, but CONFIG_KVM is not, we were missing
some defines in asm-offsets.c and included too many headers at other places.This patch makes above configuration work.
Reported-by: Stephen Rothwell
Signed-off-by: Alexander Graf
Signed-off-by: Avi Kivity -
The ALU opcode block is very regular; introduce D6ALU() to define decode
flags for 6 instructions at a time.Suggested by Paolo Bonzini.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use do_div() instead.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Like DIV and IDIV.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Use the new byte/word dual opcode decode.
Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
Many x86 instructions come in byte and word variants distinguished with bit
0 of the opcode. Add macros to aid in defining them.Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
SrcMemFAddr is not defined with the modrm operand designating a register
instead of a memory address.Signed-off-by: Avi Kivity
Signed-off-by: Marcelo Tosatti -
x86_emulate_insn() will return 1 if instruction can be restarted
without re-entering a guest.Signed-off-by: Gleb Natapov
Signed-off-by: Marcelo Tosatti -
Signed-off-by: Gleb Natapov
Signed-off-by: Marcelo Tosatti -
Signed-off-by: Gleb Natapov
Signed-off-by: Marcelo Tosatti -
Signed-off-by: Wei Yongjun
Signed-off-by: Marcelo Tosatti -
As suggested by Christian, we should expose headers to user space with
information that might be valuable there. The s390 virtio interface is
one of those cases. It defines an ABI between hypervisor and guest, so
it should be exposed to user space.Reported-by: Christian Borntraeger
Signed-off-by: Alexander Graf
Signed-off-by: Marcelo Tosatti