From nobody Tue Dec 16 11:49:56 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=1747391510; cv=none; d=zohomail.com; s=zohoarc; b=jdghNWFEKtz7cf9XYF7kYc11Y8zraNysTH+rKLR9TV6dXMWDmVpaMG9BhIdfaVRyhmekT02OmiNGcpQJ0K1VAU8r5OkXYguwCdzexkd6Pe1oAYeWxMJ0dJR6mz5oD4nZuOwvt8GKB07g2INyO+Pye5YSSdfmI9DX+vB10KlF7z8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747391510; 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=lPXqp2js7vt00YaTBMUsWA+9FdXRi2GQpFRihsFOl30=; b=eW8U8B+lPPUv5Isy9uVjasTkBx6uYMXUT7IHVhnX2pN1tQxfBh7Xt6nARIOaMa9bdZdAvEbdx0CbO1P5rTCLaxKULftxOGfucRAj/8PzWaLFvfoyvAf66fZhFpyK8T5npRJYCrGzR+1zajwdLYFglOiHopW7pbijJ1x01rqA6Bg= 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 1747391510249610.6440359174652; Fri, 16 May 2025 03:31:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.986856.1372389 (Exim 4.92) (envelope-from ) id 1uFsLo-0004wy-1e; Fri, 16 May 2025 10:31:36 +0000 Received: by outflank-mailman (output) from mailman id 986856.1372389; Fri, 16 May 2025 10:31:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uFsLn-0004wq-UX; Fri, 16 May 2025 10:31:35 +0000 Received: by outflank-mailman (input) for mailman id 986856; Fri, 16 May 2025 10:31:34 +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 1uFsFI-0000kS-NX for xen-devel@lists.xenproject.org; Fri, 16 May 2025 10:24:52 +0000 Received: from mail187-4.suw11.mandrillapp.com (mail187-4.suw11.mandrillapp.com [198.2.187.4]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ffd42512-323f-11f0-9ffb-bf95429c2676; Fri, 16 May 2025 12:24:51 +0200 (CEST) Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail187-4.suw11.mandrillapp.com (Mailchimp) with ESMTP id 4ZzNVp20C8zlfcMZ for ; Fri, 16 May 2025 10:24:50 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 26fc1f1497074d24a6572d1c605778cd; Fri, 16 May 2025 10:24:50 +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: ffd42512-323f-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1747391090; x=1747661090; bh=lPXqp2js7vt00YaTBMUsWA+9FdXRi2GQpFRihsFOl30=; 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=s+sHoJ0eyQzfCTB2nT0EItF49M6MwcQqXVhGklNcZ8O5YHLcHlJbVMTiXV/68RB2F T/O2y1MtmHFlf7DgOq2qMMbnat6Q381r53wsF1dE3l4qHrzL3g29htS8KC4GsEaUZC +6ss4KnPoicPic3B8KmevO9CPxn40f/itRtMfBEM5KSKmEAkk3NKKva6+3RLzGpoHx mjlISCXb8a+4F+sXBdD3EUKI0c9IM3zO/h4OeXTLtnfNzfn/OMeRwB3qwhyCZGeeD/ G1OlDWfn2ReZcflLk/MVXfiIhDjwT4+TbJsBb5vE62ZEXQeEu+DdOalTGvPrqzfyiC zyLE0Ev1MQHuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1747391090; x=1747651590; i=teddy.astie@vates.tech; bh=lPXqp2js7vt00YaTBMUsWA+9FdXRi2GQpFRihsFOl30=; 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=l+1h2LX+iOCvWdCT8w/r0sAX+gA8ejuFRSzeHDK3B97fbdHgxMwrOReEagGjB9dqm QnwlbgiTkxDZxKyQ6PxApNR/pyWD2Bzapa8Qw/sfhzii/5BCmj/hOdcpGAeVeyUdjn uzpqUq13p4WV0SQ0rc/GxCi2sMR2NX5RGMww20d1VYaqj/k93jBsiXL1lEj5vipFlj xKML5LximY8+d/ncP8JNsGhYbnflYmaJZReTG7oOkVbJwLOQg/xxK4LkhPTxqxPJr2 X5/+aFU3pSCB+BTDCLesgqwflgY4ZuJCrw9HylOJg+ysL6NAy3NOfA8AHxxDG6e/B+ jq1N1NdTIIcTQ== From: "Teddy Astie" Subject: =?utf-8?Q?[RFC=20PATCH=2015/16]=20HACK:=20coco:=20Leak=20ASID=20for=20coco=20guests?= X-Mailer: git-send-email 2.49.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1747391089320 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.26fc1f1497074d24a6572d1c605778cd?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20250516:md Date: Fri, 16 May 2025 10:24:50 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @mandrillapp.com) (identity teddy.astie@vates.tech) X-ZM-MESSAGEID: 1747391511509116600 Content-Type: text/plain; charset="utf-8" In order to reuse a ASID in a SEV guest, we need to perform a WBINVD on all pCPUs that ran the guest, then a DF_FLUSH on the PSP. Just leak the ASID for now. Signed-off-by: Teddy Astie --- xen/arch/x86/hvm/hvm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index d3060329fb..ced58ccf4b 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -795,7 +795,10 @@ void hvm_domain_destroy(struct domain *d) list_del(&ioport->list); xfree(ioport); } - hvm_asid_free(&d->arch.hvm.asid); + if ( !is_coco_domain(d) ) + hvm_asid_free(&d->arch.hvm.asid); + else + printk("coco: Leaking ASID %x: TODO (DF_FLUSH handling)\n", d->arc= h.hvm.asid.asid); destroy_vpci_mmcfg(d); =20 } --=20 2.49.0 Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech