From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (EUR03-AM7-obe.outbound.protection.outlook.com [40.107.105.59]) by mx.groups.io with SMTP id smtpd.web10.2988.1681978078884757023 for ; Thu, 20 Apr 2023 01:07:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=sfcnP9WS; spf=pass (domain: arm.com, ip: 40.107.105.59, mailfrom: sami.mujawar@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=3vbUycMyxudYiRVZu3KHOnR16EvlAeWUPtHl2y0uKNs=; b=sfcnP9WSFazZfKUQ08wZRJG38Q1IuYW6W6pqHQBSoRkW8Be/xAFlWv8mwQbMIyGgrsUqRs2WW0PgpeBdpwU5dvO6u4cF9ertxixqAjE8KGcaIUv5XCqQrwAd2uwFn1IgCWgUtW2G1qVwInP0q8iYGoCVoJdk097qB+T4QzVlt0M= Received: from AS9PR06CA0349.eurprd06.prod.outlook.com (2603:10a6:20b:466::24) by PAWPR08MB8813.eurprd08.prod.outlook.com (2603:10a6:102:335::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Thu, 20 Apr 2023 08:07:55 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:466:cafe::e6) by AS9PR06CA0349.outlook.office365.com (2603:10a6:20b:466::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.24 via Frontend Transport; Thu, 20 Apr 2023 08:07:55 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.24 via Frontend Transport; Thu, 20 Apr 2023 08:07:55 +0000 Received: ("Tessian outbound 8b05220b4215:v136"); Thu, 20 Apr 2023 08:07:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 71f8589ffad75157 X-CR-MTA-TID: 64aa7808 Received: from f36339428bb6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A7A710B7-F6CF-471F-8745-98FC73BB26AD.1; Thu, 20 Apr 2023 08:07:44 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f36339428bb6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 20 Apr 2023 08:07:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mldng693NJFcGSwayvGfiZx7Tnzg5kQvFN3bvovKT9/fulvWTQYJkvg6nixWe7KYS8UkvuJjgmIylhLBEb8ObtZy/zKKA86xnaw/gN0Ld924LFJ3dR9agwc1N1oZOS4v8rAql03K9OtmGEqWs9HijPEcqPEVHNNOR3A9hNVbSdUDm0j+ZVqcjVTY5+t4M1yGvKJqlOMJGEXRlen+0+4OeIcTFE04p1c/ZC29yvLuczcMz4PEtuzjLt9UlC+9CU1Xv0xBKhROaWDduSZ/aPleRC1ead0cUIhI2UmKkfG9upvLMPHwUnKWJV88H0jLzsA3YKcBT28DvRAKCDGC4jeikg== 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=3vbUycMyxudYiRVZu3KHOnR16EvlAeWUPtHl2y0uKNs=; b=ek8vt/hgnRiaLZqKcrIBMABCTgT6mvudWJgk5nZtwwjjxeuVFNEdTqcQ4Rxg6kCQJgSf4qRfz2699rSITWaAaq2I2CmmOBoG9tFYvq0Ilov5H00Mo5edWf8dDaK050iPtOLmrbIh9zQpTinvjHnYWvWl4a2nHd9YThucG+5iEdonL0eOlXmUNoh9wMp1pfGpJd/VcQOuKkH5AzkukLN3p2X0f9TkQfPGeEGgJpdJov3X1G4iiUabdn0Bl9EBCotjUmoRXOHsuNV4Sw4N+1ChUjSe/h2/5JsjfAG5HD9m1h/zueO+zAnA+Sjc+c+Z0Kh8vPza0456yYfVBV7rgfUmxA== 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=3vbUycMyxudYiRVZu3KHOnR16EvlAeWUPtHl2y0uKNs=; b=sfcnP9WSFazZfKUQ08wZRJG38Q1IuYW6W6pqHQBSoRkW8Be/xAFlWv8mwQbMIyGgrsUqRs2WW0PgpeBdpwU5dvO6u4cF9ertxixqAjE8KGcaIUv5XCqQrwAd2uwFn1IgCWgUtW2G1qVwInP0q8iYGoCVoJdk097qB+T4QzVlt0M= 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 AS4PR08MB7904.eurprd08.prod.outlook.com (2603:10a6:20b:51f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.21; Thu, 20 Apr 2023 08:07:33 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::7afd:553d:71b8:4c8c]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::7afd:553d:71b8:4c8c%8]) with mapi id 15.20.6319.022; Thu, 20 Apr 2023 08:07:33 +0000 Message-ID: <835d2efe-2c9d-ec14-c102-e95b7bf9850d@arm.com> Date: Thu, 20 Apr 2023 09:07:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [edk2-devel] [PATCH edk2-platforms v1 1/1] Platform/ARM: Reduce System Memory Size for FVP with RME extensions To: Leif Lindholm , devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, Pierre.Gondois@arm.com, Suzuki.Poulose@arm.com, Matteo.Carlini@arm.com, Akanksha.Jain2@arm.com, Ben.Adderson@arm.com, nd@arm.com References: <20230417132249.15092-1-sami.mujawar@arm.com> From: "Sami Mujawar" In-Reply-To: X-ClientProxiedBy: LO4P123CA0441.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::14) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|AS4PR08MB7904:EE_|AM7EUR03FT021:EE_|PAWPR08MB8813:EE_ X-MS-Office365-Filtering-Correlation-Id: 4656a658-7394-423a-c51b-08db417658a9 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: Qv/VbNnDQhXzvZZPI0ba8Ae8z5qYxsTK4fx68gNtJ3mj+KUTw/81AwWffU4gauRRve4uMhle23PsM4V/9tCcJ8zx5uSzT2/i0FcWHXxMAnW195tmeDO5aVRa9UBOMuq2fc6esvQS2zFYfSBHNHNqaTAsgiQMqzbMNMbi9LLXnYCPd9ljvwk/Mbmw19NUJe+5rSDcdjjO1ESPBocn7up/DpwuZiaG5qgC76myPBGqeTQzpPrGrXd9iKDRglwHlQkOQLkdeGAtK2Z/cO7qcST9AzTghlwTcWoj/iBszy7EfK3QHgA+0pmtqarUgs8oKNH1s8AxdOgFgfNrehSMae+fiLIH3OP3x7s1gAp41OxzVzKxP0x/J0517Z7Z6xWXA+aqcZFBlHISfthgc0i/K87cgN2wo7I+Tg5VjLiPSr7rSiV4GaDH4G+zpW+zcBYcvRNar86vkOYlq7h46vqIjzqWmxfEOi+GI40rtQRFx5FHTHeuYrxQ83yOa8FPBdC/+bu98x4/deLFmyTzHafppbHU7B6GD+RxQEQOe0IsslEkmqDoEt1u9Fm9wNmFqhVjdiQb6o9D7CAACRcOodvYYlOcMm7PuCEjKxyMHNY8iZWPkHn+lB3EyqaVTlg7PLmuiBCpMt8LU+BuxOHSTQXwd4Omqodc1MQCGu8EO/X6KYv/JLw= 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:(13230028)(4636009)(136003)(376002)(396003)(346002)(39860400002)(366004)(451199021)(6512007)(26005)(53546011)(6506007)(2906002)(83380400001)(186003)(6486002)(966005)(36756003)(31686004)(2616005)(86362001)(66899021)(31696002)(44832011)(478600001)(6666004)(5660300002)(66946007)(38100700002)(4326008)(66476007)(66556008)(8936002)(316002)(41300700001)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7904 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: AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6bba8741-d233-481c-ac19-08db41764b6b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: USIS5bvFkzJoQQrRMZWeJD1rMBsWcT48pZnVHgVaeqAU2TklWick1I7X/npLUnPpgCMvQjXwVdlBDDsglRhP63DKF/QZ7yDSV8wb3XKXlcAX+cxSoCUO7LG9ZR+O29cmfWM2o83977PHlT4Gy1DDS6ivLMGMMbfciImuMy4Wzkz6/izjGkQfgXlDfa+h58FdVdd+eluoygSbVGAljXwWDaVZeNkJgEro0HK0T4vMZdQhi0P2YzRIoNx0cgVooeBzERvyR798cySahTsaG2pZeh6i18v9bY57qRrkNU8U9r358C91motJ1MCPXEWWXHntARIyFnT49Rv4wzTWPFA2kJsYBj3AyqHluyr3hyDdWVlK3vHLX+CkiNsVZGIdN+clXuWj3oW/F7Z5To25QZr7NwQk+HWjNDJ+hSwiS2/IqYdvdbQKKFgbnvErV2Pg6LAjeQiDMpHryKKWoOiX/y/PaTN1yDx0gMca6sWf/HODJ+06W9ZeTs4COWJwSHGjPv8/AVAx0ohy5cz4eQfozfQF/76V2hcWp5M9k+BE8TwXHSX1mvPcVb+IALYVnp/Ma93WSV3+7Ful+RQjEZxdQrvPi3WmKFKAZk/SpyTYrIbTkHl3ByfUaQdxBF5DSnQrnFkXM8PPWGTMmp4ximDmcBHUn8qc4lMDp6JVQMz4aOJVCZZPhsQVb+puoWSVw4S/J+hZNZok3y9/x9W9gwLtIhp2L6z0XM1BEKmLuY2UnQjKVwh7NUrZRH+tLX1flDCZ+iIozdF7yUt8jjxIAZg2eZkZug== 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:(13230028)(4636009)(136003)(376002)(39860400002)(346002)(396003)(451199021)(36840700001)(46966006)(40470700004)(31696002)(86362001)(36756003)(82310400005)(66899021)(31686004)(40460700003)(40480700001)(36860700001)(47076005)(6486002)(966005)(478600001)(6506007)(186003)(2616005)(26005)(53546011)(6666004)(6512007)(70586007)(4326008)(316002)(8676002)(70206006)(41300700001)(83380400001)(5660300002)(336012)(44832011)(81166007)(8936002)(82740400003)(2906002)(356005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2023 08:07:55.1743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4656a658-7394-423a-c51b-08db417658a9 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: AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8813 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Leif, Thank you for reviewing the patch and for the feedback. Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 18/04/2023 02:30 pm, Leif Lindholm wrote: > Hi Sami, > > On Mon, Apr 17, 2023 at 14:22:49 +0100, Sami Mujawar wrote: >> For older FVPs (without support for RME extension) the top 16MB of >> DRAM1 is reserved as Trusted DRAM. However, the latest FVP Base RevC >> AEM Model [1] has support for RME extension. When RME extension is >> present the top 64MB of DRAM1 (i.e. at the top of the 32bit address >> space) is carved out for four-world support in TF-A [2]. >> >> Therefore, reduce the System Memory size by 64MB. > This is clearly needed in order to not break things, so > Reviewed-by: Leif Lindholm > *but* > this is really just extending the life of a horrible hack. > > Ideally, the ARM ltd. platforms should lead the way in providing > reference implementations - since inevitably people will look to those > for creating new platform ports. Things like this should be runtime > discoverable. [SAMI] TF-A has this information in the platform DT, which we should be able to consume and setup the system memory size dynamically. However, it will be good to get this information from TF-A using the firmware handoff protocol (https://developer.arm.com/documentation/den0135/a). I will check with the TF-A team to understand when they plan to implement this feature. I will merge this patch for now. Once we have the firmware handoff protocol implemented in TF-A, we can add corresponding support in edk2. [/SAMI] > > / > Leif > >> Reference: >> [1] FVP Base RevC AEM Model (available on x86_64 / Arm64 Linux) >> (https://developer.arm.com/Tools%20and%20Software/ >> Fixed%20Virtual%20Platforms) >> >> [2] commit c872072 (https://review.trustedfirmware.org/plugins/gitiles/ >> TF-A/trusted-firmware-a/+/c8720729726faffc39ec64f3a02440a48c8c305a)) >> >> Signed-off-by: Sami Mujawar >> --- >> Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc >> index dc081794cf98a27c667ef85bd27dacd80e9e8bd2..f70a4d52ba06f570e017ab5286f06d87193753e5 100644 >> --- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc >> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc >> @@ -107,9 +107,12 @@ [PcdsFixedAtBuild.common] >> gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000 >> gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize|0x0 >> >> - # System Memory (2GB - 16MB of Trusted DRAM at the top of the 32bit address space) >> + # System Memory >> + # When RME is supported by the FVP the top 64MB of DRAM1 (i.e. at the top >> + # of the 32bit address space) is reserved for four-world support in TF-A. >> + # Therefore, set the default System Memory size to (2GB - 64MB). >> gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 >> - gArmTokenSpaceGuid.PcdSystemMemorySize|0x7F000000 >> + gArmTokenSpaceGuid.PcdSystemMemorySize|0x7C000000 >> >> # Size of the region used by UEFI in permanent memory (Reserved 64MB) >> gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000 >> -- >> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >> >> >> >> >> >>