From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AFBBC4332F for ; Thu, 10 Nov 2022 14:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0cq0NIEgDWFfAx71Zdo5CGqWHH8Cbb+vdC5vffy8pU0=; b=CKOrQbiS/fnpNG YSvEHY6laFPfmrLYsyFQaQHNsw8fOccMo4+rgFtS6zo3wuTyaYMhiVHwPnOcQI0KywJ6A5lN7tCkc +tybhOJU1QH0kLR89zgkFSRDhJM6WcFRQxgbC/w0lrTuSU05f4IwnCIyyK+VeW5bbMLXb9kxG2UYc xNeL82lzF1oGrU1CD3Gq4//iulD7LwH+GBCqfc2itIIRbJpeJ4p8KiGdcaUs+XJ5g3Y0hKxnnhbOI NjPtSqxGwHrbV9mLIteGaZLENDjzZhKEZaOizhHtcj/RByiCYUIb+vKkSjw/7jd2Cw+++mdugta3Y +Sm7/0kp9iHLw3+pMARg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot8g5-006QQg-8o; Thu, 10 Nov 2022 14:37:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ot8g2-006QP2-Ky for linux-arm-kernel@lists.infradead.org; Thu, 10 Nov 2022 14:37:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 955301FB; Thu, 10 Nov 2022 06:37:12 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D16C13F703; Thu, 10 Nov 2022 06:37:05 -0800 (PST) Date: Thu, 10 Nov 2022 14:37:03 +0000 From: Alexandru Elisei To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] efi: Override runtime supported mask from a EFI variable if present Message-ID: References: <20221109172750.2823891-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221109172750.2823891-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221110_063710_764466_F5A044A8 X-CRM114-Status: GOOD ( 21.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Wed, Nov 09, 2022 at 06:27:50PM +0100, Ard Biesheuvel wrote: > For debugging purposes, allow the runtime override mask to be set from a > EFI variable if one exists. For instance, the RT supported mask can be > set to 0xfffd to disable the SetTime() runtime service, and enable all > others: > > echo -ne "\x7\0\0\0\xfd\xff" \ > > /sys/firmware/efi/efivars/LinuxRtMaskOverride-eb66918a-7eef-402a-842e-931d21c38ae9 I'm really sorry, I applied this patch, but I couldn't find the file (LinuxRtMaskOverride*) under efivars, and couldn't find another way of setting the variable. Thanks, Alex > > Signed-off-by: Ard Biesheuvel > --- > drivers/firmware/efi/efi.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c > index a46df5d1d0942751..faed1ef78c044924 100644 > --- a/drivers/firmware/efi/efi.c > +++ b/drivers/firmware/efi/efi.c > @@ -367,7 +367,17 @@ static int __init efisubsys_init(void) > } > } > > - if (efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES)) > + if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) { > + unsigned long size = sizeof(efi.runtime_supported_mask); > + > + if (efi.get_variable(L"LinuxRtMaskOverride", > + &EFI_RT_PROPERTIES_TABLE_GUID, NULL, &size, > + &efi.runtime_supported_mask) == EFI_SUCCESS) > + pr_info("Overriding runtime_supported_mask to 0x%x\n", > + efi.runtime_supported_mask); > + } > + > + if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_TIME)) > platform_device_register_simple("rtc-efi", 0, NULL, 0); > > /* We register the efi directory at /sys/firmware/efi */ > -- > 2.35.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel