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/
3
3
obj-y += net/
4
4
obj-y += vdso/
5
5
6
+ obj-$(CONFIG_KVM) += kvm/
7
+
6
8
# for cleaning
7
9
subdir- += boot
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ config LOONGARCH
129
129
select HAVE_KPROBES
130
130
select HAVE_KPROBES_ON_FTRACE
131
131
select HAVE_KRETPROBES
132
+ select HAVE_KVM
132
133
select HAVE_MOD_ARCH_SPECIFIC
133
134
select HAVE_NMI
134
135
select HAVE_PCI
@@ -263,6 +264,9 @@ config AS_HAS_LASX_EXTENSION
263
264
config AS_HAS_LBT_EXTENSION
264
265
def_bool $(as-instr,movscr2gr \$a0$(comma)\$scr0)
265
266
267
+ config AS_HAS_LVZ_EXTENSION
268
+ def_bool $(as-instr,hvcl 0)
269
+
266
270
menu "Kernel type and options"
267
271
268
272
source "kernel/Kconfig.hz"
@@ -676,3 +680,5 @@ source "kernel/power/Kconfig"
676
680
source "drivers/acpi/Kconfig"
677
681
678
682
endmenu
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
66
66
CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
67
67
CONFIG_EFI_CAPSULE_LOADER=m
68
68
CONFIG_EFI_TEST=m
69
+ CONFIG_VIRTUALIZATION=y
70
+ CONFIG_KVM=m
69
71
CONFIG_JUMP_LABEL=y
70
72
CONFIG_MODULES=y
71
73
CONFIG_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