From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.13517.1681833764958218574 for ; Tue, 18 Apr 2023 09:02:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=O7rQXHWq; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: andrei.warkentin@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681833764; x=1713369764; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=0dpOp4434i6tMMWA0OuOg4/bBHzca9PpaG/04rA608U=; b=O7rQXHWq6k5qHq1i0waKSo9oxFL/r0TcYyQ38AE3NYHAX9yPIks9OtO/ eg/TjfxB0XbVeCpOj4iMNdpBwzH7wQfyXV+JLMZJwagbC3y8gQ3hWP1jK koD4dHtT7/ss8OZuEFL0ZAw/71zjXnHgmbYuG7m1IxsYettK/+lhHp0pv YwKnvwgcmR+w2xyGSoFuCCMLAHVAvqAXOHfuiGtRC2P1qplDtn279a122 Eq2VY3LhHuGSM2DYshcJwhsmI1VCg2UjfchJ0ATf0WuCjN6xRgTHDEOJc 0Gzg8hMk7KaWyri/2VQ1wCwaV4VYb/4kPf3dbbBdiCIDnhw8fCUxwqscA w==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="410438486" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="410438486" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 09:02:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="641403305" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="641403305" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 18 Apr 2023 09:02:33 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 18 Apr 2023 09:02:33 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Tue, 18 Apr 2023 09:02:33 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.109) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Tue, 18 Apr 2023 09:02:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h4sl9cImoUHTgDB9TVo+Beh9BejRV6CoK/SDj1nW2VB951wgrSNX54EaVh6sBF1jQR0VgRQ7z2Im4oo3ra2YdVSLoTyzJ0RzJbUcZOuKuPd1cs8A8coBK550BmeOjncjC4UWP8E9nXs9Tf1NInbICDH81L7/eV2vbBBD6V7e9h2rNfUcAhAjsaZq4YTTCnRPHiZk/3NiENPjtHTusIttmgp8hFzlp7qWZrPipplGnq1l9NVsbiyfxFrP428Nvpm8vsH0EBXjBJc1w4FW75Ghh/+bhijQ9vidCysIgDPMhVZqrX2ibE5JMFpOK05m935R+ubR9uvRm8EFLn2Mr3nNdA== 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=dBt+87jYeppItGgnJC3i6W8dnhQiQMKPuKymIJm/i7s=; b=kFMnR6vPJv6nQ2ocv8xAhIpo+qAodIDFzuFPV3Gz7AmHO2QlTJyi1IDkvGq6RP3aYa+vugfsdbBNgvLKJcU7fpCOOBUIrLAeidnSWwvCsE+gOGwNFOGbBSa4ml0Rpe1ewADsrKG9nS1AtyzwFkczj4JoRIuJjR00sZ77FGaZIcldLQFcTQWBeTXbEmLZTrwz/zRU18Jtz3T+urxIhBFnByCuEyR+orxyaeOBudzWkxnO8vFI/ChECEDtfeQV53sMlEbfxXhAlP1eW4BQqVZjd5e5JubI9tgL7EHduCWFMo0cTaWho+gbgG5X+IPSCq4wiXvnj8ZuKAv5Dn5kZxNhsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH8PR11MB6856.namprd11.prod.outlook.com (2603:10b6:510:22b::7) by IA0PR11MB7258.namprd11.prod.outlook.com (2603:10b6:208:43d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 16:02:28 +0000 Received: from PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::f794:46bc:90a:c3a3]) by PH8PR11MB6856.namprd11.prod.outlook.com ([fe80::f794:46bc:90a:c3a3%6]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 16:02:28 +0000 From: "Andrei Warkentin" To: Tuan Phan , "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Gao, Liming" , "Liu, Zhiguang" , "sunilvl@ventanamicro.com" , "git@danielschaefer.me" Subject: Re: [PATCH v2 1/6] MdePkg/BaseLib: RISC-V: Support getting satp register value Thread-Topic: [PATCH v2 1/6] MdePkg/BaseLib: RISC-V: Support getting satp register value Thread-Index: AQHZbwMmBO11uQE+kkqsKOUTkIZd+q8xQBCg Date: Tue, 18 Apr 2023 16:02:28 +0000 Message-ID: References: <20230414185815.2994-1-tphan@ventanamicro.com> <20230414185815.2994-2-tphan@ventanamicro.com> In-Reply-To: <20230414185815.2994-2-tphan@ventanamicro.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH8PR11MB6856:EE_|IA0PR11MB7258:EE_ x-ms-office365-filtering-correlation-id: 92c4c838-18d0-43f8-1079-08db40264f04 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JqrEi7SJEYGcgeTTtLBanluHEPdATBbn6k+ZrRGOFd38FgxflAs9Jpbvp0chliBuSexQ4uxBC1sFWByZ4NJ+Pb7/fUW0D1D9dtocwCqx2gpFGtbVrHRuaxF28XCa57Eo+ZE4rLp87LMKoG7/zxljrgHuEdlAW//J64/SziV7LmrmDrW52IDXZme+b4toBDl5nWnhlFGbcjWGbvaI0MzUkP7opjqlCGWRalIycomR3syD/0U3KR4xivZjx5O6WSZs47bzW43DVibFHMWi4KM8mHxCs1mDiUYrrmO5VvU10Af/sxcBq1BYrfpJvJ3+ta3eM6pJxoPGSjpnV8MsIV2y5mfnnsAZ7mhUBrRJl2kDglBwlrhldb3p1Htw5Yte0xyi6FNrZR8K+h5pNFdLgPwKlxvcPGiexfoI133zVemNALZqEnZLHnRsQ6aLh/jCKMuB1PjaoNczNvCQ8zaojAOhiTzCAKfyD4YzLg/i4OL9djzq99a+mGSzYIk9pmnyn17/nAr5/ulKPTzj8U0tHcBxhC36TCWkEGFT6U2SdkoRYDtP5CyFTDYLIOv1tLeY9zhE2w6AEkwvsPcxyQclrR0578udwPtI696MqyuHlQpJ4I1Yn+nrXzf0CeIQVoNIXDnO x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB6856.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(366004)(39860400002)(396003)(451199021)(86362001)(6506007)(26005)(9686003)(83380400001)(33656002)(53546011)(66476007)(38070700005)(186003)(2906002)(7696005)(5660300002)(52536014)(38100700002)(71200400001)(8936002)(8676002)(478600001)(54906003)(122000001)(19627235002)(110136005)(82960400001)(41300700001)(316002)(66446008)(76116006)(66946007)(66556008)(55016003)(4326008)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XO1jubHzvUEynftlBjKT8f4BXlvjYaNG8rIcF2KP0L5NtVpFHyMVQihEDFGY?= =?us-ascii?Q?Tf91FhV/4cFsdJmxj6pnhmblNsPNi20FwzfNfd0WXy09QaGcXLw5/uRWnBME?= =?us-ascii?Q?wyTi1lNdPwzAnLo2AkhbCswzr0P/sJLbqEG1j3L6FRS/YsOB7ra597VH4kfY?= =?us-ascii?Q?5f2iVK1I/CDKv6GXNgv7D2sJvrDZuhdvzjHG6D6McPYumD6hgyobTHeETELN?= =?us-ascii?Q?A6vbsnVHlLIRNwIBIKGFf85I6ZAtABlKhuKMF4INl7scJRDfaaImFa1pZoVC?= =?us-ascii?Q?kWvKvHo/JSLsYvKASiasSF1/I1868JXn815uYopkXhThzEvlik/y32RQobPZ?= =?us-ascii?Q?btU2VJzwFFqeVXbyASt8Piezg+BcWqMBZVWUsVnOwmwxSTULCRrXjJDXsc6M?= =?us-ascii?Q?DrrnZSvPHHvQuVrk9PSaVyUPuhCf3iAonQ2Qms28tKDE41Sy2VpYMWdWdmUv?= =?us-ascii?Q?6e07BH5mxARlod4vq8nOi9olq4IgbRB2qBsBBXIhbOio82RpOoknZWOjLEPk?= =?us-ascii?Q?KipyoNMHRyFROeXt5tF/vLWsDCQ6o/XB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-ascii?Q?ehrL95BJRI7mCvze11IKGwv5nsV/AfJRMRw1IiXeLZHNzRmbLoFd2Ld2GvI1?= =?us-ascii?Q?Co/H18lKMAxuQCuKTYT8HFVcfVcnrcnuGZsFxFqnSePh9kFVEk04Iz09ND+E?= =?us-ascii?Q?OOHsLxURBaXRw6bqWyimZiFT4l3nkBx/VGPlgIqU8k0kEhfzaFi+DKacJL2G?= =?us-ascii?Q?kA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB6856.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92c4c838-18d0-43f8-1079-08db40264f04 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2023 16:02:28.1653 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: byl6WeLuNri6iwCW99BsggiT+lSF35z1A1QU1aceciP+ByPk0J4rcq8ddrh602MKyUlIYxx42JYJrr6pyeNrmkwZCycapF7uu/JjTp7lXNM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7258 Return-Path: andrei.warkentin@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks reasonable to me. Reviewed-by: Andrei Warkentin > -----Original Message----- > From: Tuan Phan > Sent: Friday, April 14, 2023 1:58 PM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Gao, Liming > ; Liu, Zhiguang ; > sunilvl@ventanamicro.com; git@danielschaefer.me; Warkentin, Andrei > ; Tuan Phan > Subject: [PATCH v2 1/6] MdePkg/BaseLib: RISC-V: Support getting satp > register value >=20 > Add an API to retrieve satp register value. >=20 > Signed-off-by: Tuan Phan > --- > MdePkg/Include/Library/BaseLib.h | 5 +++++ > MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 ++++++++ > 2 files changed, 13 insertions(+) >=20 > diff --git a/MdePkg/Include/Library/BaseLib.h > b/MdePkg/Include/Library/BaseLib.h > index 8f2df76c29a3..5d7067ee854e 100644 > --- a/MdePkg/Include/Library/BaseLib.h > +++ b/MdePkg/Include/Library/BaseLib.h > @@ -181,6 +181,11 @@ RiscVSetSupervisorAddressTranslationRegister ( > IN UINT64 >=20 > ); >=20 >=20 >=20 > +UINT64 >=20 > +RiscVGetSupervisorAddressTranslationRegister ( >=20 > + VOID >=20 > + ); >=20 > + >=20 > UINT64 >=20 > RiscVReadTimer ( >=20 > VOID >=20 > diff --git a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S > b/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S > index ac8f92f38aed..c9cf60c1664b 100644 > --- a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S > +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S > @@ -21,3 +21,11 @@ > ASM_FUNC (RiscVSetSupervisorAddressTranslationRegister) >=20 > csrw CSR_SATP, a0 >=20 > ret >=20 > + >=20 > +// >=20 > +// Get the value of Supervisor Address Translation and >=20 > +// Protection Register. >=20 > +// >=20 > +ASM_FUNC (RiscVGetSupervisorAddressTranslationRegister) >=20 > + csrr a0, CSR_SATP >=20 > + ret >=20 > -- > 2.25.1