Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2230095ybn; Thu, 26 Sep 2019 08:50:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQv1yYAV6qbvzxTdvQMc+UjBEZGm6ikS/qCzMmO9o+1Q+djc8zzp/GkE9+Ub8N36DTsNLC X-Received: by 2002:a50:cc43:: with SMTP id n3mr4525333edi.250.1569513049851; Thu, 26 Sep 2019 08:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569513049; cv=none; d=google.com; s=arc-20160816; b=u5EPrJTLBf93WeTuoY5B0mMMrH/8b1bMu2WiNuxFpTqEjJgXcVTlfjDVvT3mf4vj7D TqSppwyEr8LhH2jYiBCS5IK72S5cr9xqCCCT0vBDkrktTfz3yeV+/tTEqGdBVv+tsB/B Ff/m+lN+0bteF4qL8WgkKKFKMuTJdsV8MM0/RsyQawDdC7bK/AA91kNb+LJeWB6SvVL4 oU1rJLOQMtVPmy5EHqDeYpQEHW5egeiHIK++sI4ZshzSfimeCT7igI4uG+CPTwTjl1rm 02HW7DI6jlaq4XHrYrTL1FAqcVlLHAM/BT/aIun7zjGJB1ECT9VnwqeNxNNrxjtLtbYd iIpw== 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=c/3rZGyZ8wo8IAcGiILpVEqgSPsTH+XHREiJwrwJZ0c=; b=mDPTmeJN+P9V3RZE0/IOb+apTkc+tHIOERYo7FQejuxgD6PMmXcS+etAvosjHLQVwu rCap1DcwWMeaLud1+alrxVVBrO8Eu5zE/Eb05+1oo3rwqLQUBZ3j21e2ast1z1tkZ4Z/ a/Up5h1V+f/KeE8E0AXEKTQ0n4I6VIe4eQB7ENdOWRwQTFkRPhOkn7kKUgF3+MSqgFnJ rRx2m3DRYdnTnzhX5VH219dE5bwaYMXmlfCnqncrS27sav5Qfu0iF0mhskySkyU8NpQn ru8i8wf0EfHyeexXjY1WGkVJetACqMjzfbtMdxPQdXUKkE/od2u/X9QvqdjabR9cR1L/ sBng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U88hSCSV; 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 j2si1569798edp.114.2019.09.26.08.50.26; Thu, 26 Sep 2019 08:50:49 -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=U88hSCSV; 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 S1727380AbfIZPsC (ORCPT + 99 others); Thu, 26 Sep 2019 11:48:02 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38529 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbfIZPsB (ORCPT ); Thu, 26 Sep 2019 11:48:01 -0400 Received: by mail-wm1-f67.google.com with SMTP id 3so3123468wmi.3 for ; Thu, 26 Sep 2019 08:48:00 -0700 (PDT) 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=c/3rZGyZ8wo8IAcGiILpVEqgSPsTH+XHREiJwrwJZ0c=; b=U88hSCSVdES0JklNpygW7AUNISvDUWxqvq4/RSOySBI5RzuSv+bpqM+wTTWfEgN470 gpWs4NWRtg1KSgUlo1WODgHYlyEzsJCwy2XgdvfzaGF7tyj8UG3Cy33jvIZNQ9756JvX 1LeIfEYrSH2efSPIn9ouNdEhhcFvJsuyAipddSXiF9WT9a9mopnxOIST9ZA+6sO3tZAK AVPMuSa/OpgLP+yEGoxFMsCHt46w6mASVKwB1PexFBAeghG4VYEHVzI5C4WLILW6AM27 kwNcJaxbNdYrbcX4EdTYGMlowktBAefXRD8GaHicfkXcwspN7u5wR5AnDdvGdeEemsVO 2hzg== 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=c/3rZGyZ8wo8IAcGiILpVEqgSPsTH+XHREiJwrwJZ0c=; b=DdYcBG+XT2sYdfxhpX/IIsL9/3z7SvtMZjJnGoY+/o3owsJGPWrWZEdNEIgfOXAkeK zfW47gL+we9+5N76W38I+mcUk/JdD2+xe10/ImoM8tGEKYkKtNkBZwSiFK2VzL0JsfiS z2etoW8gOqsDdI/1kqxGBCZDaJG/p5B67Zc26KOBYcs2oYvtu2ic/v+L9WFZ1FBkKc91 85Qv25ktB1W48q31tPvDO27n7H9OONlz4nuHK1nd7z05TKsAF8myBAKe95MD74pZAJ93 tqLhwculMm7yJzYXnY4zEjvVpVDNWCRSbEefR/GCKV4kfkQ3lCjoUoO9u6R61Ri+T5Tv T/tA== X-Gm-Message-State: APjAAAUkiZqI7CF5QhrV7fKm9ms9hPbydrGJGPWZmWj+/HMsAkjBmCbx ogjTbf9Pm2ZW2TN4lPTrZ6W9c7o516rzcEvgbJFvPQ== X-Received: by 2002:a1c:3cc3:: with SMTP id j186mr3407725wma.119.1569512879378; Thu, 26 Sep 2019 08:47:59 -0700 (PDT) MIME-Version: 1.0 References: <20190926141234.8271-1-ross.lagerwall@citrix.com> In-Reply-To: From: Ard Biesheuvel Date: Thu, 26 Sep 2019 17:47:47 +0200 Message-ID: Subject: Re: [PATCH] x86/efi: Don't require non-blocking EFI callbacks To: Ross Lagerwall Cc: linux-efi , Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "the arch/x86 maintainers" , platform-driver-x86@vger.kernel.org, Linux Kernel Mailing List , Sai Praneeth 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 Thu, 26 Sep 2019 at 17:47, Ross Lagerwall wrote: > > On 9/26/19 4:29 PM, Ard Biesheuvel wrote: > > On Thu, 26 Sep 2019 at 16:12, Ross Lagerwall wrote: > >> > >> If a backend does not implement non-blocking EFI operations, it implies > >> that the normal operations are non-blocking. > > > > Is that documented anywhere? > > Sort of. From commit 6d80dba1c9fe "efi: Provide a non-blocking > SetVariable() operation" > > """ > Introduce ->set_variable_nonblocking() for this use case. It is an > optional EFI backend operation, and need only be implemented by those > backends that usually acquire locks to serialize access to EFI > variables, as is the case for virt_efi_set_variable() where we now grab > the EFI runtime spinlock. > """ > > > > >> Instead of crashing > >> dereferencing a NULL pointer, fallback to the normal operations since it > >> is safe to do so. > >> > > > > I agree that crashing is never the right thing to do, but I wonder > > whether we shouldn't just bail instead. If the provided default > > operation is non-blocking, the platform can populate the function > > pointer with a reference to the default implementation. > > If you would prefer it that platforms are always required to implement > the non-blocking functions, then I will just send a simple patch fixing > up the Xen implementation. > Yes, please, that sounds like a safer option to me.