From nobody Tue Dec 16 21:26:49 2025 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 712461C84AB for ; Wed, 15 Oct 2025 21:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562066; cv=none; b=m883CIvYpJC3u6lmoWJonLY/22ep1rybAzLMv4y9dGdODGt9NZzuoVfhf0oZwnRNVWh6mFf313DVu3MzNZWtRgeebEMjNZ8oAYzpwt5jp40pjgC8/uGye7yVldlsZC2ZHB9Z2z9Ud8RAyIEqJZki3+LufiALJw5RAWsbM0K7Px8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562066; c=relaxed/simple; bh=bNZ5nGNUpC8e2pvYUVL99aPY0d8SHeaESMtukQB/3XU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LZPBuf+wbMI0kFJctE6ZDbTcwy3NS/tExBy3gEQCNb0vrxWmEYALEZMhatuRdJKQ/P3PmTnSN+oSdtAi0wv9Ya1fZnB6L11OYPjcC1oamldMl7BPf+RtTVbMmLiBIvfTAn91RK1UdrpHOFg5owHxl1KYDk/P7UVlWb14Kp4x7z4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hafDm8Wm; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hafDm8Wm" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-3ecdd80ea44so1198333f8f.1 for ; Wed, 15 Oct 2025 14:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562063; x=1761166863; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ka9acDfWYNVlXTADikeAWQzZKPfls3YVu38LVwS+Ync=; b=hafDm8Wm9R1j2wleWPCIBHHpvUR0ANn9ufO+biLcxPUXEAux2L9IOtrX3Vhp19rFPZ qjQPNVq5bfe3HGSYVSLwwoS829dFnddsNDbDWSd0TPUjLbFmNbUY30DJyFitUpDBYHG0 x8APgU618N9ghMX7ffE6Iu+STeMOKFvW2SrT7wwaNTYXWcQhRnaURbFe3hNht/pFtXeb 5Q3u/0hMxSjInTuFvHv0Fgoyylx91QgabimnMxrWRZEpStRoRnU0hVAMjv4eC/oz2tJ4 VEra1YLB0BzLrCTwK3hhQjL0DiW4cx5DkmqN+POgi7HMNhpFGCZOrmaWu0HDX3kXZpZC z+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562063; x=1761166863; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ka9acDfWYNVlXTADikeAWQzZKPfls3YVu38LVwS+Ync=; b=WmEKCyQd9B0IZ3suAMdsm3Xu/rRucHiMLgUv4NBlyz5tqwL5Hv26qYj8vOp+PqZgVq aosbJobsR19rssIanTyh4VjV7YD+DjZa4Y1NkN7fkEDWmv/jbpBNy5o0twr8FTIIl4g/ 9pY9PeGyEqCbbOacG0DJeW8QtHgiPtPI2Hyb3Bd/9w2cynQmjuIb38AxxWE39B/+Kn7q 9KxTa1sgrzRcsPT2umNFj0XXmWp4a4Okkv+pGXZZDG1DVxb8SPRXRPn4EgSZuAjgEIe5 k9+CGVtxbz1HGy4rzxXfnsac74EzjdJ0A0bmAmaVwvC25ILVBw4IL85YH35sPyXy2yEh FldA== X-Gm-Message-State: AOJu0YwPiZsz6gfYVsWQ0FhFEsdhAHSMWHHnlsl2bgy1AtXfA1KAs17r 1xnSh2FYes8LGO4EaW+hrlnMxJTSRYj3bHKFSAhtQzdi2wSLsc2n9pJ3gd4BIdv/f2Y0jGLYeg= = X-Google-Smtp-Source: AGHT+IFKTW/66VSsBVsAUER/FDq7sYd1YbEd3eoZpeBB4yPvhP9MMDUr1WYotgBpEovQntSXolk5aG9w X-Received: from wrbbs13.prod.google.com ([2002:a05:6000:70d:b0:425:f04a:4d86]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:4608:b0:426:fc52:cca6 with SMTP id ffacd0b85a97d-426fc52ce1amr745223f8f.7.1760562062643; Wed, 15 Oct 2025 14:01:02 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:36 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=804; i=ardb@kernel.org; h=from:subject; bh=JyRr6WrjNMazb438tuZ9KzQEKZXISsNH26aHqvF27Qc=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDV2tC1n7FDTPeV2T5Cns9OHybTyotoSC/MG9h28E9c 6e9XhzRUcrCIMbFICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACbibs7IcOb7w1WO7Qs+rOkM ELf0rhGcYyJ5Y9+Kya9PRiVKqrEftmf4Zx95zqD/wkvN1ftm2b2fulPT5faOaY7fu9K+9XRNYPV R5QIA X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-10-ardb+git@google.com> Subject: [PATCH v4 resend 1/7] efi: Add missing static initializer for efi_mm::cpus_allowed_lock From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar , stable@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Initialize the cpus_allowed_lock struct member of efi_mm. Cc: Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- drivers/firmware/efi/efi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 1ce428e2ac8a..fc407d891348 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -74,6 +74,9 @@ struct mm_struct efi_mm =3D { .page_table_lock =3D __SPIN_LOCK_UNLOCKED(efi_mm.page_table_lock), .mmlist =3D LIST_HEAD_INIT(efi_mm.mmlist), .cpu_bitmap =3D { [BITS_TO_LONGS(NR_CPUS)] =3D 0}, +#ifdef CONFIG_SCHED_MM_CID + .cpus_allowed_lock =3D __RAW_SPIN_LOCK_UNLOCKED(efi_mm.cpus_allowed_lock), +#endif }; =20 struct workqueue_struct *efi_rts_wq; --=20 2.51.0.869.ge66316f041-goog From nobody Tue Dec 16 21:26:49 2025 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 748B07494 for ; Wed, 15 Oct 2025 21:01:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562068; cv=none; b=NBWZSB7DXazw+boZXakYG5x6Np/MjUEonF7fDd+5cDkMARh4cQIG+UV/l9mHKpnBcZRZ6QNFJvXGYD3f8VwkCW24BYNG1KNj+QUoe16CPWfduN3zSRq/0fxbageFXw6jzLyZduZr9hT74O5N88sfBX9vg3X1kQ1uccU0FJiPkI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562068; c=relaxed/simple; bh=pgc/OWqzPdhZ+ZByHmG0zKs5YUD6w7p8tgTZ4qv9RYY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Bu0A+f6SZLIqyvxbPtr92I5bg2n0k98uzgbc+pMajIDXLnVQRtl/eh37T7MZ/yQBbBLh3H4OsgeiTsTah76EpV18alTaSzibCWVAkGbpv7c9SvfNXqwRk2wJdZSjIllY1J0XX5PRSkuAhk+smDw7RZq8Ta8kNWfZCpkQAXHRndQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Alh6XGsl; arc=none smtp.client-ip=209.85.208.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Alh6XGsl" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-63bf373ede2so1280648a12.0 for ; Wed, 15 Oct 2025 14:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562064; x=1761166864; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=TD0cTRsfkQ0iON4YZtzctxecoLUwl3UhcnKx4hSqyjw=; b=Alh6XGslOoaDHLgHMozKhflIJuySiD2Ps3HMUrycl+vPsV7kKs0wodskKQWhpT7thW yH6K4ZRHtApemQfJh25HV4lCCQmco/foXE6pq8lYD2KBkl/VbEg8MpOdIafO1jiVuC+u BKpCJ+aA9oMVT+8Vwsllw++SkN00Pe29AioPq2zn69rNzXhEfG0oLGJwRWwUsXWan++q bvcbHX3CrJNYl0+w3LrFkxY0bpQJXrEDuNNhrZL8XVta/vYpmRd/kY5vFt1ihm1wfJ+n zyjpmAOo1VbTdoOwp5Qm7SiDYmMwoXHHwwl2mbJzgFKbl0UPRtELhdHgTMNVOiv/UKfb HiEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562064; x=1761166864; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TD0cTRsfkQ0iON4YZtzctxecoLUwl3UhcnKx4hSqyjw=; b=RXxT28x4e70ZyITbHik5F5K7+y9gkgPhhHLyIznZgUZ+eyXv3YNtf+MI1e4vRgGzh0 cEp3MW3a7AhGgW2a1gAY0aryDLyKlAdT0ibjFVNIL28yRxsqrB+e5FwSh1TUTgydcQrD f27pIJNS7WX3n0UInUwQZ11vT7kOBH65GV5ULpFM0kTfV2pcS6IRTKgGodUInvDB+hg4 SG8X1OwNkZUNNwRd6oQmoHtHsPb6ylxjFQfMQL6Knz/fKa17VtSguN98cuGgJUlnFJIz 92cVZ7O7t8IO8TopFRM1ogVtsPoDbr93IzuwbS/wn5OXvmffH8tuEmmX8MmAEybV+qPb djkw== X-Gm-Message-State: AOJu0YxIZdcSsZ8NMl0NfODQKsQ4n8/LnuXBdghPwReImht0qMn4J5Ec wSxbSEOZgunP5jt6pJRD92BtAet9pODQooZLrMrHHOAmm5r6ytY08NCI/HifNMsV/3HH1bszaA= = X-Google-Smtp-Source: AGHT+IHxb8mJwoK5rKnOiIInhvJ4q4VZQJ2QCiVbFL8msAiqQJ16/urDJrNLJku05vTcxZXu/6n/DgR7 X-Received: from edcy14.prod.google.com ([2002:a05:6402:358e:b0:63b:dac2:1b06]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:518b:b0:62f:4915:bc47 with SMTP id 4fb4d7f45d1cf-639d5b41857mr27245561a12.1.1760562063741; Wed, 15 Oct 2025 14:01:03 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:37 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=3615; i=ardb@kernel.org; h=from:subject; bh=gYpYJdboczLvZzwBAFCsuy/KXaHSzTBHbFoWrECa7Dw=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDV1t9cQbj1TMnuX+/1C4+c5tFuobh62Xpm2btO7vfz Zmmm+DdUcrCIMbFICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACbCv4aR4aJToYvt8st5Th+S nGolgoNnim0RWpP6ZF5fzOmdUoJ1ZowMixcI9ekxzvwTNP3mXMnfTRcy2o4za+5b3DPl4V3pA5f D2AE= X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-11-ardb+git@google.com> Subject: [PATCH v4 resend 2/7] efi/runtime-wrappers: Keep track of the efi_runtime_lock owner From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel The EFI runtime wrappers use a file local semaphore to serialize access to the EFI runtime services. This means that any calls to the arch wrappers around the runtime services will also be serialized, removing the need for redundant locking. For robustness, add a facility that allows those arch wrappers to assert that the semaphore was taken by the current task. Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- drivers/firmware/efi/runtime-wrappers.c | 17 ++++++++++++++++- include/linux/efi.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi= /runtime-wrappers.c index 708b777857d3..da8d29621644 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -202,6 +202,8 @@ void efi_call_virt_check_flags(unsigned long flags, con= st void *caller) */ static DEFINE_SEMAPHORE(efi_runtime_lock, 1); =20 +static struct task_struct *efi_runtime_lock_owner; + /* * Expose the EFI runtime lock to the UV platform */ @@ -219,6 +221,8 @@ static void __nocfi efi_call_rts(struct work_struct *wo= rk) efi_status_t status =3D EFI_NOT_FOUND; unsigned long flags; =20 + efi_runtime_lock_owner =3D current; + arch_efi_call_virt_setup(); flags =3D efi_call_virt_save_flags(); =20 @@ -310,6 +314,7 @@ static void __nocfi efi_call_rts(struct work_struct *wo= rk) =20 efi_rts_work.status =3D status; complete(&efi_rts_work.efi_rts_comp); + efi_runtime_lock_owner =3D NULL; } =20 static efi_status_t __efi_queue_work(enum efi_rts_ids id, @@ -444,8 +449,10 @@ virt_efi_set_variable_nb(efi_char16_t *name, efi_guid_= t *vendor, u32 attr, if (down_trylock(&efi_runtime_lock)) return EFI_NOT_READY; =20 + efi_runtime_lock_owner =3D current; status =3D efi_call_virt_pointer(efi.runtime, set_variable, name, vendor, attr, data_size, data); + efi_runtime_lock_owner =3D NULL; up(&efi_runtime_lock); return status; } @@ -481,9 +488,11 @@ virt_efi_query_variable_info_nb(u32 attr, u64 *storage= _space, if (down_trylock(&efi_runtime_lock)) return EFI_NOT_READY; =20 + efi_runtime_lock_owner =3D current; status =3D efi_call_virt_pointer(efi.runtime, query_variable_info, attr, storage_space, remaining_space, max_variable_size); + efi_runtime_lock_owner =3D NULL; up(&efi_runtime_lock); return status; } @@ -509,12 +518,13 @@ virt_efi_reset_system(int reset_type, efi_status_t st= atus, return; } =20 + efi_runtime_lock_owner =3D current; arch_efi_call_virt_setup(); efi_rts_work.efi_rts_id =3D EFI_RESET_SYSTEM; arch_efi_call_virt(efi.runtime, reset_system, reset_type, status, data_size, data); arch_efi_call_virt_teardown(); - + efi_runtime_lock_owner =3D NULL; up(&efi_runtime_lock); } =20 @@ -587,3 +597,8 @@ efi_call_acpi_prm_handler(efi_status_t (__efiapi *handl= er_addr)(u64, void *), } =20 #endif + +void efi_runtime_assert_lock_held(void) +{ + WARN_ON(efi_runtime_lock_owner !=3D current); +} diff --git a/include/linux/efi.h b/include/linux/efi.h index a98cc39e7aaa..b23ff8b83219 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1126,6 +1126,8 @@ static inline bool efi_runtime_disabled(void) { retur= n true; } extern void efi_call_virt_check_flags(unsigned long flags, const void *cal= ler); extern unsigned long efi_call_virt_save_flags(void); =20 +void efi_runtime_assert_lock_held(void); + enum efi_secureboot_mode { efi_secureboot_mode_unset, efi_secureboot_mode_unknown, --=20 2.51.0.869.ge66316f041-goog From nobody Tue Dec 16 21:26:49 2025 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6D9E2D5930 for ; Wed, 15 Oct 2025 21:01:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562068; cv=none; b=uW/xF3TLkjoLbwNOddrVowMQxRNL5srndURuZcFjDbT9gC1FSCHEbVAyZbped+GvSalaZ1JrkaLqST/pwW0/wr/aCzojgORMRaIMbpx1y0luboL5WcPcY5ZgVBlTL1iaPEGw+sYVNSYl10lUJW5PE8tDC5BO6VJYANMflCNY5T0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562068; c=relaxed/simple; bh=OKkz72icLYW14imSSGsnJwZQIz4ZrV8RIoFMrz/DOHo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=H/6tSdiFYUOOENy56rIchA5jJMBOgx71ImYHZBh3HYotIlpPQGSu1G8XzyQAdAePFw7W4aXw61QkL8RZey84ch8nUD8iwfaunHGJMq9aCQQT2jGmaBB3pF/8aH2sT+8OsgTmZ8Y3JBju7AvmIuwJgz7Ge+c0ehpclFW4iHiD9cA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LeXLlNlp; arc=none smtp.client-ip=209.85.218.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LeXLlNlp" Received: by mail-ej1-f74.google.com with SMTP id a640c23a62f3a-b5c4d76589aso2791866b.0 for ; Wed, 15 Oct 2025 14:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562065; x=1761166865; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=dl7DSFNXrvgC8fPiu6fPIF6OEEmMKscydyxcv7oyMcM=; b=LeXLlNlp4b5CawJnjlxgzI2sM0o6Rkxo2gmwphjX5/HO63aVLI8971cXQmnLgago7o 5YJ8/N0Vw4pgM00+Q4oFJPkhL1tfYSwjo8H/d456arLYjxGPWFp3I8yyz1dCyVWXazjc N0NnzvA8WXFadgLQfVxv2TsXr3swEZfhtMzX5jhK7ilgWCcv5zo01p6jcrM7yIDrgacM bp+N3n8PO0tRh8GN545EDJS5y3zAXUV2TiV3sNXqYYKrq+I6Rix8hyPGG9Yrx7kBldEj HYZPVjG2BX+Ewi3Gl3e6Tl6cSOM1OBh37dgNJqKaOVnFC/2ZK4RM7istHOaVyVkU0q23 1gWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562065; x=1761166865; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dl7DSFNXrvgC8fPiu6fPIF6OEEmMKscydyxcv7oyMcM=; b=lvfOXtCbSYDSHOcFLhiZGWi/z1UUINWTVrqtMmnyn124+PuHtFUHprENiUMVuzYeix x3RPsU9m443OaZ2zLfvZU4oZ5sOLki44N7dG3mv1GzbgXB0tZFDi89yNZiGPOmZbiZyh nddv4CG9AVKYZo9wdZTTo+3XZm+ZCbRRojCJFCT3Nl+M9Awy5VT0qYysp+MIGGx0e/1+ ZDC5MBVO1y1R5BjbjW1OsVwq4cFYZyuskvlPbnKQMFbskh2BWM/Sr9EhyldHQfSXPE/i 4Iql+wBGgCoPdjTZaTswaiG8MtEPJ01RxOCxmTqNtm90ics5KZyNea7lHsZC3xm8vT7b V69w== X-Gm-Message-State: AOJu0YznkUZs4yx3IiN3lNf701T91IUmXzbh91jQVDFH7A8GrwE4u7/o v4+vMtNKCHuhZ2Mwn6JgCnIFv2OPRcDuWiK0hGNWDqxMbfFnE9osJ6/fE7fj/vcxrIImJDA3RQ= = X-Google-Smtp-Source: AGHT+IFbnpDjbsGYz+B5RZXbbX+lQAERWey19YRdHXPDBHHjm8WsWQOtc3beJ3/VDPI6WGbFnSNWq6W+ X-Received: from ejkf21.prod.google.com ([2002:a17:906:60d5:b0:b3e:d65b:d781]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:980f:b0:b42:9840:eac5 with SMTP id a640c23a62f3a-b50acb0e645mr3264235166b.61.1760562064831; Wed, 15 Oct 2025 14:01:04 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:38 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=901; i=ardb@kernel.org; h=from:subject; bh=3k3eAeRzb5JtIy3mWW+ubq7svhGC8mUZQWnX3o9AW0Q=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDV/tegTVS5dfXu18UWPjk1eM+1663m/bMeRC4e7bqM +23r1njOkpZGMS4GGTFFFkEZv99t/P0RKla51myMHNYmUCGMHBxCsBEmOwZ/oqnmq6ITeacf2jG mnnzLl0RqJGM0Df8/FlHNOxjasSsf5MZ/qc/KH/84UNLpdyBY1qtf2/cjU7fssu6aWcD8x4784P vOjkB X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-12-ardb+git@google.com> Subject: [PATCH v4 resend 3/7] arm64/fpsimd: Don't warn when EFI execution context is preemptible From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Kernel mode FP/SIMD no longer requires preemption to be disabled, so only warn on uses of FP/SIMD from preemptible context if the fallback path is taken for cases where kernel mode NEON would not be allowed otherwise. Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/kernel/fpsimd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index e3f8f51748bc..3d848c89604e 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1934,11 +1934,11 @@ void __efi_fpsimd_begin(void) if (!system_supports_fpsimd()) return; =20 - WARN_ON(preemptible()); - if (may_use_simd()) { kernel_neon_begin(); } else { + WARN_ON(preemptible()); + /* * If !efi_sve_state, SVE can't be in use yet and doesn't need * preserving: --=20 2.51.0.869.ge66316f041-goog From nobody Tue Dec 16 21:26:49 2025 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CEC12E7BB6 for ; Wed, 15 Oct 2025 21:01:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562069; cv=none; b=AAd5Rp8v7QLitzxyN4RJxEY1hRHsugTNet5y4D9WweoCh9IQeuso4D0oe6dwcBXW6HOzVqt94GVqwEODsrs5+UP1QNwLIeDz7lhBI6Vu+mSw6T9U53pvQ/yza0IgiRf3S8xq9N3ObQuvJQcqBTwFMFm3+MMnO6KOPyj7EjmSHgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562069; c=relaxed/simple; bh=plTDTpax7UhabJ3R97rpcaBJybZ/LXy6TKvHDYaOW40=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ciXhrv1RJSnLtrs58rY2H/RRu0gHtOCrG5KRIYCDA8SOgnQH9nn2xk5VT0XIg+gXYWmbxwVcd4DuVntHAG9oMqtCbKM3Ak5vx+q7V2m3Qf5h3vXAkXS5ZAiRwxyE4oYTjqp1C7GAxdg1fiEefdRvfavnDpIEniArjQjOzlX7AP8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=TvReFQcv; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TvReFQcv" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-3fba0d9eb87so27284f8f.0 for ; Wed, 15 Oct 2025 14:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562066; x=1761166866; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=19SuM8BkFU86AdrsVL9he5wmDJI8XYP735e24p7BzJE=; b=TvReFQcv9UcVKJ/bi0wglPCLAysT/jYaBlHwhTAsOzCC5Eq24laULjnH1nnhzfHmEi 3/xyMBNmBnwWaC7p7zqb//0iUaYBZvIhT6bNHCPhDNIzvN131dHx8lLEirnZ8/mFn/AW V0wJzCex3YdTCMtcMNY4bm+2ZVrMLV5iwyAMkAjPalCDEwOqrZanJP+/MexLEFF8Khf9 jr53L8a9bheX7/LOMMP7M4ua7I7mxP9w45xyi9BVJXITfxXrxplwem+Oy8MKKJBVm0ph w6/Yu4gSopLjGxJ9DWUJ4FR5OMOcWCutmERTw/Yri+MEPuCR/LQBEc8koN+d1mxfcv2G S2Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562066; x=1761166866; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=19SuM8BkFU86AdrsVL9he5wmDJI8XYP735e24p7BzJE=; b=Mmq0hNc9y36CxjI9S7eAMQTCeLh+ragqoyVNmCghhfw9ARvLdCDAHoel/B3yqKnaAO vD/RApKn3um3xrEa1ilA8WFgUWkrExiIQo8bT0CgjGUNOCiUVjcd6yD5DZZrqcXokzjK MS28nbdAFXGcOvFr3HWA4vKbhXLOfSVXqIPwUaOEPlYt83r39DAdyDahcUHemihbKzMe LLPf0HrCVvdNcdXxQ9+zdv0OBEv2LD+rGC6ya5P3sNEYtvhfx7L3UwvOUBHvy/svG2AH NBCUfXipfWU8iD28Scb7irrmlglp6Ywrx3RDFIs+DLPiYztR7OCkIy1Xhj//b+Kpku8J 62hw== X-Gm-Message-State: AOJu0Yyv51l8vjlIrIFpjVIp/HG1PbwXNUrxUgX8sJRSHkcHqdQ4i+sO rM+w8eTlN+tIbzoF0Pb9oBGeBlCMSspJxAf8qHbqJ+S35LT5dA4ayLFybxlydVHAGcjJ35D51g= = X-Google-Smtp-Source: AGHT+IFQpVg2U3+T4NvaCVGg+3jjnpHjurMn96RVhjpcDm7JJIbQd5n2ckQZklYZZG14FZbDn1HXPBda X-Received: from wmbjn22.prod.google.com ([2002:a05:600c:6b16:b0:46f:aa50:d718]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:1a8b:b0:425:8bd1:fbb4 with SMTP id ffacd0b85a97d-4266e7df95cmr20229304f8f.50.1760562065972; Wed, 15 Oct 2025 14:01:05 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:39 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=3253; i=ardb@kernel.org; h=from:subject; bh=FjAcGhb6VYi+vJfe2JpmxvHhAqT8SyzVHt/xzyd0TNw=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDV8ejrsz6he2dwTNnrNr5LD+tP1yqof/ebabW69esX 2+PX2/SUcrCIMbFICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACaSYsHw369KU8vDXsfq9TfP xX7nJbPk247V5Kkv/vbC8eOWHEUvJUaGa8++1bypTZXk3J6btGcxy4fcT2o31pZyl61w259wpsW RBwA= X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-13-ardb+git@google.com> Subject: [PATCH v4 resend 4/7] arm64/fpsimd: Permit kernel mode NEON with IRQs off From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Currently, may_use_simd() will return false when called from a context where IRQs are disabled. One notable case where this happens is when calling the ResetSystem() EFI runtime service from the reboot/poweroff code path. For this case alone, there is a substantial amount of FP/SIMD support code to handle the corner case where a EFI runtime service is invoked with IRQs disabled. The only reason kernel mode SIMD is not allowed when IRQs are disabled is that re-enabling softirqs in this case produces a noisy diagnostic when lockdep is enabled. The warning is valid, in the sense that delivering pending softirqs over the back of the call to local_bh_enable() is problematic when IRQs are disabled. While the API lacks a facility to simply mask and unmask softirqs without triggering their delivery, disabling softirqs is not needed to begin with when IRQs are disabled, given that softirqs are only every taken asynchronously over the back of a hard IRQ. So dis/enable softirq processing conditionally, based on whether IRQs are enabled, and relax the check in may_use_simd(). Acked-by: Will Deacon Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/include/asm/simd.h | 2 +- arch/arm64/kernel/fpsimd.c | 25 +++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/asm/simd.h b/arch/arm64/include/asm/simd.h index 8e86c9e70e48..abd642c92f86 100644 --- a/arch/arm64/include/asm/simd.h +++ b/arch/arm64/include/asm/simd.h @@ -29,7 +29,7 @@ static __must_check inline bool may_use_simd(void) */ return !WARN_ON(!system_capabilities_finalized()) && system_supports_fpsimd() && - !in_hardirq() && !irqs_disabled() && !in_nmi(); + !in_hardirq() && !in_nmi(); } =20 #else /* ! CONFIG_KERNEL_MODE_NEON */ diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 3d848c89604e..6d956ed23bd2 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -225,10 +225,21 @@ static void fpsimd_bind_task_to_cpu(void); */ static void get_cpu_fpsimd_context(void) { - if (!IS_ENABLED(CONFIG_PREEMPT_RT)) - local_bh_disable(); - else + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) { + /* + * The softirq subsystem lacks a true unmask/mask API, and + * re-enabling softirq processing using local_bh_enable() will + * not only unmask softirqs, it will also result in immediate + * delivery of any pending softirqs. + * This is undesirable when running with IRQs disabled, but in + * that case, there is no need to mask softirqs in the first + * place, so only bother doing so when IRQs are enabled. + */ + if (!irqs_disabled()) + local_bh_disable(); + } else { preempt_disable(); + } } =20 /* @@ -240,10 +251,12 @@ static void get_cpu_fpsimd_context(void) */ static void put_cpu_fpsimd_context(void) { - if (!IS_ENABLED(CONFIG_PREEMPT_RT)) - local_bh_enable(); - else + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) { + if (!irqs_disabled()) + local_bh_enable(); + } else { preempt_enable(); + } } =20 unsigned int task_get_vl(const struct task_struct *task, enum vec_type typ= e) --=20 2.51.0.869.ge66316f041-goog From nobody Tue Dec 16 21:26:49 2025 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D18E2FB619 for ; Wed, 15 Oct 2025 21:01:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562070; cv=none; b=s1/02ZyExJibiuCD+GJIKJ+E0uIYCrRxR/xUKiqVl//YWNT4H1brSOwRXOn4QROJ4bu/YhRBdfh+ZAjR7J/g88EvGigg16IedOt/gLZe2SR95Ld9+ZEyNT+0nJpuSyaFYaHkwFv2Wy2348O7Wc4lOfku4nyhkS5+wtJBk1hGBxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562070; c=relaxed/simple; bh=bSLBiu0ysu2fpSjU/5Ic3vJljP+H3GdHCmIfG9IdFAw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rtYi/1a1kl+ze/6/+kN49IRTCHRHfqnsMuXe+5L3NOaDCd40lLCcS6WDCKQ5Z4Hu9uYdTE629DpySncbLkNbuN3KUUetblxK+GEVRZtKEZDhpPynde6vnR7iXMWv0iqw4BPve7jnTTAOJDBkp4W1ZX9CeYqE98FHrH5uajP3BV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=oNW7RfHm; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oNW7RfHm" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-470fd49f185so197025e9.2 for ; Wed, 15 Oct 2025 14:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562067; x=1761166867; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=moTm52zNGwrt++YsXPE2KY3jx72epI/Bj7ns6GGNFCU=; b=oNW7RfHml7K84ZSq3nmGOcCZWU6o9h0wrhRuN+vZWWdoryoVCrEaXTi6eo4zchcA47 zBEHevUmzuxU693aY7fl3rJPSmb0QUDR5S3mS8OuqLFAEp68VNzWeU9Njio2bdSQFKBt GeSqid2XNLako0eAJPnhIXV09vIedLqYQp7271/qBJ6bgdFQYiDcsyusPcNhhzBy+qP4 HSrjp8L6Y2gM87aBuz4y/MtXsAmUOL2j3dK11U6A3K+6o3+kpjH9q0dqy3PjR+rOX5wG CCLN6AAYQ/h/HBTKOefkDcgbaiVzuXffEUs+3mbpWAOCc0b0iH6bjyx0+68E7kHHS1T/ XSlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562067; x=1761166867; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=moTm52zNGwrt++YsXPE2KY3jx72epI/Bj7ns6GGNFCU=; b=veM6oZDbsDJL4RtipvZXohZWGBrqc/OLS3KMILH02ny/myWkPSqNxbeIbvgAwPFDgZ Ora+WDzsqaGGXCVT02K+uiTFon6GlvJcE55elAD2HRVFsFovDvQx/10Tc3lJcHobFETh Dsj9Wh2n8yMmyLVUdJc48W853fpsQN4tRQyMaLqDX0byJ/2GvqhYNRqhDkIkT+ycVIUr 37lHS7S+g1fPQ06Dr5zNyX6VF81njzah7ZduUT2vOnJHl2Gsuf6UY88z8CQcriLCp4kF Z15eYWfrd2xNVWyJ+pCruTjQFc1D0IT6k2zdkND7umuz1avi1MsmhLva5OK7yAg3sg4K xp1A== X-Gm-Message-State: AOJu0YzQ7fwhXXhe8DvwdBpd4qRqpu3ociXdp8FojQAuInVWLvgRjumg Sz6aLHGTnQY2dLS6QWxwB6B6VnwCZsz8tP/8TvjmOWCsY4JedFh0Yy1HO1XHVIasnJ2YPBgaEg= = X-Google-Smtp-Source: AGHT+IHH59sy7BRWjY21dGoKX4xtSPPUT5SSUEKeDj8aOzwiGGO++q5eu2jsvFIaGupUZgFYbR/j27IV X-Received: from wmbz7.prod.google.com ([2002:a05:600c:c087:b0:45d:d60a:8d7e]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4745:b0:46d:cfc9:1d0f with SMTP id 5b1f17b1804b1-46fa9af30e5mr238090085e9.19.1760562066912; Wed, 15 Oct 2025 14:01:06 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:40 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=1252; i=ardb@kernel.org; h=from:subject; bh=oVK+oBrwb79YVKXaSmfzPNI2/YhF6t6CcaRgcjvBZKg=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDV1f3/5ul8hNbKh+8Zbsj80cisndue7zrlEc6PtOnT QpiddjXUcrCIMbFICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACYit52RYZ4Qs+dJc9XZnP4n frR4rXqa5Ma+X6v4iZ38lyaPotjSK4wMX9/J+1/oEZxeKK1ySNHzvbd/MssT0+t819wvfLoxnVW bDwA= X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-14-ardb+git@google.com> Subject: [PATCH v4 resend 5/7] arm64/efi: Drop efi_rt_lock spinlock from EFI arch wrapper From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Since commit 5894cf571e14 ("acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers") all EFI runtime calls on arm64 are routed via the EFI runtime wrappers, which are serialized using the efi_runtime_lock semaphore. This means the efi_rt_lock spinlock in the arm64 arch wrapper code has become redundant, and can be dropped. For robustness, replace it with an assert that the EFI runtime lock is in fact held by 'current'. Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/kernel/efi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 6c371b158b99..0094f5938ba6 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -165,19 +165,16 @@ asmlinkage efi_status_t efi_handle_corrupted_x18(efi_= status_t s, const char *f) return s; } =20 -static DEFINE_RAW_SPINLOCK(efi_rt_lock); - void arch_efi_call_virt_setup(void) { + efi_runtime_assert_lock_held(); efi_virtmap_load(); - raw_spin_lock(&efi_rt_lock); __efi_fpsimd_begin(); } =20 void arch_efi_call_virt_teardown(void) { __efi_fpsimd_end(); - raw_spin_unlock(&efi_rt_lock); efi_virtmap_unload(); } =20 --=20 2.51.0.869.ge66316f041-goog From nobody Tue Dec 16 21:26:49 2025 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDA853016EA for ; Wed, 15 Oct 2025 21:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562071; cv=none; b=cFIgbF1HrXEl5AjPgCGSecXpvRLYb0Vdrz3q5Av4WYshEusEKkaBEszXT6mnvUhijbiTWofBNysym1ZbhfdmXo0XAfyaA7BgsPiOaHHABT3Sfv2Wky1kQcF9EOjLwsAOunjXaWN7agytD+z4/dV6ef5PjGVqBXFV74A8eyXd9yI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562071; c=relaxed/simple; bh=5L4b1rIUXgU5wl8/jKyJxd4Vt1myFkIrr70lbjcEQg0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=b/uq9Mlk4kqP5/FalyIHPtFZjXlIpOcxpTfof/KJxYs1onYflu1mg+YN1VpVF6Lu7AJ8uFlUBJyrSTCDwhbhjsVyPwQGQBK3JAH57eK520FYVlnpo9nciewQsfzWve+wUoQUskZ5SQhMDa/CyM9F2kY25nHzf7GA0zxg+Llsy8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sdniQ+/A; arc=none smtp.client-ip=209.85.218.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sdniQ+/A" Received: by mail-ej1-f74.google.com with SMTP id a640c23a62f3a-b5b12e9e02eso567866b.2 for ; Wed, 15 Oct 2025 14:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562068; x=1761166868; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=HtXilHA5AAd1z6GdE3uGsC51Fo0T6TRa6MXgCog/xSk=; b=sdniQ+/AIrpNRxg4X/oiZktkjCV3G90M3L9OyRP2IMnm/D65G7fT2/EgGbPJ4UmtRc qnWBQ3LO6t+KGMvmXxIZk4Np1xVunWDMnfx8pfSbuH1poz8Ac1yMhwgVJKYKszveu42K +J95u90cw4ufhCDW3wNoSh3Q6cAoSGkl72a8W9kj4r4FY+TGsWdTX2LDAzY09DbDt3MM iaJ8o9gPYlcx5bsFT9XcIJxtt4Xxjnp9hJvU2cuzbjad7081FFzd+iXBpvsbucWKOPUU aYMvzyQAJ4FXsF+z2ZgryrjQrLcyGhEaBWZ/Qxzz9aNqZJX0ZFbeABJecbxY8+oqN0sB HMtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562068; x=1761166868; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HtXilHA5AAd1z6GdE3uGsC51Fo0T6TRa6MXgCog/xSk=; b=cOYO78WaRhKhtrgsIErYnVbQtsx1b/yrMmeFfnV7LzDGNZpF/dnVvQ/xVCOjGZSnFy zVOs+1PRF8k5BD6qY417z39pc0/kB66EQUx6kPmJkpJG0cGnfKtnalxhNbTPozHfRFzS ICiac2CEYwRWAlRyOy4lpzmn7FxOiqcxUjbUS8ZTPZjY8L0/wbHl6DersZ8MnzxZ1u0A Aptpru6s9JoZL0uUI1X4zhY8cRWn+qqm6FI+B2nBDSZnrZUtWRDnThhG+KJots3Fdgzs VoYFQQcBdzuSboZVcXvakKXIpRnObXd+TwG0DmA7oPnjKfJu2rTu++BVrqjWuWocBPfT zP+Q== X-Gm-Message-State: AOJu0YyINLYhIuXOSqkNfj39BxWe0m3RXp6OnMC2N9bACPqfG5y+WKWM NVUGnlMNSdBI8F1JiedS+uTQURbl6kLs4/fojiVbC+poyNdojhqyXhONuGTtZxQn9vG7h9fSmw= = X-Google-Smtp-Source: AGHT+IH3ROeCSpPWS9y2jZ7CvrP8/bWnx+s6dPg9rJBua5mdk6FXYUzuc6+UiuwI+/nVZ3rpHBAA+hiX X-Received: from ejblo1.prod.google.com ([2002:a17:906:fa01:b0:b47:89a2:8c6c]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:980f:b0:b45:420c:81c0 with SMTP id a640c23a62f3a-b50ac0cc34cmr3303674866b.36.1760562068221; Wed, 15 Oct 2025 14:01:08 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:41 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=2657; i=ardb@kernel.org; h=from:subject; bh=997YokF8smvlH2+7Du/063cegE+dHugAIUP6dU3Aa2s=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDVzdTg/stWY4eySNf39jeOrDI2WBiyytOz6jjvWbRV x/v0FjRUcrCIMbFICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACaSeZKR4apV4b0pL78sZ598 LzA4+I6BwcnoBUdSut9MUZh7iKesm5Phv0fEh9RthhFMgprc7NoZL8o/mqhbhr2MTOZkDl/GnKb KCgA= X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-15-ardb+git@google.com> Subject: [PATCH v4 resend 6/7] arm64/efi: Move uaccess en/disable out of efi_set_pgd() From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel efi_set_pgd() will no longer be called when invoking EFI runtime services via the efi_rts_wq work queue, but the uaccess en/disable are still needed when using PAN emulation using TTBR0 switching. So move these into the callers. Acked-by: Will Deacon Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/include/asm/efi.h | 13 +++---------- arch/arm64/kernel/efi.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index bcd5622aa096..aa91165ca140 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -126,21 +126,14 @@ static inline void efi_set_pgd(struct mm_struct *mm) if (mm !=3D current->active_mm) { /* * Update the current thread's saved ttbr0 since it is - * restored as part of a return from exception. Enable - * access to the valid TTBR0_EL1 and invoke the errata - * workaround directly since there is no return from - * exception when invoking the EFI run-time services. + * restored as part of a return from exception. */ update_saved_ttbr0(current, mm); - uaccess_ttbr0_enable(); - post_ttbr_update_workaround(); } else { /* - * Defer the switch to the current thread's TTBR0_EL1 - * until uaccess_enable(). Restore the current - * thread's saved ttbr0 corresponding to its active_mm + * Restore the current thread's saved ttbr0 + * corresponding to its active_mm */ - uaccess_ttbr0_disable(); update_saved_ttbr0(current, current->active_mm); } } diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 0094f5938ba6..85f65d5c863c 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -169,12 +169,30 @@ void arch_efi_call_virt_setup(void) { efi_runtime_assert_lock_held(); efi_virtmap_load(); + + /* + * Enable access to the valid TTBR0_EL1 and invoke the errata + * workaround directly since there is no return from exception when + * invoking the EFI run-time services. + */ + uaccess_ttbr0_enable(); + post_ttbr_update_workaround(); + __efi_fpsimd_begin(); } =20 void arch_efi_call_virt_teardown(void) { __efi_fpsimd_end(); + + /* + * Defer the switch to the current thread's TTBR0_EL1 until + * uaccess_enable(). Do so before efi_virtmap_unload() updates the + * saved TTBR0 value, so the userland page tables are not activated + * inadvertently over the back of an exception. + */ + uaccess_ttbr0_disable(); + efi_virtmap_unload(); } =20 --=20 2.51.0.869.ge66316f041-goog From nobody Tue Dec 16 21:26:49 2025 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2DE6303A08 for ; Wed, 15 Oct 2025 21:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562072; cv=none; b=YiawpP8XWGHBQEcdWqa2kWdPyhK/sGKgfgyfSl74h4vYDNsrUj+S/XJLoW6V6afCReYQl22mPp/tDuogzI3WfGTOlKgtxt4dID8/FM1Il99juoCo1bzeEZuSxLzgvMJaYR75PkyiXn4SluLcfE64zKd/fpf5wLTFHr56L4X3SFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760562072; c=relaxed/simple; bh=GEasR0yp9JDDzCfLFtnK5FtUGxYfMchQqiNVE7LLkTk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=APdyQpIUwc7n9tBXJY8O4Yd3YO6M1Lug4GAHqjijuD2VJU1z7kzeIP2RhmsHmH9GQNkMR0Ip1P/JEZQgoAiT4Dv0Yqk/w5AqjpWX3kSfnx/IsSmcMYYD/MZPlcsyI7e87kZgtZ+uPL43COOZgYl3BKNQaCO9fZ4Y3AiCdT1PeGk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jTd2Opgm; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jTd2Opgm" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-471001b980eso197995e9.1 for ; Wed, 15 Oct 2025 14:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760562069; x=1761166869; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=MfJeYBJf9dKVExNOryhisMuvn1pJYVbY2e0JV1a62gs=; b=jTd2OpgmyULeNfFVLwsjcL+xqNoq/yBMHY9hXeVF1waW2yYOpcWHPNyKaBaxCl8ich YuqT8iiRXTKj1klWpEHouas8+hV5s0t56b6LeBDGU76jh5TNIb69ANKcsLZxLxfN2dGT 6cTYUjWOB1kGK5dm7ji8hwTXON+M8xSOLxNAQx0ZKZQTRT5LDU8SNmwHezs/ATCvCfDW xtFqXYoNQ2H74kuGLyp5f7HdAprWUQ/4v9rd1G6hqeCt4jU/ur6fmQJNFqEYyy6DNpP1 +cKVO8tFSKIG+OotbnM+ce92U9551rEAS+nmexXgepVfr07VqtMAI7HXChwRM7dR3546 8UHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760562069; x=1761166869; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MfJeYBJf9dKVExNOryhisMuvn1pJYVbY2e0JV1a62gs=; b=b1uac2Mt68OUnUJMibkW7xTaruBQ8HCb2KUzfNRNDt73KivmnJHLEb78zCZRIF3pxu oouTXiHq4GVDv22TFLvmG0T7EkZwXIrT2HxOkfN11rbNHlmPlF9kSNZyO0bNyLbyHbWK 4CCFn5YbAsS+Fy9QJ9MYSLdpR7ERbbLRlBv31eBCY8GKyIFlhkZgGv8/ddnCSJBct2F5 ohbIDhIcv+v1MojBwK15PnNBPT3+1p4Lx6LUx0b9IVCu1k4OGRAndok+SJrSb/q7ryq2 02VY0wzSGKi8nF++udLwLg0fQnDeJIPKKHyjdfhu6Nz6V3xjaMaWpOojAmUIlghOardX Hmnw== X-Gm-Message-State: AOJu0YykUTFf1sXwnSCJUB/YuTEVjw2jXrvCS68t5FuZ22a8UJ3nnonb HFkYpXmsrMKklqoWef5Cmz2JN3WbvbbB5IZ0K0Ze/dYBC6ob9fz07/Qp3KwFiEW0Cmh4FZyQ8Q= = X-Google-Smtp-Source: AGHT+IG+9dkTmwOQEgWRMCLUBLZu1hNOQYGDhgDBr9mXwrcUJWepG/mZYYY9jhBrgkyuHclPeYFheC4j X-Received: from wmwq23.prod.google.com ([2002:a05:600d:8357:b0:46e:32e6:eb8f]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:c162:b0:46e:4a60:ea2c with SMTP id 5b1f17b1804b1-46fa9b17e57mr225565295e9.37.1760562069252; Wed, 15 Oct 2025 14:01:09 -0700 (PDT) Date: Wed, 15 Oct 2025 22:56:42 +0200 In-Reply-To: <20251015205634.3820870-9-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015205634.3820870-9-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=3342; i=ardb@kernel.org; h=from:subject; bh=V3JoExKah8YdhW3E7vX+STaF9jmPPtKMQXsXC3Dx8GU=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIeMDV6/Jz242lTS+WVIXjoZvt3DsOfpAQDKj6UxbRA9vo bXjjfSOUhYGMS4GWTFFFoHZf9/tPD1RqtZ5lizMHFYmkCEMXJwCMBEdI4Y/XAwX+9rNX0+Rdvlo fmVqpOjpZaUz1A+KsFpfrfn4ouyyDsMvZl2bLeJTdxe9UkgwLf07P13Kmv9tW+TczqTrKaXqwTw sAA== X-Mailer: git-send-email 2.51.0.869.ge66316f041-goog Message-ID: <20251015205634.3820870-16-ardb+git@google.com> Subject: [PATCH v4 resend 7/7] arm64/efi: Call EFI runtime services without disabling preemption From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Peter Zijlstra , Catalin Marinas , Mark Brown , Pierre Gondois , Sami Mujawar Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel The only remaining reason why EFI runtime services are invoked with preemption disabled is the fact that the mm is swapped out behind the back of the context switching code. The kernel no longer disables preemption in kernel_neon_begin(). Furthermore, the EFI spec is being clarified to explicitly state that only baseline FP/SIMD is permitted in EFI runtime service implementations, and so the existing kernel mode NEON context switching code is sufficient to preserve and restore the execution context of an in-progress EFI runtime service call. Most EFI calls are made from the efi_rts_wq, which is serviced by a kthread. As kthreads never return to user space, they usually don't have an mm, and so we can use the existing infrastructure to swap in the efi_mm while the EFI call is in progress. This is visible to the scheduler, which will therefore reactivate the selected mm when switching out the kthread and back in again. Given that the EFI spec explicitly permits runtime services to be called with interrupts enabled, firmware code is already required to tolerate interruptions. So rather than disable preemption, disable only migration so that EFI runtime services are less likely to cause scheduling delays. To avoid potential issues where runtime services are interrupted while polling the secure firmware for async completions, keep migration disabled so that a runtime service invocation does not resume on a different CPU from the one it was started on. Note, though, that the firmware executes at the same privilege level as the kernel, and is therefore able to disable interrupts altogether. Acked-by: Will Deacon Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/kernel/efi.c | 23 ++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 85f65d5c863c..a81cb4aa4738 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include =20 @@ -168,7 +169,20 @@ asmlinkage efi_status_t efi_handle_corrupted_x18(efi_s= tatus_t s, const char *f) void arch_efi_call_virt_setup(void) { efi_runtime_assert_lock_held(); - efi_virtmap_load(); + + if (preemptible() && (current->flags & PF_KTHREAD)) { + /* + * Disable migration to ensure that a preempted EFI runtime + * service call will be resumed on the same CPU. This avoids + * potential issues with EFI runtime calls that are preempted + * while polling for an asynchronous completion of a secure + * firmware call, which may not permit the CPU to change. + */ + migrate_disable(); + kthread_use_mm(&efi_mm); + } else { + efi_virtmap_load(); + } =20 /* * Enable access to the valid TTBR0_EL1 and invoke the errata @@ -193,7 +207,12 @@ void arch_efi_call_virt_teardown(void) */ uaccess_ttbr0_disable(); =20 - efi_virtmap_unload(); + if (preemptible() && (current->flags & PF_KTHREAD)) { + kthread_unuse_mm(&efi_mm); + migrate_enable(); + } else { + efi_virtmap_unload(); + } } =20 asmlinkage u64 *efi_rt_stack_top __ro_after_init; --=20 2.51.0.869.ge66316f041-goog