From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web11.32050.1627314978487243803 for ; Mon, 26 Jul 2021 08:56:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JAyT9efT; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id A595F60F6E for ; Mon, 26 Jul 2021 15:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627314977; bh=AUPl5i4cZseHOwZNowDH/W/QJWrmMKDWFoPMRZmUUVI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JAyT9efTDwWdx4xKFrHW5ezSi9iBLEQVjO3kRt2w8et0MibYLNqM+9etP7uRQTYzw Iv3ZhGyqmglOeS7ITA/c9PsvXIZLi48guSX9jY8DbqioRBwhJYw8uyfAnOao2eF4Pp WG0B1rHbz4dGvK+USBiKoHfHgPzraBukuzQQNGtYM+fHARqhdguOv+2kxva9hNeirJ LHk4Q2oNSvZntOGUDiqFi2VFb8CehsEzKPzIPLvgzpCTrIdltECv56h5cOosdwt0Yw Lcvdt5+b0tagEVuNQvsQ+8/Yy91ocvl8qo0er9McofVaWJYiU0J09Ntxg4ABPcIghq /GMJRZSIr3O1g== Received: by mail-oi1-f174.google.com with SMTP id 21so11399697oin.8 for ; Mon, 26 Jul 2021 08:56:17 -0700 (PDT) X-Gm-Message-State: AOAM532hGpZzfgvKJYihfrU1mJJIzZ+2UAEbTyZqCRQElGwZDb5899VR Xr5w6fekt24ni7R8GvqIq+v8wIH1OSED/WNpIgk= X-Google-Smtp-Source: ABdhPJyG60jhku7Jbk/aymMzOtLUzsN3EwAgjrFBg3gygC3AtqSWc3i53o6aYdjYOXCr8CCYNrhexZtFLISOrdKCfyo= X-Received: by 2002:aca:4c49:: with SMTP id z70mr11434947oia.174.1627314977075; Mon, 26 Jul 2021 08:56:17 -0700 (PDT) MIME-Version: 1.0 References: <20210723091521.1663-1-Sunny.Wang@arm.com> In-Reply-To: From: "Ard Biesheuvel" Date: Mon, 26 Jul 2021 17:56:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-platform PATCH v1 1/1] Platform/RaspberryPi: Make SetVariable return EFI_UNSUPPORTED at runtime To: Sunny Wang Cc: edk2-devel-groups-io , Samer El-Haj-Mahmoud , Sami Mujawar , Jeremy Linton , Ard Biesheuvel , Pete Batard , Leif Lindholm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 26 Jul 2021 at 09:18, Sunny Wang wrote: > > Please ignore this patch. Making gRT->SetVariable at runtime return EFI_U= NSUPPORTED would cause some OSes' installation failure/error. > I thought the latest OS may support UNSUPPORTED case, but it turned out s= till an error/failure. I checked both Ubuntu 21.04 and OpenSUSE 15.3 Leap, = and both of them could not be smoothly installed. > I will take a further look into this and figure out a better solution. > ok > Hi Ard, > Yeah, I'm also working on EFI_RT_PROPERTIES_TABLE, but ran into some prob= lems. I'm still debugging it. Hope using EFI_RT_PROPERTIES_TABLE won't caus= e OS installation failure. > ok > Best Regards, > Sunny Wang > > -----Original Message----- > From: Ard Biesheuvel > Sent: Friday, July 23, 2021 11:10 PM > To: Sunny Wang > Cc: edk2-devel-groups-io ; Samer El-Haj-Mahmoud ; Sami Mujawar ; Jeremy Li= nton ; Ard Biesheuvel ; P= ete Batard ; Leif Lindholm > Subject: Re: [edk2-platform PATCH v1 1/1] Platform/RaspberryPi: Make SetV= ariable return EFI_UNSUPPORTED at runtime > > On Fri, 23 Jul 2021 at 11:15, Sunny Wang wrote: > > > > The RPi does not support storing UEFI NV variables at runtime. For now, > > gRT->SetVariable at runtime returns EFI_OUT_OF_RESOURCES which is not a > > proper error and would cause FWTS failures. Therefore, this patch is > > to make gRT->SetVariable at runtime return EFI_UNSUPPORTED. > > > > For more information, please check the issues below: > > -https://github.com/pftf/RPi4/issues/6 > > -https://github.com/pftf/RPi4/issues/93 > > -https://github.com/pftf/RPi4/issues/163 > > > > I also tested this with the ACS 3.0 FWTS. All the failures > > reported in issue 93 and 163 can be fixed by this patch. > > > > Cc: Samer El-Haj-Mahmoud > > Cc: Sami Mujawar > > Cc: Jeremy Linton > > Cc: Ard Biesheuvel > > Cc: Pete Batard > > Cc: Leif Lindholm > > > > Signed-off-by: Sunny Wang > > This looks ok to me, but we should also expose this fact via the > EFI_RT_PROPERTIES_TABLE, so that the OS can anticipate this result. > > > --- > > .../Drivers/VarBlockServiceDxe/VarBlockService.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockSe= rvice.c b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockService.c > > index 572309439a..16d4d4f178 100644 > > --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockService.c > > +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockService.c > > @@ -2,6 +2,7 @@ > > * > > * Copyright (c) 2018, Andrei Warkentin > > * Copyright (c) 2006-2014, Intel Corporation. All rights reserved. > > + * Copyright (c) 2021, ARM Limited. All rights reserved. > > * > > * SPDX-License-Identifier: BSD-2-Clause-Patent > > * > > @@ -596,6 +597,7 @@ FvbProtocolWrite ( > > EFI_DEVICE_ERROR - The block device is not functioning correc= tly and > > could not be written > > EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL > > + EFI_UNSUPPORTED This function is not supported at runtime > > > > --*/ > > { > > @@ -605,6 +607,16 @@ FvbProtocolWrite ( > > EFI_STATUS Status; > > EFI_STATUS ReturnStatus; > > > > + // > > + // The current variables support relies on modifying RPI_EFI.FD on S= D > > + // card, which works fine at boot time. However, at runtime, the SD > > + // controller is exposed via ACPI and subsequently owned by the OS. > > + // Therefore, we need to direclty return EFI_UNSUPPORTED. > > + // > > + if (EfiAtRuntime ()) { > > + return EFI_UNSUPPORTED; > > + } > > + > > // > > // Check for invalid conditions. > > // > > -- > > 2.31.0.windows.1 > > > IMPORTANT NOTICE: The contents of this email and any attachments are conf= idential and may also be privileged. If you are not the intended recipient,= please notify the sender immediately and do not disclose the contents to a= ny other person, use it for any purpose, or store or copy the information i= n any medium. Thank you.