Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp629849imu; Wed, 9 Jan 2019 03:50:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN5IMVnSbu95VWfKp2fs6W7WV7LeYiM6ZMM6Byzz1nuxJY992pWFClZkaasiF+Nj7X5nWEeb X-Received: by 2002:a17:902:bcc7:: with SMTP id o7mr5796760pls.281.1547034627961; Wed, 09 Jan 2019 03:50:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547034627; cv=none; d=google.com; s=arc-20160816; b=XIuQuLCRnkR7gRgUx4pka+mGPiXFx2O2SQLDYoREaz+X5oxQ2INeAVcQDMcOghabB1 TlaXMFFNE2b3O5HmbhxkskzMOLqpmM+2McfojKxvW3ymRdZXyeFk90bPM3ffDSbdtTz5 1HwRFo53wKhgfiRzibWswfeQDw1Aqyy2NNwRy5moHi0UYCTxYWIFg6M5pSC6tOYL4fdm 6aeJcoppL3SGq+1JVZ2mCsZ02JbQY7atUqIokfjNCwyyYDpXYVGZ2ed5fMyQNi55nJpo dlSVZ079BDAesy6Mk+RchcABvh7qWFuACboHJJUxCJlek5xArzlRIgW0SVJ71b4aTvo4 gHlw== 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 :message-id:date:subject:cc:to:from; bh=XlGILgNimAsIo3mJZAmIT3ADQHwKOiNPFod5KVJPYFA=; b=uALBGPVdvrCj68IbwpUa+Ob/e1XTDC3a/DmAqETc3Dejn17S6e7Zlz/Na8r4zlpsyl sS++3O6kcJVslpftlRCEZgt7dq7m2UrpZyrkLXXxGV2l0i3HSmSMGcdJ6RT3hte1CRpy Qliy86t3EtGbum67JDFsn7/T5tuukmGpLWjw7vtLqOieCcvkKl+aFt0Pe+0jTlvx+FZb 6nbNpCRFBrSc34nY7WjVLxPcn1nvXCgrq5qjOSQjZa2DTqzaekOxcUbpG5stoqOG7KCj 2eSdeIlrUYqCQ+OlZP0h4CNYIhTD0PuWuu094DagHYa6coK4h73Akb1kArnAb8IOcZYk qIVg== ARC-Authentication-Results: i=1; mx.google.com; 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 f22si65926605pgm.81.2019.01.09.03.50.13; Wed, 09 Jan 2019 03:50:27 -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; 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 S1730436AbfAIKv7 (ORCPT + 99 others); Wed, 9 Jan 2019 05:51:59 -0500 Received: from g2t1383g.austin.hpe.com ([15.233.16.89]:15733 "EHLO g2t1383g.austin.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729798AbfAIKvp (ORCPT ); Wed, 9 Jan 2019 05:51:45 -0500 Received: from g4t3428.houston.hpe.com (g4t3428.houston.hpe.com [15.241.140.76]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g2t1383g.austin.hpe.com (Postfix) with ESMTPS id 96EA5E5F; Wed, 9 Jan 2019 10:45:47 +0000 (UTC) Received: from sarge.linuxathome.me (unknown [16.214.81.200]) by g4t3428.houston.hpe.com (Postfix) with ESMTP id 991E853; Wed, 9 Jan 2019 10:45:48 +0000 (UTC) From: Hedi Berriche To: Ard Biesheuvel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Cc: x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Hedi Berriche Subject: [PATCH 0/3] Protect against concurrent calls into UV BIOS Date: Wed, 9 Jan 2019 10:45:38 +0000 Message-Id: <20190109104541.25733-1-hedi.berriche@hpe.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 gets clobbered. Patch #1 makes the efi_runtime_lock semaphore visible to EFI runtime callers defined outside drivers/firmware/efi/runtime-wrappers.c in preparation for using it to serialise calls into UV BIOS. Patch #2 removes uv_bios_call_reentrant() because it's dead code. Patch #3 makes uv_bios_call() variants use efi_runtime_sem to protect against concurrency. Hedi Berriche (3): efi/x86: turn EFI runtime semaphore into a global lock x86/platform/UV: kill uv_bios_call_reentrant() as it has no callers x86/platform/UV: use efi_runtime_sem to serialise BIOS calls arch/x86/include/asm/uv/bios.h | 4 +- arch/x86/platform/uv/bios_uv.c | 37 +++++++++++-------- drivers/firmware/efi/runtime-wrappers.c | 60 ++++++++++++++++---------------- include/linux/efi.h | 3 + 4 files changed, 57 insertions(+), 47 deletions(-) -- 2.20.0