From: Marc Zyngier <maz@kernel.org>
To: Zhenyu Ye <yezhenyu2@huawei.com>
Cc: <yuzenghui@huawei.com>, <will@kernel.org>,
<oliver.upton@linux.dev>, <catalin.marinas@arm.com>,
<joey.gouly@arm.com>, <linux-kernel@vger.kernel.org>,
<xiexiangyou@huawei.com>, <zhengchuan@huawei.com>,
<wangzhou1@hisilicon.com>, <linux-arm-kernel@lists.infradead.org>,
<kvm@vger.kernel.org>, <kvmarm@lists.linux.dev>
Subject: Re: [PATCH v1 3/5] arm64/kvm: using ioctl to enable/disable the HDBSS feature
Date: Tue, 11 Mar 2025 09:59:50 +0000 [thread overview]
Message-ID: <86tt7zopk9.wl-maz@kernel.org> (raw)
In-Reply-To: <20250311040321.1460-4-yezhenyu2@huawei.com>
+1 on everything Oliver said. Additionally:
On Tue, 11 Mar 2025 04:03:19 +0000,
Zhenyu Ye <yezhenyu2@huawei.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.
next prev parent reply other threads:[~2025-03-11 9:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 4:03 [PATCH v1 0/5] Support the FEAT_HDBSS introduced in Armv9.5 Zhenyu Ye
2025-03-11 4:03 ` [PATCH v1 1/5] arm64/sysreg: add HDBSS related register information Zhenyu Ye
2025-03-11 9:41 ` Marc Zyngier
2025-03-11 4:03 ` [PATCH v1 2/5] arm64/kvm: support set the DBM attr during memory abort Zhenyu Ye
2025-03-11 9:47 ` Marc Zyngier
2025-03-11 4:03 ` [PATCH v1 3/5] arm64/kvm: using ioctl to enable/disable the HDBSS feature Zhenyu Ye
2025-03-11 8:05 ` Oliver Upton
2025-03-11 9:59 ` Marc Zyngier [this message]
2025-03-11 4:03 ` [PATCH v1 4/5] arm64/kvm: support to handle the HDBSSF event Zhenyu Ye
2025-03-11 10:34 ` Marc Zyngier
2025-03-11 4:03 ` [PATCH v1 5/5] arm64/config: add config to control whether enable HDBSS feature Zhenyu Ye
2025-03-11 9:53 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86tt7zopk9.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=xiexiangyou@huawei.com \
--cc=yezhenyu2@huawei.com \
--cc=yuzenghui@huawei.com \
--cc=zhengchuan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.