Skip to contentSkip to conversation

portability: add CONFIG_KVM_HAS_PIO around pio_data

PATCH RESEND New Christian Ehrhardt 1 participant 1 message Jan 17, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 portability: add CONFIG_KVM_HAS_PIO around pio_data

Carsten asked for the same on s390 which brings me to resend ppc patches neither rejected, commented nor accepted yet

Subject: [PATCH][RESEND] portability: add CONFIG_KVM_HAS_PIO around pio_data
From: Hollis Blanchard <hollisb-r/[email protected]>

Define and use CONFIG_KVM_HAS_PIO so that non-x86 don't need pio_data in kvm_arch_vcpu.

 arch/x86/kvm/Kconfig |    5 +++++
 virt/kvm/kvm_main.c  |    2 ++
 2 files changed, 7 insertions(+)
arch/x86/kvm/Kconfig +5 -0
index 4086080..e31ac6e 100644
@@ -33,9 +33,13 @@ config KVM
 
 	  If unsure, say N.
 
+config KVM_HAS_PIO
+	bool
+
 config KVM_INTEL
 	tristate "KVM for Intel processors support"
 	depends on KVM
+	select KVM_HAS_PIO
 	---help---
 	  Provides support for KVM on Intel processors equipped with the VT
 	  extensions.
@@ -43,6 +47,7 @@ config KVM_INTEL
 config KVM_AMD
 	tristate "KVM for AMD processors support"
 	depends on KVM
+	select KVM_HAS_PIO
 	---help---
 	  Provides support for KVM on AMD processors equipped with the AMD-V
 	  (SVM) extensions.
virt/kvm/kvm_main.c +2 -0
index 4295623..f6e4232 100644
@@ -677,8 +677,10 @@ static int kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 
 	if (vmf->pgoff == 0)
 		page = virt_to_page(vcpu->run);
+#ifdef CONFIG_KVM_HAS_PIO
 	else if (vmf->pgoff == KVM_PIO_PAGE_OFFSET)
 		page = virt_to_page(vcpu->arch.pio_data);
+#endif /* CONFIG_KVM_HAS_PIO */
 	else
 		return VM_FAULT_SIGBUS;
 	get_page(page);

-------------------------------------------------------------------------
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/