From nobody Sun Dec 14 11:58:18 2025 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; Authentication-Results: mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; 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=reject dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1764250808; cv=none; d=zohomail.com; s=zohoarc; b=FHyDIJi4IOJqK7lYHrS5XNjeySofU/YsJ8wd0dViSHoEL/3SNmf2EgXVeSscRs+9rNEh6WCYkNC3qLkoBTHmF66mwqF+m6ArMFAP/GBqUPRT+Am0C3R+DKLXgUXvKaJMHRz1AVajrBs8SkROHSX2HyBmIzPLRCcFSTZ5UIXIOCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764250808; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=thBPwpCdaOZGJV5TWAllKK33OhFnY55OPorBf+4bLqU=; b=ggdgjvMRjKHBVU5bQvz5bUgDni46sFvAzW1SCRZhYdtH5cgbvZwmwSAgP4S2/TIeeeXMRDZiAA37oM+YZ0R3DLctjqWgSR0UN3ncsUhvtddVwXk2lTNpBSaZc44ohILUV4jwF6N0SkMoa6UjZSDEQZJmJv2oO1r8HMe4WRvOzf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; 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=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1764250808574382.3680826189267; Thu, 27 Nov 2025 05:40:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1173861.1498882 (Exim 4.92) (envelope-from ) id 1vOcDs-0008Dw-VA; Thu, 27 Nov 2025 13:39:48 +0000 Received: by outflank-mailman (output) from mailman id 1173861.1498882; Thu, 27 Nov 2025 13:39:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vOcDs-0008Dn-Rj; Thu, 27 Nov 2025 13:39:48 +0000 Received: by outflank-mailman (input) for mailman id 1173861; Thu, 27 Nov 2025 13:39:47 +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 1vOcDr-0007qN-29 for xen-devel@lists.xenproject.org; Thu, 27 Nov 2025 13:39:47 +0000 Received: from mail132-18.atl131.mandrillapp.com (mail132-18.atl131.mandrillapp.com [198.2.132.18]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 867166d9-cb96-11f0-980a-7dc792cee155; Thu, 27 Nov 2025 14:39:41 +0100 (CET) Received: from pmta09.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail132-18.atl131.mandrillapp.com (Mailchimp) with ESMTP id 4dHHbc2h8WzCf9XsP for ; Thu, 27 Nov 2025 13:39:40 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id f6bdf73267e24ad58f58833a5a32f85c; Thu, 27 Nov 2025 13:39:40 +0000 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: 867166d9-cb96-11f0-980a-7dc792cee155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1764250780; x=1764520780; bh=thBPwpCdaOZGJV5TWAllKK33OhFnY55OPorBf+4bLqU=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=QfuXrUYc4XnbI+pzTl1aARchA7yYhnETOdD8yISoCYlUKoAr2Pp6a0CcLQnbfiXJ+ xaZtGmQQguRDKhmzjxRG0k/qNnzs5EIMnBY0mp7564FrQ2xey0yCtlvD6/A3xLp13g bV5NgyXKflSn+5Yzyca63+VCGFNVGh062m0Do4ArV/6qiyL8Igv/n7yOl2j11yUxfn qV/e4jMNnZlznzVuRsKb+3EDoCzBGXWgtY5EBlF5h13Cogi/6xg3OijmcH4NPAgcOL rsAuy4yAntUcnm6I2Jr5iS1+qTCw2Gmy0h7hVMXO4IMpc/+F36TX4CalLA5hTCPKNm nXzUWQWbm4jAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1764250780; x=1764511280; i=teddy.astie@vates.tech; bh=thBPwpCdaOZGJV5TWAllKK33OhFnY55OPorBf+4bLqU=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=U3pwQzuXkV+Jq/Sn7vDo/+wGH/jmAJxZCgn5uTsm4UzF50z+zbAb/6Ym0U45X4rQr zy53Y4t1ockktlu8ESaKwsOYIhPGC9K3ZGmJxg5vZ6bDZ7+TmXMp83kOc7cGkIShpK 2VtOEHss6i6cxgi37y1+CnWLz55Jxb2l7nJMOCX5Emgopv42wAHJlQYdG9CHyHZkJh z9JoV6X4VZ4ez+zIMR55P/BX6snHD2JNdbvFXKfC5pS3kDJVOEWJiApRel71VIkjSn Be8m2hCW566NGGiKnE44J0+X70K7T7SqoVQKp8qiQnA5koGXmI1kb6RGgIs+VAcPEw BzLgcFrJNby+Q== From: "Teddy Astie" Subject: =?utf-8?Q?[RFC=20PATCH=201/4]=20x86/ept:=20Drop=20shadow=20mode=20check=20in=20ept=5Fsync=5Fdomain()?= X-Mailer: git-send-email 2.51.2 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1764250779412 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" Message-Id: In-Reply-To: References: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.f6bdf73267e24ad58f58833a5a32f85c?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20251127:md Date: Thu, 27 Nov 2025 13:39:40 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity teddy.astie@vates.tech) (identity @mandrillapp.com) X-ZM-MESSAGEID: 1764250809757019200 Content-Type: text/plain; charset="utf-8" This function can only be reached from EPT-related code which is inherently HAP. Thus it is not useful to check for shadow_paging (or lack of HAP) ther= e. Moreover, it is an error to call this function in the non-EPT cases. Not a functional change. Signed-off-by: Teddy Astie Reviewed-by: Jan Beulich --- This function is only called through EPT code and by vmx_domain_update_eptp= () called by EPT log-dirty logic, and doesn't look reachable from shadow paging code. I think the original reason of this check was for eventually allowing guest= s to use both shadow paging and HAP and switch between the 2 dynamically. xen/arch/x86/mm/p2m-ept.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index ce4ef632ae..dfdbfa0afe 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -1268,9 +1268,10 @@ static void ept_sync_domain_mask(struct p2m_domain *= p2m, const cpumask_t *mask) void ept_sync_domain(struct p2m_domain *p2m) { struct domain *d =3D p2m->domain; + ASSERT(hap_enabled(d)); =20 - /* Only if using EPT and this domain has some VCPUs to dirty. */ - if ( paging_mode_shadow(d) || !d->vcpu || !d->vcpu[0] ) + /* Only if this domain has some VCPUs to dirty. */ + if ( !d->vcpu || !d->vcpu[0] ) return; =20 ept_sync_domain_prepare(p2m); --=20 2.51.2 -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech