* [PATCH 0 of 2] A couple ifdefs
@ 2008-01-15 21:59 Hollis Blanchard
2008-01-15 21:59 ` [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu Hollis Blanchard
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Hollis Blanchard @ 2008-01-15 21:59 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
These small ifdefs are necessary for integration of the PowerPC port.
3 files changed, 9 insertions(+)
arch/x86/kvm/Kconfig | 5 +++++
include/linux/kvm_host.h | 2 ++
virt/kvm/kvm_main.c | 2 ++
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu
2008-01-15 21:59 [PATCH 0 of 2] A couple ifdefs Hollis Blanchard
@ 2008-01-15 21:59 ` Hollis Blanchard
2008-01-20 13:15 ` Avi Kivity
2008-01-15 21:59 ` [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier Hollis Blanchard
2008-01-16 8:03 ` [PATCH 0 of 2] A couple ifdefs Avi Kivity
2 siblings, 1 reply; 10+ messages in thread
From: Hollis Blanchard @ 2008-01-15 21:59 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
# HG changeset patch
# User Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1200434310 21600
# Node ID 7fa5947a2da8c0c7424ebdcfaebcae624d6cf015
# Parent ee0c227fe3f6632f4b1b5fde3f7e05c8ea0a4378
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
2 files changed, 7 insertions(+)
arch/x86/kvm/Kconfig | 5 +++++
virt/kvm/kvm_main.c | 2 ++
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -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_AMD
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.
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -677,8 +677,10 @@ static int kvm_vcpu_fault(struct vm_area
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier
2008-01-15 21:59 [PATCH 0 of 2] A couple ifdefs Hollis Blanchard
2008-01-15 21:59 ` [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu Hollis Blanchard
@ 2008-01-15 21:59 ` Hollis Blanchard
2008-01-16 8:08 ` Avi Kivity
2008-01-16 8:03 ` [PATCH 0 of 2] A couple ifdefs Avi Kivity
2 siblings, 1 reply; 10+ messages in thread
From: Hollis Blanchard @ 2008-01-15 21:59 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
# HG changeset patch
# User Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1200434370 21600
# Node ID 9878c9cec5f831ff5e9b97539aabc5fa3d934501
# Parent 931a81e1002110be0e8bf5b335bf199d43534c2c
This allows kvm_host.h to be #included even when struct preempt_notifier is
undefined.
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
1 file changed, 2 insertions(+)
include/linux/kvm_host.h | 2 ++
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -66,7 +66,9 @@ void kvm_io_bus_register_dev(struct kvm_
struct kvm_vcpu {
struct kvm *kvm;
+#ifdef CONFIG_PREEMPT_NOTIFIERS
struct preempt_notifier preempt_notifier;
+#endif
int vcpu_id;
struct mutex mutex;
int cpu;
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0 of 2] A couple ifdefs
2008-01-15 21:59 [PATCH 0 of 2] A couple ifdefs Hollis Blanchard
2008-01-15 21:59 ` [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu Hollis Blanchard
2008-01-15 21:59 ` [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier Hollis Blanchard
@ 2008-01-16 8:03 ` Avi Kivity
[not found] ` <478DBA4D.7060408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2008-01-16 8:03 UTC (permalink / raw)
To: Hollis Blanchard
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hollis Blanchard wrote:
> These small ifdefs are necessary for integration of the PowerPC port.
>
>
Only patch 2 of 2 made it.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier
2008-01-15 21:59 ` [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier Hollis Blanchard
@ 2008-01-16 8:08 ` Avi Kivity
[not found] ` <478DBB95.6030005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2008-01-16 8:08 UTC (permalink / raw)
To: Hollis Blanchard
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hollis Blanchard wrote:
> # HG changeset patch
> # User Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> # Date 1200434370 21600
> # Node ID 9878c9cec5f831ff5e9b97539aabc5fa3d934501
> # Parent 931a81e1002110be0e8bf5b335bf199d43534c2c
> This allows kvm_host.h to be #included even when struct preempt_notifier is
> undefined.
>
>
Don't you actually need preempt notifiers? They are useful if you have
state that is only needed from userspace, but is expensive to switch.
For x86, this is the syscall msrs (which define the syscall entry
point), the fpu (which is not used in the kernel), and a few other bits
(which I'm too lazy too look up and are esoteric anyway).
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0 of 2] A couple ifdefs
[not found] ` <478DBA4D.7060408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2008-01-16 9:24 ` Christian Ehrhardt
0 siblings, 0 replies; 10+ messages in thread
From: Christian Ehrhardt @ 2008-01-16 9:24 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Hollis Blanchard
Avi Kivity wrote:
> Hollis Blanchard wrote:
>> These small ifdefs are necessary for integration of the PowerPC port.
>>
>>
>
> Only patch 2 of 2 made it.
>
As Hollis should be sleeping right now I resend 1/2 as it arrived on kvm-powerpc-devel
(I hope my mail-app keeps the format this time)
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
original mail
---
# HG changeset patch
# User Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1200434310 21600
# Node ID 7fa5947a2da8c0c7424ebdcfaebcae624d6cf015
# Parent ee0c227fe3f6632f4b1b5fde3f7e05c8ea0a4378
Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
2 files changed, 7 insertions(+)
arch/x86/kvm/Kconfig | 5 +++++
virt/kvm/kvm_main.c | 2 ++
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -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_AMD
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.
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -677,8 +677,10 @@ static int kvm_vcpu_fault(struct vm_area
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier
[not found] ` <478DBB95.6030005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2008-01-16 16:23 ` Hollis Blanchard
0 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2008-01-16 16:23 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Wed, 2008-01-16 at 10:08 +0200, Avi Kivity wrote:
> Hollis Blanchard wrote:
> > # HG changeset patch
> > # User Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> > # Date 1200434370 21600
> > # Node ID 9878c9cec5f831ff5e9b97539aabc5fa3d934501
> > # Parent 931a81e1002110be0e8bf5b335bf199d43534c2c
> > This allows kvm_host.h to be #included even when struct preempt_notifier is
> > undefined.
>
> Don't you actually need preempt notifiers? They are useful if you have
> state that is only needed from userspace, but is expensive to switch.
> For x86, this is the syscall msrs (which define the syscall entry
> point), the fpu (which is not used in the kernel), and a few other bits
> (which I'm too lazy too look up and are esoteric anyway).
Yes, I do. However, if you #include <kvm_host.h> *without*
CONFIG_VIRTUALIZATION=y, CONFIG_PREEMPT_NOTIFIERS is not set and the
structure is undefined.
It is Linux policy to be able to unconditionally include headers, and
indeed I already hit this problem when I added that #include to
arch/powerpc/kernel/asm-offsets.c.
--
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu
2008-01-15 21:59 ` [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu Hollis Blanchard
@ 2008-01-20 13:15 ` Avi Kivity
[not found] ` <47934974.2020107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2008-01-20 13:15 UTC (permalink / raw)
To: Hollis Blanchard
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hollis Blanchard wrote:
> # HG changeset patch
> # User Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> # Date 1200434310 21600
> # Node ID 7fa5947a2da8c0c7424ebdcfaebcae624d6cf015
> # Parent ee0c227fe3f6632f4b1b5fde3f7e05c8ea0a4378
>
> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>
> ---
> 2 files changed, 7 insertions(+)
> arch/x86/kvm/Kconfig | 5 +++++
> virt/kvm/kvm_main.c | 2 ++
>
>
> diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
> --- a/arch/x86/kvm/Kconfig
> +++ b/arch/x86/kvm/Kconfig
> @@ -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_AMD
> 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.
>
Too much Kconfig for this. Since I want to do some Kconfig changes
anyway, I'll do this another way.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu
[not found] ` <47934974.2020107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2008-01-24 12:59 ` Carsten Otte
[not found] ` <47988BA1.80507-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Carsten Otte @ 2008-01-24 12:59 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Hollis Blanchard
Avi Kivity wrote:
> Too much Kconfig for this. Since I want to do some Kconfig changes
> anyway, I'll do this another way.
I think you overlooked something here. Actually this should change too
if we don't have pio:
-.......case KVM_GET_VCPU_MMAP_SIZE:
-.......-.......r = -EINVAL;
-.......-.......if (arg)
-.......-.......-.......goto out;
-.......-.......r = 2 * PAGE_SIZE;
-.......-.......break;
so long,
Carsten
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu
[not found] ` <47988BA1.80507-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
@ 2008-01-24 13:14 ` Avi Kivity
0 siblings, 0 replies; 10+ messages in thread
From: Avi Kivity @ 2008-01-24 13:14 UTC (permalink / raw)
To: carsteno-tA70FqPdS9bQT0dZR+AlfA
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Hollis Blanchard
Carsten Otte wrote:
> Avi Kivity wrote:
>> Too much Kconfig for this. Since I want to do some Kconfig changes
>> anyway, I'll do this another way.
> I think you overlooked something here. Actually this should change too
> if we don't have pio:
> -.......case KVM_GET_VCPU_MMAP_SIZE:
> -.......-.......r = -EINVAL;
> -.......-.......if (arg)
> -.......-.......-.......goto out;
> -.......-.......r = 2 * PAGE_SIZE;
> -.......-.......break;
>
Right you are. Fixup patch pushed. Thanks.
--
Any sufficiently difficult bug is indistinguishable from a feature.
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-01-24 13:14 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 21:59 [PATCH 0 of 2] A couple ifdefs Hollis Blanchard
2008-01-15 21:59 ` [PATCH 1 of 2] Define and use CONFIG_KVM_HAS_PIO so that we don't need pio_data in kvm_arch_vcpu Hollis Blanchard
2008-01-20 13:15 ` Avi Kivity
[not found] ` <47934974.2020107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-24 12:59 ` Carsten Otte
[not found] ` <47988BA1.80507-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2008-01-24 13:14 ` Avi Kivity
2008-01-15 21:59 ` [PATCH 2 of 2] Use CONFIG_PREEMPT_NOTIFIERS around struct preempt_notifier Hollis Blanchard
2008-01-16 8:08 ` Avi Kivity
[not found] ` <478DBB95.6030005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-16 16:23 ` Hollis Blanchard
2008-01-16 8:03 ` [PATCH 0 of 2] A couple ifdefs Avi Kivity
[not found] ` <478DBA4D.7060408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-16 9:24 ` Christian Ehrhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox