Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1480863pxb; Thu, 4 Feb 2021 14:16:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxwDgM1QghUxV5XGYzDM9ssVyTGX+RC+g6g/gNQJxAhRZODnlnYMfsXJ/tCktge5LGC13T X-Received: by 2002:a17:907:2897:: with SMTP id em23mr1183780ejc.550.1612477007192; Thu, 04 Feb 2021 14:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612477007; cv=none; d=google.com; s=arc-20160816; b=QgWdQG1U9JZKICjWLEb9AaN3OtwpLd7u7oP18JHSnM4eFWnAdnX71iFjPtHF0AHAmA yduhd7EhuTxX/suxWbu98KeXftiOKpCrA6nAuUFCFE/Wi+h5grRFDMUDWdhcQ02LJWo5 8hADqmLiU2QibYjZfA1JXjtKnOTs8xFkhbn5KnXJuC9H89itJ5nqBbfUCXvA19RCmgW1 Q7+7iVIR7/7I5AycaCLZbujnE+6/XhRXz5RRNiYtPXpduHrHUM2BCAa8lN7gNi7N1U5B tYx1jp+anvAYf52FtxAgUyZC1nSAWGK7PRQxPcVTa2CYbLuTkZpMaN8gvzLWEDqKMVO5 Cllg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qUcBmX7dmaTykemYNBo1gvegAj0QB+Et810B66xa7FI=; b=JaCwJV1MKoGOCX91RyxVIOdgT2G8NLyXt3PDUnC2QN+bd33BkLVgP/pLDIgRHeP5v6 PNLLSXj3QA1NCIg8HTVg62ntmAoQIp8A3duMqJ1r9Y4ZVKhd4nPcgg9y83R13Dgj4akB 0IJR5P9B3V3H1EcPb3opUwPNBV7YY6mneiv0v0MuI+KlhM8Zu/EDN4BYKrK7GXbWoCs1 QnroHl+TiswQTSRYeelLROnUd2dkuFC4HtRhhUs5+Tai0GBIuJIY6bXDzVQ6uQSC6tnY Bfhh5HnaNd9muninbJMkIDys/6Nl77cpsl5QUulVEAH/7KjZiN2LXrUjfyiy1ZL17NFm icEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RMPqKhZG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si3970039ejb.174.2021.02.04.14.16.22; Thu, 04 Feb 2021 14:16:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RMPqKhZG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbhBDWOF (ORCPT + 99 others); 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