You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (202 commits)
MAINTAINERS: update KVM entry
KVM: correct error-handling code
KVM: fix compile warnings on s390
KVM: VMX: Check cpl before emulating debug register access
KVM: fix misreporting of coalesced interrupts by kvm tracer
KVM: x86: drop duplicate kvm_flush_remote_tlb calls
KVM: VMX: call vmx_load_host_state() only if msr is cached
KVM: VMX: Conditionally reload debug register 6
KVM: Use thread debug register storage instead of kvm specific data
KVM guest: do not batch pte updates from interrupt context
KVM: Fix coalesced interrupt reporting in IOAPIC
KVM guest: fix bogus wallclock physical address calculation
KVM: VMX: Fix cr8 exiting control clobbering by EPT
KVM: Optimize kvm_mmu_unprotect_page_virt() for tdp
KVM: Document KVM_CAP_IRQCHIP
KVM: Protect update_cr8_intercept() when running without an apic
KVM: VMX: Fix EPT with WP bit change during paging
KVM: Use kvm_{read,write}_guest_virt() to read and write segment descriptors
KVM: x86 emulator: Add adc and sbb missing decoder flags
KVM: Add missing #include
...
This commit is contained in:
@@ -193,7 +193,7 @@ Code Seq# Include File Comments
|
||||
0xAD 00 Netfilter device in development:
|
||||
<mailto:rusty@rustcorp.com.au>
|
||||
0xAE all linux/kvm.h Kernel-based Virtual Machine
|
||||
<mailto:kvm-devel@lists.sourceforge.net>
|
||||
<mailto:kvm@vger.kernel.org>
|
||||
0xB0 all RATIO devices in development:
|
||||
<mailto:vgo@ratio.de>
|
||||
0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
|
||||
|
||||
@@ -57,6 +57,7 @@ parameter is applicable:
|
||||
ISAPNP ISA PnP code is enabled.
|
||||
ISDN Appropriate ISDN support is enabled.
|
||||
JOY Appropriate joystick support is enabled.
|
||||
KVM Kernel Virtual Machine support is enabled.
|
||||
LIBATA Libata driver is enabled
|
||||
LP Printer support is enabled.
|
||||
LOOP Loopback device support is enabled.
|
||||
@@ -1098,6 +1099,44 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||
kstack=N [X86] Print N words from the kernel stack
|
||||
in oops dumps.
|
||||
|
||||
kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs.
|
||||
Default is 0 (don't ignore, but inject #GP)
|
||||
|
||||
kvm.oos_shadow= [KVM] Disable out-of-sync shadow paging.
|
||||
Default is 1 (enabled)
|
||||
|
||||
kvm-amd.nested= [KVM,AMD] Allow nested virtualization in KVM/SVM.
|
||||
Default is 0 (off)
|
||||
|
||||
kvm-amd.npt= [KVM,AMD] Disable nested paging (virtualized MMU)
|
||||
for all guests.
|
||||
Default is 1 (enabled) if in 64bit or 32bit-PAE mode
|
||||
|
||||
kvm-intel.bypass_guest_pf=
|
||||
[KVM,Intel] Disables bypassing of guest page faults
|
||||
on Intel chips. Default is 1 (enabled)
|
||||
|
||||
kvm-intel.ept= [KVM,Intel] Disable extended page tables
|
||||
(virtualized MMU) support on capable Intel chips.
|
||||
Default is 1 (enabled)
|
||||
|
||||
kvm-intel.emulate_invalid_guest_state=
|
||||
[KVM,Intel] Enable emulation of invalid guest states
|
||||
Default is 0 (disabled)
|
||||
|
||||
kvm-intel.flexpriority=
|
||||
[KVM,Intel] Disable FlexPriority feature (TPR shadow).
|
||||
Default is 1 (enabled)
|
||||
|
||||
kvm-intel.unrestricted_guest=
|
||||
[KVM,Intel] Disable unrestricted guest feature
|
||||
(virtualized real and unpaged mode) on capable
|
||||
Intel chips. Default is 1 (enabled)
|
||||
|
||||
kvm-intel.vpid= [KVM,Intel] Disable Virtual Processor Identification
|
||||
feature (tagged TLBs) on capable Intel chips.
|
||||
Default is 1 (enabled)
|
||||
|
||||
l2cr= [PPC]
|
||||
|
||||
l3cr= [PPC]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2926,6 +2926,7 @@ F: include/linux/sunrpc/
|
||||
|
||||
KERNEL VIRTUAL MACHINE (KVM)
|
||||
M: Avi Kivity <avi@redhat.com>
|
||||
M: Marcelo Tosatti <mtosatti@redhat.com>
|
||||
L: kvm@vger.kernel.org
|
||||
W: http://kvm.qumranet.com
|
||||
S: Supported
|
||||
|
||||
@@ -235,7 +235,8 @@ struct kvm_vm_data {
|
||||
#define KVM_REQ_PTC_G 32
|
||||
#define KVM_REQ_RESUME 33
|
||||
|
||||
#define KVM_PAGES_PER_HPAGE 1
|
||||
#define KVM_NR_PAGE_SIZES 1
|
||||
#define KVM_PAGES_PER_HPAGE(x) 1
|
||||
|
||||
struct kvm;
|
||||
struct kvm_vcpu;
|
||||
@@ -465,7 +466,6 @@ struct kvm_arch {
|
||||
unsigned long metaphysical_rr4;
|
||||
unsigned long vmm_init_rr;
|
||||
|
||||
int online_vcpus;
|
||||
int is_sn2;
|
||||
|
||||
struct kvm_ioapic *vioapic;
|
||||
|
||||
@@ -19,9 +19,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
static inline unsigned int kvm_arch_para_features(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
#
|
||||
# KVM configuration
|
||||
#
|
||||
config HAVE_KVM
|
||||
bool
|
||||
|
||||
config HAVE_KVM_IRQCHIP
|
||||
bool
|
||||
default y
|
||||
source "virt/kvm/Kconfig"
|
||||
|
||||
menuconfig VIRTUALIZATION
|
||||
bool "Virtualization"
|
||||
@@ -28,6 +24,8 @@ config KVM
|
||||
depends on PCI
|
||||
select PREEMPT_NOTIFIERS
|
||||
select ANON_INODES
|
||||
select HAVE_KVM_IRQCHIP
|
||||
select KVM_APIC_ARCHITECTURE
|
||||
---help---
|
||||
Support hosting fully virtualized guest machines using hardware
|
||||
virtualization extensions. You will need a fairly recent
|
||||
@@ -49,9 +47,6 @@ config KVM_INTEL
|
||||
Provides support for KVM on Itanium 2 processors equipped with the VT
|
||||
extensions.
|
||||
|
||||
config KVM_TRACE
|
||||
bool
|
||||
|
||||
source drivers/virtio/Kconfig
|
||||
|
||||
endif # VIRTUALIZATION
|
||||
|
||||
+28
-57
@@ -210,16 +210,6 @@ int kvm_dev_ioctl_check_extension(long ext)
|
||||
|
||||
}
|
||||
|
||||
static struct kvm_io_device *vcpu_find_mmio_dev(struct kvm_vcpu *vcpu,
|
||||
gpa_t addr, int len, int is_write)
|
||||
{
|
||||
struct kvm_io_device *dev;
|
||||
|
||||
dev = kvm_io_bus_find_dev(&vcpu->kvm->mmio_bus, addr, len, is_write);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
static int handle_vm_error(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
{
|
||||
kvm_run->exit_reason = KVM_EXIT_UNKNOWN;
|
||||
@@ -231,6 +221,7 @@ static int handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
{
|
||||
struct kvm_mmio_req *p;
|
||||
struct kvm_io_device *mmio_dev;
|
||||
int r;
|
||||
|
||||
p = kvm_get_vcpu_ioreq(vcpu);
|
||||
|
||||
@@ -247,16 +238,13 @@ static int handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
kvm_run->exit_reason = KVM_EXIT_MMIO;
|
||||
return 0;
|
||||
mmio:
|
||||
mmio_dev = vcpu_find_mmio_dev(vcpu, p->addr, p->size, !p->dir);
|
||||
if (mmio_dev) {
|
||||
if (!p->dir)
|
||||
kvm_iodevice_write(mmio_dev, p->addr, p->size,
|
||||
&p->data);
|
||||
else
|
||||
kvm_iodevice_read(mmio_dev, p->addr, p->size,
|
||||
&p->data);
|
||||
|
||||
} else
|
||||
if (p->dir)
|
||||
r = kvm_io_bus_read(&vcpu->kvm->mmio_bus, p->addr,
|
||||
p->size, &p->data);
|
||||
else
|
||||
r = kvm_io_bus_write(&vcpu->kvm->mmio_bus, p->addr,
|
||||
p->size, &p->data);
|
||||
if (r)
|
||||
printk(KERN_ERR"kvm: No iodevice found! addr:%lx\n", p->addr);
|
||||
p->state = STATE_IORESP_READY;
|
||||
|
||||
@@ -337,13 +325,12 @@ static struct kvm_vcpu *lid_to_vcpu(struct kvm *kvm, unsigned long id,
|
||||
{
|
||||
union ia64_lid lid;
|
||||
int i;
|
||||
struct kvm_vcpu *vcpu;
|
||||
|
||||
for (i = 0; i < kvm->arch.online_vcpus; i++) {
|
||||
if (kvm->vcpus[i]) {
|
||||
lid.val = VCPU_LID(kvm->vcpus[i]);
|
||||
if (lid.id == id && lid.eid == eid)
|
||||
return kvm->vcpus[i];
|
||||
}
|
||||
kvm_for_each_vcpu(i, vcpu, kvm) {
|
||||
lid.val = VCPU_LID(vcpu);
|
||||
if (lid.id == id && lid.eid == eid)
|
||||
return vcpu;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -409,21 +396,21 @@ static int handle_global_purge(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
struct kvm *kvm = vcpu->kvm;
|
||||
struct call_data call_data;
|
||||
int i;
|
||||
struct kvm_vcpu *vcpui;
|
||||
|
||||
call_data.ptc_g_data = p->u.ptc_g_data;
|
||||
|
||||
for (i = 0; i < kvm->arch.online_vcpus; i++) {
|
||||
if (!kvm->vcpus[i] || kvm->vcpus[i]->arch.mp_state ==
|
||||
KVM_MP_STATE_UNINITIALIZED ||
|
||||
vcpu == kvm->vcpus[i])
|
||||
kvm_for_each_vcpu(i, vcpui, kvm) {
|
||||
if (vcpui->arch.mp_state == KVM_MP_STATE_UNINITIALIZED ||
|
||||
vcpu == vcpui)
|
||||
continue;
|
||||
|
||||
if (waitqueue_active(&kvm->vcpus[i]->wq))
|
||||
wake_up_interruptible(&kvm->vcpus[i]->wq);
|
||||
if (waitqueue_active(&vcpui->wq))
|
||||
wake_up_interruptible(&vcpui->wq);
|
||||
|
||||
if (kvm->vcpus[i]->cpu != -1) {
|
||||
call_data.vcpu = kvm->vcpus[i];
|
||||
smp_call_function_single(kvm->vcpus[i]->cpu,
|
||||
if (vcpui->cpu != -1) {
|
||||
call_data.vcpu = vcpui;
|
||||
smp_call_function_single(vcpui->cpu,
|
||||
vcpu_global_purge, &call_data, 1);
|
||||
} else
|
||||
printk(KERN_WARNING"kvm: Uninit vcpu received ipi!\n");
|
||||
@@ -852,8 +839,6 @@ struct kvm *kvm_arch_create_vm(void)
|
||||
|
||||
kvm_init_vm(kvm);
|
||||
|
||||
kvm->arch.online_vcpus = 0;
|
||||
|
||||
return kvm;
|
||||
|
||||
}
|
||||
@@ -1000,10 +985,10 @@ long kvm_arch_vm_ioctl(struct file *filp,
|
||||
goto out;
|
||||
if (irqchip_in_kernel(kvm)) {
|
||||
__s32 status;
|
||||
mutex_lock(&kvm->lock);
|
||||
mutex_lock(&kvm->irq_lock);
|
||||
status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
|
||||
irq_event.irq, irq_event.level);
|
||||
mutex_unlock(&kvm->lock);
|
||||
mutex_unlock(&kvm->irq_lock);
|
||||
if (ioctl == KVM_IRQ_LINE_STATUS) {
|
||||
irq_event.status = status;
|
||||
if (copy_to_user(argp, &irq_event,
|
||||
@@ -1216,7 +1201,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
|
||||
if (IS_ERR(vmm_vcpu))
|
||||
return PTR_ERR(vmm_vcpu);
|
||||
|
||||
if (vcpu->vcpu_id == 0) {
|
||||
if (kvm_vcpu_is_bsp(vcpu)) {
|
||||
vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
|
||||
|
||||
/*Set entry address for first run.*/
|
||||
@@ -1224,7 +1209,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
|
||||
|
||||
/*Initialize itc offset for vcpus*/
|
||||
itc_offset = 0UL - kvm_get_itc(vcpu);
|
||||
for (i = 0; i < kvm->arch.online_vcpus; i++) {
|
||||
for (i = 0; i < KVM_MAX_VCPUS; i++) {
|
||||
v = (struct kvm_vcpu *)((char *)vcpu +
|
||||
sizeof(struct kvm_vcpu_data) * i);
|
||||
v->arch.itc_offset = itc_offset;
|
||||
@@ -1356,8 +1341,6 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
kvm->arch.online_vcpus++;
|
||||
|
||||
return vcpu;
|
||||
fail:
|
||||
return ERR_PTR(r);
|
||||
@@ -1952,19 +1935,6 @@ int kvm_highest_pending_irq(struct kvm_vcpu *vcpu)
|
||||
return find_highest_bits((int *)&vpd->irr[0]);
|
||||
}
|
||||
|
||||
int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
if (kvm_highest_pending_irq(vcpu) != -1)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
/* do real check here */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->arch.timer_fired;
|
||||
@@ -1977,7 +1947,8 @@ gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn)
|
||||
|
||||
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE;
|
||||
return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE) ||
|
||||
(kvm_highest_pending_irq(vcpu) != -1);
|
||||
}
|
||||
|
||||
int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
|
||||
|
||||
@@ -830,8 +830,8 @@ static void vcpu_set_itc(struct kvm_vcpu *vcpu, u64 val)
|
||||
|
||||
kvm = (struct kvm *)KVM_VM_BASE;
|
||||
|
||||
if (vcpu->vcpu_id == 0) {
|
||||
for (i = 0; i < kvm->arch.online_vcpus; i++) {
|
||||
if (kvm_vcpu_is_bsp(vcpu)) {
|
||||
for (i = 0; i < atomic_read(&kvm->online_vcpus); i++) {
|
||||
v = (struct kvm_vcpu *)((char *)vcpu +
|
||||
sizeof(struct kvm_vcpu_data) * i);
|
||||
VMX(v, itc_offset) = itc_offset;
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
|
||||
|
||||
/* We don't currently support large pages. */
|
||||
#define KVM_PAGES_PER_HPAGE (1UL << 31)
|
||||
#define KVM_NR_PAGE_SIZES 1
|
||||
#define KVM_PAGES_PER_HPAGE(x) (1UL<<31)
|
||||
|
||||
struct kvm;
|
||||
struct kvm_run;
|
||||
@@ -153,7 +154,6 @@ struct kvm_vcpu_arch {
|
||||
u32 pid;
|
||||
u32 swap_pid;
|
||||
|
||||
u32 pvr;
|
||||
u32 ccr0;
|
||||
u32 ccr1;
|
||||
u32 dbcr0;
|
||||
|
||||
@@ -138,7 +138,7 @@ void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu)
|
||||
kmem_cache_free(kvm_vcpu_cache, vcpu_44x);
|
||||
}
|
||||
|
||||
static int kvmppc_44x_init(void)
|
||||
static int __init kvmppc_44x_init(void)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -149,7 +149,7 @@ static int kvmppc_44x_init(void)
|
||||
return kvm_init(NULL, sizeof(struct kvmppc_vcpu_44x), THIS_MODULE);
|
||||
}
|
||||
|
||||
static void kvmppc_44x_exit(void)
|
||||
static void __exit kvmppc_44x_exit(void)
|
||||
{
|
||||
kvmppc_booke_exit();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "timing.h"
|
||||
|
||||
#include "44x_tlb.h"
|
||||
#include "trace.h"
|
||||
|
||||
#ifndef PPC44x_TLBE_SIZE
|
||||
#define PPC44x_TLBE_SIZE PPC44x_TLB_4K
|
||||
@@ -263,7 +264,7 @@ static void kvmppc_44x_shadow_release(struct kvmppc_vcpu_44x *vcpu_44x,
|
||||
|
||||
/* XXX set tlb_44x_index to stlb_index? */
|
||||
|
||||
KVMTRACE_1D(STLB_INVAL, &vcpu_44x->vcpu, stlb_index, handler);
|
||||
trace_kvm_stlb_inval(stlb_index);
|
||||
}
|
||||
|
||||
void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu)
|
||||
@@ -365,8 +366,8 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
|
||||
/* Insert shadow mapping into hardware TLB. */
|
||||
kvmppc_44x_tlbe_set_modified(vcpu_44x, victim);
|
||||
kvmppc_44x_tlbwe(victim, &stlbe);
|
||||
KVMTRACE_5D(STLB_WRITE, vcpu, victim, stlbe.tid, stlbe.word0, stlbe.word1,
|
||||
stlbe.word2, handler);
|
||||
trace_kvm_stlb_write(victim, stlbe.tid, stlbe.word0, stlbe.word1,
|
||||
stlbe.word2);
|
||||
}
|
||||
|
||||
/* For a particular guest TLB entry, invalidate the corresponding host TLB
|
||||
@@ -485,8 +486,8 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
|
||||
kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlb_index);
|
||||
}
|
||||
|
||||
KVMTRACE_5D(GTLB_WRITE, vcpu, gtlb_index, tlbe->tid, tlbe->word0,
|
||||
tlbe->word1, tlbe->word2, handler);
|
||||
trace_kvm_gtlb_write(gtlb_index, tlbe->tid, tlbe->word0, tlbe->word1,
|
||||
tlbe->word2);
|
||||
|
||||
kvmppc_set_exit_type(vcpu, EMULATED_TLBWE_EXITS);
|
||||
return EMULATE_DONE;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
# KVM configuration
|
||||
#
|
||||
|
||||
config HAVE_KVM_IRQCHIP
|
||||
bool
|
||||
source "virt/kvm/Kconfig"
|
||||
|
||||
menuconfig VIRTUALIZATION
|
||||
bool "Virtualization"
|
||||
@@ -59,17 +58,6 @@ config KVM_E500
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config KVM_TRACE
|
||||
bool "KVM trace support"
|
||||
depends on KVM && MARKERS && SYSFS
|
||||
select RELAY
|
||||
select DEBUG_FS
|
||||
default n
|
||||
---help---
|
||||
This option allows reading a trace of kvm-related events through
|
||||
relayfs. Note the ABI is not considered stable and will be
|
||||
modified in future updates.
|
||||
|
||||
source drivers/virtio/Kconfig
|
||||
|
||||
endif # VIRTUALIZATION
|
||||
|
||||
@@ -8,7 +8,9 @@ EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm
|
||||
|
||||
common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
|
||||
|
||||
common-objs-$(CONFIG_KVM_TRACE) += $(addprefix ../../../virt/kvm/, kvm_trace.o)
|
||||
CFLAGS_44x_tlb.o := -I.
|
||||
CFLAGS_e500_tlb.o := -I.
|
||||
CFLAGS_emulate.o := -I.
|
||||
|
||||
kvm-objs := $(common-objs-y) powerpc.o emulate.o
|
||||
obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
|
||||
|
||||
@@ -520,7 +520,7 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
|
||||
return kvmppc_core_vcpu_translate(vcpu, tr);
|
||||
}
|
||||
|
||||
int kvmppc_booke_init(void)
|
||||
int __init kvmppc_booke_init(void)
|
||||
{
|
||||
unsigned long ivor[16];
|
||||
unsigned long max_ivor = 0;
|
||||
|
||||
@@ -60,9 +60,6 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
|
||||
|
||||
kvmppc_e500_tlb_setup(vcpu_e500);
|
||||
|
||||
/* Use the same core vertion as host's */
|
||||
vcpu->arch.pvr = mfspr(SPRN_PVR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -132,7 +129,7 @@ void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu)
|
||||
kmem_cache_free(kvm_vcpu_cache, vcpu_e500);
|
||||
}
|
||||
|
||||
static int kvmppc_e500_init(void)
|
||||
static int __init kvmppc_e500_init(void)
|
||||
{
|
||||
int r, i;
|
||||
unsigned long ivor[3];
|
||||
@@ -160,7 +157,7 @@ static int kvmppc_e500_init(void)
|
||||
return kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), THIS_MODULE);
|
||||
}
|
||||
|
||||
static void kvmppc_e500_exit(void)
|
||||
static void __init kvmppc_e500_exit(void)
|
||||
{
|
||||
kvmppc_booke_exit();
|
||||
}
|
||||
|
||||
@@ -180,6 +180,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
|
||||
case SPRN_MMUCSR0:
|
||||
vcpu->arch.gpr[rt] = 0; break;
|
||||
|
||||
case SPRN_MMUCFG:
|
||||
vcpu->arch.gpr[rt] = mfspr(SPRN_MMUCFG); break;
|
||||
|
||||
/* extra exceptions */
|
||||
case SPRN_IVOR32:
|
||||
vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
|
||||
|
||||
+12
-14
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "../mm/mmu_decl.h"
|
||||
#include "e500_tlb.h"
|
||||
#include "trace.h"
|
||||
|
||||
#define to_htlb1_esel(esel) (tlb1_entry_num - (esel) - 1)
|
||||
|
||||
@@ -224,9 +225,8 @@ static void kvmppc_e500_stlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||||
|
||||
kvmppc_e500_shadow_release(vcpu_e500, tlbsel, esel);
|
||||
stlbe->mas1 = 0;
|
||||
KVMTRACE_5D(STLB_INVAL, &vcpu_e500->vcpu, index_of(tlbsel, esel),
|
||||
stlbe->mas1, stlbe->mas2, stlbe->mas3, stlbe->mas7,
|
||||
handler);
|
||||
trace_kvm_stlb_inval(index_of(tlbsel, esel), stlbe->mas1, stlbe->mas2,
|
||||
stlbe->mas3, stlbe->mas7);
|
||||
}
|
||||
|
||||
static void kvmppc_e500_tlb1_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||||
@@ -269,7 +269,7 @@ static inline void kvmppc_e500_deliver_tlb_miss(struct kvm_vcpu *vcpu,
|
||||
tlbsel = (vcpu_e500->mas4 >> 28) & 0x1;
|
||||
victim = (tlbsel == 0) ? tlb0_get_next_victim(vcpu_e500) : 0;
|
||||
pidsel = (vcpu_e500->mas4 >> 16) & 0xf;
|
||||
tsized = (vcpu_e500->mas4 >> 8) & 0xf;
|
||||
tsized = (vcpu_e500->mas4 >> 7) & 0x1f;
|
||||
|
||||
vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(victim)
|
||||
| MAS0_NV(vcpu_e500->guest_tlb_nv[tlbsel]);
|
||||
@@ -309,7 +309,7 @@ static inline void kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||||
vcpu_e500->shadow_pages[tlbsel][esel] = new_page;
|
||||
|
||||
/* Force TS=1 IPROT=0 TSIZE=4KB for all guest mappings. */
|
||||
stlbe->mas1 = MAS1_TSIZE(BOOKE_PAGESZ_4K)
|
||||
stlbe->mas1 = MAS1_TSIZE(BOOK3E_PAGESZ_4K)
|
||||
| MAS1_TID(get_tlb_tid(gtlbe)) | MAS1_TS | MAS1_VALID;
|
||||
stlbe->mas2 = (gvaddr & MAS2_EPN)
|
||||
| e500_shadow_mas2_attrib(gtlbe->mas2,
|
||||
@@ -319,9 +319,8 @@ static inline void kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
|
||||
vcpu_e500->vcpu.arch.msr & MSR_PR);
|
||||
stlbe->mas7 = (hpaddr >> 32) & MAS7_RPN;
|
||||
|
||||
KVMTRACE_5D(STLB_WRITE, &vcpu_e500->vcpu, index_of(tlbsel, esel),
|
||||
stlbe->mas1, stlbe->mas2, stlbe->mas3, stlbe->mas7,
|
||||
handler);
|
||||
trace_kvm_stlb_write(index_of(tlbsel, esel), stlbe->mas1, stlbe->mas2,
|
||||
stlbe->mas3, stlbe->mas7);
|
||||
}
|
||||
|
||||
/* XXX only map the one-one case, for now use TLB0 */
|
||||
@@ -535,9 +534,8 @@ int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu)
|
||||
gtlbe->mas3 = vcpu_e500->mas3;
|
||||
gtlbe->mas7 = vcpu_e500->mas7;
|
||||
|
||||
KVMTRACE_5D(GTLB_WRITE, vcpu, vcpu_e500->mas0,
|
||||
gtlbe->mas1, gtlbe->mas2, gtlbe->mas3, gtlbe->mas7,
|
||||
handler);
|
||||
trace_kvm_gtlb_write(vcpu_e500->mas0, gtlbe->mas1, gtlbe->mas2,
|
||||
gtlbe->mas3, gtlbe->mas7);
|
||||
|
||||
/* Invalidate shadow mappings for the about-to-be-clobbered TLBE. */
|
||||
if (tlbe_is_host_safe(vcpu, gtlbe)) {
|
||||
@@ -545,7 +543,7 @@ int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu)
|
||||
case 0:
|
||||
/* TLB0 */
|
||||
gtlbe->mas1 &= ~MAS1_TSIZE(~0);
|
||||
gtlbe->mas1 |= MAS1_TSIZE(BOOKE_PAGESZ_4K);
|
||||
gtlbe->mas1 |= MAS1_TSIZE(BOOK3E_PAGESZ_4K);
|
||||
|
||||
stlbsel = 0;
|
||||
sesel = kvmppc_e500_stlbe_map(vcpu_e500, 0, esel);
|
||||
@@ -679,14 +677,14 @@ void kvmppc_e500_tlb_setup(struct kvmppc_vcpu_e500 *vcpu_e500)
|
||||
|
||||
/* Insert large initial mapping for guest. */
|
||||
tlbe = &vcpu_e500->guest_tlb[1][0];
|
||||
tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOKE_PAGESZ_256M);
|
||||
tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOK3E_PAGESZ_256M);
|
||||
tlbe->mas2 = 0;
|
||||
tlbe->mas3 = E500_TLB_SUPER_PERM_MASK;
|
||||
tlbe->mas7 = 0;
|
||||
|
||||
/* 4K map for serial output. Used by kernel wrapper. */
|
||||
tlbe = &vcpu_e500->guest_tlb[1][1];
|
||||
tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOKE_PAGESZ_4K);
|
||||
tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOK3E_PAGESZ_4K);
|
||||
tlbe->mas2 = (0xe0004500 & 0xFFFFF000) | MAS2_I | MAS2_G;
|
||||
tlbe->mas3 = (0xe0004500 & 0xFFFFF000) | E500_TLB_SUPER_PERM_MASK;
|
||||
tlbe->mas7 = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define __KVM_E500_TLB_H__
|
||||
|
||||
#include <linux/kvm_host.h>
|
||||
#include <asm/mmu-fsl-booke.h>
|
||||
#include <asm/mmu-book3e.h>
|
||||
#include <asm/tlb.h>
|
||||
#include <asm/kvm_e500.h>
|
||||
|
||||
@@ -59,7 +59,7 @@ extern void kvmppc_e500_tlb_setup(struct kvmppc_vcpu_e500 *);
|
||||
/* TLB helper functions */
|
||||
static inline unsigned int get_tlb_size(const struct tlbe *tlbe)
|
||||
{
|
||||
return (tlbe->mas1 >> 8) & 0xf;
|
||||
return (tlbe->mas1 >> 7) & 0x1f;
|
||||
}
|
||||
|
||||
static inline gva_t get_tlb_eaddr(const struct tlbe *tlbe)
|
||||
@@ -70,7 +70,7 @@ static inline gva_t get_tlb_eaddr(const struct tlbe *tlbe)
|
||||
static inline u64 get_tlb_bytes(const struct tlbe *tlbe)
|
||||
{
|
||||
unsigned int pgsize = get_tlb_size(tlbe);
|
||||
return 1ULL << 10 << (pgsize << 1);
|
||||
return 1ULL << 10 << pgsize;
|
||||
}
|
||||
|
||||
static inline gva_t get_tlb_end(const struct tlbe *tlbe)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <asm/kvm_ppc.h>
|
||||
#include <asm/disassemble.h>
|
||||
#include "timing.h"
|
||||
#include "trace.h"
|
||||
|
||||
#define OP_TRAP 3
|
||||
|
||||
@@ -187,7 +188,9 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
|
||||
case SPRN_SRR1:
|
||||
vcpu->arch.gpr[rt] = vcpu->arch.srr1; break;
|
||||
case SPRN_PVR:
|
||||
vcpu->arch.gpr[rt] = vcpu->arch.pvr; break;
|
||||
vcpu->arch.gpr[rt] = mfspr(SPRN_PVR); break;
|
||||
case SPRN_PIR:
|
||||
vcpu->arch.gpr[rt] = mfspr(SPRN_PIR); break;
|
||||
|
||||
/* Note: mftb and TBRL/TBWL are user-accessible, so
|
||||
* the guest can always access the real TB anyways.
|
||||
@@ -417,7 +420,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
|
||||
}
|
||||
}
|
||||
|
||||
KVMTRACE_3D(PPC_INSTR, vcpu, inst, (int)vcpu->arch.pc, emulated, entryexit);
|
||||
trace_kvm_ppc_instr(inst, vcpu->arch.pc, emulated);
|
||||
|
||||
if (advance)
|
||||
vcpu->arch.pc += 4; /* Advance past emulated instruction. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user