From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.13081.1631115244723829884 for ; Wed, 08 Sep 2021 08:34:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=KZfApQSG; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=08858f7fb0=abner.chang@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 188FXCDG003692; Wed, 8 Sep 2021 15:33:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=+8QAO8eeH53mjf0Qtmny2te6ZK7Pgf36716UX8kB3Wg=; b=KZfApQSG0dXOAVXDgJP3LTtZg/wy4poObvLr2iWHr3Nw/6fRS1Xeiy20rMycgLcJyvYn VUaPgBpA6U3lt68zfOvpmITLnFIJNlo2Dh02KIA5OuQmjEh/rTBIbPrW73gfW3fb0BuX MMo7bYlJxlF1MPfh+ckiNpRu2uc5qtwojFQDPVslA5kqkvI81vXOHFCyUQSrMZABmckQ ge/gpoqWILMDWhC0ZVZuR/CROvbUhThN6LH0AQPSvzYSqLIdc/eSuo2PTUKa7WbrQOG6 GSA89j3O1kVz//MoZWngHw+A408+RvAHNM67lyRvzEmphv9qoDKhH/Mc99J6lBdq78DO ug== Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 3axcp50kn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 15:33:45 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3425.houston.hpe.com (Postfix) with ESMTPS id E08A5CE; Wed, 8 Sep 2021 15:33:42 +0000 (UTC) Received: from G4W9335.americas.hpqcorp.net (16.208.33.85) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 8 Sep 2021 15:33:37 +0000 Received: from G4W10204.americas.hpqcorp.net (2002:10cf:5210::10cf:5210) by G4W9335.americas.hpqcorp.net (2002:10d0:2155::10d0:2155) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 8 Sep 2021 15:33:36 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (15.241.52.13) by G4W10204.americas.hpqcorp.net (16.207.82.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18 via Frontend Transport; Wed, 8 Sep 2021 15:33:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K9rSuaYGcJzK/9jdS9O7/cJ3OwtwScCQ6acNrlIQtfMYIe70kfwlQobJebzBpO8ZQwLed4cmtMQQN6QbbJ6Gti1OmI1GL1uVSx7GzMUJotV6x/jEqmOiu/bpR1G6q2oKUy4hYlp4S/5t+PF+WptoQWYNudskP85NtkG+gO6C+weXnHd3qhmAU+CcDHBxnIvU1rOOdo6RMs3mGjYAIINSTbcptLIrt2bRvVwjAQJ30MQEr/UGGgjZWKliBZDppldT+YrQuSZFtUAD7P5zbTXuGr1TMg2HGVNQLjPZeygIhInWvEMH0m+wQzQmi5Pe7XS1YIA09J5QuRZPdCu5fPDzEA== 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; bh=jyZktpSnEF4+bhf6JYWY50eUe9pWLY/dswDC82vgpy8=; b=jDWUtj12NtzSHO5eEwCwnr+izgbpocovPZz171Ui3rrvm0tMgrsz0O/6dF+MhMleos4airDJapVSxnAMDV7m+fUfU2j5br1nyREOLVtccEOcKTQvyxJ+6vCf3VVBs0cbeI+AooIychFdl93U1RI1M72tdhsVakcoR2d4HMlw6ahpnhZKc7j08sVgskW0VUYXEaYnOpgwiXGFlIjATR9wmzNBe0ZYAiuGZOR8geXkkbBOA1HZ9sVuOoqgK2T3aHxWBQxYJ9xKzv9aPOdW5hXej8BDBfo5h+iMDbL8+ggUynvsG5Hy6R22xZVnRSPlR12WXCJaT2FEiurmAVlXkkCcEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7508::16) by CS1PR8401MB0584.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7507::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 15:33:34 +0000 Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::b88a:7fe7:6294:683f]) by CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::b88a:7fe7:6294:683f%9]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 15:33:34 +0000 From: "Abner Chang" To: 'Gerd Hoffmann' CC: Leif Lindholm , "Yao, Jiewen" , "devel@edk2.groups.io" , gaoliming , 'Ard Biesheuvel' , "Kinney, Michael D" , "Ni, Ray" , "Schaefer, Daniel" , 'Sunil V L' , 'Ard Biesheuvel' Subject: Re: [edk2-devel] [RFC] RISC-V QEMU virtual package Thread-Topic: [edk2-devel] [RFC] RISC-V QEMU virtual package Thread-Index: AdeiA3r7QFRZVQLaTkiMKtJbfsb/KgAt/HkAAAZrB1AABGB0UAAH6ySwAEGp9IAAI/PFcAAGd5qAAAOU45A= Date: Wed, 8 Sep 2021 15:33:34 +0000 Message-ID: References: <005f01d7a2bb$6d8e5ef0$48ab1cd0$@byosoft.com.cn> <20210907172229.geh4zcz7pvxoyyj6@leviathan> <20210908133705.kc4unk3nizradc4j@sirius.home.kraxel.org> In-Reply-To: <20210908133705.kc4unk3nizradc4j@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=hpe.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f6eac2c6-50d1-4f25-3d93-08d972de0567 x-ms-traffictypediagnostic: CS1PR8401MB0584: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eaZZERdNExIY+J00ADr/DatbHWextPngybC2TAxko/pllftV2BkHmdCaDFlrvQlPYJSLJjL+6s3BZ32jWrnK5ucUh8HAo0JtR6g2GDsDMcsiYAhNKuXcPrb8pZb7cWnl/Sj+XICbieYn41jaLX68wlRdJNmZNACPAnH1fDFxHfqbzm5bz52FSP8wrRGvzmAmgy8nTokJ13WM0ZfVNiLb4SI4DTj6St/ALuVsyRUGSWQnsQp/0auejF+QZXrJaaEJ+PB9Zd81iZNLGxXchBlqkz99cAimQnrIa9gu6rw6qYOyKjeWFmedzEQJRCnIINrYCqxr6/vqcDMzlTcZhV9tjWZUbeGoSziGDb084S5jKyQgXA87vyEG9DBD7JvpqllfQxL4u9JkpOMUhW3cg8NynyAH59+VBWz0r5/gpIsPdcrerGCY1qWGLf6nST1GWjUpokemuPJ4KRAKZCY12MkKQIcvHXAwOrLT/8MMUiiA8oJu98gP8xyAXlKdTEuG+wmhp4WOs9pD6pk5kUKbSnZfZSFLkZ03+9C43XryrJ/pINEcZcCWYIFrVQAXLtb7ZBq09S2s97AqzxAOeswQJhvCgonWNugzgs9xlsi/KnaVtpLBDTJchD9ALX5GSFJ0fiipGLWCVmpCi1wF7RHMXd2OlNgvVTsWFr+G7t42/aPuF1hH/pYP8yNjJQuWPK0uB/vXlDNWTyoy32q3nNx5GDUHpQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(396003)(376002)(346002)(39860400002)(136003)(7416002)(478600001)(76116006)(8936002)(38070700005)(66946007)(66476007)(64756008)(8676002)(66446008)(55016002)(54906003)(7696005)(66556008)(9686003)(4326008)(2906002)(83380400001)(6916009)(86362001)(186003)(26005)(5660300002)(38100700002)(71200400001)(52536014)(122000001)(53546011)(33656002)(6506007)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iRAWDLiIu4skU6ATh9dEjJ+x8TGZMzC1d1RgNSEvYy+CtnFsU5f14xbnfvB0?= =?us-ascii?Q?Cer063QKvWVgMfMw+vM+4+vtF6A1bQxxGVtn7y8+L6EDQ9ia89tJ5CTOi9eK?= =?us-ascii?Q?0zMzCVo0wnjeX+gCftcobepzT8mEL+1nxmwYHd4fUqryTSEcEf/ZQwnWmGOW?= =?us-ascii?Q?eC5tDFB+jBP1RIyIxv0MGROj4ggRFtt4ezL/DvX7puZsECw/i4JWd7J+921H?= =?us-ascii?Q?s3FDbeRreUWuFuzuOIvAQ4CQM9S9yVSHeyWDlvpRGBAliA9DX6e7RYTrbQxI?= =?us-ascii?Q?f8Gl92JXvQrPV9R30iq/JbLRZ6OlnQx0qbwRbrjIRdABGVVuEy8DSImF3JC6?= =?us-ascii?Q?wgULCNs6NO5DGN7/9F3wJohi3Vix3M8HW/dt6a3/mTaKybL8z0TGyJinPwTL?= =?us-ascii?Q?2t5wkw/Ivukrp66wPoit07d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tX?= =?us-ascii?Q?rAM1Jg51BQ4nsjmXDeRv+ZBT?= X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: f6eac2c6-50d1-4f25-3d93-08d972de0567 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2021 15:33:34.7394 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LgHfWRWEucgQy6OPXda/XK1piivnQTnwsrtlze8EfvNvpV+LBPz9t4Srv+/hwDCKJ2IpWLwwslNeXGGqE1Pzfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0584 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: 7XAcY8ww9XO_3lpHoxq_GkIYmWr1pyzQ X-Proofpoint-ORIG-GUID: 7XAcY8ww9XO_3lpHoxq_GkIYmWr1pyzQ X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-08_06:2021-09-07,2021-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 clxscore=1015 spamscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080097 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: 'Gerd Hoffmann' [mailto:kraxel@redhat.com] > Sent: Wednesday, September 8, 2021 9:37 PM > To: Chang, Abner (HPS SW/FW Technologist) > Cc: Leif Lindholm ; Yao, Jiewen ; > devel@edk2.groups.io; gaoliming ; 'Ard > Biesheuvel' ; Kinney, Michael D > ; Ni, Ray ; Schaefer, Daniel > ; 'Sunil V L' ; 'Ard > Biesheuvel' > Subject: Re: [edk2-devel] [RFC] RISC-V QEMU virtual package >=20 > Hi, >=20 > > > Are you expecting to need different functionality from the ArmVirtPkg > > > one? If not, you could move that one to > > > OvmfPkg/Library/QemuFwCfgCommonLib > > > or something. >=20 > > The interfaces provided by ARM QemuFwLib seems works fine with RISC-V > > OVMF, however the build fail with the recent change of adding "#if > > defined(MDE_CPU_AARCH64)". >=20 > How does that fail to build? That is the cast from pointer to integer on (UINT32)&Access). The build err= or could be fixed by adding (UINTN) before casting to UINT32 though. >=20 > The #ifdef looks like a performance optimization, doing 64bit mmio > access on 64bit platforms to reduce the number of traps. Even without > fixing that up for RISCV64 so it gets the same treatment everything > should work fine, just a little slower than it could. >=20 > > I prefer to have RISC-V instance because I > > am not sure if any fw_cfg interface changes would be made on RISC-V > > QEMU. >=20 > The fw_cfg interface should not diverge. ia32/x64 works a bit different > because there is a separate io address space on that architecture and > fw_cfg uses that for historical reasons. All platforms using the mmio > variant of the fw_cfg interface should work alike though. Hmm, ok.=20 We can have the common one for both ARM and RISC-V if there is no potential= issues in the future as you mentioned. We can also add #defined (MDE_CPU_R= ISCV64) to avoid the build error as ARM and RISC-V share the same code. One more question, there is already a QemuFwCfgLib library for ia32/x64. Th= e naming of QemuFwCfgCommonLib under Library seems confusing. How about we = put this library under /FDT and also name it as QemuFwCfgLib? Because ARM/= RISC-V fw_cfg also depends on FDT. Abner >=20 > take care, > Gerd