PowerPC snapshot, integrated with upstream
Subsystems (3)
PATCH 1/1 PowerPC snapshot, integrated with upstream
There are still a few things we're debugging, but a few people expressed interest so I'm sending out a snapshot now.
We will be posting qemu patches in the near future as well, just as soon as we've beaten it into submission. Linux+Qemu is what doesn't work today. For now this code seems to be working fine with the testcases in the kvm-userspace/user directory.
You've probably seen I have a number of patches in flight this week, and some of them aren't upstream yet, but you should be able to pick them out of email easily. (SF's list archive doesn't seem to be saving attachments for this list, but I asked http://marc.info to pick it up as well so you should have better luck there.)
PowerPC 440 KVM implementation.
MAINTAINERS +7 -0
@@ -2219,6 +2219,13 @@ W: kvm.sourceforge.net W: kvm.sourceforge.net S: Supported +KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC +P: Hollis Blanchard +M: [email protected] +L: [email protected] +W: kvm.qumranet.com +S: Supported + KEXEC P: Eric Biederman M: [email protected]
arch/powerpc/Kconfig +1 -0
@@ -694,3 +694,4 @@ config PPC_LIB_RHEAP config PPC_LIB_RHEAP bool +source "arch/powerpc/kvm/Kconfig"
arch/powerpc/Makefile +1 -0
@@ -147,6 +147,7 @@ core-y += arch/powerpc/kernel/ \ arch/powerpc/platforms/ core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/ core-$(CONFIG_XMON) += arch/powerpc/xmon/ +core-$(CONFIG_KVM) += arch/powerpc/kvm/ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
arch/powerpc/kernel/asm-offsets.c +31 -0
@@ -22,6 +22,7 @@#include <linux/mman.h> #include <linux/mm.h> #include <linux/suspend.h> +#include <linux/kvm_host.h> #ifdef CONFIG_PPC64 #include <linux/time.h> #include <linux/hardirq.h>
@@ -328,5 +329,35 @@ int main(void)DEFINE (PGD_TABLE_SIZE ,PGD_TABLE_SIZE ); +#ifdef CONFIG_KVM +DEFINE (TLBE_BYTES ,sizeof (struct tlbe )); + + DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack)); + DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid)); + DEFINE(VCPU_HOST_TLB, offsetof(struct kvm_vcpu, arch.host_tlb)); + DEFINE(VCPU_SHADOW_TLB, offsetof(struct kvm_vcpu, arch.shadow_tlb)); + DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr)); + DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr)); + DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr)); + DEFINE(VCPU_XER, offsetof(struct kvm_vcpu, arch.xer)); + DEFINE(VCPU_CTR, offsetof(struct kvm_vcpu, arch.ctr)); + DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.pc)); + DEFINE(VCPU_GUEST_MSR, offsetof(struct kvm_vcpu, arch.guest_msr)); + DEFINE(VCPU_SHADOW_MSR, offsetof(struct kvm_vcpu, arch.shadow_msr)); + DEFINE(VCPU_SPRG4, offsetof(struct kvm_vcpu, arch.sprg4)); + DEFINE(VCPU_SPRG5, offsetof(struct kvm_vcpu, arch.sprg5)); + DEFINE(VCPU_SPRG6, offsetof(struct kvm_vcpu, arch.sprg6)); + DEFINE(VCPU_SPRG7, offsetof(struct kvm_vcpu, arch.sprg7)); + DEFINE(VCPU_PID, offsetof(struct kvm_vcpu, arch.pid)); + + DEFINE(VCPU_TRAMPOLINE, offsetof(struct kvm_vcpu, arch.trampoline)); + DEFINE(VCPU_TRAMPOLINE_TLBE, offsetof(struct kvm_vcpu, arch.trampoline_tlbe)); + DEFINE(VCPU_LINEAR, offsetof(struct kvm_vcpu, arch.linear)); + DEFINE(VCPU_RESUME_GUEST, offsetof(struct kvm_vcpu, arch.resume_guest)); + DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, arch.last_inst)); + DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, arch.fault_dear)); + DEFINE(VCPU_FAULT_ESR, offsetof(struct kvm_vcpu, arch.fault_esr)); +#endif +return 0 ; }
arch/powerpc/kvm/44x_tlb.c new file +215 -0
215 lines not on this page · raw message
arch/powerpc/kvm/44x_tlb.h new file +91 -0
91 lines not on this page · raw message
arch/powerpc/kvm/Kconfig new file +45 -0
45 lines not on this page · raw message
arch/powerpc/kvm/Makefile new file +15 -0
@@ -0,0 +1,15 @@ +# +# Makefile for Kernel-based Virtual Machine module +# + +EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm + +common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o) + +kvm-objs := $(common-objs) +obj-$(CONFIG_KVM) += kvm.o + +kvm-powerpc-objs := powerpc.o emulate.o 44x_tlb.o booke_interrupts.o +obj-$(CONFIG_KVM_POWERPC) += kvm-powerpc.o + +AFLAGS_booke_interrupts.o := -I$(obj)
arch/powerpc/kvm/booke_interrupts.S new file +531 -0
531 lines not on this page · raw message
arch/powerpc/kvm/emulate.c new file +636 -0
636 lines not on this page · raw message
arch/powerpc/kvm/powerpc.c new file +862 -0
862 lines not on this page · raw message
include/asm-powerpc/kvm.h new file +56 -0
56 lines not on this page · raw message
include/asm-powerpc/kvm_asm.h new file +60 -0
60 lines not on this page · raw message
include/asm-powerpc/kvm_host.h new file +177 -0
177 lines not on this page · raw message
include/asm-powerpc/kvm_para.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +* Copyright IBM Corp. 2008 +* +* Authors: Hollis Blanchard <[email protected]> +*/ + +#ifndef __POWERPC_KVM_PARA_H__ +#define __POWERPC_KVM_PARA_H__ + +#ifdef __KERNEL__ + +static inline int kvm_para_available (void ) +{ +return 0 ; +} + +static inline unsigned int kvm_arch_para_features (void ) +{ +return 0 ; +} + +#endif /* __KERNEL__ */ + +#endif /* __POWERPC_KVM_PARA_H__ */ +
include/linux/kvm.h +7 -0
@@ -73,6 +73,7 @@ struct kvm_irqchip {#define KVM_EXIT_INTR 10#define KVM_EXIT_SET_TPR 11#define KVM_EXIT_TPR_ACCESS 12 +#define KVM_EXIT_DCR 13/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ struct kvm_run {
@@ -137,6 +138,12 @@ struct kvm_run {__u32 is_write;__u32 pad; } tpr_access; +/* KVM_EXIT_DCR */ +struct { +__u32 dcrn; +__u32 data; +__u8 is_write; + } dcr;/* Fix the size of the union. */ char padding[256 ]; };
Signature · 12 lines
Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-ppc-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel