Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4832416ybl; Wed, 22 Jan 2020 05:34:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwVbGnYkrra4IjSWi1wxIJrcYqv4KBISNkEuHAdSVIIBobDIE3kWNsMxAGhmvS0a/748uN5 X-Received: by 2002:a9d:7b4e:: with SMTP id f14mr7448084oto.355.1579700051675; Wed, 22 Jan 2020 05:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579700051; cv=none; d=google.com; s=arc-20160816; b=QWPQVk+Qlv1iGmdUUFlG39PAUzI/5b/1edp01j2ojY5OUKiJe8Au3JQXoiYjn9AR6p JClC71SiCumjwpBSQXHFx7ALjwlkqW1DIB5O0n6EMEe+z52erEh5/dK3lUD2S+Wgc2Xm hovvkWCTsvYdRuSmi5c0q0edFur3AbSv0IFejirxNeY7eD7d/ue6S4iNlYgOJNc8MiPu BrjjPVYcYcL9KlTg82RJ3mL9oIL6EtU7MHKYTwqWQvRnxLOARaQBiQZKXN6ubbP4O7l4 0FkUFbUy0Dzmlqdc2ew/YUIsfM6sWraX3mQ02wyvFcJIXe5w7nMOXAolWlHIK2WyorZT uZ4w== 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=XJ2pAui/sMaOUyXfmxgSta4mBDbKP9S14KrIo/LxDX0=; b=VfLjN+7tmpv6JMTz/frotuhktaohghPaKQzPegEPPLL4L1vU1R21+L9njWX4c/xQfR 6qdC22VbAiw8OZq9Nn1doJUjP6wAawoJoBqPZSpod2ku+3NR84TubcdIwNZHaQqPSwHy fgvix6OflDQlI8QR6ErYVbgnKeQHVmhaBFfkVLaCu6b3zcF3VvDNanhuVqJncLy3aD70 XDRmKdBY/SRsMF7hznRjThtf6aKSlyZqFcBiFTX5Tb8eviSWPkFVGXfL8N1TeHa1h+e2 zJgtXhPL15B07Q/m5+0BOY9UKxd3ZJBTJpnxUkbBe7Ude/bqrzsbH7u0nvku0kQijXLw de5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yeOfO4om; 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 z11si24076185otm.312.2020.01.22.05.33.59; Wed, 22 Jan 2020 05:34:11 -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=yeOfO4om; 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 S1729099AbgAVNTx (ORCPT + 99 others); Wed, 22 Jan 2020 08:19:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:35808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728811AbgAVNTr (ORCPT ); Wed, 22 Jan 2020 08:19:47 -0500 Received: from localhost (unknown [84.241.205.26]) (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 4861820678; Wed, 22 Jan 2020 13:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699186; bh=RSUDhfPhXk0dWiZ10UxNgdPkWdvoHWDWWByQvoZi8Lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yeOfO4omESxdLvcUs6gqyvwKYXhk3SJdL8/Ynx5bKc2MIUaAk0U9XcX/x+EF/TSos eV8Pyr5t4R3g/BiezgWxRXyS5nR4Og8zYT2Yz+uwXXIfxUtV9n66xPb1CPiIigEQJT HgGeVx2L7iCe3h0qSCzzwYCzZ5xL6QkbdknCOr2M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Arvind Sankar , Hans de Goede , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, Ingo Molnar Subject: [PATCH 5.4 066/222] x86/efistub: Disable paging at mixed mode entry Date: Wed, 22 Jan 2020 10:27:32 +0100 Message-Id: <20200122092838.449657394@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@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: Ard Biesheuvel commit 4911ee401b7ceff8f38e0ac597cbf503d71e690c upstream. The EFI mixed mode entry code goes through the ordinary startup_32() routine before jumping into the kernel's EFI boot code in 64-bit mode. The 32-bit startup code must be entered with paging disabled, but this is not documented as a requirement for the EFI handover protocol, and so we should disable paging explicitly when entering the kernel from 32-bit EFI firmware. Signed-off-by: Ard Biesheuvel Cc: Cc: Arvind Sankar Cc: Hans de Goede Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: https://lkml.kernel.org/r/20191224132909.102540-4-ardb@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/boot/compressed/head_64.S | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -244,6 +244,11 @@ ENTRY(efi32_stub_entry) leal efi32_config(%ebp), %eax movl %eax, efi_config(%ebp) + /* Disable paging */ + movl %cr0, %eax + btrl $X86_CR0_PG_BIT, %eax + movl %eax, %cr0 + jmp startup_32 ENDPROC(efi32_stub_entry) #endif