Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1593495pxb; Thu, 4 Feb 2021 17:58:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL9jr7/6L2OHMS96/MJskpqIynuctsPQyMJPU1CRsFUjLyjmgfqQL28fevHZfGG2K5myMT X-Received: by 2002:a17:906:a2c9:: with SMTP id by9mr1807061ejb.546.1612490286030; Thu, 04 Feb 2021 17:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612490286; cv=none; d=google.com; s=arc-20160816; b=o7k8RwsZ/ZQJDb1i/zzlJYhq3YT6zzmHAkUy2OgowL04uWCSSvbLNb/6Ynu2ukV40c C07cPX3Bn//+fvhlVjs7YO6jPGbkYyaYQw2xNOwAvWiGurYVeJEUFtqF/oAExGSyQPJJ 5RyZf1RhKJu5aP4ovtcBe+trxg4I8ZmlP96yWhbjkHqmnx4RA/5UxDnsnYc29AkcZihO iGOgkukqjRhrzY7Hnh6TXcH5+/7dPtGrqBGlYYkuVt9Mlyf0BroPtcpyQf3EmFSjC9KF VcQCz/S1HFmBMXPxeQMbqOZ6ODeq2S7W0UQL1sk0IG/p0MjMfVhPkcMk6jVoFxtl44kp wDyg== 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; bh=WJYooe3xF7/mefKhohc7tEDBTk22wMNA7vkmjEV5aGE=; b=HkUCkPNsQ6jkOjZrleJ2X9daaMLVzcWjrsZJUakuf9nnUPc5ou4EvEiljToplcdiJZ m1icfEqv4pa00ezRFq/a/Tx2ZtnJzCvnWUL9dhHGULrTzaWhRG+RnOsJYVDIq3DwqzWE L7iMbA3qwSQlheWY3iK347O2qf5OM9BxtAhrgGo0h1bRAyTcwDOeYLjMO3mWKSaWWjPF jnwe9SMEBiK1YehznCOzPTG7BsvRQBorLjpwXCbiQwm9NPUqC4P27YCj8FPnobL4MEr9 AnM4AbmUgSHLW4zbAoUBlj2Sv9yC8ddHVsLjGWZ/BL2fSglpL6vO2BBFH1FcHD988ETT //0g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn4si5189267ejc.205.2021.02.04.17.57.41; Thu, 04 Feb 2021 17:58:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbhBEAJI (ORCPT + 99 others); Thu, 4 Feb 2021 19:09:08 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:45927 "EHLO mail-qv1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231565AbhBEAJG (ORCPT ); Thu, 4 Feb 2021 19:09:06 -0500 Received: by mail-qv1-f42.google.com with SMTP id w11so2648134qvz.12; Thu, 04 Feb 2021 16:08:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WJYooe3xF7/mefKhohc7tEDBTk22wMNA7vkmjEV5aGE=; b=OEkbXOfMnCzy05c/wZUaypq6cpFZOBRTTfB0QhmONB2ki24Ik/LazMbkuGGGeoujyS Vc+Np2E/MI6O56y0Z1r6sPMNpUE3UawLqAs584joedES5a/3tsMjQdiwkoq/vfKmxUSp 9Q10qxfMmlr+7Eb7El5ESiVLk1TQKYNahGjloFePRkVkJkO9fQPtLQkg+YHK7VwnLE7p GQQ/BhKh19K5puW+BykRU+bavOqEL4XmeDhGMu6BcRQXeaqRadVFQjlNheTUOBvnnLSy U8Df5miijD04exYYpkPmC345hLkPYhOnF+vdaLCF8L1bTkEOpUWzQfqT5kkCmP28HrFJ Hfcg== X-Gm-Message-State: AOAM532VE9UvYiljfivfyR4VDz4SdMxKxQCAzcadApq6IgR0X/xTpOnq zazN9sMndhUIaJgrFnMMulI= X-Received: by 2002:a05:6214:446:: with SMTP id cc6mr2003665qvb.31.1612483705438; Thu, 04 Feb 2021 16:08:25 -0800 (PST) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id e15sm3360111qtq.43.2021.02.04.16.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 16:08:24 -0800 (PST) Date: Thu, 4 Feb 2021 19:08:22 -0500 From: Arvind Sankar To: Borislav Petkov 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: References: <20210118202409.GG30090@zn.tnic> <20210203185148.GA1711888@localhost> <20210204105155.GA32255@zn.tnic> <20210204221318.GI32255@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210204221318.GI32255@zn.tnic> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 11:13:18PM +0100, Borislav Petkov wrote: > 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... > No, I don't have any objections to removing them altogether. All the comments other than the one about changing the #define's only apply if it's decided to keep them.