From nobody Wed Jun 29 16:47:13 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 5884D86C53C for ; Wed, 29 Jun 2022 16:47:34 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2124.outbound.protection.outlook.com [40.107.215.124]) (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 4LY6nw0XrVz3h4d; Wed, 29 Jun 2022 16:47:31 +0000 (UTC) (envelope-from schakrabarti@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=arcQ7Z5nUAClCnhXSEz/ja0IbV3+IClZxEKFVBJ6a7oOoA0skgkCISmq9M0L86w7as3wQ36DUzALuIzZzeH4Tw4fjzwrWgvIcbCBPznZLrFkq8NbFiN4a+dd1viQ21G5SwG+oLTAJqQCKRVFW4K3B7aH8LxlOc3ED1yaP1cOMv6SGNZFLqowtKvdFsgwU4B7nyqPRqEWKvI88Tbudk1zWO6KeOAenpiOvx2WV8SphJvwS9f49Jddy4Ck1yV+UCI3SPOTf/XTEcC8ROgzdxcgeu90LvvCK2P6MFXf3X817ITnOe20TQXRDaouA1l2kJy6kywohf/VPRy4DFb3QIk9jw== 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=tUmvwTEzWL69eruvXL2eyc4BhW9iMIAJ/Skf0y2Qy/E=; b=cBNoIOiSHwryXlr2WNpHGviDMktLdwo7ikx6n/LlIVNF/5snaoF0A8uqV9PHpx6MQj1zlDrlBLRh3saDW1mAB1mpdUmuS87yzTvX7wGdfDuo81OWh/Cpf04dc9A6oeIIOYCjWqdN0qt7FkTL107H/PTGvzbbIRdjGOioG3bC8WEXZeimEaW+HyJRiPlYBfsEqd3e/hsF/L8UoTK5szgJfwsD8/K0AEcMZkeWrIxmD8dbMZEoks6kYWKIvu9Yd4kOYdIT7Qs4gKJyKFtVTWIWG+JDaLylQUJ03BBi49FQlyjMll7Sx7X3mEhebQs7tj+k8XUMl4UlUt4r48U50ku8AA== 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=tUmvwTEzWL69eruvXL2eyc4BhW9iMIAJ/Skf0y2Qy/E=; b=A4L3GJNNIRjpE7izBJBG+Be5Tn17DP6sqYCW+O35LCHJYcmy7G4AFdGG65N5PZez3Cn1VfMav0v8D6MokNCZN1a8BNHVVElNdGpR/ygkKkSmrydQXK8A0L2oxalP0PWrBC0DB56VeTLS8imCLYkVQJ1pPzEOgMLDWoGy/aS4p0c= Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM (2603:1096:301:75::14) by SG2P153MB0378.APCP153.PROD.OUTLOOK.COM (2603:1096:0:8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.6; Wed, 29 Jun 2022 16:47:13 +0000 Received: from PSAP153MB0536.APCP153.PROD.OUTLOOK.COM ([fe80::793a:342:7dbf:9919]) by PSAP153MB0536.APCP153.PROD.OUTLOOK.COM ([fe80::793a:342:7dbf:9919%4]) with mapi id 15.20.5417.006; Wed, 29 Jun 2022 16:47:13 +0000 From: Souradeep Chakrabarti To: Andrew Turner , "freebsd-arm@FreeBSD.org" CC: 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+AABvz3ZYASRvJhw== Date: Wed, 29 Jun 2022 16:47:13 +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-29T16:47:12.822Z;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: 8debb211-2f29-4100-57ca-08da59ef0480 x-ms-traffictypediagnostic: SG2P153MB0378:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k1wdnakJGlZQ1FnYzV9B6RMDiw9l2p1gNMwrQ5SV+vvwME9lmjIzneHVseiKQ+9oePjGwPfM6esDX5vqX7ImKGSPms+yO0jC3EMk2mDxZoXSXD7FaupVWRhEA1ebaeVMK2fMYBFkdy/T0XSznkKuiZz+RGFzkVmYTTMD72HyTslBEgAXFiMaDZP+plAhLgJ6s/CsBhg9eTwPVg96zSVjaw2/nckgL/3vM9y0K1u+/MuuUBGlIfU+HFc5ivYwTRoQ21ecqBryqUChQxFUh51UgEu8TJw/2z5JsuIOSFbLPoR8KdfUd1actBKduS13kMBsZ8f0BnAsfKOkGWBSizIzhNaPQDNBt3i+Z8jtoFVA10p0egd9vaxhilmjxT0Lys2U47LsP9bA9CG1nFKD7h/wDIxHO2uiBl0Lx7O1NhecIFKIkwjSC5yypB4z7POpE5jdifeediRgcvuGevHMao1tr2m7bMcCff+4qCQUduTBzkvllMKigGT6KoNXXyQQoM4/y5CpuPu2XKKoTXHb/8yj9Pg3ol5tmRIF8yFcEGm5JR0dN45JER/KZyxhr4UoLkNaRMqvAFOU54Kf0ErssCkjJtLw52Qlzr6SLYiDGDln2hhDt3tq30/+Gd+lewn1VqyExcY2SxQzrewTd43sG4l39GgKiQsjHLfsXh83BbFVdli5wUarhEWvg3vrgavz/CpntjZNoxpNWklJe4eiWEqUtXEwtrsb5vJKFBaK1AhfT9sU6zKoxKCVEi6vp1cFT6TdqmLWZj/t/tXMb+uYU20SVtNt8y3BlYI2YOZAjgsT1gRvrfn4XjCh7cyD7yVCCPDYsCboK1RPJw/BH1h73IExgA== 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)(366004)(346002)(396003)(39860400002)(136003)(376002)(451199009)(91956017)(10290500003)(478600001)(316002)(8676002)(450100002)(38100700002)(26005)(86362001)(66556008)(33656002)(71200400001)(64756008)(76116006)(186003)(66446008)(66946007)(107886003)(66476007)(6506007)(41300700001)(110136005)(7696005)(55016003)(4326008)(9686003)(5660300002)(8936002)(2906002)(52536014)(122000001)(82960400001)(8990500004)(38070700005)(82950400001)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LQxGi27D7sJyRuZUNpsLFTJXDtR1ooXV4RMAWBVZMhyvsLQ/LDDxpujqZi4n?= =?us-ascii?Q?KFEVvIIjbJ+VJNdBIz4R2j/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xY99nllZ+PlQCvvvaVicslWZSuvBI8fttTW259iaRYESpy+JeNNoNkb?= =?us-ascii?Q?Qai5hv8JehR+DNRo8sMw37z7NBxDX9xvNEf8aTez6FuIfCZcjaD8EjyUYmsC?= =?us-ascii?Q?YEq9u8k9BSti275mOhbbJyoARUOWHsm9pz0xyXOuTLDESrkbvrN132ZFOKPR?= =?us-ascii?Q?+F8ITqA7FdKJE2J27WGyiNxhAFE3d5Mvb4WxzrIXCblk81DfpShLyvq0Aevc?= =?us-ascii?Q?bjUY8wRsPym8FHDx3mGbVEsdhhvLliL3K4IkBNRV23Qd5BHNS9ENfkVbJe6Z?= =?us-ascii?Q?ajjMfRhXjcZ38+/msHpYtwJU68A12pkFibzARLGSgIAofbmBgEVOfZNa0SEa?= =?us-ascii?Q?pT2UVvuv2PpprrKtt1c4erqaNgPvNKVxrXoKIg4lJ5l/VoVcZBfUmg2Hrtf4?= =?us-ascii?Q?YItA0I35Bgp1NFvcT/2q+GX+GY8qyeB+VkdmXEIdwG1q3TYKDYTNhVdz8HoI?= =?us-ascii?Q?AfJ/u9ff5yr6RjhfSDwepiCSUFT6WtWPco0eydene+dLNmJ5cBFSuEK1YiN5?= =?us-ascii?Q?ERUHlUqmaBCwG7pt/OzgYBB2fEjLcoVu90Ke?= Content-Type: text/plain; charset="us-ascii" 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: 8debb211-2f29-4100-57ca-08da59ef0480 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2022 16:47:13.3766 (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: h+M/O5Q0iDQgu7C05bvEwjHRbPHL/Mw+09HTEY6lf7mS8JPba5M3QcrLQyh7D2AR6z9Sgel8sEV2TIOebJdxmmP7u7QfeLbz3yhqi7YlnME= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0378 X-Rspamd-Queue-Id: 4LY6nw0XrVz3h4d X-Spamd-Bar: --------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=microsoft.com header.s=selector2 header.b=A4L3GJNN; 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 40.107.215.124 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]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; 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)[40.107.215.124: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:40.104.0.0/14, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.215.124:from] X-ThisMailContainsUnwantedMimeParts: N Hi Andrew, It will be really helpful if arm smccc hvc 1.2 version is implemented in Fr= eeBSD. It is required for Hyper-V HvCallGetVpRegisters hypercall. Please le= t me know if there is any plan to implement smccc 1.2 version anytime soon = or not. Thanks & Regards, Souradeep ________________________________________ From: Souradeep Chakrabarti Sent: Tuesday, June 28, 2022 11:36 AM To: Andrew Turner Cc: freebsd-arm@FreeBSD.org; Wei Hu Subject: Re: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call Hi Andrew, Thanks for your response. While looking into the code, it looked to me we h= ave smccc version till 1.1 implemented. But for hyper-v hypercall implementation we need to read registers beyond X= 0 to X3, which is implemented in 1.2 version. Is there any plan on version 1.2 implementation ? Thanks & Regards, Souradeep From: Andrew Turner Sent: Monday, June 27, 2022 9:59 PM To: Souradeep Chakrabarti Cc: freebsd-arm@FreeBSD.org ; Wei Hu Subject: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call On 27 Jun 2022, at 09:57, Souradeep Chakrabarti wrote: Hi Andrew, 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. In FreeBSD do we have something similar? 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 HVC call, what API should I use? Thanks & Regards, Souradeep You can use arm_smccc_hvc to hard code the type. Both the hvc and smc versi= ons are implemented in sys/dev/psci/smccc_arm64.S. They depend on the arm64= ABI to put the arguments into the correct registers to be passed into the = hypervisor. If your code is running after the psci device has attached you can use psci= _callfn. It is a function pointer to either of the arm_smccc_* functions de= pending on what is in ACPI/FDT. Andrew