Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1607462imj; Thu, 14 Feb 2019 09:05:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IbJ2xWp8GFh13I8JmFmbsLipm3TfIfchhYExchfHBwxYpuTbrUkEqeIHDngaxtPJBI9ogcM X-Received: by 2002:a17:902:b60e:: with SMTP id b14mr5031283pls.301.1550163930835; Thu, 14 Feb 2019 09:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550163930; cv=none; d=google.com; s=arc-20160816; b=vjBj3BGQyd+XjlWNUWldsUFs2fvUtKzm3BnHD6h4FBE2ptsdRx1OAdfd5YPKFW9VZX O0gwJuqyRhPcXEhWCrELWrRuKaHZxaaGE6kw8JBTRCNUxdkynP13x5w239MWWSyIDL9N eAWR1RTPqmqN9EUWx2tpoiPuZnNT5C3/pCILvv9rDj5euPIomgXaw8gdAaZQlTUnIxiS Cbm52esm3QsTM5e7KCfNV+QOwQq4BFQ5+G4/8L9CsHFZ+f9nM/WhlpQ4V1cUv/TyN3io eBzB1bcANgqIAzCbQotK1b69tfCXjhsntCvhbkkrsczmFfcfszFz3dRZEn8ytsnAl4iR qAXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/vjC5NjxwgilwtZCnDsY6OAd0Xq/XwAgXTYGo31ekm8=; b=sf2c4r1xkKVe94k3qyJT/HjlGbLVppi8tW+ViqzuMFcX+F36YW/Rp1YCKIxN8bBq+s PKM7UMGh5vlzJD7lAcx6xLmfrS7Z65WbSk8EfetLRza6OCCgx9ThoD6b3oyroRd9RavP 0CK+PyrsmWOZYqdY9wumcIPA7a6P8AsT8xMo1X2Ex1Ivo29/dMJL2ske9PB/EKMA1hXi +6WBsyVrqEsRzlzXhoCK7AA8j4hKDP/4pBFuxq5+QyTA+RYvWwkNfQI1i7prR/BQVHtR CfJk6hF64oXG3CKLZlc4hfuBioSzClmA15vRfFbldGP/00Fy1+XDQaM04K1s14W26/u1 6oYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNK1c8yT; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si135249pla.155.2019.02.14.09.05.14; Thu, 14 Feb 2019 09:05:30 -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=@linaro.org header.s=google header.b=aNK1c8yT; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436605AbfBNIRu (ORCPT + 99 others); Thu, 14 Feb 2019 03:17:50 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:38517 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403869AbfBNIRu (ORCPT ); Thu, 14 Feb 2019 03:17:50 -0500 Received: by mail-it1-f193.google.com with SMTP id l66so2307251itg.3 for ; Thu, 14 Feb 2019 00:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/vjC5NjxwgilwtZCnDsY6OAd0Xq/XwAgXTYGo31ekm8=; b=aNK1c8yTuLO4n3j1d0QYocvzyrdgUf2vlTgREXu9f8Pp7aHd+561eGZq7biuBgPwnl ygku9cP6LmXbeDCzJO+lM8/MQJqILhCqiZrJz3z5XrKI/1bV+hng6VZCrDkRYoqJY35w 2tuoD1M+ZiZlwTlrhEezTf+8Pug5NNZT5PnZWY1tDtIgrhQM1ygT5xlHxLjrMcDXe98S RQQY9759UBbO9LYT0ruTyZWG5zxy8fYZ2UjDy1J4/d4B80fVcwJrKwZ2+kpHA96ieivs pz20h2lHsIeCFCzNhxk4thUvlz1IjYq/Fd6H9NYEARdEO++iKFkD4jpTcZhnPgBxqP4x o0uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/vjC5NjxwgilwtZCnDsY6OAd0Xq/XwAgXTYGo31ekm8=; b=K+btUe4527veZWNdeDuoXXnnJTE3/A73r7DExamdukNSIECDBeCu1Nn37zSF98Y853 hVxYRAdfokukU7rgwkl7imBZx6fOh575Tafe2Xdl/F2ZgCy5ghCU0r1zvB5cAq7mMSN3 qrVJD0kLTJY3TKUeVIpuuXLIA5RVQBnq6w/7MU5C1UFT7xduREXM2aZcXJ0BZyNEeg2R jl5Z2MT+jZM9GN5HqJ7IfRmau6Uv3yvyh6HHiBH3yXaPW8UCh27Bsmmd7OTBuRz34lwG Hm7k5IOttCtR+alJ5BHNBcb1OTz6/0Mk6lToynhdSBMNuR4N1yCNnelu4aLYwRgFhdXY zh8A== X-Gm-Message-State: AHQUAua6R8dk5HW1ahZ4ZPX8I13+E30XjfGSguBKcmy8M11nB+nqjSay dVMPW2GptfBscGuYjDDsLR97rJMCMAgBBfCH1kdcBg== X-Received: by 2002:a24:c3c4:: with SMTP id s187mr1485818itg.158.1550132268814; Thu, 14 Feb 2019 00:17:48 -0800 (PST) MIME-Version: 1.0 References: <20190213193413.25560-1-hedi.berriche@hpe.com> In-Reply-To: <20190213193413.25560-1-hedi.berriche@hpe.com> From: Ard Biesheuvel Date: Thu, 14 Feb 2019 09:17:37 +0100 Message-ID: Subject: Re: [Patch v3 0/4] Protect against concurrent calls into UV BIOS To: Hedi Berriche , Ingo Molnar , Thomas Gleixner , Borislav Petkov Cc: Linux Kernel Mailing List , Bhupesh Sharma , "H. Peter Anvin" , linux-efi , "the arch/x86 maintainers" , Russ Anderson , Mike Travis , Dimitri Sivanich , Steve Wahl , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Feb 2019 at 20:34, Hedi Berriche wrote: > > - Changes since v2 > Addressed comments from Ard Biesheuvel: > * expose efi_runtime_lock to UV platform only instead of globally > * remove unnecessary #ifdef CONFIG_EFI from bios_uv.c > > - Changes since v1: > Addressed comments from Bhupesh Sharma, Thomas Gleixner, and Ard Biesheuvel: > * made __uv_bios_call() static > * moved the efi_enabled() cleanup to its own patchlet > * explained the reason for renaming the efi_runtime_lock semaphore > * dropped the reviewed-bys as they should be given on the mailing list > * Cc'ng stable@vger.kernel.org given the nature of the problem addressed by the patches > Hi Hedi, The patches look good to me now. For the series, Reviewed-by: Ard Biesheuvel However, I don't think all the patches should go to -stable. Only 4/4 fixes an actual bug, and the remaining patches don't look like they are prerequisites for that change. Also, if your colleagues reviewed your patches, now would be the time to ask them to give their Reviewed-by as well. -- Ard. > --- > > Calls into UV BIOS were not being serialised which is wrong as it violates EFI > runtime rules, and bad as it does result in all sorts of potentially hard to > track down hangs and panics when efi_scratch.prev_mm gets clobbered whenever > efi_switch_mm() gets called concurrently from two different CPUs. > > Patch #1 removes an unnecessary #ifdef CONFIG_EFI guard from bios_uv.c. > > Patch #2 removes uv_bios_call_reentrant() because it's dead code. > > Patch #3 is a cleanup that drops test_bit() in favour of the ad hoc efi_enabled(). > > Patch #4 makes uv_bios_call() variants use the efi_runtime_lock semaphore to > protect against concurrency. > > Cc: Russ Anderson > Cc: Mike Travis > Cc: Dimitri Sivanich > Cc: Steve Wahl > Cc: stable@vger.kernel.org # v4.9+ > > Hedi Berriche (4): > x86/platform/UV: remove unnecessary #ifdef CONFIG_EFI > x86/platform/UV: kill uv_bios_call_reentrant() as it has no callers > x86/platform/UV: use efi_enabled() instead of test_bit() > x86/platform/UV: use efi_runtime_lock to serialise BIOS calls > > arch/x86/include/asm/uv/bios.h | 13 ++++----- > arch/x86/platform/uv/bios_uv.c | 35 ++++++++++++++----------- > drivers/firmware/efi/runtime-wrappers.c | 7 +++++ > 3 files changed, 34 insertions(+), 21 deletions(-) > > -- > 2.20.1 >