# Re: \[PATCH\] x86: efi: avoid BUILD\_BUG\_ON() for non-constant p4d\_index

- From: Borislav Petkov \<bp@alien8.de\>
- Date: 2021-02-04 22:14:20 
- List: linux-efi
- Page: https://ratatoskr.run/linux-efi/2021/02/6259260
- Thread: https://ratatoskr.run/linux-efi/2021/01/6227158/t.md

```text
On Thu, Feb 04, 2021 at 04:43:58PM -0500, Arvind Sankar wrote:
> This should check EFI_VA_END instead of EFI_VA_START, and maybe throw in
> a BUG_ON if EFI_VA_END >= EFI_VA_START.

No need:

        if (efi_va < EFI_VA_END) {
                pr_warn(FW_WARN "VA address range overflow!\n");
                return;
        }

We already check we're not going over at map time. And our runtime
services range is hardcoded. And we're switching to that PGD on each
runtime services call.

So I don't see the point for keeping any of the assertions.

Unless you have other valid arguments for keeping them...

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
```
