diff mbox

[v4,21/32] arm64: KVM: Build system integration

Message ID 1368540840-26750-22-git-send-email-marc.zyngier@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marc Zyngier May 14, 2013, 2:13 p.m. UTC
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm64/Kconfig      |  2 ++
 arch/arm64/Makefile     |  2 +-
 arch/arm64/kvm/Kconfig  | 59 +++++++++++++++++++++++++++++++++++++++++++++++++
 arch/arm64/kvm/Makefile | 23 +++++++++++++++++++
 4 files changed, 85 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/kvm/Kconfig
 create mode 100644 arch/arm64/kvm/Makefile

Comments

Catalin Marinas May 21, 2013, 3:42 p.m. UTC | #1
On Tue, May 14, 2013 at 03:13:49PM +0100, Marc Zyngier wrote:
> --- /dev/null
> +++ b/arch/arm64/kvm/Kconfig
...
> +config KVM_ARM_VGIC
> +        bool
> +	depends on KVM_ARM_HOST && OF
> +	select HAVE_KVM_IRQCHIP
> +	---help---
> +	  Adds support for a hardware assisted, in-kernel GIC emulation.
> +
> +config KVM_ARM_TIMER
> +        bool
> +	depends on KVM_ARM_VGIC
> +	select HAVE_KVM_IRQCHIP
> +	---help---
> +	  Adds support for the Architected Timers in virtual machines
> +
> +source drivers/virtio/Kconfig

Shouldn't the above configs go to drivers/virtio/Kconfig as well (or
drivers/virtio/arm/Kconfig)?
Paolo Bonzini May 21, 2013, 4:09 p.m. UTC | #2
----- Messaggio originale -----
> Da: "Catalin Marinas" <catalin.marinas@arm.com>
> A: "Marc Zyngier" <Marc.Zyngier@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, "Will Deacon"
> <Will.Deacon@arm.com>, pbonzini@redhat.com, gleb@redhat.com, "Christopher Covington" <cov@codeaurora.org>
> Inviato: Martedì, 21 maggio 2013 17:42:27
> Oggetto: Re: [PATCH v4 21/32] arm64: KVM: Build system integration
> 
> On Tue, May 14, 2013 at 03:13:49PM +0100, Marc Zyngier wrote:
> > --- /dev/null
> > +++ b/arch/arm64/kvm/Kconfig
> ...
> > +config KVM_ARM_VGIC
> > +        bool
> > +	depends on KVM_ARM_HOST && OF
> > +	select HAVE_KVM_IRQCHIP
> > +	---help---
> > +	  Adds support for a hardware assisted, in-kernel GIC emulation.
> > +
> > +config KVM_ARM_TIMER
> > +        bool
> > +	depends on KVM_ARM_VGIC
> > +	select HAVE_KVM_IRQCHIP
> > +	---help---
> > +	  Adds support for the Architected Timers in virtual machines
> > +
> > +source drivers/virtio/Kconfig
> 
> Shouldn't the above configs go to drivers/virtio/Kconfig as well (or
> drivers/virtio/arm/Kconfig)?

virtio doesn't mean "virtual versions of devices that also exist in
hardware"; those are indeed in arch/ARCH/kvm.  virtio is a specific bus
for paravirtualized devices.  It is not KVM-specific and the code runs
in the guest (whereas arch/arm64/kvm/Kconfig is host code).

That said, drivers/virtio/Kconfig is already sourced by drivers/Kconfig.
Why do you need to source it again here?

Paolo
Marc Zyngier May 21, 2013, 4:14 p.m. UTC | #3
On 21/05/13 17:09, Paolo Bonzini wrote:
> 
> 
> ----- Messaggio originale -----
>> Da: "Catalin Marinas" <catalin.marinas@arm.com>
>> A: "Marc Zyngier" <Marc.Zyngier@arm.com>
>> Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, "Will Deacon"
>> <Will.Deacon@arm.com>, pbonzini@redhat.com, gleb@redhat.com, "Christopher Covington" <cov@codeaurora.org>
>> Inviato: Martedì, 21 maggio 2013 17:42:27
>> Oggetto: Re: [PATCH v4 21/32] arm64: KVM: Build system integration
>>
>> On Tue, May 14, 2013 at 03:13:49PM +0100, Marc Zyngier wrote:
>>> --- /dev/null
>>> +++ b/arch/arm64/kvm/Kconfig
>> ...
>>> +config KVM_ARM_VGIC
>>> +        bool
>>> +	depends on KVM_ARM_HOST && OF
>>> +	select HAVE_KVM_IRQCHIP
>>> +	---help---
>>> +	  Adds support for a hardware assisted, in-kernel GIC emulation.
>>> +
>>> +config KVM_ARM_TIMER
>>> +        bool
>>> +	depends on KVM_ARM_VGIC
>>> +	select HAVE_KVM_IRQCHIP
>>> +	---help---
>>> +	  Adds support for the Architected Timers in virtual machines
>>> +
>>> +source drivers/virtio/Kconfig
>>
>> Shouldn't the above configs go to drivers/virtio/Kconfig as well (or
>> drivers/virtio/arm/Kconfig)?
> 
> virtio doesn't mean "virtual versions of devices that also exist in
> hardware"; those are indeed in arch/ARCH/kvm.  virtio is a specific bus
> for paravirtualized devices.  It is not KVM-specific and the code runs
> in the guest (whereas arch/arm64/kvm/Kconfig is host code).
> 
> That said, drivers/virtio/Kconfig is already sourced by drivers/Kconfig.
> Why do you need to source it again here?

