Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21348360rwd; Thu, 29 Jun 2023 14:55:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kE7BTqBNwklt3ZxCdz5SGgjKiI13Md5+UpPs6R8pXzysVYen45KJh5tp1h7T88lbZlA0v X-Received: by 2002:a05:6a20:4289:b0:124:eea9:6691 with SMTP id o9-20020a056a20428900b00124eea96691mr6247019pzj.31.1688075722999; Thu, 29 Jun 2023 14:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688075722; cv=none; d=google.com; s=arc-20160816; b=rexGXZqbosUOQOv1vLELWReF9x6ifVn6KmPj5JJrfkgcSFP3mLGgLBHwRWVK+4M3OX gdnivHz4Q2C/G3xjuYjpbCZuR+qnYPB4Z6FldBatNHefGFRfidQfHtroFrM7kpHThAri chMwvHCRRT7gMSWpu6Th0Dvt+DRYayZw+6pM1KrXGhYm+4bzNCeBK80afVpG2cn56BW4 UUmrcl/EY/G57QoPzBVf/vinY+d/jpZBSfc6Hgtce31yYlStICN8NRN9K+WAklKc4VdY 3VvRMRspSUOCzPzd9DQd7oze7JiIBufQE0nuV8DKiI/zxydgrwEElGWbdH/vxrKv6hiZ g0AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=75LIyOY6AijewOlIqwSrq2BC/yOybE4HkxwuTKoOGUo=; fh=vP6Ibpw2HSzfa91ZMkGS/iIHmZYJ2vPS4xCdTrqc4iU=; b=wZuf8ee+j7mQblZrotdwlpvO/hrJz1V4h3Tx7/+M6bSYqouhZTsXBsvZ1dDYX5Jhv6 InA6cZax7m1PO7eQFgKSLJocHpeFGPzfRwGC2p1fXuGqctsK+Sg3IiQ5T/GKRXY8Rcc+ +Q0BllgGzeDCNvkXTZwE7o6osxRRHfFh0eunHozesgOtC6hdwaqCswpUjKaHWCZSC5Cq vMyA2qfIiyaDFcqi+KWonYQpKcvApYLjYKa3OrS8WKVyFhMlqfwkrA6Duq2m0Pn+Xy/F lF3U9I9z9qrvsPwUO9QuEs5j9VwVQPIr5ON2V6zR4U5rLHvzUgxOQNRCcGQoEHw3G5Ib LM8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SeEF1PIu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=YeeoZVXw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a63e113000000b0055b07fcb6d1si5568154pgh.723.2023.06.29.14.55.06; Thu, 29 Jun 2023 14:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SeEF1PIu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=YeeoZVXw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231963AbjF2Vpo (ORCPT + 99 others); Thu, 29 Jun 2023 17:45:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232163AbjF2Vpa (ORCPT ); Thu, 29 Jun 2023 17:45:30 -0400 Received: from galois.linutronix.de (unknown [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E756C30EC; Thu, 29 Jun 2023 14:45:28 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688075114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=75LIyOY6AijewOlIqwSrq2BC/yOybE4HkxwuTKoOGUo=; b=SeEF1PIuFbYRaLxbOKiA/FGfPJTUTsvRrL+bKdxf6Hq6f3ikd0xh9LtzJnwpNzTHhqdVeU qa+e6tZqnBia6KH58YlIMcbU7GsTFjznm2W03sgevPE1qgP0d/WWZYl1Nky6RNWUKbiXJJ o0wtgdtsn24NuXhvl0ZJjJyvHGf++s7OgjT0jLGO0g76oYRk4Oq3lgTVVCY2uAlz/rLZ2B 6sa2VMx3YJVeDrMXoc5RNGAaz6zRXut3T6OVuCj/39iOdJKjGw13qR/kelF4xJtLcPD3Jz 9Or2xd8wTdNQUNBajY/PN9/MSadLoz52PGFFabremXiCOPme/B7pMlvxjXP6OQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688075114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=75LIyOY6AijewOlIqwSrq2BC/yOybE4HkxwuTKoOGUo=; b=YeeoZVXw2ImFfqjK7uAVdS+NDUxpZMWNyqanwHQXxkiM6OowOu2qNxIe2YsXup0tu8EHGc ZvA8TF/bL23pBEDQ== To: Ard Biesheuvel Cc: LKML , =?utf-8?Q?Nikl=C4=81vs_Ko=C4=BCes?= =?utf-8?Q?=C5=86ikovs?= , linux-efi@vger.kernel.org, x86@kernel.org, regressions@lists.linux.dev Subject: Re: x86/efi: Make efi_set_virtual_address_map IBT safe In-Reply-To: References: <87jzvm12q0.ffs@tglx> Date: Thu, 29 Jun 2023 23:45:13 +0200 Message-ID: <878rc20wpi.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 29 2023 at 23:42, Ard Biesheuvel wrote: > On Thu, 29 Jun 2023 at 21:35, Thomas Gleixner wrote: >> Nikl=C4=81vs reported a boot regression on an Alderlake machine and bise= cted it >> to commit 9df9d2f0471b ("init: Invoke arch_cpu_finalize_init() earlier"). >> >> By moving the invocation of arch_cpu_finalize_init() further down he >> identified that efi_enter_virtual_mode() is the function which causes >> the boot hang. >> >> The main difference of the earlier invocation is that the boot CPU is >> already fully initialized and mitigations and alternatives are applied. >> >> But the only really interesting change turned out to be IBT, which is >> now enabled before efi_enter_virtual_mode(). "ibt=3Doff" on the kernel >> command line cured the problem. >> >> Inspection of the involved calls in efi_enter_virtual_mode() unearthed t= hat >> efi_set_virtual_address_map() is the only place in the kernel which invo= kes >> an EFI call without the IBT safe wrapper. This went obviously unnoticed = so >> far as IBT was enabled later. >> >> Use arch_efi_call_virt() instead of efi_call() to cure that. >> >> Fixes: fe379fa4d199 ("x86/ibt: Disable IBT around firmware") >> Fixes: 9df9d2f0471b ("init: Invoke arch_cpu_finalize_init() earlier") >> Reported-by: Nikl=C4=81vs Ko=C4=BCes=C5=86ikovs >> Signed-off-by: Thomas Gleixner >> Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D217602 > > Reviewed-by: Ard Biesheuvel > > I take it you'll send this straight to Linus? I can do that. Thanks, tglx