From nobody Mon Feb 9 05:29:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1767983342; cv=none; d=zohomail.com; s=zohoarc; b=ZCL1F1CBGeD3ZVg/E41eepdKCAmZ6cqSpJY31BZN6/l1BI6zDv0umQEoXr8f2zvkZqwpS/rF4kgSvw+YsuhU34q7+IB3483HF9xEntkcH3UHll4Zbq58XiU06OHPZYJ1OdMUQIoTP8+86by6vCQ3r+YGJ5FzPdTBa7T9QpE5kHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767983342; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qCiBUHR9GUmV1iDaApd4GQnbRtt5KA9W3cMN2DSAagc=; b=mS9VNm6Mk/iLlQwosKuAP5gyORpTGE945Jli9lnd4dad9eX55due0VMt19G/Id1S+LAooc8Nf+5MSVCFnpheqNMdKxNtr04dd72UGPNhBKOvskApBPxjOfbTTN2rJ+dSwwl3ukZpsd07U8DrjkyXVzjb4nG68zJWsCNBDGblLf4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1767983342072278.7934263935232; Fri, 9 Jan 2026 10:29:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1199112.1515816 (Exim 4.92) (envelope-from ) id 1veHDs-0003G1-58; Fri, 09 Jan 2026 18:28:32 +0000 Received: by outflank-mailman (output) from mailman id 1199112.1515816; Fri, 09 Jan 2026 18:28:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1veHDs-0003Fu-1M; Fri, 09 Jan 2026 18:28:32 +0000 Received: by outflank-mailman (input) for mailman id 1199112; Fri, 09 Jan 2026 18:28:30 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1veHDp-0003Fi-WE for xen-devel@lists.xenproject.org; Fri, 09 Jan 2026 18:28:30 +0000 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [2a00:1450:4864:20::433]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fd73ae4e-ed88-11f0-9ccf-f158ae23cfc8; Fri, 09 Jan 2026 19:28:27 +0100 (CET) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-4308d87782dso386846f8f.2 for ; Fri, 09 Jan 2026 10:28:27 -0800 (PST) Received: from lab.home (dynamic-2a00-1028-83a4-4bca-c0bb-96ff-feed-9d50.ipv6.o2.cz. [2a00:1028:83a4:4bca:c0bb:96ff:feed:9d50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd0e16f4sm24411728f8f.11.2026.01.09.10.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jan 2026 10:28:25 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fd73ae4e-ed88-11f0-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767983306; x=1768588106; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qCiBUHR9GUmV1iDaApd4GQnbRtt5KA9W3cMN2DSAagc=; b=YTG+PIcM2cBhYEZuJATxOPxrR1xUYZQjv4Q2FIuVuabXIQ8qCo1cm6Ob7JTT3SRNgM 6NieO7x98epP9FViAJ7WhpFvuoHfzGqNk1/lzuF1Z0bjkX2LlRjtBoeW6ZlAIRV5MYQw dsVCz/lBkX2nooXeBf4aAIPv+En02FL91BWhy6ciX9KQaIvdHpYQ9ArDTEhiUbHwUgzW jy8dbSefF3KArk/gOyjbgqhWJSzMC439k3ldr2qohZBf+rRyxbA/GnMftFVce7WZZP70 RT62N6IzKz+9Xn/GsmJme7ag+GooCDBIRHw+lqR3Gyg6QARBQsrlnTNFcwJuK7EJc1ON G1Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767983306; x=1768588106; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qCiBUHR9GUmV1iDaApd4GQnbRtt5KA9W3cMN2DSAagc=; b=KcVcvOIqPP02PnAj7miYB83agpaeEtt9zK9UTbS41wG++EN8Jjt6Wh3nkKEq6z46Ve w3/fdcA2CNInHmbY3+Khi4O4VwEPuO2ImZvUMFU6dJEV+kc0W8IELk2x16IxwpsVutPP uefjDtKsQmP1SPjog9zIJIz9zbn+gZKSsNJSjRVNVBCx4y73EZky8Hu/HJFgdbubo5Cj 6BebD470/u7AbVvH26+FZnT0BvH2tks3k+cpDTMcJDMakDPAiNSeX2DjXlBo7VUtE9my VwpfIlX220CzihXuf7WG9mwveHdfCd0TUR2oIIQIDe2LImSuKOy7hVcBb5zsxlYucQL1 0Ejw== X-Gm-Message-State: AOJu0YzmjBqrGtnk/lwRgfF2qZxhQTYFUg78qhquTld1+m8Ym0RdLPB8 ooB/wHUFCfPPthNnK0RLiQThJPMTKi18YQZda21bEAffn2mJJ2NlzulrK5AHaQ== X-Gm-Gg: AY/fxX748T6Sa6IiWIqESlENGdlNbjbzobd1jfT6zbJHnF8baiOjk1Zg6XSlAkFkS27 WDe3dDtD6+Axi9gNptH28gU9uJRNEStG85n39OhOVJX0xniEk7QcpFLiF0npkqrGmByCG6Qa2Td +p19/bOhgJwGHPxtaQ4CpaFurpm3dXLdV0WBiCKZ4gJE+D2yuhJa503L25s5835P2BxrxYilalg kEal2huxc2DmEuROKlTfpi22J7i2rJjV/+L/TTdvRdYD8ja9ThHazxs7A0Y8YsDRtZhhMQQDz3n qrPW8CWx4iqQ1Jaf2c0vEuNN+d9Mi0lhN8bg6g5SCCdSJb+7fwkY0dGTXzOxmxiLRrrM68at9TT AkanPXZl4wcxQhtcgxyh7uPaXvYiv/O57T2F39ac9pEls+vObE9//mS+xrKFc6Hj3Y3KWRm8YRm 4/UXyaiwAGHy3I3Xp2ZgBVSCm2tcVrKBRrFz08elOOG/ulPuHr577TsWKnzy8gMYh14Jh1c0imF u1+2QSbP3Ixd7s= X-Google-Smtp-Source: AGHT+IHjAjG9+x8tuHWmGR6vgWBaQIRYyWhXNF6DWbFscEYVN6wqkZllXh0KlYAv/GA/YZSiKbZagQ== X-Received: by 2002:a05:6000:180f:b0:432:c37c:ec04 with SMTP id ffacd0b85a97d-432c37cec1bmr6149656f8f.0.1767983306096; Fri, 09 Jan 2026 10:28:26 -0800 (PST) From: "=?UTF-8?q?Petr=20Bene=C5=A1?=" X-Google-Original-From: =?UTF-8?q?Petr=20Bene=C5=A1?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Petr=20Bene=C5=A1?= , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH] x86/altp2m: altp2m_get_effective_entry() should honor ap2m->default_access Date: Fri, 9 Jan 2026 18:28:22 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1767983344293158500 From: Petr Bene=C5=A1 Commit 7e5b662 fixed p2m_altp2m_get_or_propagate() to use the altp2m's default_access when propagating entries from the host p2m. However, the same fix was not applied to altp2m_get_effective_entry(), which has the same iss= ue. When altp2m_get_effective_entry() prepopulates a superpage from the host p2m, it incorrectly uses the host p2m's access permissions instead of the altp2m's default_access. This causes problems when the superpage is later split (e.g., when setting mem_access on a specific 4K page): all 512 entries inherit the host p2m's access rights instead of the altp2m's default_access. This issue became apparent after commit 50baf2d, which causes the host p2m to use superpages more frequently. Before that commit, the host p2m typically had 4K entries after VM restore, so the prepopulate branch was rarely taken. Symptoms include memory-access events firing for unexpected pages when using VMI tools with altp2m, particularly after VM resume. The issue can be worked around by booting with "hap_1gb=3D0 hap_2mb=3D0". Fixes: 7e5b662 ("x86/altp2m: p2m_altp2m_get_or_propagate() should honor ap2= m->default_access") Signed-off-by: Petr Bene=C5=A1 Acked-by: Tamas K Lengyel --- xen/arch/x86/mm/altp2m.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c index 0261360aae..0bc9b9ad2f 100644 --- a/xen/arch/x86/mm/altp2m.c +++ b/xen/arch/x86/mm/altp2m.c @@ -194,6 +194,9 @@ int altp2m_get_effective_entry(struct p2m_domain *ap2m,= gfn_t gfn, mfn_t *mfn, gfn_t gfn_aligned =3D _gfn(gfn_x(gfn) & mask); mfn_t mfn_aligned =3D _mfn(mfn_x(*mfn) & mask); =20 + /* Override the altp2m entry with its default access. */ + *a =3D ap2m->default_access; + rc =3D ap2m->set_entry(ap2m, gfn_aligned, mfn_aligned, page_or= der, *t, *a, 1); if ( rc ) return rc; --=20 2.34.1