Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2917191ybh; Mon, 5 Aug 2019 08:56:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmu9vAw8FYWPmmoQfPCXhMEWT2Abgr3a/9tGEgQQZHVpVwK97KlbZPQPVW9DhHK2Ft9Ibl X-Received: by 2002:a17:902:e512:: with SMTP id ck18mr137456934plb.53.1565020599444; Mon, 05 Aug 2019 08:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565020599; cv=none; d=google.com; s=arc-20160816; b=IgRYoaAsjif7Yezj8W/lUOQLo3qNR4mrbku+DDMsYR+62KclDIJIiU1MBDF6oxlw66 rMbvUC8u+tcTlKcGu+pAC4UKFJG4WH2RcrjSVmR2Xfy/CoWWvaQaVIvhWZ8KIWWduE2u luwSx45vqCUGCbhbVfYmHBfkhMDTM9ef2S1W8if88M3dqw4BPX5rr/ZfxBHKgK6lBv+X W4bl0hzKLR4CcDje3cfFCoBHQasXSy6dxnVOwsSzpl7k+kGUsLU9F+IGdAsd+dm4I7fU tsBYG+jybr4Hoafm/ntWBX72/YsHB16VkEwQwQtxiJRSCs5b1QJGDNJjO007WwAMY4Aa UGag== 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=pnsluh819l1ZStKbmfOcG3O4jnLq32HWa/lDwn+83Yg=; b=w4YxRTK7x3/tI9gU7RL1EAK7Ev/7vpgfZBRv/PtALCjeze/g6pDz3TfmDqH65xdsc8 ChvfMwOAB3EgrUHxw7QVz1PWbVURWptyTDQ5K1Ji4m1DkFkdmcxgzz6THSU/HtlKHzOX fe8HIyxrtYjhpAPhelITf1fAdOoH50TvoOYLUm56IgzMQq8xYZjesgs0Ds1HkUtBAEPS ooi984Ia7HNLWdzNIIZ0FS2F6fUu7lhWwiUp4r2U+RCnJMzTwzrfYuqn2sNh1SGBF4Jw 8BXr/6TvA9d4y76IDkRxb57XXB4VTNqQn6UZ+coutgMfvEYzNWRnpfkEacL0HW0KLhdA AOLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nIKF7www; 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 l63si46052925pfl.41.2019.08.05.08.56.23; Mon, 05 Aug 2019 08:56:39 -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=nIKF7www; 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 S1729305AbfHEPzO (ORCPT + 99 others); Mon, 5 Aug 2019 11:55:14 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44505 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728028AbfHEPzO (ORCPT ); Mon, 5 Aug 2019 11:55:14 -0400 Received: by mail-wr1-f68.google.com with SMTP id p17so84924543wrf.11 for ; Mon, 05 Aug 2019 08:55:13 -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=pnsluh819l1ZStKbmfOcG3O4jnLq32HWa/lDwn+83Yg=; b=nIKF7wwwI0QPjCu0IOvAfwL8Hr2Lr3IyHpP1+ypF27lI+2iwFL7eal+6vIO+rqw+Mt LXAwxw+s2ChlfUXNMEXSxChFPEyBlt2mrI7syMIUMzAKRifN913by3ykVqN0/d6xl7XU 45yp5Dbam98j3f3E/3LUUY2skj+VRIR6Q8k8Rg31HD71xr5EqDX6gQ6cap/HUwc24hja S7D4kueITTfZcQpcEVxOCeYR8beovQfohGrp1HjLWzMgb2ix1D3u4rlYkfqFYgbvAlqx BgcR5X7htSE1LfbrPS4WmeTMbUqF3oBy6DHpwH+405NuzlAK/rx/oVE5GFOwT1brTawU LZFA== 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=pnsluh819l1ZStKbmfOcG3O4jnLq32HWa/lDwn+83Yg=; b=XXRxYuptmeKo3C0ge8mw8CM7vGQPAgo+E13gQa7FXWYsjgDKP8Ak9rQOSCMJSUhtVm 9puJpooWxc7L/Vc04luL3BdavGeSrXybBJd+C8IO5tYY3czWSi7Bm/JNJRPdtSKnLxtO OLk2gzu+pWySFFDr7BTJvTGlvIHU22HMbx+Ng79XhdhNvtd0Xz6oZr6535lUVlLHZxaP N8jbuE+tGbzj37i+lnFN7SlCzkL/oStsmEv5oMMwHdldCvxGjsM701AVJItt2ObDQfVg 1R/+6qrW75z5qgAzuveld10vfLxEOxcUrBGAYhRTu9y6Pvu/VhfmffwdF0P01ZT7MO5x ulgw== X-Gm-Message-State: APjAAAUf9KtuZAaCue9A21p5SWbFq/UYu5yf6cq0Wei3crpDDs8TDWwH Mu0uMlfiESYB+qR2xwMLA8VOEMIfZBKldxhl/yjrkQ== X-Received: by 2002:a5d:46cf:: with SMTP id g15mr26762663wrs.93.1565020512761; Mon, 05 Aug 2019 08:55:12 -0700 (PDT) MIME-Version: 1.0 References: <20190805083553.GA27708@dhcp-128-65.nay.redhat.com> In-Reply-To: <20190805083553.GA27708@dhcp-128-65.nay.redhat.com> From: Ard Biesheuvel Date: Mon, 5 Aug 2019 18:55:03 +0300 Message-ID: Subject: Re: [PATCH] do not clean dummy variable in kexec path To: Dave Young Cc: linux-efi , Kexec Mailing List , Linux Kernel Mailing List , Matthew Garrett , Bhupesh Sharma 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 Mon, 5 Aug 2019 at 11:36, Dave Young wrote: > > kexec reboot fails randomly in UEFI based kvm guest. The firmware > just reset while calling efi_delete_dummy_variable(); Unfortunately > I don't know how to debug the firmware, it is also possible a potential > problem on real hardware as well although nobody reproduced it. > > The intention of efi_delete_dummy_variable is to trigger garbage collection > when entering virtual mode. But SetVirtualAddressMap can only run once > for each physical reboot, thus kexec_enter_virtual_mode is not necessarily > a good place to clean dummy object. > I would argue that this means it is not a good place to *create* the dummy variable, and if we don't create it, we don't have to delete it either. > Drop efi_delete_dummy_variable so that kexec reboot can work. > Creating it and not deleting it is bad, so please try and see if we can omit the creation on this code path instead. > Signed-off-by: Dave Young > --- > arch/x86/platform/efi/efi.c | 3 --- > 1 file changed, 3 deletions(-) > > --- linux-x86.orig/arch/x86/platform/efi/efi.c > +++ linux-x86/arch/x86/platform/efi/efi.c > @@ -894,9 +894,6 @@ static void __init kexec_enter_virtual_m > > if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX)) > runtime_code_page_mkexec(); > - > - /* clean DUMMY object */ > - efi_delete_dummy_variable(); > #endif > } >