From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.87]) by mx.groups.io with SMTP id smtpd.web11.7633.1666185586218305546 for ; Wed, 19 Oct 2022 06:19:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=u8An5e1v; spf=pass (domain: arm.com, ip: 40.107.7.87, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=hXXPhhgKLKoes2h2StwDKNNEVCXx8Aj9vMakpchXrKjMy0GE2s6NdgQ9qOjn9iINRIhyYm/4AJf6mbDkHNnLCPFr/m2Ddr6GwsHKMO9gMiUNMYD2paP8AQiFNnEA+wg29NzELhOr/CzqWdgxPzXJBSYqGol3IQiFeSWSpTz/m27a8W6vJCt9eH8qE96IQ4Tcfqa4u0q7phzxBh/TCHCkIPY14SWTKSyEUJPzK95jq54Q4/dYv6QIyO1iPar+Sy/YjGvLaLjTkq4GfM1Df0RK4RUHXIvwjXep2w4kbi95q0d9xt7ulGygGVmCdcZ7m3h6BCmyYzW+J0Uhpi/Njot/Zg== ARC-Message-Signature: i=2; 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=Kt1UHjsPLy4va0vb5XAelXeY3wEJ0swsbnLHNfZ7+/M=; b=Axiqer1ScVgNWDQWiC8McYJlwwI+l28UVmcndyL1acXEWjLVDlWQJggryJx5RpebqAWgSLtymJ2qwNhXijnv8cMAR6iWx0soGROlgHBjqOTDCgDdPjulLm03Hz/ZQqOIkN0Fm33rrq6B9jCziu9lyc3AB5WEL6Ag9PfE60B8O8wwpmUyYTYkaJrnH/TpQqEhG06MLmxPQjp3BNTD8/4MgQj5RbtRt2fzQSA0709gpAD45RYjgcHrVCVLjORpZXhZtGB0i5rsrbhrx/Qs8un+nqje4lMLZGDB9Ml86t28stbxI1rYyjmWsw/ezYGltwAn5+RsNX16IwwG0p92PNDyQQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kt1UHjsPLy4va0vb5XAelXeY3wEJ0swsbnLHNfZ7+/M=; b=u8An5e1v0skNva/HnNV06U9P8SLX2W6WrdDBeOuJ6hObAr5hxwC7vDxcT95sDTHYPEHIeuRtJofhqeAXVQB89VOYVHo1onL9VUcpiuyNel3AzUwUaqn+1opT4KOgDqg0roG0VIT7O/J0huYDOj6M6aSXvCI0ka0Q8DY3c0Zn/wU= Received: from AS9PR06CA0069.eurprd06.prod.outlook.com (2603:10a6:20b:464::18) by AS2PR08MB9199.eurprd08.prod.outlook.com (2603:10a6:20b:578::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Wed, 19 Oct 2022 13:19:43 +0000 Received: from AM7EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:464:cafe::5d) by AS9PR06CA0069.outlook.office365.com (2603:10a6:20b:464::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend Transport; Wed, 19 Oct 2022 13:19:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT024.mail.protection.outlook.com (100.127.140.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32 via Frontend Transport; Wed, 19 Oct 2022 13:19:42 +0000 Received: ("Tessian outbound b4aebcc5bc64:v130"); Wed, 19 Oct 2022 13:19:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5a130c068a6bea98 X-CR-MTA-TID: 64aa7808 Received: from d376441961e2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 254E03E4-B0FE-45BE-8C3B-268C30A8AC51.1; Wed, 19 Oct 2022 13:19:36 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d376441961e2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 19 Oct 2022 13:19:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XfCBLtkw7S74iWYhHUDULRgYh7KeOPT4ZSyMtPqE+5y4jNEuyWGsnfQ1g8llXC3vG9WhUfPdy6yzOCmY+OCZcTT20yxAwUHkzMOHxxOr7sgBnxHchiw6gTgKzj2Wew24796U3zmpPbaFQt1Vy7vCKZ27wtNg87T6CJLT4feBEySNm3tq3c9E+nOsDbOnQ9NhvbyFljUS8AGHBybOQ0aUUqJfJJS3MidZTZNZRbxMtCXVyrTfsgwQSt9ZDmU5A2z0vrvY/V9oGIxm0u1HslG5KrQ2Me6ZkhXO7qF1t4Fvv8Rviay4AfgXd39sqLDJrlcZguOl2qO7sh3C3s0XMsaa7A== 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=Kt1UHjsPLy4va0vb5XAelXeY3wEJ0swsbnLHNfZ7+/M=; b=HtdbFavdx4JNSe4CYox92lhQxwM+v41AN26oiAadVAdfDqDPb8TSOjzbxG4kxRxneV6p8kHOVfMQkUlKfKmDzdsr4nQi4Hb4G9hb6MLO1URBeSfaLBxF9/QiCOsBrCY4cP9fGgRcHopnNoU7g730Uu+RJYLfj+3r4bt+hvmtKpiFIr75owz1DK5/CTEdmLPPUZ3gkCJ4L56P2uVZa9Q7iC9eTsZxuRQl3qqtcAyUEmrO1EKoP83OeSeGxedynru7hwA/7ikRPyySW0bPYAkZK+IgBt2B1FJ9k3UYvWkvHmCPHvxL5zzm28NSuTtlM/rFHKsxdLark2CEzVLSaYeM2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kt1UHjsPLy4va0vb5XAelXeY3wEJ0swsbnLHNfZ7+/M=; b=u8An5e1v0skNva/HnNV06U9P8SLX2W6WrdDBeOuJ6hObAr5hxwC7vDxcT95sDTHYPEHIeuRtJofhqeAXVQB89VOYVHo1onL9VUcpiuyNel3AzUwUaqn+1opT4KOgDqg0roG0VIT7O/J0huYDOj6M6aSXvCI0ka0Q8DY3c0Zn/wU= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by DB9PR08MB6412.eurprd08.prod.outlook.com (2603:10a6:10:23d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.28; Wed, 19 Oct 2022 13:19:30 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::283c:fe2e:699d:2bf]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::283c:fe2e:699d:2bf%5]) with mapi id 15.20.5723.033; Wed, 19 Oct 2022 13:19:30 +0000 Message-ID: <4679fd99-b2db-8ab5-5734-514480c4c830@arm.com> Date: Wed, 19 Oct 2022 14:19:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH 25/29] OvmfPkg: Add NorFlashQemuLib library To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Sunil V L , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Daniel Schaefer , "nd@arm.com" References: <20221010101202.1146624-1-sunilvl@ventanamicro.com> <20221010101202.1146624-26-sunilvl@ventanamicro.com> <2f9cdb28-7fa0-c2a2-d53c-7f2f7e87aef3@arm.com> From: "Sami Mujawar" In-Reply-To: X-ClientProxiedBy: LO2P265CA0195.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::15) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|DB9PR08MB6412:EE_|AM7EUR03FT024:EE_|AS2PR08MB9199:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f7fe7f8-064a-4367-276d-08dab1d495c0 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HQRWfuZigEq7AgMCNAeLU03BQhXbKVm1hALlZeJ/PjtyVjB09L4+9J5vPQcdXRJ3kDPjdL9E4FQnNOI7ygxv/2+gNQyZnp96OhpIzM/zRG8DgUAXoyAMN+hPCQj3Lba2EvsbM/J2SU5AAXjS2ZKZ8xc7/9BSG0vvraImjPaIqkm4I6KbUQwgbiBCPJWDUDNJ8rsG5l74mIiZYodaYzLCevOWAIQpvJ60glmzdmDYBArbzjjEiATtr9cFCw3Aaxc12nDQooI03S/Y7yZzGhyJQ8azRlFgBTXIpdo+ed3QbCiK7ATMc0G0KwKnSkzWTuXBM5G+2/jy0gIA8RJYmAzdBpb8zrNEsGfGgq16QCzFjzZuEfgxf2fsjja/45qT/koYFkVxga8LW7sK3BUePIOHh+mFZtA/aIJWC3AxH8L3tJCzGvX4zBJQQqt/4Jl92HPwjue2mJzoy1lOYpg+blSgUINFoeWD2n8sUb3L/Yh7bM7VTamxm6wlUbIKLNZPyAMVur5gAT7mIeC6Xd7uVdvn7sbALVdebYU6rlCZS6jUI8Pm1hrhQvl30gG6S8pXHrmonYPTo7ZfMG6+ldPST/9qLsplmq91bNNOJoW96PYMz+FIXzPLgJwpsCinPsxO4jLWtfSsUO3KtiP+L9I/mOk5HYescbHlRPUsAnfi0+NRBIOAeJHmHaPYr/QKJ50uFKXrog1f+7sIZa2SJCLQmIuEYVq3OCHQSmtkSLL1AjV5Amz4A4CGzSV/V0Yjj5vLezuExaHXttaxKOXIdMbpWmpt8eViZkk3mIFoW/x7XWyf0IJ1XIg4bBqiUsa1yIHu7G7q1q4gQv6CHV4gQ6pvguh8wruX9Y6Tp2gD4cd7OFsHvZA= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(366004)(39860400002)(136003)(346002)(451199015)(44832011)(66899015)(2906002)(66556008)(316002)(110136005)(54906003)(5660300002)(6486002)(4326008)(478600001)(8676002)(6506007)(966005)(41300700001)(186003)(66946007)(6512007)(38100700002)(8936002)(53546011)(26005)(83380400001)(31686004)(66476007)(36756003)(86362001)(31696002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6412 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0b7a3b55-1ffa-4dd0-ef98-08dab1d48dfd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bdbyIGTUOKPg0ZK6VL8KD8rP8PzfVJSE1o3z6g6vGORb/zz0FN0MYsEO3kOUaZXezC1S06t5FiI5qzM4ANelceuQ/deqj91dDmXH+LDPnnp/0JL/T+O8N0X7GhESwvrJ0Skx6Hk5U6sledvItdtevisdQIsnhpKQVE4eydLJ0dTXPpnRPRakDuYXl9CgkPSuRpLtHox+44/mU7rorVX/LFBJ8fkQ/82Vexq8E0VyznA2xRmIiNFnFTDI/KvjGNrXL49YigHPxs5SkuR3VSe72spnCwRrWvJdm2XhLLgGEN6b5qSzok6OCv7JECEy6CSn/EubrQN8CsPXpu9YH1UwvpSM7G38XrIf9nOC0nmNrR7AQxa47wJSin+2k2YW3GNG9W90YVCjHtpEtTw15gTsGaBMj3cBqWjrD6u9T8hSSmUeUy5P3mGzTM+d4Sd5wYnpxDdRFMVT6/PH8roH5TZbqvld3zDV4dNj/c4C/nmLhva0wlPKVvXVr9+J2YDPw8zPAFKcSzqmhbI1Rj0QgLCvqqvznu9buzy6ypiBFJHARZdACrAWK90LPNBrEHyb64aGdJoODw51+Yn0rrYu+AsmvVwWjRBYTYzmGathEpR2ahfh2/FrDP4UwhtihPGfecAI04eKVo4Av9fhzB8nl9ZJ2/NLp1b3DFUyM789tpeuEI60N8O1+/T3aWrui0DrZxFn2oCMGFti+fQDZyX4vpuo6d1xjnzg8WaVO9/44yIYeiQ3CfrpjBCMYCJ8ZvXoJ6gyPgG5GbbU20rku9IDHozObxwTWAiYjY0o+6/idhoLfjUPmBW6DmfH+15AHK3rge/MbiWYtaNlujNrLRy9w80dTGzP+Z8MlHUkd2nqkeSJYinCNPBYMq+cRGnaSByk2C1W X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199015)(46966006)(40470700004)(36840700001)(356005)(40480700001)(82740400003)(4326008)(8676002)(70586007)(70206006)(41300700001)(36756003)(110136005)(316002)(26005)(6506007)(53546011)(47076005)(186003)(336012)(6512007)(2616005)(36860700001)(478600001)(31696002)(6486002)(86362001)(83380400001)(966005)(2906002)(81166007)(54906003)(40460700003)(31686004)(66899015)(44832011)(82310400005)(5660300002)(8936002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 13:19:42.9459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f7fe7f8-064a-4367-276d-08dab1d495c0 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9199 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Ard, On 19/10/2022 02:14 pm, Ard Biesheuvel wrote: > On Wed, 19 Oct 2022 at 15:06, Sami Mujawar wrote: >> Hi Ard, >> >> Please see my query inline marked [SAMI]. >> >> Regards, >> >> Sami Mujawar >> >> On 19/10/2022 01:19 pm, Ard Biesheuvel via groups.io wrote: >>> On Mon, 10 Oct 2022 at 12:13, Sunil V L wrote: >>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076 >>>> >>>> This is copied from ArmVirtPkg since it is required for >>>> other architectures also. >>>> >>>> It also adds the instance for single flash drive which has >>>> both code and variables. This is copied from SbsaQemu. >>>> >>>> Cc: Ard Biesheuvel >>>> Cc: Jiewen Yao >>>> Cc: Jordan Justen >>>> Cc: Gerd Hoffmann >>>> Cc: Daniel Schaefer >>>> Signed-off-by: Sunil V L >>> Let's call these >>> >>> QemuNorFlashPlatformLib [for the library class] >>> >>> QemuNorFlashDeviceTreeLib >>> QemuNorFlashStaticLib >>> >>> and for the driver >>> >>> QemuNorFlashDxe >> [SAMI] We use the NorFlashDxe for the Kvmtool guest firmware, see >> https://github.com/tianocore/edk2/blob/master/ArmVirtPkg/ArmVirtKvmTool.dsc#L294 >> >> Considering this, should QemuNorFlashDxe be called OvmfNorFlashDxe? >> >> [/SAMI] >> > Ah yes, good point. So using Qemu as a prefix is slightly problematic. > > My intent is for this driver to be optimized towards NOR flash > emulation the way QEMU implements it. The main difference between the > platforms is that some of them (notably, ArmVirtQemu.dsc) also execute > from the emulated region, which requires an executable (read-only) > memslot in KVM, as instruction fetches (as opposed to explicit loads > and stores) cannot be emulated by KVM. KvmTool only uses the NOR flash > for variables, so it doesn't really care how the emulation is > implemented, as long as the loads and stores are carried out in the > expected way. > > I don't think the Ovmf prefix makes sense here either - OVMF is still > primarily x86, which uses a different flash emulation altogether. > Maybe VirtNorFlashDxe, to emphasize that it does not expect to be > dealing with actual NOR flash? VirtNorFlashDxe sounds good to me. Regards, Sami Mujawar > > Suggestions welcome :-)