Probably some brain fart on my side. I'll get rid of it.

Thanks,

	M.
Catalin Marinas May 22, 2013, 8:42 a.m. UTC | #4
On Tue, May 21, 2013 at 05:09:47PM +0100, Paolo Bonzini wrote:
> 
> 
> ----- Messaggio originale -----
> > Da: "Catalin Marinas" <catalin.marinas@arm.com>
> > A: "Marc Zyngier" <Marc.Zyngier@arm.com>
> > Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, "Will Deacon"
> > <Will.Deacon@arm.com>, pbonzini@redhat.com, gleb@redhat.com, "Christopher Covington" <cov@codeaurora.org>
> > Inviato: Martedì, 21 maggio 2013 17:42:27
> > Oggetto: Re: [PATCH v4 21/32] arm64: KVM: Build system integration
> > 
> > On Tue, May 14, 2013 at 03:13:49PM +0100, Marc Zyngier wrote:
> > > --- /dev/null
> > > +++ b/arch/arm64/kvm/Kconfig
> > ...
> > > +config KVM_ARM_VGIC
> > > +        bool
> > > +	depends on KVM_ARM_HOST && OF
> > > +	select HAVE_KVM_IRQCHIP
> > > +	---help---
> > > +	  Adds support for a hardware assisted, in-kernel GIC emulation.
> > > +
> > > +config KVM_ARM_TIMER
> > > +        bool
> > > +	depends on KVM_ARM_VGIC
> > > +	select HAVE_KVM_IRQCHIP
> > > +	---help---
> > > +	  Adds support for the Architected Timers in virtual machines
> > > +
> > > +source drivers/virtio/Kconfig
> > 
> > Shouldn't the above configs go to drivers/virtio/Kconfig as well (or
> > drivers/virtio/arm/Kconfig)?
> 
> virtio doesn't mean "virtual versions of devices that also exist in
> hardware"; those are indeed in arch/ARCH/kvm.  virtio is a specific bus
> for paravirtualized devices.  It is not KVM-specific and the code runs
> in the guest (whereas arch/arm64/kvm/Kconfig is host code).

You are right. What I meant was kvm/virt/arm/Kconfig (the place where
the vgic and timer driver goes).
Paolo Bonzini May 22, 2013, 8:45 a.m. UTC | #5
Il 22/05/2013 10:42, Catalin Marinas ha scritto:
> On Tue, May 21, 2013 at 05:09:47PM +0100, Paolo Bonzini wrote:
>>
>>
>> ----- Messaggio originale -----
>>> Da: "Catalin Marinas" <catalin.marinas@arm.com>
>>> A: "Marc Zyngier" <Marc.Zyngier@arm.com>
>>> Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, "Will Deacon"
>>> <Will.Deacon@arm.com>, pbonzini@redhat.com, gleb@redhat.com, "Christopher Covington" <cov@codeaurora.org>
>>> Inviato: Martedì, 21 maggio 2013 17:42:27
>>> Oggetto: Re: [PATCH v4 21/32] arm64: KVM: Build system integration
>>>
>>> On Tue, May 14, 2013 at 03:13:49PM +0100, Marc Zyngier wrote:
>>>> --- /dev/null
>>>> +++ b/arch/arm64/kvm/Kconfig
>>> ...
>>>> +config KVM_ARM_VGIC
>>>> +        bool
>>>> +	depends on KVM_ARM_HOST && OF
>>>> +	select HAVE_KVM_IRQCHIP
>>>> +	---help---
>>>> +	  Adds support for a hardware assisted, in-kernel GIC emulation.
>>>> +
>>>> +config KVM_ARM_TIMER
>>>> +        bool
>>>> +	depends on KVM_ARM_VGIC
>>>> +	select HAVE_KVM_IRQCHIP
>>>> +	---help---
>>>> +	  Adds support for the Architected Timers in virtual machines
>>>> +
>>>> +source drivers/virtio/Kconfig
>>>
>>> Shouldn't the above configs go to drivers/virtio/Kconfig as well (or
>>> drivers/virtio/arm/Kconfig)?
>>
>> virtio doesn't mean "virtual versions of devices that also exist in
>> hardware"; those are indeed in arch/ARCH/kvm.  virtio is a specific bus
>> for paravirtualized devices.  It is not KVM-specific and the code runs
>> in the guest (whereas arch/arm64/kvm/Kconfig is host code).
> 
> You are right. What I meant was kvm/virt/arm/Kconfig (the place where
> the vgic and timer driver goes).

