From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.web08.55.1612458244772683985 for ; Thu, 04 Feb 2021 09:04:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=vsbN2OTR; spf=pass (domain: nuviainc.com, ip: 209.85.128.48, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f48.google.com with SMTP id a16so6330233wmm.0 for ; Thu, 04 Feb 2021 09:04:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OPKylCJ1EStqLrTro1WCo5lVmQikAm+v9ToX0eCDHyw=; b=vsbN2OTRkbiF0FXHxTsFb09XdlPaWmuMS+6GKkAnWAzjk3qfQHszl272O8jFRf/F/0 n4Qqfmgt+aYuuoDkeb8Geh/DZXUlSVEtDr2eh6RqgSYQHVK2dYKvFLWi4KmGT8e8joUd +mvCabI8YXIoV97U62MYjPmdHVmjw7R6OjpR1RPe9EnKm1ntJyseKxVbFU5kyyMyb8Yk KE0NJLLSAeiC1KGbVLGFpougjHjkqflYfQuStHp3e+scB0Buw5kvEb8KwRUTGukYLvuD R8Fm40g0UopEB64YhCveXER7Wgq3BgMFV0uU7EUVDAnnMdqj5RRdfWUM9ob21+NZyaTj NO2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OPKylCJ1EStqLrTro1WCo5lVmQikAm+v9ToX0eCDHyw=; b=PnrPVcxeooSHnEIpxyClTh271zGAhDgDe2QTWP65Zsfmsnkt/sbfEf6BO0omrTuCzG X4uJ/fY9NxlfH7f277Ar+yYVmoFDVUzf2lUO55aOsRSx8gPce1T6OFsajteJfpDyFCEf NGlZ5WuoCWij85M/EPEuqHJIA+yuW+eBWYAtAExiN/YrAVPODH+s+l4KaME5NQURronZ Cb1+piMbTIvv5ehsKv8xes4u+pYMnbDpXeLaPmEoTtnmtnRPqiW88C/4anj+ixh1Vfgk sF8y/sDjF49070TaHl1SDwjE7G1S/ogVblDA4hpQKATt9IHa9RgzPZLnyQTLxj96Rj6/ ceLQ== X-Gm-Message-State: AOAM532E0hYvUbfp3fuZE8gy90fqWNZeoTP83oztTvaJ03Y6GbZPoc9j lysEJ9JOUHiSrWrW2SyVo49k5A== X-Google-Smtp-Source: ABdhPJyyrp9hPvKxikJI4J3OJ6RwnL5qKICjkRBzqIsZHzz0rG67NDcSNZXsnuE9Fy1lbf5E2uD0ng== X-Received: by 2002:a1c:cc19:: with SMTP id h25mr137289wmb.124.1612458243282; Thu, 04 Feb 2021 09:04:03 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id r13sm7296313wmh.9.2021.02.04.09.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 09:04:02 -0800 (PST) Date: Thu, 4 Feb 2021 17:04:00 +0000 From: "Leif Lindholm" To: Ard Biesheuvel Cc: Laszlo Ersek , devel@edk2.groups.io, Ard Biesheuvel Subject: Re: [PATCH v2 1/1] ArmPkg/Library: prevent endless reboot loop with emulated NV varstore Message-ID: <20210204170400.GA1664@vanye> References: <20210204140601.9215-1-leif@nuviainc.com> <2f86afc5-eecb-8c63-2c40-01e380ab301f@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 04, 2021 at 16:49:03 +0100, Ard Biesheuvel wrote: > > > + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable > > > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString > > > gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate > > > gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits > > > diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > > > index 9905cad22908..5ceb23d822e5 100644 > > > --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > > > +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c > > > @@ -848,11 +848,15 @@ PlatformBootManagerUnableToBoot ( > > > // If the number of configured boot options has changed, reboot > > > // the system so the new boot options will be taken into account > > > // while executing the ordinary BDS bootflow sequence. > > > + // *Unless* persistent varstore is being emulated, since we would > > > + // then end up in an endless reboot loop. > > > // > > > - if (NewBootOptionCount != OldBootOptionCount) { > > > - DEBUG ((DEBUG_WARN, "%a: rebooting after refreshing all boot options\n", > > > - __FUNCTION__)); > > > - gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > > > + if (!PcdGetBool (PcdEmuVariableNvModeEnable)) { > > > + if (NewBootOptionCount != OldBootOptionCount) { > > > + DEBUG ((DEBUG_WARN, "%a: rebooting after refreshing all boot options\n", > > > + __FUNCTION__)); > > > + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > > > + } > > > } > > > > > > Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu); > > > > > > > At the level where I commented on v1 -- i.e., totally superficially --: > > > > Acked-by: Laszlo Ersek > > > > Ard should please review this patch for the logic change. > > > > Reviewed-by: Ard Biesheuvel Thanks! Pushed as 1b6c3a94eca7. / Leif