[PATCH 11/27] KVM: PPC: Use CONFIG_PPC_BOOK3S define

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexander Graf
Date: Thursday, April 15, 2010 - 3:11 pm

Upstream recently added a new name for PPC64: Book3S_64.

So instead of using CONFIG_PPC64 we should use CONFIG_PPC_BOOK3S consotently.
That makes understanding the code easier (I hope).

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/asm/kvm_host.h |    8 ++++----
 arch/powerpc/kernel/asm-offsets.c   |    6 +++---
 arch/powerpc/kvm/Kconfig            |    2 +-
 arch/powerpc/kvm/emulate.c          |    6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 5869a48..22801f8 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -66,7 +66,7 @@ struct kvm_vcpu_stat {
 	u32 dec_exits;
 	u32 ext_intr_exits;
 	u32 halt_wakeup;
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 	u32 pf_storage;
 	u32 pf_instruc;
 	u32 sp_storage;
@@ -160,7 +160,7 @@ struct hpte_cache {
 struct kvm_vcpu_arch {
 	ulong host_stack;
 	u32 host_pid;
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 	ulong host_msr;
 	ulong host_r2;
 	void *host_retip;
@@ -201,7 +201,7 @@ struct kvm_vcpu_arch {
 #endif
 
 	ulong msr;
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 	ulong shadow_msr;
 	ulong shadow_srr1;
 	ulong hflags;
@@ -283,7 +283,7 @@ struct kvm_vcpu_arch {
 	u64 dec_jiffies;
 	unsigned long pending_exceptions;
 
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 	struct hpte_cache hpte_cache[HPTEG_CACHE_NUM];
 	int hpte_cache_offset;
 #endif
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 957ceb7..57a8c49 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -426,8 +426,8 @@ int main(void)
 	DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, arch.fault_dear));
 	DEFINE(VCPU_FAULT_ESR, offsetof(struct kvm_vcpu, arch.fault_esr));
 
-	/* book3s_64 */
-#ifdef CONFIG_PPC64
+	/* book3s */
+#ifdef CONFIG_PPC_BOOK3S
 	DEFINE(VCPU_FAULT_DSISR, offsetof(struct kvm_vcpu, arch.fault_dsisr));
 	DEFINE(VCPU_HOST_RETIP, offsetof(struct kvm_vcpu, arch.host_retip));
 	DEFINE(VCPU_HOST_R2, offsetof(struct kvm_vcpu, arch.host_r2));
@@ -442,7 +442,7 @@ int main(void)
 #else
 	DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr));
 	DEFINE(VCPU_XER, offsetof(struct kvm_vcpu, arch.xer));
-#endif /* CONFIG_PPC64 */
+#endif /* CONFIG_PPC_BOOK3S */
 #endif
 #ifdef CONFIG_44x
 	DEFINE(PGD_T_LOG2, PGD_T_LOG2);
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
index 8ef3766..d864698 100644
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
@@ -31,7 +31,7 @@ config KVM_BOOK3S_64_HANDLER
 
 config KVM_BOOK3S_64
 	tristate "KVM support for PowerPC book3s_64 processors"
-	depends on EXPERIMENTAL && PPC64
+	depends on EXPERIMENTAL && PPC_BOOK3S_64
 	select KVM
 	select KVM_BOOK3S_64_HANDLER
 	---help---
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index c6db28c..b608c0b 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -69,7 +69,7 @@
 #define OP_STH  44
 #define OP_STHU 45
 
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 static int kvmppc_dec_enabled(struct kvm_vcpu *vcpu)
 {
 	return 1;
@@ -86,7 +86,7 @@ void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
 	unsigned long dec_nsec;
 
 	pr_debug("mtDEC: %x\n", vcpu->arch.dec);
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 	/* mtdec lowers the interrupt line when positive. */
 	kvmppc_core_dequeue_dec(vcpu);
 
@@ -153,7 +153,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
 
 	switch (get_op(inst)) {
 	case OP_TRAP:
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S
 	case OP_TRAP_64:
 		kvmppc_core_queue_program(vcpu, SRR1_PROGTRAP);
 #else
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/27] Book3S_32 (PPC32) KVM support, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 01/27] KVM: PPC: Name generic 64-bit code generic, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 02/27] KVM: PPC: Add host MMU Support, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 03/27] KVM: PPC: Add SR swapping code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 04/27] KVM: PPC: Add generic segment switching code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 05/27] PPC: Split context init/destroy functions, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 06/27] KVM: PPC: Add kvm_book3s_64.h, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 07/27] KVM: PPC: Add kvm_book3s_32.h, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 08/27] KVM: PPC: Add fields to shadow vcpu, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 09/27] KVM: PPC: Improve indirect svcpu accessors, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 10/27] KVM: PPC: Use KVM_BOOK3S_HANDLER, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 11/27] KVM: PPC: Use CONFIG_PPC_BOOK3S define, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 12/27] PPC: Add STLU, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 13/27] KVM: PPC: Use now shadowed vcpu fields, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 14/27] KVM: PPC: Extract MMU init, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 15/27] KVM: PPC: Make real mode handler generic, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 16/27] KVM: PPC: Make highmem code generic, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 18/27] KVM: PPC: Release clean pages as clean, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 19/27] KVM: PPC: Remove fetch fail code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 20/27] KVM: PPC: Add SVCPU to Book3S_32, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 21/27] KVM: PPC: Emulate segment fault, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 22/27] KVM: PPC: Add Book3S compatibility code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 24/27] PPC: Export SWITCH_FRAME_SIZE, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 25/27] KVM: PPC: Check max IRQ prio, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 26/27] KVM: PPC: Add KVM intercept handlers, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 27/27] KVM: PPC: Enable Book3S_32 KVM building, Alexander Graf, (Thu Apr 15, 3:11 pm)
Re: [PATCH 05/27] PPC: Split context init/destroy functions, Benjamin Herrenschmidt, (Thu Apr 15, 11:46 pm)
Re: [PATCH 12/27] PPC: Add STLU, Benjamin Herrenschmidt, (Thu Apr 15, 11:47 pm)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Benjamin Herrenschmidt, (Thu Apr 15, 11:47 pm)
Re: [PATCH 24/27] PPC: Export SWITCH_FRAME_SIZE, Benjamin Herrenschmidt, (Thu Apr 15, 11:48 pm)
Re: [PATCH 26/27] KVM: PPC: Add KVM intercept handlers, Benjamin Herrenschmidt, (Thu Apr 15, 11:48 pm)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 2:07 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Benjamin Herrenschmidt, (Fri Apr 16, 2:22 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 2:25 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 2:31 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 4:18 am)
Re: [PATCH 00/27] Book3S_32 (PPC32) KVM support, Avi Kivity, (Wed Apr 21, 2:42 am)