Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3286412ybb; Tue, 31 Mar 2020 02:07:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtnmS+Bma+QtaGNFjnRD9/OcvI5pra5qkUftasBlAfwAx59DiIT2QF118ag0lzcQ4sLbtTq X-Received: by 2002:a9d:a22:: with SMTP id 31mr11762142otg.349.1585645647601; Tue, 31 Mar 2020 02:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645647; cv=none; d=google.com; s=arc-20160816; b=JlOP3WN39a4cHOOaDIZS6RHh7jiVDuyvZm/5lsb2KdM/+Z1KYns3nxDxaVJqj12Wb5 /ra7TwfOxBCtH6KKiRpxKc00sZVEyhvXmPP8siOjlJXZU9NG9Xak9DAskKsZD6xoUV4l md/LOUq9urVDkyJsWK5v3jwTJx9m162vhmw3oFbZR/d86LcEc4BZunAER3wv7sgmTsNq +k1FJWzcAUkhCCl0tYKZ2ANUp3AmyOZ6XYFw4ofW+0LLFzdO+pW2gZ6GGjCsC92j7iL0 WbXbx9fG8YoOArRzLe/9wfsfBbKwVWlC+bGLVj/OoaGrDQIDqMmZ7Z8fZrSLnUqOA5Kz DsBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0ZVszC2U2rRFDt43kD86TpTkb0sDcyH0Fn2tQbgqP1Y=; b=j+4PbFPSZp8CnG/3p3xkneeaR+j63tFIKahmBqxon5wdSyuH510YmkR1fajYpj1aXf ysi6rbBGdbhzlIzuhJMqeXQXGryukq3AaKNRYvolHc8dViPZwrxKmeHjMdsZYjmgMF2c XIdMnl8liKJayiJrs0v41NQsXXnrwCx412noHBhiqSFj7o/0p01BYUxqOTHOyXTjFLdC 19KKzXhE7ZmHgvZkCZo84ZpcWJ4utm4bRRmMzohLcvby1FZwNYTCa5/GPK0yyyBFP0ba T++fSKn4QOQ5FfMtTraS+d10cq1Ib/RK3xvsPerqodHSdyn8mtSy+zdmjhjss1058MaO 047g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H3W45oXi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si5911815otl.238.2020.03.31.02.07.15; Tue, 31 Mar 2020 02:07:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H3W45oXi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731020AbgCaJG0 (ORCPT + 99 others); Tue, 31 Mar 2020 05:06:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:47754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731130AbgCaJGV (ORCPT ); Tue, 31 Mar 2020 05:06:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED5FC20787; Tue, 31 Mar 2020 09:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645580; bh=PVwq12ikNVjYzL7dLyszQb2N26rWLUYHtiw4e8tlS6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H3W45oXiRBVJVafM33SzNnXkdMF+eaaEGIRZhbq0ndoJKXQPsgRfdxt3pflWJWiWh vll/S4HVgH3seR25NnvpIsx4/ToRi/OsJVL9lO88Nf2blfb0hSkn8IEet9IjBksG9b Up4QqhfYBnhVw2mQQEhAumci0UODDS/sgBILZH8Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Borislav Petkov , Tom Lendacky Subject: [PATCH 5.5 097/170] x86/ioremap: Fix CONFIG_EFI=n build Date: Tue, 31 Mar 2020 10:58:31 +0200 Message-Id: <20200331085434.553399232@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov commit 870b4333a62e45b0b2000d14b301b7b8b8cad9da upstream. In order to use efi_mem_type(), one needs CONFIG_EFI enabled. Otherwise that function is undefined. Use IS_ENABLED() to check and avoid the ifdeffery as the compiler optimizes away the following unreachable code then. Fixes: 985e537a4082 ("x86/ioremap: Map EFI runtime services data as encrypted for SEV") Reported-by: Randy Dunlap Signed-off-by: Borislav Petkov Tested-by: Randy Dunlap Cc: Tom Lendacky Cc: Link: https://lkml.kernel.org/r/7561e981-0d9b-d62c-0ef2-ce6007aff1ab@infradead.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/ioremap.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -115,6 +115,9 @@ static void __ioremap_check_other(resour if (!sev_active()) return; + if (!IS_ENABLED(CONFIG_EFI)) + return; + if (efi_mem_type(addr) == EFI_RUNTIME_SERVICES_DATA) desc->flags |= IORES_MAP_ENCRYPTED; }