public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [edk2-devel] [PATCH 1/5] ArmPkg/CpuDxe: use private copy of GetRootTranslationTableInfo()
Date: Thu, 2 Apr 2020 12:03:16 +0100	[thread overview]
Message-ID: <20200402110316.GP7468@vanye> (raw)
In-Reply-To: <0e6a6c40-1a48-a5cb-563f-4f5b39c41fef@arm.com>

On Thu, Apr 02, 2020 at 12:29:30 +0200, Ard Biesheuvel wrote:
> On 4/2/20 12:28 PM, Leif Lindholm wrote:
> > On Thu, Apr 02, 2020 at 12:20:54 +0200, Ard Biesheuvel wrote:
> > > On 4/2/20 12:16 PM, Leif Lindholm via groups.io wrote:
> > > > On Sat, Mar 28, 2020 at 11:43:17 +0100, Ard Biesheuvel wrote:
> > > > > Before getting rid of GetRootTranslationTableInfo() and the related
> > > > > LookupAddresstoRootTable() in AARCH64's version of ArmMmuLib, add a
> > > > > version of the former to CpuDxe, which will be its only remaining
> > > > > user. While at it, simplify it a bit, since in the CpuDxe cases,
> > > > > both OUT arguments are always provided.

Summary after discussing off-list:
This patch isn't *just* moving a public function private, but it's
replacing use of a function that was never meant to be public and had
a completely bonkers forward-declaration in a different module.

Ard has agreed to make the commit message more explicit on that point,
and I'm happy with that. So with that change, for the series:
Reviewed-by: Leif Lindholm <leif@nuviainc.com>

> > > > So, this may be super picky, but:
> > > > Deleting the prototype without making the definition also STATIC would
> > > > cause build errors with -Wmissing-prototypes (which someone might be
> > > > enabling explicitly or implicitly if say doing some code hardening on
> > > > the side).
> > > > 
> > > > Now, it's a valid point to say that -Wmissing-prototypes isn't in our
> > > > current CFLAGS, but I think it would be a good habit to get into.
> > > > So you get a:
> > > > 
> > > > Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> > > > 
> > > > regardless, but I'd appreciate if you could sling a STATIC into
> > > > ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c as well before
> > > > pushing.
> > > > 
> > > 
> > > Well, while I see your point, please note that the prototype only exists in
> > > a local header file that only gets included by CpuDxe, and not by any of the
> > > other consumers of ArmMmuLib.
> > 
> > What I'm saying is that with -Wmissing-prototypes added, building
> > after applying this patch (but before applying the one that deletes
> > the function) gives:
> > 
> > "aarch64-linux-gnu-gcc"   -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=ArmMmuBaseLibStrings -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mcmodel=small -flto -Wno-unused-but-set-variable -Wno-unused-const-variable -DMDEPKG_NDEBUG -DDISABLE_NEW_DEPRECATED_INTERFACES -mstrict-align -mgeneral-regs-only -c -o /work/git/tianocore/Build/ArmVirtQemu-AARCH64/RELEASE_GCC5/AARCH64/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib/OUTPUT/AArch64/ArmMmuLibCore.obj -I/work/git/edk2/ArmPkg/Library/ArmMmuLib/AArch64 -I/work/git/edk2/ArmPkg/Library/ArmMmuLib -I/work/git/tianocore/Build/ArmVirtQemu-AARCH64/RELEASE_GCC5/AARCH64/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib/DEBUG -I/work/git/edk2/ArmPkg -I/work/git/edk2/ArmPkg/Include -I/work/git/edk2/EmbeddedPkg -I/work/git/edk2/EmbeddedPkg/Include -I/work/git/edk2/MdePkg -I/work/git/edk2/MdePkg/Include -I/work/git/edk2/MdePkg/Include/AArch64 /work/git/edk2/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> > leif@vanye:/work/git/tianocore$ "aarch64-linux-gnu-gcc"   -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=ArmMmuBaseLibStrings -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mcmodel=small -flto -Wno-unused-but-set-variable -Wno-unused-const-variable -DMDEPKG_NDEBUG -DDISABLE_NEW_DEPRECATED_INTERFACES -mstrict-align -mgeneral-regs-only -c -o /work/git/tianocore/Build/ArmVirtQemu-AARCH64/RELEASE_GCC5/AARCH64/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib/OUTPUT/AArch64/ArmMmuLibCore.obj -I/work/git/edk2/ArmPkg/Library/ArmMmuLib/AArch64 -I/work/git/edk2/ArmPkg/Library/ArmMmuLib -I/work/git/tianocore/Build/ArmVirtQemu-AARCH64/RELEASE_GCC5/AARCH64/ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib/DEBUG -I/work/git/edk2/ArmPkg -I/work/git/edk2/ArmPkg/Include -I/work/git/edk2/EmbeddedPkg -I/work/git/edk2/EmbeddedPkg/Include -I/work/git/edk2/MdePkg -I/work/git/edk2/MdePkg/Include -I/work/git/edk2/MdePkg/Include/AArch64 /work/git/edk2/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c -Wmissing-prototypes
> > /work/git/edk2/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c:109:1: error: no previous prototype for ‘GetRootTranslationTableInfo’ [-Werror=missing-prototypes]
> >   GetRootTranslationTableInfo (
> >   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> > 
> > So it breaks bisect if you're experimenting with hardening.
> > 
> > As I said, I don't insist, but I want to be sure you realise that bit
> > before you decide.
> > 
> 
> But none of the other consumers of ArmMmuLib do an #include of
> ArmPkg/Drivers/CpuDxe/CpuDxe.h, right? So I am slightly puzzled by this
> result.
>

  reply	other threads:[~2020-04-02 11:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 10:43 [PATCH 0/5] ArmPkg: cosmetic cleanups for ArmMmuLib Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 1/5] ArmPkg/CpuDxe: use private copy of GetRootTranslationTableInfo() Ard Biesheuvel
2020-04-02 10:16   ` Leif Lindholm
2020-04-02 10:20     ` [edk2-devel] " Ard Biesheuvel
2020-04-02 10:28       ` Leif Lindholm
2020-04-02 10:29         ` Ard Biesheuvel
2020-04-02 11:03           ` Leif Lindholm [this message]
2020-04-02 12:44             ` Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 2/5] ArmPkg/CpuDxe: move PageAttributeToGcdAttribute() out of ArmMmuLib Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 3/5] ArmPkg/ArmMmuLib: drop pointless LookupAddresstoRootTable() routine Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 4/5] ArmPkg/ArmMmuLib: get rid of GetRootTranslationTableInfo() Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 5/5] ArmPkg/ArmMmuLib: drop unused TT_ATTR_INDX_INVALID CPP symbol Ard Biesheuvel
2020-04-02 10:23   ` Leif Lindholm
2020-04-02 10:29     ` [edk2-devel] " Ard Biesheuvel
2020-04-02 10:57       ` Leif Lindholm
2020-04-02 11:05         ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200402110316.GP7468@vanye \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox