linux-yocto/arch/loongarch
Bibo Mao 1c73128437 LoongArch: KVM: Fix VM migration failure with PTW enabled
commit f58c9aa1065f73d243904b267c71f6a9d1e9f90e upstream.

With PTW disabled system, bit _PAGE_DIRTY is a HW bit for page writing.
However with PTW enabled system, bit _PAGE_WRITE is also a "HW bit" for
page writing, because hardware synchronizes _PAGE_WRITE to _PAGE_DIRTY
automatically. Previously, _PAGE_WRITE is treated as a SW bit to record
the page writeable attribute for the fast page fault handling in the
secondary MMU, however with PTW enabled machine, this bit is used by HW
already (so setting it will silence the TLB modify exception).

Here define KVM_PAGE_WRITEABLE with the SW bit _PAGE_MODIFIED, so that
it can work on both PTW disabled and enabled machines. And for HW write
bits, both _PAGE_DIRTY and _PAGE_WRITE are set or clear together.

Cc: stable@vger.kernel.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-25 11:16:48 +02:00
..
boot LoongArch: dts: Add PWM support to Loongson-2K2000 2025-06-06 18:51:16 +08:00
configs crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS 2025-05-12 13:33:14 +08:00
crypto loongarch/crc32: expose CRC32 functions through lib 2024-12-01 17:23:01 -08:00
include LoongArch: KVM: Fix VM migration failure with PTW enabled 2025-09-25 11:16:48 +02:00
kernel LoongArch: Check the return value when creating kobj 2025-09-25 11:16:47 +02:00
kvm LoongArch: KVM: Fix VM migration failure with PTW enabled 2025-09-25 11:16:48 +02:00
lib LoongArch: Fix build warnings about export.h 2025-06-26 20:07:18 +08:00
mm LoongArch: Handle KCOV __init vs inline mismatches 2025-06-26 20:07:18 +08:00
net LoongArch: BPF: Fix jump offset calculation in tailcall 2025-08-20 18:40:47 +02:00
pci LoongArch: Fix build warnings about export.h 2025-06-26 20:07:18 +08:00
power LoongArch: Save and restore CSR.CNTC for hibernation 2025-05-14 22:17:52 +08:00
vdso LoongArch: vDSO: Remove -nostdlib complier flag 2025-08-20 18:40:47 +02:00
Kbuild LoongArch: Migrate to the generic rule for built-in DTB 2025-01-25 18:51:33 +08:00
Kconfig LoongArch: Handle jump tables options for RUST 2025-09-25 11:16:47 +02:00
Kconfig.debug LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub 2024-06-21 10:18:40 +08:00
Makefile LoongArch: Handle jump tables options for RUST 2025-09-25 11:16:47 +02:00