[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 1/2] domctl: Handle XEN_DOMCTL_getpageframeinfo3 without the domctl lock
- To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Jun 2026 09:11:15 -0400
- Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781183480; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=6SVmJda0/ihaiKMENcSONOEu0BYW6DAROXOmb9ogDrs=; b=RVY/w+Dm8US4qgvUorV6Q5W+oXxybyeiYnxUbfsqnKuGdKTuUTb1wctOK1z2D4SHhKdEvQbqskNvVCFUjwsMD61HdQUhOsZbR7HOgk396ZqqKMWMvPFhRsn7vfmygrYQ57VMByf9V/0Z4XWVcXlL43ElQQS/nqSzdiqLzP4Irbc=
- Arc-seal: i=1; a=rsa-sha256; t=1781183480; cv=none; d=zohomail.com; s=zohoarc; b=maqe0zEljAsZc5Z7mFNegrlJRx0ayOblz0nYyKmyZlHNjmGuL8Z50kQpYwg8UJtDSu1O9ft3aFvVTVnIUb7zXKpIWLF9Zg83LkAuyfU1Z4w8pr3ec+mI8HES44IMq8gw6cMZfieNnkdrl81gOWRjLCw2CFyvZLPpqPhyaSEO230=
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@xxxxxxxxxxxxxxxxxxxx" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Thu, 11 Jun 2026 13:11:41 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 6/9/26 11:15 AM, Ross Lagerwall wrote:
It does not have side effects and is protected from concurrent changes
by the P2M read lock therefore skip taking the domctl lock.
Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---
xen/arch/x86/domctl.c | 4 ++++
xen/common/domctl.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 83bf51e498df..0e9a2532887e 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -301,6 +301,10 @@ long arch_do_domctl(
/* Games to allow this code block to handle a compat guest. */
void __user *guest_handle = domctl->u.getpageframeinfo3.array.p;
+ ret = xsm_domctl(XSM_OTHER, d, domctl);
+ if ( ret )
+ break;
+
if ( unlikely(num > 1024) ||
unlikely(num != domctl->u.getpageframeinfo3.num) )
{
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 3efa5b9d55b9..35144d95b808 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -555,6 +555,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t)
u_domctl)
case XEN_DOMCTL_gsi_permission:
case XEN_DOMCTL_bind_pt_irq:
case XEN_DOMCTL_unbind_pt_irq:
+ case XEN_DOMCTL_getpageframeinfo3:
ret = arch_do_domctl(op, d, u_domctl);
goto domctl_out_unlock_domonly;
I would respectfully ask to be mindful when XSM hooks are being
manipulated in a patch that a review from an XSM maintainer should be
sought before committing a patch. In this case case the change itself is
good, though I would have liked the opportunity to comment that the
commit message should have had some explanation on the xsm change.
V/r,
Daniel P. Smith
|