Patchwork KVM: PPC: protect use of kvmppc_h_pr

login
register
mail settings
Submitter Andreas Schwab
Date Nov. 8, 2011, 5:17 p.m.
Message ID <m27h3apm8c.fsf_-_@igel.home>
Download mbox | patch
Permalink /patch/124401/
State Not Applicable
Headers show

Comments

Andreas Schwab - Nov. 8, 2011, 5:17 p.m.
kvmppc_h_pr is only available if CONFIG_KVM_BOOK3S_64_PR.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 arch/powerpc/kvm/book3s_pr.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Alexander Graf - Nov. 11, 2011, 4:03 p.m.
On 11/08/2011 06:17 PM, Andreas Schwab wrote:
> kvmppc_h_pr is only available if CONFIG_KVM_BOOK3S_64_PR.
>
> Signed-off-by: Andreas Schwab<schwab@linux-m68k.org>

Thanks, applied to kvm-ppc-next.


Alex

Patch

diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index bc4d50d..05473b5 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -660,10 +660,12 @@  program_interrupt:
 			ulong cmd = kvmppc_get_gpr(vcpu, 3);
 			int i;
 
+#ifdef CONFIG_KVM_BOOK3S_64_PR
 			if (kvmppc_h_pr(vcpu, cmd) == EMULATE_DONE) {
 				r = RESUME_GUEST;
 				break;
 			}
+#endif
 
 			run->papr_hcall.nr = cmd;
 			for (i = 0; i < 9; ++i) {