From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27269C61DA4 for ; Mon, 6 Feb 2023 12:50:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=npnItUPifPI3Z6o0f/OC+2O2OAAk2WOYSxku+eFOAv0=; b=REaeGbn7Fv7CxO Iz4TghWn2XDgEDetSMVQyNE0hNfadkXv4JVqJExBAm57c+zxDio4dJsAZCH6O2TG9YN/LHfcER7m9 5t3gRftUYnkSycnSxiCDAqMKzk8JsgqgA25mESnOn/3kTYv3WHV64xePyXnpEEwSpiE2jpHSMHmuW AjJbnnucApBxYD7mMeEzjkcFAMhs83gQDIQwyPIDOUCmfpUxtIo8PmVnM/9x7/CNwLZy9Mz1aORzC CoKo8pQYgKpjDotWB/W8N19aEqZAd68tjNshmna6XkHJyjXiLU8Izy27wleddUyRwjK2Xr/6M9nVf vGnsySPOVrcJux1d47cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pP0wQ-008WVz-U3; Mon, 06 Feb 2023 12:49:51 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pP0wO-008WUn-J9 for linux-arm-kernel@lists.infradead.org; Mon, 06 Feb 2023 12:49:49 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 61E4C60EC4; Mon, 6 Feb 2023 12:49:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68680C433D2; Mon, 6 Feb 2023 12:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675687786; bh=fSkpN+gT5cuBhbCnweyTH9Ry8FXA4fNsNVToxzaN468=; h=From:To:Cc:Subject:Date:From; b=ZXDSHVGHQJZtsZYWvL90JW/pG2F5O+jiFraaz9QcqY74aCUGzOP8tWpIUu+LdsBSt wnzM1p1NrDdMOGmWhD3nx/9TQFEzg8IQMhqKC0z4HotVuoVP86O9W5PzUOFXYTJLJb zDFDXxUMwzHz8Ypj+XAtNMZjyBOsFI0bv07dt40KlGyqbp4M7MX9EX5UBZPsAZLxOw hXxa5xYMCd2wpMwdiHKdPbZQsEq6MW7ScDzt3Q5sWtJUKjnjPINZt7CHoJbHwFzQzO F1hUpnMHpHYURuHfpuxoQa4H3QKWvTreIPMQVI1n+qlQpMga8c1FxEj0pp9J2UyRD5 Mi9TxfzAJdC6w== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Catalin Marinas , Will Deacon , Kees Cook , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Subject: [PATCH v2 0/3] efi: Enable BTI for EFI runtimes services Date: Mon, 6 Feb 2023 13:49:35 +0100 Message-Id: <20230206124938.272988-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1774; i=ardb@kernel.org; h=from:subject; bh=fSkpN+gT5cuBhbCnweyTH9Ry8FXA4fNsNVToxzaN468=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBj4PdcIh2OTQBLySYPjqXUEBgp6kblCsSE0GY/Y Xpi16zhQwWJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY+D3XAAKCRDDTyI5ktmP JFV7DACTGjFtc41BWSTho5LIkJla8YVyqX1QjJixLvvTsbeR4pUwKTVoE7NigKNdfOv+LuPAFLU 9eT4UgE7931be/Rjfljyv3hrnaoL1JQpUIml+gaOjfvaEuaPvefositf5nUYBMdYO9ft4umMkrg wxSJvAlqfGl5Zy2UnUc0On2HXcTQ1u1lcu3kxuwVYLzbhY//EZ6svkd5dzVvPaKxXXHgW/gHCi1 y6wNKnS8ZpCGPOzdKArWfIMGcHcJuBTESFa6/cvFnQ9EUg+1Waqnv5428OwiZqyTjeTiRqWRVyB 1u821NxCBQbFIYZ0uQLS+SeR0vNd6ZZ88v0mJFMi6h+Xvn2yhTN/ySduR+811v0d1aOZKuEschN bSP6yIzgHJeMxsBUq5i8NSD2h+hVwV+/d+wZR5cliAkiyP9NpD7Gdjw7nirMgGCNvouZ6G8fSEU Fk4ETVSnFXhnvc7QImbrH3M9JO4Tg1UNKdaZhhHzhSRKndaA+4wllxN2rR7YD9TbFx/jo= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230206_044948_744777_043F7D84 X-CRM114-Status: GOOD ( 12.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The EFI spec v2.10 introduces a global flag in the memory attributes table that indicates whether the EFI runtime code regions were emitted with BTI landing pads, and can therefore tolerate being mapped with BTI enforcement enabled. Add the generic plumbing for this, and wire it up for arm64. Changes since v1: - enable BTI in UEFI code regions even if CONFIG_ARM64_BIT_KERNEL=n - deal with BTI exceptions occuring in EFI code gracefully - add equivalent handling to x86 - add Kees's R-b Cc: Catalin Marinas Cc: Will Deacon Cc: Kees Cook Cc: Mark Rutland Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Ard Biesheuvel (3): efi: Discover BTI support in runtime services regions efi: arm64: Wire up BTI annotation in memory attributes table efi: x86: Wire up IBT annotation in memory attributes table arch/arm/include/asm/efi.h | 2 +- arch/arm/kernel/efi.c | 5 +++-- arch/arm64/include/asm/efi.h | 3 ++- arch/arm64/kernel/efi.c | 17 ++++++++++++++--- arch/arm64/kernel/traps.c | 6 ++++++ arch/riscv/include/asm/efi.h | 2 +- arch/riscv/kernel/efi.c | 3 ++- arch/x86/include/asm/efi.h | 4 +++- arch/x86/include/asm/ibt.h | 4 ++-- arch/x86/kernel/apm_32.c | 4 ++-- arch/x86/kernel/cpu/common.c | 5 +++-- arch/x86/platform/efi/efi_64.c | 8 +++++++- drivers/firmware/efi/memattr.c | 7 ++++++- include/linux/efi.h | 8 ++++++-- 14 files changed, 58 insertions(+), 20 deletions(-) -- 2.39.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel