From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.16663.1630328560050081521 for ; Mon, 30 Aug 2021 06:02:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Sxgcd04y; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: jiewen.yao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10091"; a="205480346" X-IronPort-AV: E=Sophos;i="5.84,363,1620716400"; d="scan'208";a="205480346" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2021 06:01:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,363,1620716400"; d="scan'208";a="459370587" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 30 Aug 2021 06:01:35 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 30 Aug 2021 06:01:35 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 30 Aug 2021 06:01:35 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Mon, 30 Aug 2021 06:01:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VGMoabV7XBsikCUSKfhER6unagg/Q2tFQWr7OMwAPEMtyXjOJ0MxwV0yFtPcUXhbSHIj79dD6+tQMNt6et2JaDxv9L/nYfbMRzK5fE7jKXhwcnfDY4qCPZPCL7RGAZwF/Xd3tkYsufUPQMPmxWOb34BYInsQm+0OzFVusc4TicnhXEXVTds5I1ihWSifkNEkowS8aOe5OaBTOyuXW0nANE6uXfBZtDi6DYIpgUgg7rz4WSq8TFL8OQgTRe0k81LFdWVVQx1dqtXWSmDxK9QdsjDCY9u4Xuwfe942/XczMFwNdsBXY1rAakpfqQfx2l0ZOTnA8zOtUaX7sC2Cullq/Q== 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-SenderADCheck; bh=lQNQN/KbKbwigoK8WxSzwuVhvZb0/4jvO8uZoFRKe90=; b=ZhOY+uck+9XhdR5oK/lhn3WnEtT/xLvXsaLsbFltewYZxOEWqMIY8WAkw1cNHrn6NH152CD/Ev/7cs8mWwJmcNxVFtYChmjWT9qSlh3DisosVnQjnBhzdPPK42RMnbi1vXNzXHtY/8uI5ujS1pcNXS3uBA2YAVwLyLve3aSMnk5IMiowXI/3RrJV131NOZM5HYaR5GOrM1yo67yDpZ2gYTEblK4jzU65G6m7t/zfxm/n6DGnELGiZ3AWAHbHeLKBJ8hGeBdi0XJSiq1T5P88f07vs6P3yVl0egt3TnT2Fz3Y6FNJ1KZwhApqL6FzfVsM51Aj+sfH0SjAwyjYVNBRMw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lQNQN/KbKbwigoK8WxSzwuVhvZb0/4jvO8uZoFRKe90=; b=Sxgcd04y17whMiDpr+o+oYDzb3ijwIjpGJbSF8PrlJebfqNuAxtsVhE26tqf6skMMcazqkdfmITMXaQwyVsN8CexDUuZ5/ErwGrCtt/pCPGFEQfjDE/y6n+Dlzi1f6+j8Uf4eAvjSkcpU5BlSlIee85R7oQMz0Bh8AAVeS/uvY4= Received: from PH0PR11MB4885.namprd11.prod.outlook.com (2603:10b6:510:35::14) by PH0PR11MB5015.namprd11.prod.outlook.com (2603:10b6:510:39::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Mon, 30 Aug 2021 13:01:33 +0000 Received: from PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::d445:88af:f26a:103b]) by PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::d445:88af:f26a:103b%7]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 13:01:33 +0000 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "kraxel@redhat.com" Subject: Re: [edk2-devel] mmio mappings for runtime service Thread-Topic: [edk2-devel] mmio mappings for runtime service Thread-Index: AQHXnYkoFRNUOtr8RUiRyek/DW7sjauMAT8g Date: Mon, 30 Aug 2021 13:01:33 +0000 Message-ID: References: <20210830102350.z6rhkeebav4mziu2@sirius.home.kraxel.org> In-Reply-To: <20210830102350.z6rhkeebav4mziu2@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8b81547b-4167-4694-b042-08d96bb64b1b x-ms-traffictypediagnostic: PH0PR11MB5015: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nBWKuDYbaZZa6IKa5AGBTwk7s/5kdbDS3iB5POmESZpqN/U3eLc8yYgMdwL5CcI/OlP0P42usaKDGAPz98kZNzzD1L1npuE4Sc7vAfNqZ89zHQ1TEScw0Lrj8k32Qm5cb4r4vViMPhIkkvcNAtzsB/y5qb+JeuZsgIrMoXjJU6iD6QjADLCfif1ywF+uK19gJ39XloptUs8oP3Wvbn/TCyK6loRwygmldRPZkA7MmYbO/fwhMJ0gATVHqwhonuEDoiuWQ6/ZYHowEf2dPMjSptSLtS+SNcOcwphEG7xHqNnlXVi6kxViO5PsHVB1hDbkfIpbnQN64AUwhuwKg3VVPIFQVr489af0eBvmugsWa4sGgHqcKp3pgyGpX5NGQo5b9ft3n5m5Ks1XxHefBI/5xmmeJmCTmhSOjHyWCAAwaN+p2RxnzUFx/hIK4Set1QrH5bqMDJw7GzB5xDVqxqNx6lIn0OnEVL0qINKR4VhAY+4xMmiikb51SJf0qYiV1iExGX1bjaa/q2WtQ8CNLmlENYRhZ6x3vU2B+OV2uzlYUKIvkyGW/j9tQYREE59KvCs9YMj/AjAm2HZTsXjjo1i+5vBNPnsykyhWSyR5PPM4YPJuo6WGSjW2eHUKvx75aUixo0WHQRYwNV94i/1jkpgSjKQde0Te0mHEKBLNzTijDrI033TIQMPyuT6/O8JU4ivZLezaWLfUR3UnKLK3jPsq2wyrow4aRAVmw78iIi2VErVCfnfbqBgQkDgfTZwimHYuaNSSPvFs1bEwl9LdFNoIx1wCy2xNvCIUXOpmU4qwvLYD1CM4p43hgKkxpXzZNzXKwhOdGQ20ouwW3neRL/A/Ng== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4885.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(39860400002)(396003)(376002)(136003)(316002)(66476007)(6506007)(64756008)(66946007)(66446008)(66556008)(53546011)(38070700005)(122000001)(186003)(7696005)(26005)(76116006)(110136005)(52536014)(38100700002)(71200400001)(5660300002)(55016002)(478600001)(33656002)(8936002)(966005)(8676002)(86362001)(83380400001)(9686003)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?msQb+IhR4oeIcwFirPojaFuEQV2mX/KYx3LRmkxtf/ejITBzLdWh+9OxPlUO?= =?us-ascii?Q?MSFkSwavjpgciXTsqi3dZugel5XLKfVNwgNiPTWhlGbTalCiFYn5M4ZvdoRg?= =?us-ascii?Q?jiD3KGgA9gypAOdwYGEDr1lUiJddcFfMqksn+tUo9H840kTuxoNBasAB28+6?= =?us-ascii?Q?/+GC3E8zXb02SakIDmfxrx89xlR3oJs5tGbyCjGk6X0AY4ZfClNEPZ11+jvs?= =?us-ascii?Q?BvUSUZgXVcvacj8TZabx81vhRD9zvtJFYtwUiS77IvCCT1qbS6I/tquqjgdl?= =?us-ascii?Q?miHalP9NXP4ws0f+3AqBOchcTd2hzLLD5NVUA4UcSoaOTTzEb3Eq4NuylclH?= =?us-ascii?Q?ikdWp6EKk3Y8bhcyYJqMvDEi6rYAioan+siGuf6CjaYyB3LQ4jTm04E/n37W?= =?us-ascii?Q?MgzRQRSmxmB56jemNaZteoGCnB2dzU3FELkgnca1zbU8s3/dHamhYjMd+qXY?= =?us-ascii?Q?Om+hECdkN516vXDba0ZL5OvpgaA6dzV1UX5Y2PqZsmGRnBSK8Q6T+w1XVs6F?= =?us-ascii?Q?3gO/zwK8kyoHg2JokaVYG7RSv5uFFW6KDWF2i5fkmeyMZgx5b4zUVOM12mCZ?= =?us-ascii?Q?iAJUYMiL8zOJXZXYmo2h1HutjFKRQs+v4sxDlIq8Rz3oq4pEBy56gRLXiWDI?= =?us-ascii?Q?bJBmcOOs3Crr+awZJ+kFUMZgl2kOTa8dg6apWwJ+TPuxxXWtCSy23Ha7sgCy?= =?us-ascii?Q?L8jHHV7bSmu6N19nuDnLVMi8Fd2laUPxOl5euuQ1zbg70HSCxqgzc32v9Qft?= =?us-ascii?Q?QSQSy3R2tPDanRQxEvdLxldmRiOmwv1i+39lnJW6gdLYykOGaDrd5j3mJLPp?= =?us-ascii?Q?0e+4qLxgJA2Smq1k/T65irgvVX6xggRq1Ok9OFzAWIzk1LqsSl7xkOtKFUZa?= =?us-ascii?Q?XmMQ0yoJ1EXXrgnjErKGckrCpIGyt8WroDgJOYfgIZieHY98/dLDOAdBL24X?= =?us-ascii?Q?nv4dibBzKA7dMlKXXhx+lprIb/Puu8VZ6llyJgg3bRY2u0QB3eLwHz5mempp?= =?us-ascii?Q?QmqH3Pr55LWcnx3UzGAxNWSwChf/vsKwOtiPEBP6Zh2Yd0SQU0ywNU5HDhCb?= =?us-ascii?Q?ax26XEXAKzeLiSoujIgVTCd/h6XmtgoU4sWzyesBuKraopPPOPJbviWhIhVT?= =?us-ascii?Q?PnGktMkTA/y8uRxug+yhVhlr3092POT9V8Iv5IPYKkHyEIuQaM2gxpPE1LRI?= =?us-ascii?Q?wYqxQR3oEnVS4fya0KD7J6xYSe2SHpBqUOJhlOp2billzA9vDedwsfpnEqT2?= =?us-ascii?Q?A2X9E1RVgBCBw1ufLUbsn8h/e3JRS3A77N7BSiu2LNbDcVq+LJf9ZzwbQPdd?= =?us-ascii?Q?htPo7tVOqlZgXxOAuf03vlqs?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4885.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b81547b-4167-4694-b042-08d96bb64b1b X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2021 13:01:33.6736 (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: LpQJhj3UAVA6UoEOBS4zIIy58J9wHQ/4V6RO22LEH0vTIDXXggmhKKkFyY0qfJISLkzJ6a277tm0zV05mEgCuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5015 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The BIOS driver must set EFI_RUNTIME_MEMORY attribute for the EfiGcdMemoryT= ypeMemoryMappedIo region with GCD service gDS->SetMemorySpaceAttributes(). Then DXE will report EfiMemoryMappedIO with EFI_RUNTIME_MEMORY attribute in= UEFI memory map. The OS will gBS->GetMemoryMap() and assign virtual address for the MMIO, an= d gRT->SetVirtualAddressMap() back to the BIOS. Finally, the BIOS driver can gRT->ConvertPointer() the MMIO physical addres= s to virtual address, then access it at runtime. Thank you Yao Jiewen > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Gerd > Hoffmann > Sent: Monday, August 30, 2021 6:24 PM > To: devel@edk2.groups.io > Subject: [edk2-devel] mmio mappings for runtime service >=20 > Hi, >=20 > What is the correct way to make sure runtime services can access > mmio registers, i.e. that there is a mapping in the page tables > for the mmio page needed? >=20 > Is that the job of the firmware? > Or should the OS calling the runtime service handle that? > In case of the latter: How does the OS figure which pages are needed? >=20 > thanks, > Gerd >=20 >=20 >=20 >=20 >=20