Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3977279ybv; Sun, 16 Feb 2020 10:25:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxFRMAi5pe9T3AKNg+cbBH4WReNCue7VDAZi15MdNHjiB9NA2AkpokMwcO5HGUaNm8qlg1n X-Received: by 2002:a9d:6544:: with SMTP id q4mr9169973otl.269.1581877509294; Sun, 16 Feb 2020 10:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581877509; cv=none; d=google.com; s=arc-20160816; b=EduEWSLH46QB48CTNDYvr1URXwTbUhgOns7fqWDb9bclgLBN9JqT6QBRScfURVYJoS BZgKJbxLXCqM/whTpxrhRTmIAFO34DUXsgpL0YSe95tyhauAfW7ehfFmoB7B78lJhB+X QSn9EKxuPamuGeIl1t6MUbngCrzCnvOYeLnsqpMre7MwI+Adv4zDRUvwlVkQ6O0F7JWn ge2gdFlz0M1eLvJ/T4HQnTLmirv8igUNzz/v09bXB1vAr5ME3NFGfrvELD5AMZVatHLW t6PJF7ACDxzwk6Nwvg62cudrcDwa2bbztgaTRRSJzSBZJBKdj8sw/5RL3Z/X52rQLqE2 QRTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=JK5n3vt5ejUZogk1sPiqcItWr9q/YvXjcFwVlF6kmkU=; b=mJUVLXaQc3IRBul+1NSRtcFqeIQjckdIe6Tmexb6T3Tjim3p83m7uxcNvTo2KsQXn7 OWfMxdDNn9ZEGgb0TRoAyNHpFp908TI4NZdYKvEWTXRdNwUXeG1/SPq0YMjVGToZWI8I 00GXMGgQuKqxH7WawZcHu6zHq/F+AA2p0sWt6qajrSDiCpNhI26K2dFBF8kZnkk1zYSq cfOs/K4jv7hXGmLy6eelTZ7arC4a+XDcex2kNkA0AgyxE+XU/AFRIXfkGeYhFG0YdR8F a0E2WxI+h83+0kvOhygfxX5gjAyiHQDzVw2B9DvDfZ5vn1N+SS6fpDyqpNN5JXNXwo1t IQkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JnsxNCD+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si5821091otd.135.2020.02.16.10.24.57; Sun, 16 Feb 2020 10:25:09 -0800 (PST) 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=JnsxNCD+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728103AbgBPSYN (ORCPT + 99 others); Sun, 16 Feb 2020 13:24:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:33644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbgBPSYM (ORCPT ); Sun, 16 Feb 2020 13:24:12 -0500 Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr [109.210.65.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 799F2208C4; Sun, 16 Feb 2020 18:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581877451; bh=OxGn9R5ntWFnT5wJ6BdqGbw1uixdFfwfbWefP91OvJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JnsxNCD+1RLneTNgq/CogMRQxYifR6C7GyaugkwWdw/+gaqMhMpEPZKvjCCGbOX9c Pd7L6rWpuxTlucWjnFEMqJaJjSDjgtFRnve0YDty6fAdZpvuDc4qstmhQGQCtZ+M80 oMMvPD93iiq+y9hPh6mlYvncMNJw4vYs20zRtSdM= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , nivedita@alum.mit.edu, x86@kernel.org Subject: [PATCH 15/18] efi/x86: merge assignments of efi.runtime_version Date: Sun, 16 Feb 2020 19:23:31 +0100 Message-Id: <20200216182334.8121-16-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200216182334.8121-1-ardb@kernel.org> References: <20200216182334.8121-1-ardb@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org efi.runtime_version is always set to the same value on both existing code paths, so just set it earlier from a shared one. Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/efi.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 54ada9f9612e..57651facb99d 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -423,6 +423,8 @@ static int __init efi_systab_init(u64 phys) efi_systab.tables = systab32->tables; } + efi.runtime_version = hdr->revision; + efi_systab_report_header(hdr, efi_systab.fw_vendor); early_memunmap(p, size); @@ -873,15 +875,6 @@ static void __init kexec_enter_virtual_mode(void) } efi_sync_low_kernel_mappings(); - - /* - * Now that EFI is in virtual mode, update the function - * pointers in the runtime service table to the new virtual addresses. - * - * Call EFI services through wrapper functions. - */ - efi.runtime_version = efi_systab.hdr.revision; - efi_native_runtime_setup(); #endif } @@ -968,14 +961,6 @@ static void __init __efi_enter_virtual_mode(void) efi_free_boot_services(); - /* - * Now that EFI is in virtual mode, update the function - * pointers in the runtime service table to the new virtual addresses. - * - * Call EFI services through wrapper functions. - */ - efi.runtime_version = efi_systab.hdr.revision; - if (!efi_is_mixed()) efi_native_runtime_setup(); else -- 2.17.1