diff options
author | Bibo Mao <maobibo@loongson.cn> | 2025-09-18 19:44:22 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2025-09-18 19:44:22 +0800 |
commit | f58c9aa1065f73d243904b267c71f6a9d1e9f90e (patch) | |
tree | 287638a1d1576b5e122b5badf9ef645173b8dfab /rust/helpers/rcu.c | |
parent | 091b29d53fe645781c5c1f405bc9fcd50ce5792b (diff) |
LoongArch: KVM: Fix VM migration failure with PTW enabled
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>
Diffstat (limited to 'rust/helpers/rcu.c')
0 files changed, 0 insertions, 0 deletions