Ah yeah, that could make sense.

Paolo
diff mbox

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 48347dc..a74f6fd 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -237,6 +237,8 @@  source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
+source "arch/arm64/kvm/Kconfig"
+
 source "arch/arm64/Kconfig.debug"
 
 source "security/Kconfig"
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index c95c5cb..ae89e63 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -36,7 +36,7 @@  TEXT_OFFSET := 0x00080000
 
 export	TEXT_OFFSET GZFLAGS
 
-core-y		+= arch/arm64/kernel/ arch/arm64/mm/
+core-y		+= arch/arm64/kernel/ arch/arm64/mm/ arch/arm64/kvm/
 libs-y		:= arch/arm64/lib/ $(libs-y)
 libs-y		+= $(LIBGCC)
 
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
new file mode 100644
index 0000000..a76be8b
--- /dev/null
+++ b/arch/arm64/kvm/Kconfig
@@ -0,0 +1,59 @@ 
+#
+# KVM configuration
+#
+
+source "virt/kvm/Kconfig"
+
+menuconfig VIRTUALIZATION
+	bool "Virtualization"
+	---help---
+	  Say Y here to get to see options for using your Linux host to run
+	  other operating systems inside virtual machines (guests).
+	  This option alone does not add any kernel code.
+
+	  If you say N, all options in this submenu will be skipped and
+	  disabled.
+
+if VIRTUALIZATION
+
+config KVM
+	bool "Kernel-based Virtual Machine (KVM) support"
+	select PREEMPT_NOTIFIERS
+	select ANON_INODES
+	select KVM_MMIO
+	select KVM_ARM_HOST
+	select KVM_ARM_VGIC
+	select KVM_ARM_TIMER
+	---help---
+	  Support hosting virtualized guest machines.
+
+	  This module provides access to the hardware capabilities through
+	  a character device node named /dev/kvm.
+
+	  If unsure, say N.
+
+config KVM_ARM_HOST
+	bool
+	depends on KVM
+	depends on MMU
+	select	MMU_NOTIFIER
+	---help---
+	  Provides host support for ARM processors.
+
+config KVM_ARM_VGIC
+        bool
+	depends on KVM_ARM_HOST && OF
+	select HAVE_KVM_IRQCHIP
+	---help---
+	  Adds support for a hardware assisted, in-kernel GIC emulation.
+
+config KVM_ARM_TIMER
+        bool
+	depends on KVM_ARM_VGIC
+	select HAVE_KVM_IRQCHIP
+	---help---
+	  Adds support for the Architected Timers in virtual machines
+
+source drivers/virtio/Kconfig
+
+endif # VIRTUALIZATION
diff --git a/arch/arm64/kvm/Makefile b/arch/arm64/kvm/Makefile
new file mode 100644
index 0000000..75b8c48
--- /dev/null
+++ b/arch/arm64/kvm/Makefile
@@ -0,0 +1,23 @@ 
+#
+# Makefile for Kernel-based Virtual Machine module
+#
+
+ccflags-y += -Ivirt/kvm -Iarch/arm64/kvm
+CFLAGS_arm.o := -I.
+CFLAGS_mmu.o := -I.
+
+KVM=../../../virt/kvm
+ARM=../../../arch/arm/kvm
+
+obj-$(CONFIG_KVM_ARM_HOST) += kvm.o
+
+kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o
+kvm-$(CONFIG_KVM_ARM_HOST) += $(ARM)/arm.o $(ARM)/mmu.o $(ARM)/mmio.o
+kvm-$(CONFIG_KVM_ARM_HOST) += $(ARM)/psci.o $(ARM)/perf.o
+
+kvm-$(CONFIG_KVM_ARM_HOST) += inject_fault.o
+kvm-$(CONFIG_KVM_ARM_HOST) += hyp.o hyp-init.o handle_exit.o
+kvm-$(CONFIG_KVM_ARM_HOST) += guest.o reset.o sys_regs.o sys_regs_generic_v8.o
+
+obj-$(CONFIG_KVM_ARM_VGIC) += $(KVM)/arm/vgic.o
+obj-$(CONFIG_KVM_ARM_TIMER) += $(KVM)/arm/arch_timer.o