From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF07BC433E0 for ; Thu, 4 Feb 2021 22:14:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2ECD64FAB for ; Thu, 4 Feb 2021 22:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbhBDWOF (ORCPT ); Thu, 4 Feb 2021 17:14:05 -0500 Received: from mail.skyhub.de ([5.9.137.197]:47090 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhBDWOC (ORCPT ); Thu, 4 Feb 2021 17:14:02 -0500 Received: from zn.tnic (p200300ec2f0c7e0006ca03b6d355ef00.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:7e00:6ca:3b6:d355:ef00]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id F35AF1EC03C1; Thu, 4 Feb 2021 23:13:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1612476801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=qUcBmX7dmaTykemYNBo1gvegAj0QB+Et810B66xa7FI=; b=RMPqKhZGJ2bsiL2depyJvChrKeZSRXFqHO1SPI2325gfkUEJ6lEUVP3xOpz9fuOUPhtXIP DSpjZAgR5lyHa4OQyWPjDntaH0rAGuEcgsqomb6ErD2IoSb1wztiyB0kIgcOqrWwuJtRn7 XHMmPJxqnj/GX8ybRcZtbX2XyPKQARA= Date: Thu, 4 Feb 2021 23:13:18 +0100 From: Borislav Petkov To: Arvind Sankar Cc: Ard Biesheuvel , Nathan Chancellor , Arnd Bergmann , Thomas Gleixner , Ingo Molnar , X86 ML , Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , Darren Hart , Andy Shevchenko , "H. Peter Anvin" , linux-efi , platform-driver-x86@vger.kernel.org, Linux Kernel Mailing List , clang-built-linux , "Kirill A. Shutemov" Subject: Re: [PATCH] x86: efi: avoid BUILD_BUG_ON() for non-constant p4d_index Message-ID: <20210204221318.GI32255@zn.tnic> References: <20210118202409.GG30090@zn.tnic> <20210203185148.GA1711888@localhost> <20210204105155.GA32255@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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