From nobody Tue Dec 16 11:46: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=1747391584; cv=none; d=zohomail.com; s=zohoarc; b=mXTLghIvOMbE43QzIcE2TwBYQhHTegbRoLJmOHfJobnAl8l7zNJq1imIWtQ1JgP7Vf3na2SJ1D8w5nBVQ51NvvE+HlXQkSaibVvylshI1ZZwDe8g88am15w3Z7bEHipHYFsBinhk6d9j5Xq2BiNFmM/0WDpoZtFnapLjR1uBpxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747391584; 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=09td6MHuWEdAtrsXq56Leo+iJWk3EtNEWxuIkhfA2QY=; b=irgCYstnSStguEtM+gW5TYJmIybCHM5nT8LWaJAylFc86uMJX55m8DL7maZRkD1YWzr/J4eTPVPa+W4Zat2x42AIjnJpb7Ss3M1+jgEzfB8qpfPTVCGAmW9oahF3g3Ftmf8ObEP+XYBqGzXaQ3mnhHEPJsJSPebeqoDdq62234U= 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 1747391584810559.4113804627735; Fri, 16 May 2025 03:33:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.986884.1372418 (Exim 4.92) (envelope-from ) id 1uFsN2-0007AW-Vu; Fri, 16 May 2025 10:32:52 +0000 Received: by outflank-mailman (output) from mailman id 986884.1372418; Fri, 16 May 2025 10:32:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uFsN2-0007AP-TE; Fri, 16 May 2025 10:32:52 +0000 Received: by outflank-mailman (input) for mailman id 986884; Fri, 16 May 2025 10:32:51 +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 1uFsFS-0000kS-7H for xen-devel@lists.xenproject.org; Fri, 16 May 2025 10:25:02 +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 0562caa4-3240-11f0-9ffb-bf95429c2676; Fri, 16 May 2025 12:25:00 +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 4ZzNVz4HQJzlkq4C for ; Fri, 16 May 2025 10:24:59 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 7f39565cc8474cdab9afc80d3eba8c0e; Fri, 16 May 2025 10:24:59 +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: 0562caa4-3240-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1747391099; x=1747661099; bh=09td6MHuWEdAtrsXq56Leo+iJWk3EtNEWxuIkhfA2QY=; 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=a2gbiYcDd7G4EV3R5dxVsuqVVKQkuHXSZ49ZrcQCKwpH+qX/qpCklXy/nF5zhmYDD hhiShkEoS8n5h7/Gu46AcEd3w0qx5jzrjZA/tzc9NqYGBzXekD3T0+P2feDSoqCRZ9 71LZ2prWtjXd88k5UBe/qm0jrtC/9ybHTqZkQVn6e/8RYSXOtHBTIXYhj8PnvRAi8j yb05w6xYqgKIzo2ASJ2pKRQcfyXVLV1G7FbCfWmDA7WMxG45mfvkuK3mlmPV1iqdoJ mYMg9moILLsRk0G73K4WXZesxLzlgYibF1IDQRnoNn2wmfFk6WTuvCmr0oC2HdR+YM WcU0gsRV1YBhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1747391099; x=1747651599; i=teddy.astie@vates.tech; bh=09td6MHuWEdAtrsXq56Leo+iJWk3EtNEWxuIkhfA2QY=; 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=ChFOJqpTBxrMueYRacemat+PhOtQRul24i2hKMOu+K6adyvVryfz1rexR0B7HCG8l vloHswhqGTnRPsIelIFWY24288wh2izec/m9cro0zButbUNKTHp4lRRkUHi84Ja5V1 rCWqKsl1K1iWLOuZrv7rgdETeSijzFJ5G5qIhptnTui/53vIQ9hYw/QcV48qXgfkVz tQHuNkzoly0ZXMIWoCBL5ybb0rrabfGDgl0T33yxIsac1ZouTwdK+BAcxyNTf/ORbS 5Aan1fymqhrtyc0MoC6NmkG5O3/Zh0QsUAtqU3Re64uoGCmyAqKK8nq7izgg2hLaq3 Xcp6feiEQMHBw== From: "Teddy Astie" Subject: =?utf-8?Q?[RFC=20PATCH=2016/16]=20HACK:=20Add=20sev=5Fconsole=20hypercall?= 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: 1747391098333 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Andrew Cooper" , "Anthony PERARD" , "Michal Orzel" , "Jan Beulich" , "Julien Grall" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , "Stefano Stabellini" 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.7f39565cc8474cdab9afc80d3eba8c0e?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20250516:md Date: Fri, 16 May 2025 10:24:59 +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: 1747391586236116600 Content-Type: text/plain; charset="utf-8" Introduce a basic console hypercall for debugging needs under SEV when PV console is not usable at this point. This is later on used by the earlyprintk of the experimental SEV Linux branch. Signed-off-by: Teddy Astie --- xen/common/coco.c | 6 ++++++ xen/include/hypercall-defs.c | 2 ++ xen/include/public/xen.h | 1 + 3 files changed, 9 insertions(+) diff --git a/xen/common/coco.c b/xen/common/coco.c index d9bd17628d..23c0da6281 100644 --- a/xen/common/coco.c +++ b/xen/common/coco.c @@ -131,4 +131,10 @@ long do_coco_op(unsigned int cmd, XEN_GUEST_HANDLE_PAR= AM(void) arg) } } =20 +long do_sev_console_op(unsigned long c) +{ + printk("%c", (unsigned char)c); + return 0; +} + __initcall(coco_init); \ No newline at end of file diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 6c01a9e395..19f40f0b38 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -210,6 +210,7 @@ hypfs_op(unsigned int cmd, const char *arg1, unsigned l= ong arg2, void *arg3, uns xenpmu_op(unsigned int op, xen_pmu_params_t *arg) #endif coco_op(unsigned int cmd, void *arg) +sev_console_op(unsigned long c) =20 #ifdef CONFIG_PV caller: pv64 @@ -297,5 +298,6 @@ mca do do - = - - paging_domctl_cont do do do do - #endif coco_op do do do do do +sev_console_op do do do do - =20 #endif /* !CPPCHECK */ diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index e656d6f617..04fc891353 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -119,6 +119,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); #define __HYPERVISOR_dm_op 41 #define __HYPERVISOR_hypfs_op 42 #define __HYPERVISOR_coco_op 43 +#define __HYPERVISOR_sev_console_op 45 =20 /* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48 --=20 2.49.0 Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech