Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1771220imm; Sun, 15 Jul 2018 16:50:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1qqdUreO+4OLD/JoZ1do2KS+CxYYWyB9O6y1wG+uZcYwCswUOKdP+1/Ql+5IvdEtv8XQa X-Received: by 2002:a62:e0d5:: with SMTP id d82-v6mr15913204pfm.59.1531698632483; Sun, 15 Jul 2018 16:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531698632; cv=none; d=google.com; s=arc-20160816; b=z0cMK7PgzdW7+YfwrMCzf/PkbQO/YSEEXcbFoycPBkhshLJk+WoI0FG5dEfzB3wEVr HvH9HIJjLz2qXMKD4QlpJ6TgANbNUjmpPQRsZ6sXUocYAZOX5iuonA+DQnzZTpSrHoZz UPfSsdMAih05QUqvKsRDX0PE6+n7tMsqifHTOqjQdh3jhIEp1sM9z5ivdv6HSfWS2hFW WpUTBqJvsdTYJC29HXUBcPZh8VBaS5qYNbKN3dbtsbONGV0KYOFIIVSsLzs+SpLvOiv8 b1eoi5XKSAZ2hdEIJFUkWvnC1nOsNv+Uai7pX2SJLeOaGYZ+QSoX4JvJ35HtvDh3KhMp eAVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=o6uN+0NiwMNdoBnAu1NBDeQud/0iZ5w3ITx2NdKNLtk=; b=g/3OFXTprWaDupb7KZekeM9JxQPuvTDi4zkhiPyPWw45v3h5XuU/IR0djuDBYlYNgo FuOtmgtPuedYjiK1h3Lg2O5wz1O7Wh7/jv/P29lIJyyCzlHwvD+YD8Y+DozNTF/WSbid M+t06B4SYEdYBb5mfckWVzsh/XeHMNf1zVWN8riSPbb8F8+Bx9kDtGB0paTgUstdGIqt hw4EKp4dvRcLGxyq4oU0O+RNusE2fF4Ayt8jjMtrBagxC2AWBMMgqHK+2SXQnn2+HgpO aTqCD7L05ethEEg+3dQYAVVEZSAqsAZV3I6fVP67YHBocRzRXPvnoBpkDNEeyaAWDURE Yv3Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11-v6si19919302pgf.558.2018.07.15.16.50.15; Sun, 15 Jul 2018 16:50:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbeGPAOS convert rfc822-to-8bit (ORCPT + 99 others); Sun, 15 Jul 2018 20:14:18 -0400 Received: from mga17.intel.com ([192.55.52.151]:64556 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbeGPAOS (ORCPT ); Sun, 15 Jul 2018 20:14:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2018 16:49:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,358,1526367600"; d="scan'208";a="73012034" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga001.jf.intel.com with ESMTP; 15 Jul 2018 16:49:38 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.242]) by ORSMSX101.amr.corp.intel.com ([169.254.8.64]) with mapi id 14.03.0319.002; Sun, 15 Jul 2018 16:49:38 -0700 From: "Prakhya, Sai Praneeth" To: Ingo Molnar , Ard Biesheuvel CC: "linux-efi@vger.kernel.org" , Thomas Gleixner , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 2/8] efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() Thread-Topic: [PATCH 2/8] efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable() Thread-Index: AQHUGPtNybe82jcTAUCuwjoYvO+nlKSRXGMA//+bd9A= Date: Sun, 15 Jul 2018 23:49:37 +0000 Message-ID: References: <20180711094040.12506-1-ard.biesheuvel@linaro.org> <20180711094040.12506-3-ard.biesheuvel@linaro.org> <20180715223808.GB16209@gmail.com> In-Reply-To: <20180715223808.GB16209@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFlMWJiZjgtYmEyMi00ZWE5LWJmMzYtNTI1MzUzMWY5MjJjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSWFxNmxDdGlZRGlkcE5aQjI5WGJoeFRWeWpFelNzUUZzU25INXlkT3lvYWhSZ0FKNzB1MDA4azhmQ2wyUm1wbiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > 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); > > } > > Just wondering, what is the full stack trace of the splat? It sounds a bit surprising > to me that such type of EFI code is used from the idle thread. Sorry! for the confusing commit message. Kernel warns about scheduling from idle thread only when "efi_rts_wq" is used to invoke efi_runtime_services(). So, presently, this doesn't happen on mainline kernel. Support for "efi_rts_wq" is added by commit 3eb420e70d87 (efi: Use a work queue to invoke EFI Runtime Services). With v4.18-rc5 kernel, the stack trace looks as below: Please note that it's not just a warning but a kernel panic due to NULL pointer dereference. If I remember correctly, I noticed "bad: scheduling from the idle thread!" warning during development phase (probably with v4.15 or v4.16 kernels). [ 0.075052] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c2 [ 0.076000] PGD 0 P4D 0 [ 0.076000] Oops: 0000 [#1] SMP PTI [ 0.076000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.18.0-rc5-efitest+ #216 [ 0.076000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 [ 0.076000] RIP: 0010:__queue_work+0x41/0x5f0 [ 0.076000] Code: fd 48 83 ec 10 8b 35 2e e2 79 01 89 7c 24 04 85 f6 74 17 65 48 8b 04 25 40 4f 01 00 8b 88 54 0c 00 00 85 c9 0f 84 b5 02 00 00 <41> f6 84 24 c2 01 00 00 01 0f 85 f7 03 00 00 48 bd eb 83 b5 80 46 [ 0.076000] RSP: 0000:ffffffff82603cf0 EFLAGS: 00010046 [ 0.076000] RAX: ffffffff8262a7c0 RBX: 0000000000000246 RCX: 0000000000000000 [ 0.076000] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000002000 [ 0.076000] RBP: ffffffff82603da0 R08: 0000000000000000 R09: 0000000000000001 [ 0.076000] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 0.076000] R13: 0000000000002000 R14: ffffffff82603da0 R15: 0000000000000000 [ 0.076000] FS: 0000000000000000(0000) GS:ffff88007e000000(0000) knlGS:0000000000000000 [ 0.076000] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.076000] CR2: 00000000000001c2 CR3: 0000000005a24001 CR4: 00000000000606b0 [ 0.076000] Call Trace: [ 0.076000] queue_work_on+0x33/0x70 [ 0.076000] virt_efi_set_variable+0x11f/0x160 [ 0.076000] ? efi_call_virt_check_flags+0x80/0x80 [ 0.076000] efi_delete_dummy_variable+0x8c/0xb0 [ 0.076000] ? efi_enter_virtual_mode+0x42c/0x4e0 [ 0.076000] efi_enter_virtual_mode+0x42c/0x4e0 [ 0.076000] start_kernel+0x456/0x4f4 [ 0.076000] secondary_startup_64+0xa5/0xb0 [ 0.076000] Modules linked in: [ 0.076000] CR2: 00000000000001c2 [ 0.076000] ---[ end trace 5a03876c3be00272 ]--- [ 0.076000] RIP: 0010:__queue_work+0x41/0x5f0 [ 0.076000] Code: fd 48 83 ec 10 8b 35 2e e2 79 01 89 7c 24 04 85 f6 74 17 65 48 8b 04 25 40 4f 01 00 8b 88 54 0c 00 00 85 c9 0f 84 b5 02 00 00 <41> f6 84 24 c2 01 00 00 01 0f 85 f7 03 00 00 48 bd eb 83 b5 80 46 [ 0.076000] RSP: 0000:ffffffff82603cf0 EFLAGS: 00010046 [ 0.076000] RAX: ffffffff8262a7c0 RBX: 0000000000000246 RCX: 0000000000000000 [ 0.076000] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000002000 [ 0.076000] RBP: ffffffff82603da0 R08: 0000000000000000 R09: 0000000000000001 [ 0.076000] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 0.076000] R13: 0000000000002000 R14: ffffffff82603da0 R15: 0000000000000000 [ 0.076000] FS: 0000000000000000(0000) GS:ffff88007e000000(0000) knlGS:0000000000000000 [ 0.076000] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.076000] CR2: 00000000000001c2 CR3: 0000000005a24001 CR4: 00000000000606b0 [ 0.076000] Kernel panic - not syncing: Attempted to kill the idle task! [ 0.076000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]--- Regards, Sai