All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Tianrui Zhao <zhaotianrui@loongson.cn>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	loongarch@lists.linux.dev, Jens Axboe <axboe@kernel.dk>,
	Mark Brown <broonie@kernel.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	maobibo@loongson.cn, Xi Ruoyao <xry111@xry111.site>,
	zhaotianrui@loongson.cn, kernel test robot <lkp@intel.com>
Subject: [PATCH v11 29/31] LoongArch: KVM: Enable kvm config and add the makefile
Date: Mon, 22 May 2023 11:12:15 +0800	[thread overview]
Message-ID: <20230522031217.956464-30-zhaotianrui@loongson.cn> (raw)
In-Reply-To: <20230522031217.956464-1-zhaotianrui@loongson.cn>

Enable LoongArch kvm config and add the makefile to support build kvm
module.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304131526.iXfLaVZc-lkp@intel.com/
Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn>
---
 arch/loongarch/Kbuild                      |  1 +
 arch/loongarch/Kconfig                     |  2 ++
 arch/loongarch/configs/loongson3_defconfig |  2 ++
 arch/loongarch/kvm/Kconfig                 | 38 ++++++++++++++++++++++
 arch/loongarch/kvm/Makefile                | 22 +++++++++++++
 5 files changed, 65 insertions(+)
 create mode 100644 arch/loongarch/kvm/Kconfig
 create mode 100644 arch/loongarch/kvm/Makefile

diff --git a/arch/loongarch/Kbuild b/arch/loongarch/Kbuild
index b01f5cdb27e0..40be8a1696f9 100644
--- a/arch/loongarch/Kbuild
+++ b/arch/loongarch/Kbuild
@@ -2,6 +2,7 @@ obj-y += kernel/
 obj-y += mm/
 obj-y += net/
 obj-y += vdso/
+obj-y += kvm/
 
 # for cleaning
 subdir- += boot
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index d38b066fc931..16ddf4f6f9bd 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -113,6 +113,7 @@ config LOONGARCH
 	select HAVE_KPROBES
 	select HAVE_KPROBES_ON_FTRACE
 	select HAVE_KRETPROBES
+	select HAVE_KVM
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI
 	select HAVE_PCI
@@ -604,3 +605,4 @@ source "drivers/acpi/Kconfig"
 endmenu
 
 source "drivers/firmware/Kconfig"
+source "arch/loongarch/kvm/Kconfig"
diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 6cd26dd3c134..3c0cbe6ad08f 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -63,6 +63,8 @@ CONFIG_EFI_ZBOOT=y
 CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
 CONFIG_EFI_CAPSULE_LOADER=m
 CONFIG_EFI_TEST=m
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
diff --git a/arch/loongarch/kvm/Kconfig b/arch/loongarch/kvm/Kconfig
new file mode 100644
index 000000000000..8a999b4c0232
--- /dev/null
+++ b/arch/loongarch/kvm/Kconfig
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# 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
+	tristate "Kernel-based Virtual Machine (KVM) support"
+	depends on HAVE_KVM
+	select MMU_NOTIFIER
+	select ANON_INODES
+	select PREEMPT_NOTIFIERS
+	select KVM_MMIO
+	select KVM_GENERIC_DIRTYLOG_READ_PROTECT
+	select HAVE_KVM_VCPU_ASYNC_IOCTL
+	select HAVE_KVM_EVENTFD
+	select SRCU
+	help
+	  Support hosting virtualized guest machines using hardware
+	  virtualization extensions. You will need a fairly processor
+	  equipped with virtualization extensions.
+
+	  If unsure, say N.
+
+endif # VIRTUALIZATION
diff --git a/arch/loongarch/kvm/Makefile b/arch/loongarch/kvm/Makefile
new file mode 100644
index 000000000000..2335e873a6ef
--- /dev/null
+++ b/arch/loongarch/kvm/Makefile
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for LOONGARCH KVM support
+#
+
+ccflags-y += -I $(srctree)/$(src)
+
+include $(srctree)/virt/kvm/Makefile.kvm
+
+obj-$(CONFIG_KVM) += kvm.o
+
+kvm-y += main.o
+kvm-y += vm.o
+kvm-y += vmid.o
+kvm-y += tlb.o
+kvm-y += mmu.o
+kvm-y += vcpu.o
+kvm-y += exit.o
+kvm-y += interrupt.o
+kvm-y += timer.o
+kvm-y += switch.o
+kvm-y += csr_ops.o
-- 
2.39.1


  parent reply	other threads:[~2023-05-22  3:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22  3:11 [PATCH v11 00/31] Add KVM LoongArch support Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 01/31] LoongArch: KVM: Add kvm related header files Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 02/31] LoongArch: KVM: Implement kvm module related interface Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 03/31] LoongArch: KVM: Implement kvm hardware enable, disable interface Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 04/31] LoongArch: KVM: Implement VM related functions Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 05/31] LoongArch: KVM: Add vcpu related header files Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 06/31] LoongArch: KVM: Implement vcpu create and destroy interface Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 07/31] LoongArch: KVM: Implement vcpu run interface Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 08/31] LoongArch: KVM: Implement vcpu handle exit interface Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 09/31] LoongArch: KVM: Implement vcpu get, vcpu set registers Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 10/31] LoongArch: KVM: Implement vcpu ENABLE_CAP ioctl interface Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 11/31] LoongArch: KVM: Implement fpu related operations for vcpu Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 12/31] LoongArch: KVM: Implement vcpu interrupt operations Tianrui Zhao
2023-05-22  3:11 ` [PATCH v11 13/31] LoongArch: KVM: Implement misc vcpu related interfaces Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 14/31] LoongArch: KVM: Implement vcpu load and vcpu put operations Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 15/31] LoongArch: KVM: Implement vcpu status description Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 16/31] LoongArch: KVM: Implement update VM id function Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 17/31] LoongArch: KVM: Implement virtual machine tlb operations Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 18/31] LoongArch: KVM: Implement vcpu timer operations Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 19/31] LoongArch: KVM: Implement kvm mmu operations Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 20/31] LoongArch: KVM: Implement handle csr excption Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 21/31] LoongArch: KVM: Implement handle iocsr exception Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 22/31] LoongArch: KVM: Implement handle idle exception Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 23/31] LoongArch: KVM: Implement handle gspr exception Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 24/31] LoongArch: KVM: Implement handle mmio exception Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 25/31] LoongArch: KVM: Implement handle fpu exception Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 26/31] LoongArch: KVM: Implement kvm exception vector Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 27/31] LoongArch: KVM: Implement vcpu world switch Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 28/31] LoongArch: KVM: Implement probe virtualization when LoongArch cpu init Tianrui Zhao
2023-05-22  3:12 ` Tianrui Zhao [this message]
2023-05-22  3:12 ` [PATCH v11 30/31] LoongArch: KVM: Supplement kvm document about LoongArch-specific part Tianrui Zhao
2023-05-22  3:12 ` [PATCH v11 31/31] LoongArch: KVM: Add maintainers for LoongArch KVM Tianrui Zhao
2023-05-22  3:42   ` WANG Xuerui
2023-05-22  7:14     ` Tianrui Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230522031217.956464-30-zhaotianrui@loongson.cn \
    --to=zhaotianrui@loongson.cn \
    --cc=alexander.deucher@amd.com \
    --cc=axboe@kernel.dk \
    --cc=broonie@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@xen0n.name \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=loongarch@lists.linux.dev \
    --cc=maobibo@loongson.cn \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.