Unverified Commit d3f9c037 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13998 Synchronization with patch for loongarch virtualization

Merge Pull Request from: @lixianglai 
 
Synchronization with patch for loongarch virtualization
增加pv ipi功能
0012-LoongArch-KVM-Add-PV-IPI-support-on-host-side.patch
0013-LoongArch-KVM-Add-PV-IPI-support-on-guest-side.patch

增加软件中断功能
0014-LoongArch-KVM-Add-software-breakpoint-support.patch
0015-LoongArch-KVM-Add-mmio-trace-events-support.patch
0016-LoongArch-KVM-Sync-pending-interrupt-when-getting-ES.patch
0017-LoongArch-KVM-Delay-secondary-mmu-tlb-flush-until-gu.patch
0018-LoongArch-KVM-Select-huge-page-only-if-secondary-mmu.patch
0019-LoongArch-KVM-Discard-dirty-page-tracking-on-readonl.patch
0020-LoongArch-KVM-Add-memory-barrier-before-update-pmd-e.patch
0021-LoongArch-KVM-Add-dirty-bitmap-initially-all-set-sup.patch
0022-LoongArch-KVM-Mark-page-accessed-and-dirty-with-page.patch
0023-LoongArch-KVM-always-make-pte-young-in-page-map-s-fa.patch
增加pv steal time支持
0024-LoongArch-KVM-Add-PV-steal-time-support-in-host-side.patch
0025-LoongArch-KVM-Add-PV-steal-time-support-in-guest-sid.patch
0026-perf-kvm-Add-kvm-stat-for-loongarch64.patch
0027-KVM-Discard-zero-mask-with-function-kvm_dirty_ring_r.patch
0028-LoongArch-KVM-Invalidate-guest-steal-time-address-on.patch
0029-LoongArch-Revert-qspinlock-to-test-and-set-simple-lo.patch
0030-LoongArch-KVM-Add-VM-feature-detection-function.patch
增加loongarch LBT支持
0031-LoongArch-KVM-Add-Binary-Translation-extension-suppo.patch
0032-LoongArch-KVM-Add-vm-migration-support-for-LBT-regis.patch
0033-LoongArch-KVM-Add-PMU-support-for-guest.patch
0034-LoongArch-KVM-Enable-paravirt-feature-control-from-V.patch
0035-LoongArch-KVM-Implement-function-kvm_para_has_featur.patch
0036-LoongArch-KVM-Add-KVM-hypercalls-documentation-for-L.patch
0037-LoongArch-KVM-Add-cpucfg-area-for-kvm-hypervisor.patch
0038-LoongArch-KVM-Remove-unnecessary-definition-of-KVM_P.patch
0039-LoongArch-KVM-Add-vcpu-mapping-from-physical-cpuid.patch
0040-LoongArch-KVM-Remove-undefined-a6-argument-comment-f.patch
0041-LoongArch-KVM-Remove-unnecessary-CSR-register-saving.patch

ISSUE: #IAZJDO  
 
Link:https://gitee.com/openeuler/kernel/pulls/13998

 

Reviewed-by: default avatarJuxin Gao <gaojuxin@loongson.cn>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 24f2faf5 b6239f74
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4011,9 +4011,10 @@
			vulnerability. System may allow data leaks with this
			option.

	no-steal-acc	[X86,PV_OPS,ARM64,PPC/PSERIES] Disable paravirtualized
			steal time accounting. steal time is computed, but
			won't influence scheduler behaviour
	no-steal-acc	[X86,PV_OPS,ARM64,PPC/PSERIES,RISCV,LOONGARCH,EARLY]
			Disable paravirtualized steal time accounting. steal time
			is computed, but won't influence scheduler behaviour


	nosync		[HW,M68K] Disables sync negotiation for all devices.

+1 −0
Original line number Diff line number Diff line
@@ -11588,6 +11588,7 @@ L: kvm@vger.kernel.org
L:	loongarch@lists.linux.dev
S:	Maintained
T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
F:	Documentation/virt/kvm/loongarch/
F:	arch/loongarch/include/asm/kvm*
F:	arch/loongarch/include/uapi/asm/kvm*
F:	arch/loongarch/kvm/
+31 −0
Original line number Diff line number Diff line
@@ -631,6 +631,26 @@ config RANDOMIZE_BASE_MAX_OFFSET

source "kernel/livepatch/Kconfig"

config PARAVIRT
	bool "Enable paravirtualization code"
	depends on AS_HAS_LVZ_EXTENSION
	help
	  This changes the kernel so it can modify itself when it is run
	  under a hypervisor, potentially improving performance significantly
	  over full virtualization.  However, when run without a hypervisor
	  the kernel is theoretically slower and slightly larger.

config PARAVIRT_TIME_ACCOUNTING
	bool "Paravirtual steal time accounting"
	depends on PARAVIRT
	help
	  Select this option to enable fine granularity task steal time
	  accounting. Time spent executing other tasks in parallel with
	  the current vCPU is discounted from the vCPU power. To account for
	  that, there can be a small performance impact.

	  If in doubt, say N here.

endmenu

config ARCH_SELECT_MEMORY_MODEL
@@ -683,6 +703,17 @@ source "drivers/cpufreq/Kconfig"
source "kernel/power/Kconfig"
source "drivers/acpi/Kconfig"

config PARAVIRT_TIME_ACCOUNTING
	bool "Paravirtual steal time accounting"
	depends on PARAVIRT
	help
	  Select this option to enable fine granularity task steal time
	  accounting. Time spent executing other tasks in parallel with
	  the current vCPU is discounted from the vCPU power. To account for
	  that, there can be a small performance impact.

	  If in doubt, say N here.

endmenu

source "arch/loongarch/kvm/Kconfig"
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ generic-y += mcs_spinlock.h
generic-y += parport.h
generic-y += early_ioremap.h
generic-y += qrwlock.h
generic-y += qspinlock.h
generic-y += rwsem.h
generic-y += segment.h
generic-y += user.h
+3 −4
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ __BUILD_GCSR_OP(tlbidx)

#define kvm_save_hw_gcsr(csr, gid)	(csr->csrs[gid] = gcsr_read(gid))
#define kvm_restore_hw_gcsr(csr, gid)	(gcsr_write(csr->csrs[gid], gid))

#define kvm_read_clear_hw_gcsr(csr, gid)	(csr->csrs[gid] = gcsr_write(0, gid))

int kvm_emu_iocsr(larch_inst inst, struct kvm_run *run, struct kvm_vcpu *vcpu);
@@ -210,9 +211,7 @@ static __always_inline void kvm_change_sw_gcsr(struct loongarch_csrs *csr,
	csr->csrs[gid] |= val & _mask;
}

#define KVM_PMU_EVENT_ENABLED	(CSR_PERFCTRL_PLV0 |		\
					CSR_PERFCTRL_PLV1 |	\
					CSR_PERFCTRL_PLV2 |	\
					CSR_PERFCTRL_PLV3)
#define KVM_PMU_EVENT_ENABLED	(CSR_PERFCTRL_PLV0 | CSR_PERFCTRL_PLV1 | \
					CSR_PERFCTRL_PLV2 | CSR_PERFCTRL_PLV3)

#endif	/* __ASM_LOONGARCH_KVM_CSR_H__ */
Loading