[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86tt7zopk9.wl-maz@kernel.org>
Date: Tue, 11 Mar 2025 09:59:50 +0000
From: Marc Zyngier <maz@...nel.org>
To: Zhenyu Ye <yezhenyu2@...wei.com>
Cc: <yuzenghui@...wei.com>,
<will@...nel.org>,
<oliver.upton@...ux.dev>,
<catalin.marinas@....com>,
<joey.gouly@....com>,
<linux-kernel@...r.kernel.org>,
<xiexiangyou@...wei.com>,
<zhengchuan@...wei.com>,
<wangzhou1@...ilicon.com>,
<linux-arm-kernel@...ts.infradead.org>,
<kvm@...r.kernel.org>,
<kvmarm@...ts.linux.dev>
Subject: Re: [PATCH v1 3/5] arm64/kvm: using ioctl to enable/disable the HDBSS feature
+1 on everything Oliver said. Additionally:
On Tue, 11 Mar 2025 04:03:19 +0000,
Zhenyu Ye <yezhenyu2@...wei.com> wrote:
>
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 1f55b0c7b11d..9c11e2292b1e 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -1703,6 +1703,9 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
> if (writable)
> prot |= KVM_PGTABLE_PROT_W;
>
> + if (kvm->enable_hdbss && logging_active)
> + prot |= KVM_PGTABLE_PROT_DBM;
> +
This looks totally wrong. If the page is defined as R/O
(KVM_PGTABLE_PROT_W not being set), setting the DBM flag makes it
writable anyway (the W bit is the Dirty bit). Hello, memory
corruption?
overall, this patch is a total mess, and needs to be split to have the
runtime logic on one side, and the userspace API on the other. Don't
mix the two.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists