From patchwork Wed Jul 11 09:40:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 141713 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp70479ljj; Wed, 11 Jul 2018 02:41:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcPxDN6WDSgMrTO2qW4BxNSO+EHAUR5zq/mW8JpybGgPRbOlu2uFkHIxOIFScqFOiMpGqPV X-Received: by 2002:a62:fc4b:: with SMTP id e72-v6mr14898208pfh.168.1531302105708; Wed, 11 Jul 2018 02:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531302105; cv=none; d=google.com; s=arc-20160816; b=wHloYmGe9O7LnyY7vjwyKC1Flumr8XSuZtUfS0w0MTBvcWBQSsgEUvhd2nxqTx0Rzp phhITyCdLCyrBWDRDqmXVcOTNqatkuTcQ/opWuMjnHQBplzT3dGnQVAqCJspOMbC26OJ 6PQlLZRwSoPglN1x7qNvvoHznYwIbtPpY76RPGjNc0kYpEPonwPL0hM4NO0ZSsETyldk wLcZhLfcFRV1lM5FIsPr3dhwv+XmlB+bgv8NR+hW4qiYrvC29Jh7mLEpprMzQmjTNkRm 9f8KbP2E9EyqTLKJ9GYukm8zYCTo7teC7bDZwANxOVjVcIUPUdU8GuLmsQvwAu0lk5Ay 40Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/q/sznLHl7/eGa0nIgn7Rl1zB0oOPHdHKcT0/DG3mmI=; b=XSyd/LyOcjV+TSnPGpPjYUmzDbpMpNOGFDowhYncDvD6rhipjG99eG1dwT7044Bj6/ ydic7Bxq27cNBLfyq3bQyebsYP4LdfUG7UhseL4c+GEQreY/xRK7LBtGLB/l8nr+jgo4 Gw06zveX6jL4MCtN+OlGT6GdmIkA0XTDNDmJlkZXiI6PFq/MC9MY3856vTL+3+GhdZE+ AEIyl/938gXbDmvVFezLc13/UGtqnM25c41ojDrtHyhbdksvdpj1O6dgoIApB/86TM7G d34JdHDairXR8KKPxGkJhC+awRRwvL4ZY6H4D6ASZ+1yD1vq59iFhAGfl5TE7eo4zdh9 Qi4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NxGCGonp; 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 o5-v6si18429675plk.25.2018.07.11.02.41.45; Wed, 11 Jul 2018 02:41:45 -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=NxGCGonp; 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 S1732631AbeGKJoU (ORCPT + 22 others); Wed, 11 Jul 2018 05:44:20 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38573 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbeGKJoU (ORCPT ); Wed, 11 Jul 2018 05:44:20 -0400 Received: by mail-wm0-f68.google.com with SMTP id 69-v6so1814093wmf.3 for ; Wed, 11 Jul 2018 02:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/q/sznLHl7/eGa0nIgn7Rl1zB0oOPHdHKcT0/DG3mmI=; b=NxGCGonpLZkmEeIDuPLeFHFtG5j80zMXTsEdiu3XivE5TKiuVWSIUI1ib2zjAkHu8d o+UZKoVk7w28ELVveptunwB0A2QHj7W4En5PRKSdi+ZY4VcPdxrnKPliS2KPYKfxcTZQ /LAGI59Nup92sQrs/86h4c7DbjHbT35EBHPUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/q/sznLHl7/eGa0nIgn7Rl1zB0oOPHdHKcT0/DG3mmI=; b=YcGv02nAA/rvAvQttJP00RHSPQo4ZWWlUie/k2dOIJ0lkgRMIk+6AP78T4MiChrQaF vSJj5NFN5BoE2pEDOwBzlSeVWsgBo/uiUC23NpaXY0F5zGkUwwKEWJruaU5TduouU+E/ N6d68WpgrmQdQr5XS3+XHpGoOI9bUrWzHheqUcmqpPpSsvzdeplQcE0u/DlWE16DDpIS 9CGfc39rE2g3OfyC572l1ixoO9RRCcPbcIB2gSOIOtcYcEkGWKMSArH6X3U9C18O9ejt 1/9Pk0vP+N61lumkOhZgPXZxgi7lYm9G7Njj9PdSlmmBFVLUiZW6TI0deIwEYrtINVPD wpMg== X-Gm-Message-State: APt69E3EA6+IFo66GdyseJk+yre8Wg8t9a4RP9tvo8tzimgrSkKPBUTf T8wRvTg8MbZQa3TyC3NRBb1a8aMbpOQ= X-Received: by 2002:a1c:c14:: with SMTP id 20-v6mr18591887wmm.117.1531302051627; Wed, 11 Jul 2018 02:40:51 -0700 (PDT) Received: from localhost.localdomain (33.153.69.91.rev.sfr.net. [91.69.153.33]) by smtp.gmail.com with ESMTPSA id t124-v6sm1641311wmt.29.2018.07.11.02.40.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 02:40:50 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Sai Praneeth , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 2/8] efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() Date: Wed, 11 Jul 2018 11:40:34 +0200 Message-Id: <20180711094040.12506-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180711094040.12506-1-ard.biesheuvel@linaro.org> References: <20180711094040.12506-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sai Praneeth Presently, efi_delete_dummy_variable() uses set_variable() which might block and hence kernel prints stack trace with a warning "bad: scheduling from the idle thread!". So, make efi_delete_dummy_variable() use set_variable_nonblocking(), which, as the name suggests doesn't block. Signed-off-by: Sai Praneeth Prakhya Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 36c1f8b9f7e0..6af39dc40325 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -105,12 +105,11 @@ early_param("efi_no_storage_paranoia", setup_storage_paranoia); */ void efi_delete_dummy_variable(void) { - efi.set_variable((efi_char16_t *)efi_dummy_name, - &EFI_DUMMY_GUID, - EFI_VARIABLE_NON_VOLATILE | - EFI_VARIABLE_BOOTSERVICE_ACCESS | - EFI_VARIABLE_RUNTIME_ACCESS, - 0, NULL); + efi.set_variable_nonblocking((efi_char16_t *)efi_dummy_name, + &EFI_DUMMY_GUID, + EFI_VARIABLE_NON_VOLATILE | + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL); } /*