From nobody Tue Jun 28 06:06:19 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AE1B1876C71 for ; Tue, 28 Jun 2022 06:06:30 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) Received: from apac01-obe.outbound.protection.outlook.com (mail-eastasiaazon11020017.outbound.protection.outlook.com [52.101.128.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LXDcj2wjVz4RSt; Tue, 28 Jun 2022 06:06:29 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SgsVSweAAPfCI9Nw1oaBlrZG310CcI/I4sUeMZOLoYBetiyYkyBmrUnyZDuVYaS5TG6zJafDvE4BH2h3iySecsrNSUGkJB1c5FiSgrz48PSdCvetXZVv52NqxKYGjpglju8go/Izpive2AcRh71EFha/AwHhu0BFerrNiU0X/x3o41n839IUsPCwQTdA4budGTgxliYHPhAfeF+GpaAi2JiO19eBsanJSe7w4wgXRkLxiDnaLMv53ajGx5yz0vjXh3t672IC3jZJrgA8gTMCZ8En5e/esUP12BwmJFB+iAP3iEEVecjet6boXufRfV7QvJbr7jjhUlPIvB0CjncBGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WBfd9oFu3GujTgt762d1vHYICYMCqCN+g3gIP1FAexk=; b=miWrEeXjC6D7houo7uuHA2GmecwJo/jc5zeqJ5tqmSYWul/t7ES9O47B2j2QLySlgirkcxGPtk0wtOM2Eh2AnnkmjOgepR+kuvrraHshzP7Gvugm6OZknGmYiTHyn5O/hioEPRmcVxDw7BhsOw50+TeYrabCibGINBB6c/vVxMhmEqkwnFOIvTR1JvvQRwdGpniiiu459ViF/wW3RDKOo6fC/+6pLp7ZRgYHJhuqBZgKlE83A3LdcA2R1s2W3zEaAt+DfmeeO/ujm3e/IWNRfD41kkkurWalSMS6+DimiDGvHXwjgDTTpbTOsEpvXa6mNVWqj1jFLRwZgPrGEth/pA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WBfd9oFu3GujTgt762d1vHYICYMCqCN+g3gIP1FAexk=; b=M0Fi8lMSp325xdu06c90V5LXxb6yrFsbpDVJnE7R5Qp33E0roiMgFXEChUBYzHCwlvtpGp4HQ63rtRjsfXx5V2IrXYbSTL6EHoaVejt+gulIosmAS4PjJDVUbspg4KAjntes3rpJxOAvBI1JSU8F6PMXGTqMnTACI35tyTL8OBI= Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM (2603:1096:301:75::14) by PUZP153MB0751.APCP153.PROD.OUTLOOK.COM (2603:1096:301:e0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.5; Tue, 28 Jun 2022 06:06:19 +0000 Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM ([fe80::bda2:79a7:8be8:b026]) by PSAP153MB0536.APCP153.PROD.OUTLOOK.COM ([fe80::bda2:79a7:8be8:b026%4]) with mapi id 15.20.5395.011; Tue, 28 Jun 2022 06:06:19 +0000 From: Souradeep Chakrabarti To: Andrew Turner CC: "freebsd-arm@FreeBSD.org" , Wei Hu Subject: Re: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call Thread-Topic: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call Thread-Index: AdiKA2Q7WTo8sgKeSKGdouN0obA7iwAP6A+AABvz3ZY= Date: Tue, 28 Jun 2022 06:06:19 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-06-28T06:06:22.010Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 810b862e-4dc6-4610-6e61-08da58cc5188 x-ms-traffictypediagnostic: PUZP153MB0751:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WZyJicE+gTey1ZoKKLI22BKjQ9EpoXqqYdiZ2OoL/dJyPttk2J1NyywuCZm35/QsD72kD63qkWFTGPKA7Tn0HNxVTDwwXCRXMRUXI/QCxCmL8UQCKwgFS+/OddPj1yXenEdYY5OuOW39mWlMt6MjJ9ZLh3zEmH+ysYkVhhl1Re3a758Y68KyMBeqjQz2tR6sGaex3Jd+QMx8+OntWbwtGsulEveaAOROIIjxImfFg4Xx4uSZuOsnLk1gOp9NG/wONElKYrYBO+dRByNH509rEhBeLNk+CIGhU61FY1UHAK9yx0T/rLGT6yQUcCVU6twod1Hn8QZBOgVH53W3xxhzPZbJiBDVdFR7TA+6DDmVgv+paoLkl0bKR+9CAf4jbXdtt5jZiipUdjHi1vSO1LjsLSVeo+iifG5qA0vgGNs1befn4dKzgBWuEIANZU3RsG9sNdHNBCtTuG6UemzDpYegajm6L5W7iP9dhS0+0VY8zIuQxihs0sFIgDAaCbGLs8KsUayraUExOz5ai4GX3AePcvR9by08XvfQDrBz5Ym3NjoCdfudKyAXbGEmIzWutkJH3CLBRkuBBIZ5Z4eyXNiIPTxqJ/7byZshLukeVaNR6OrEXK1Vu8bDj8aH+Wd8Bv2xpuMhuoRFPl+Ym9K8AcuiU/qHrcHG4cnpNI+qbi0BhIAyLxhknJMZVmyI0mNljDtqY0Jaiv5HfwM6FLdtivEuRlAL5dnVCc8iSbf9ulJ6AxraRc9qdUTBkxISyTsPlPk6bJSy6w8SljCl0h362SZWNwy+vU3iFEaLLstEqD87QUkrGoNzeEeAkQk95w2AG7fDOuY4sQtnaogi44p3yLGO+w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PSAP153MB0536.APCP153.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(136003)(346002)(396003)(39860400002)(366004)(451199009)(66476007)(450100002)(4326008)(66446008)(8676002)(71200400001)(64756008)(53546011)(91956017)(66556008)(66946007)(76116006)(6916009)(10290500003)(316002)(26005)(54906003)(33656002)(9686003)(86362001)(2906002)(8990500004)(186003)(5660300002)(52536014)(38070700005)(8936002)(107886003)(55016003)(122000001)(7696005)(38100700002)(82960400001)(82950400001)(6506007)(478600001)(41300700001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Myz24p3LckgRb6iMZDBYxV4G0nofsCw5dRR92So72Y46BZafN1VUMkW4ZC?= =?iso-8859-1?Q?YbXa4VIqsTy/uznWzlO9LpwRNx3KtqSv+1NfKpCc/sstuTb3iQo33cw/0s?= =?iso-8859-1?Q?iYOiiIjP/fqXMyksnIuTbHPvYjNfWdiqhbnLySfbjH3pEljwS3TRM8iAiq?= =?iso-8859-1?Q?osYoNQTsAGXed2RrnaYH6ploGtlwDqzlMf/xKIBgBAm7OgHshLV3hgPh1H?= =?iso-8859-1?Q?hMMswpZCM/kYMPk/5zK46hUN7HQyFOcUKvw7q0a8+fRUHHMwrgU7IIN+vm?= =?iso-8859-1?Q?SCykyL4x8f0AcKpbh49bhWQ2xAocPrHNTM0iouv8pzrjbUzvHQxqg1wk5D?= =?iso-8859-1?Q?M3ttZMA3580KGd2jOOycGH3SWg92jgtuOrua9ldFiNThWgwAtwxvI7GJTl?= =?iso-8859-1?Q?uzkyPBjrQx/Xqsd47HTUUsNmRjxXnuQgfB6hPtvz9fba+ZkqslhUaaxdrc?= =?iso-8859-1?Q?ls5CvdSyHLklEzWo7rB99QJEDenx6QxkDtWruo1y55y0f/yGZpbhwAE++l?= =?iso-8859-1?Q?szyplKDZAbkNBUA6464z7rIGQKS8wXj7iV27/MGsLab0UVCLYTkbsQ6OO2?= =?iso-8859-1?Q?WpQlxCT/Wa7SBAsbPEQKfzdhccub9w+HKKI4L533qhhpGqgYjfNYBtXFYj?= =?iso-8859-1?Q?uG1geG9m7OESc+y5CUy3lrSaOfl8v99K5oVOupOFC+bXoBsxGK/X0zKZre?= =?iso-8859-1?Q?TnrE3x42q6gLslkChCEWmfAWAznAX0axIycGl+KNjnT9zzGP2MYUeqHJ1V?= =?iso-8859-1?Q?rlKniLkHQTmZCGgHTq8UkIq+02ML1iR3rhhvvHXBKADG3kUExdUnljxak7?= =?iso-8859-1?Q?t1FsDBP5xcpoLrmY1nppXKqgbyb5QSRdoovTVqUDr/MMaMva6shrW2kzg6?= =?iso-8859-1?Q?XbIzXGDU2LqIkBdNMb1ZaCqBVROIvhikJQXKEeVi85yMrxvoZsmt+Nmujy?= =?iso-8859-1?Q?p+eMdKBc4LpS0BWQXVeYSUF2OohianRtMstseFuxUREfSRfiakpLFC0Zyg?= =?iso-8859-1?Q?LR37GadW/8OBX3nO60ikea4Fpz1eslCxXavqyng83WvO+1+ZyFFoTcl6Ei?= =?iso-8859-1?Q?S2htMijsj/AT4jVDc0m1FfafrBRtLkLPkT6QpVNsqHFinGc0DefvJqoPLX?= =?iso-8859-1?Q?jT3JncZ+oXkSm/xcJtGqQ43+7j+r6EWWuLWxwbTWB2mObiyoBfqq7jcO+/?= =?iso-8859-1?Q?Pu1ozhhSJDElJ3l/PRZt1EJf02aF2wdvbU8Ped2iGBjz5gUMrnK3bdZYzo?= =?iso-8859-1?Q?RBSJr22m8OwfRFYZ+8ubJZodrHsumPI3JnTAbQPiou4qukqvPXlpBuiHpP?= =?iso-8859-1?Q?ADb5HCiHiDTzAqivY+6ZO8qo9A+bhELXCp59ZxJq7N+3RHrJVfauiDA33O?= =?iso-8859-1?Q?ZiR4YRVtxF7loZscBU7AivwqkMzM5GqdCKK8lvKnGJ86SU+SKyY4a1m/Xm?= =?iso-8859-1?Q?zhExAPmBPP+i27Cc/0lkupJiWc2D5vSln0GIzikby2azvz833sm+bnGTfY?= =?iso-8859-1?Q?H2duQGMdAfGhaa8EQglwjPUb12qXvFdS7nq8o/mOPBIFHl2OJ06600cmT1?= =?iso-8859-1?Q?o0BlkMCGCZu8NUZkNhyD9FgaZTSM?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PSAP153MB0536.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 810b862e-4dc6-4610-6e61-08da58cc5188 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2022 06:06:19.0659 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: svaDxJXNXKJjG7Z+FU6031SpuXI7oy+B5P4zhHYfUHGK3CifoOcnAIObZ4nMbaViokOLm55IJv1+zYXL9yTxoKGzhyNNCGLfZRgilhv0u58= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZP153MB0751 X-Rspamd-Queue-Id: 4LXDcj2wjVz4RSt X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=microsoft.com header.s=selector2 header.b=M0Fi8lMS; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=microsoft.com; spf=pass (mx1.freebsd.org: domain of schakrabarti@microsoft.com designates 52.101.128.17 as permitted sender) smtp.mailfrom=schakrabarti@microsoft.com X-Spamd-Result: default: False [-10.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[microsoft.com:s=selector2]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:52.100.0.0/14]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[microsoft.com:+]; DMARC_POLICY_ALLOW(-0.50)[microsoft.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[52.101.128.17:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-arm]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:52.96.0.0/12, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+] X-ThisMailContainsUnwantedMimeParts: N =0A= Hi Andrew,=0A= =0A= Thanks for your response. While looking into the code, it looked to me we h= ave smccc version till 1.1 implemented.=0A= But for hyper-v hypercall implementation we need to read registers beyond X= 0 to X3, which is implemented in 1.2 version.=0A= =0A= Is there any plan on version 1.2 implementation ?=0A= =0A= Thanks & Regards,=0A= =A0Souradeep=0A= =0A= =0A= =0A= From: Andrew Turner =0A= Sent: Monday, June 27, 2022 9:59 PM=0A= To: Souradeep Chakrabarti =0A= Cc: freebsd-arm@FreeBSD.org ; Wei Hu =0A= Subject: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call =0A= =A0=0A= =0A= =0A= On 27 Jun 2022, at 09:57, Souradeep Chakrabarti wrote:=0A= =0A= Hi Andrew,=0A= =A0=0A= In Linux we have SMCCC v1.1 compliant HVC call arm_smccc_1_1_hvc(), which i= s used for SMCCC and HVC call convention.=0A= In FreeBSD do we have something similar?=0A= =A0=0A= I can arm_smccc_smc() in sys/dev/psci/smccc.h, but could not find the imple= mentation details of it. If I need to use SMCCC compliant=0A= HVC call, what API should I use?=0A= =A0=0A= Thanks & Regards,=0A= Souradeep=0A= =0A= You can use=A0arm_smccc_hvc to hard code the type. Both the hvc and smc ver= sions are implemented in=A0sys/dev/psci/smccc_arm64.S. They depend on the a= rm64 ABI to put the arguments into the correct registers to be passed into = the hypervisor. =0A= =0A= If your code is running after the psci device has attached you can use=A0ps= ci_callfn. It is a function pointer to either of the=A0arm_smccc_* function= s depending on what is in ACPI/FDT.=0A= =0A= Andrew=