File tree Expand file tree Collapse file tree 5 files changed +72
-0
lines changed
Expand file tree Collapse file tree 5 files changed +72
-0
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,7 @@ obj-y += mm/
33obj-y += net/
44obj-y += vdso/
55
6+ obj-$(CONFIG_KVM) += kvm/
7+
68# for cleaning
79subdir- += boot
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ config LOONGARCH
129129 select HAVE_KPROBES
130130 select HAVE_KPROBES_ON_FTRACE
131131 select HAVE_KRETPROBES
132+ select HAVE_KVM
132133 select HAVE_MOD_ARCH_SPECIFIC
133134 select HAVE_NMI
134135 select HAVE_PCI
@@ -263,6 +264,9 @@ config AS_HAS_LASX_EXTENSION
263264config AS_HAS_LBT_EXTENSION
264265 def_bool $(as-instr,movscr2gr \$a0$(comma)\$scr0)
265266
267+ config AS_HAS_LVZ_EXTENSION
268+ def_bool $(as-instr,hvcl 0)
269+
266270menu "Kernel type and options"
267271
268272source "kernel/Kconfig.hz"
@@ -676,3 +680,5 @@ source "kernel/power/Kconfig"
676680source "drivers/acpi/Kconfig"
677681
678682endmenu
683+
684+ source "arch/loongarch/kvm/Kconfig"
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ CONFIG_EFI_ZBOOT=y
6666CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
6767CONFIG_EFI_CAPSULE_LOADER=m
6868CONFIG_EFI_TEST=m
69+ CONFIG_VIRTUALIZATION=y
70+ CONFIG_KVM=m
6971CONFIG_JUMP_LABEL=y
7072CONFIG_MODULES=y
7173CONFIG_MODULE_FORCE_LOAD=y
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: GPL-2.0
2+ #
3+ # KVM configuration
4+ #
5+
6+ source "virt/kvm/Kconfig"
7+
8+ menuconfig VIRTUALIZATION
9+ bool "Virtualization"
10+ help
11+ Say Y here to get to see options for using your Linux host to run
12+ other operating systems inside virtual machines (guests).
13+ This option alone does not add any kernel code.
14+
15+ If you say N, all options in this submenu will be skipped and
16+ disabled.
17+
18+ if VIRTUALIZATION
19+
20+ config KVM
21+ tristate "Kernel-based Virtual Machine (KVM) support"
22+ depends on AS_HAS_LVZ_EXTENSION
23+ depends on HAVE_KVM
24+ select HAVE_KVM_DIRTY_RING_ACQ_REL
25+ select HAVE_KVM_EVENTFD
26+ select HAVE_KVM_VCPU_ASYNC_IOCTL
27+ select KVM_GENERIC_DIRTYLOG_READ_PROTECT
28+ select KVM_GENERIC_HARDWARE_ENABLING
29+ select KVM_MMIO
30+ select KVM_XFER_TO_GUEST_WORK
31+ select MMU_NOTIFIER
32+ select PREEMPT_NOTIFIERS
33+ help
34+ Support hosting virtualized guest machines using
35+ hardware virtualization extensions. You will need
36+ a processor equipped with virtualization extensions.
37+
38+ If unsure, say N.
39+
40+ endif # VIRTUALIZATION
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: GPL-2.0
2+ #
3+ # Makefile for LoongArch KVM support
4+ #
5+
6+ ccflags-y += -I $(srctree ) /$(src )
7+
8+ include $(srctree ) /virt/kvm/Makefile.kvm
9+
10+ obj-$(CONFIG_KVM) += kvm.o
11+
12+ kvm-y += exit.o
13+ kvm-y += interrupt.o
14+ kvm-y += main.o
15+ kvm-y += mmu.o
16+ kvm-y += switch.o
17+ kvm-y += timer.o
18+ kvm-y += tlb.o
19+ kvm-y += vcpu.o
20+ kvm-y += vm.o
21+
22+ CFLAGS_exit.o += $(call cc-option,-Wno-override-init,)
You can’t perform that action at this time.
0 commit comments