Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1374304imm; Sun, 27 May 2018 05:29:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhPxem4wm0ikBCQ1H2DytEg3tyS53dphJTvW0vwf+o53LHXIEgHTtw/k49qS2ZZMj1IxD4 X-Received: by 2002:a17:902:b692:: with SMTP id c18-v6mr9643484pls.307.1527424150611; Sun, 27 May 2018 05:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527424150; cv=none; d=google.com; s=arc-20160816; b=QMCw58v4WH9a5Q9IEOoY2P0AKWDWl6O40Py4x3jLlzM0uubao/R0uTmcucc49WEsPH 1ERuyd0jZurJiN/lX1g82u39cIKDN0JRLJ9SwAo9lHWUc5Z4jjByy+/Cn2NApjeWMD/4 J+Mtl4Y9SmuU7qEk0Sjh88nO4XmK6CT1O8L2uv5Ujy/xqW/vSaBxrVmh+6NyvjlkS76o 7tKHn5NfaFViry1nFZ5LM3GJWbHxoD9KWVqG2CA7Qklyu/PEdcwh5UygZrwch0m+Txu6 8joTQMrdVq99mfOhMBAZIxtx9Y0x/Mtt+n+ZxW0oGRp0SunV9S00gH/Sr73Tmtt2c6Qm jbtg== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=K52lAoAR2M/YDYSRMkWvNAZ9NJR/3o19AQyhQFdOTzM=; b=KFCZgu7tU5F4S83N8xKvdU57kqOgmArqLHbntuTpqhzqhnNHkUHDRQWgkVeozL6dzH SdUl4jAqCFBNdNClGbAHZ4ZqzrMano1XgcYwfdsVx+37JAHxdfeneLhzd7Qnl1AFZ6KS 7rmJ+XYgmpPesS7yRsqXh5SUSq5Kh6Ta6vGM8ffOoLGDZaUSJL/W9VAyxFrBAIc8u4qo tKsKeEP6tYozBCbPm3u302tTch0ij7Jhu20imM8TOeMPHgJhdQGbYllGJuMaxDF0uMeu FgxyYIipHvK0iyHuucnQeiXokMRsepQ/mhKfuqKyIexflzYmYL+aZpW7HTEwyx8dSH65 NNfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UfVmGQ4+; 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 d37-v6si28433399plb.125.2018.05.27.05.28.39; Sun, 27 May 2018 05:29:10 -0700 (PDT) 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=UfVmGQ4+; 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 S1032630AbeE0M23 (ORCPT + 99 others); Sun, 27 May 2018 08:28:29 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:33036 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030283AbeE0M22 (ORCPT ); Sun, 27 May 2018 08:28:28 -0400 Received: by mail-io0-f193.google.com with SMTP id o185-v6so11278202iod.0 for ; Sun, 27 May 2018 05:28:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=K52lAoAR2M/YDYSRMkWvNAZ9NJR/3o19AQyhQFdOTzM=; b=UfVmGQ4+udlSA129oZBzCnfhPuKrYKfatE5TcPX+a8gHsDCfyMdRv7wYHPNmmsPxmr iu8oTLcYTm0M6uesVna45Oh81SflNPBBYB89Tut6kKytaIEEUk6ykeiKbQ5G4t5dzhfT V26vZ/F2yhMLVW3akIFQZPALA0SjMWDbW+4gE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=K52lAoAR2M/YDYSRMkWvNAZ9NJR/3o19AQyhQFdOTzM=; b=uEJZ10rVefEUVSEdQAYItTrDk4/ka9PAWZOG+9becvejHByJmffQgamJg5/c0SHK6O rCfEWgd/uhVPZdCbygXUlSBuC6yo5uOKrWhsX0i79kxOHssPySStmeTESEsFvOrffG9T XlzZtkEqqdCe2Q9VsBbpv41yW2QL/6tFi0aeq73Hu6pso0iV5oR/0prcwMNZ7j7270Ji 3zx/kF8hq2Xi6uP49LPu4h3IYu2pPFZEzmsECJE42WSfNHLB5xF9P/gcCvGgG6glfl1S hvga6E8pKpjpwUmZudQSmOXO9YEXWJLnmMcPIHit/nzru7lH0se6+icQd45hxh2v5uiS rxcg== X-Gm-Message-State: ALKqPwe7tE36kssftTyxP8TYgubaO5suHXJZUmd9aIdmlniQpbRN5QJ1 hnSFCF/jjjyaJlkQmLI6hw3dQf1UCtzN6kpIZbGpPA== X-Received: by 2002:a6b:545:: with SMTP id 66-v6mr7921526iof.173.1527424107459; Sun, 27 May 2018 05:28:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bb86:0:0:0:0:0 with HTTP; Sun, 27 May 2018 05:28:26 -0700 (PDT) In-Reply-To: References: <1527285903-31799-1-git-send-email-sai.praneeth.prakhya@intel.com> From: Ard Biesheuvel Date: Sun, 27 May 2018 14:28:26 +0200 Message-ID: Subject: Re: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services To: "Prakhya, Sai Praneeth" Cc: "linux-efi@vger.kernel.org" , Linux Kernel Mailing List , Lee Chun-Yi , Borislav Petkov , "Luck, Tony" , Will Deacon , "Hansen, Dave" , Mark Rutland , Bhupesh Sharma , Naresh Bhat , "Neri, Ricardo" , Peter Zijlstra , "Shankar, Ravi V" , Matt Fleming , "Williams, Dan J" , Miguel Ojeda Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 May 2018 at 10:37, Prakhya, Sai Praneeth wrote: >> > One more question again, if we are sure that non-blocking variants >> > will _always_ be called in atomic context, then, we got it covered. >> > Because, in >> > set_variable() and query_variable_info() (both blocking and >> > non-blocking) we check for in_atomic() and if so, we don't use efi_rts= _wq >> (please refer to patch 3). >> > >> > If you think, there might be a probability of calling non-blocking >> > efi_rts out of atomic context, then, sure! Let's make them never use >> efi_rts_wq. >> > >> >> This is not about what happens to be the current situation. It is about = the API. >> >> The non-blocking functions should never block, period. They either fail = gracefully >> or perform their duties without sleeping. > > Yes, that makes sense. > >> >> In this particular case, I think it is useful to have a guaranteed non-b= locking >> version, not only to delete the dummy EFI variable, but potentially in o= ther >> future cases as well, given that they can be called much earlier in the = boot (when >> the perf/%cr3 issue is not a concern to begin with) > > Thanks for making it more clear :) > I will change the non-blocking variants _not_ to use efi_rts_wq and as yo= u suggested > make efi_delete_dummy_variable() use non-blocking variants (that should a= lso make it > local to arch/x86). > Yes, please. > Another follow on question is, does every firmware support both blocking = and > non-blocking variants (specially legacy EFI firmware)? I am worried about > this because, presently efi_delete_dummy_variable() uses set_variable() a= nd > query_variable_info() but if I change efi_delete_dummy_variable() to use = non-blocking > variants and if they aren=E2=80=99t supported, then, I guess, efi_delete_= dummy_variable() might > fail :( > > So, could you please clarify on that? > I don't follow. Why should it make any difference to the firmware whether the OS routines blocks or gives up? We always honor the mutual exclusion between different invocations of runtime services, and the firmware itself has no awareness of the kind of scheduling the OS needs to do to ensure this.