From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web09.387.1645807719371191119 for ; Fri, 25 Feb 2022 08:48:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tanswryc; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9AA0B61CD3 for ; Fri, 25 Feb 2022 16:48:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 095DFC340F4 for ; Fri, 25 Feb 2022 16:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645807718; bh=hp1k8VvNVzKyzl4rThPUlz2j+USVy48Wy99SRsxcDVk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TanswrycvoceJ1xLj5zFIqoFu7ZSUneoN04SO0eN2bXiVuzkTwMLt3BTifsMMCAIK trDIHPHqH9c6+V5LAZu8x1tQgtXK39d+zzvrtFKioH67qMt3Aj0Dmx8JXneeEY8unc qgJPo2UT4Vt/DPldEAHgsKgQwbJqDrpWN5DBHIeKet0tdR62LHL8FtTWucs6wnsrWx 74/X4FoRXRfgdfHDChfRlsGPcZCB9C270c+TH19OcWyIBUIIM4NvzAoq7fhdUE/iH2 MMYGlBNlqX+e+U1FwIOwb9w20o5O7I/goWeK+ShaVwoGA1tvmfONMlhVz2zsOO4AYB YS57u3kzaw44A== Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-2d07ae0b1c4so39700607b3.11 for ; Fri, 25 Feb 2022 08:48:37 -0800 (PST) X-Gm-Message-State: AOAM533JmQZ6JEjbhmeJ4PPMifRLVYN82MNmgYasfWz4rIQ3DXndSPA2 o15JwY+jbMpoUfks7KOOFTioaXx+ZMkXYepf6QE= X-Google-Smtp-Source: ABdhPJyi7hQOYBY1ercr3UVOB/1tRrEr/vrzVEjFlWGRF9g8M2E+Jh/EmQNfhlQNqwapNe702u0/ZaSiNwq7intgHy4= X-Received: by 2002:a0d:d482:0:b0:2d8:1555:e21d with SMTP id w124-20020a0dd482000000b002d81555e21dmr6629167ywd.272.1645807717076; Fri, 25 Feb 2022 08:48:37 -0800 (PST) MIME-Version: 1.0 References: <20220129151346.4120964-1-ardb@kernel.org> <4ae599f2-e987-66e8-2c8e-47c851d8b7c7@amazon.com> In-Reply-To: <4ae599f2-e987-66e8-2c8e-47c851d8b7c7@amazon.com> From: "Ard Biesheuvel" Date: Fri, 25 Feb 2022 17:48:25 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ArmVirtPkg/ArmVirtMemoryInitPeiLib: avoid redundant cache invalidation To: Alexander Graf Cc: edk2-devel-groups-io , Leif Lindholm , Sami Mujawar , "Schander, Johanna 'Mimoja' Amelie" Content-Type: text/plain; charset="UTF-8" On Mon, 31 Jan 2022 at 14:21, Alexander Graf wrote: > > > On 29.01.22 16:13, Ard Biesheuvel wrote: > > Alex reports that the cache invalidation performed by > > ArmVirtMemoryInitPeiLib takes a non-negligible amount of time at boot. > > This cache invalidation used to be necessary to avoid inconsistencies > > between the CPU's cached and uncached views of the permanent PEI memory > > region, given that the PEI phase is where the MMU gets enabled. > > > > The only allocations done from permanent PEI memory with the MMU off are > > pages used for page tables, and since commit 748fea6279ef > > ("ArmPkg/ArmMmuLib AARCH64: invalidate page tables before populating > > them"), each of those is invalidated in the caches explicitly, for > > reasons described in the patch's commit log. All other allocations done > > in PEI are either from temporary PEI memory, which includes the stack, > > or from permanent PEI memory but after the MMU has been enabled. > > > > This means that the cache invalidation in ArmVirtMemoryInitPeiLib is no > > longer necessary, and can simply be dropped. > > > > Cc: Alexander Graf > > Signed-off-by: Ard Biesheuvel > > > Reviewed-by: Alexander Graf > > Also, feel free to add > > Reported-by: Alexander Graf > Merged as #2547 Thanks,