From patchwork Tue Jan 31 04:03:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin He X-Patchwork-Id: 50585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2552751wrn; Mon, 30 Jan 2023 20:28:43 -0800 (PST) X-Google-Smtp-Source: AK7set/Z2YemM4F02qO8AWykvrukuucFoTGpr5Ep19THmoLtgWosKoztLU1IMj+zlACWChResLHU X-Received: by 2002:a62:a515:0:b0:593:e6d9:d4c0 with SMTP id v21-20020a62a515000000b00593e6d9d4c0mr2039938pfm.32.1675139323452; Mon, 30 Jan 2023 20:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675139323; cv=none; d=google.com; s=arc-20160816; b=SUmKLoaymg+RFi07xYx+fbcRB9LVXFZ1OUtzBzQquAwk3RgK/ym3Z4vRbKQy3697dn qWwDxgpwiWqNxl726u3EfFrkiCzrPBvEXZEqB+o+vF53DCimtvqd3JCIMGg3dVV94E3s TIhiuSAI3l8rmy/5S1QyT/mFWL9XBAFbR+zBR5MQXAWibOe0OCj9FUwn5R4P3Hbr07I3 Q3C/pHoFNvQPRAIPjHOYeVzmm3y5wiTMadIfQrGb6eDP7H2pdfapY20nJ2ZviDOvqP3y orWhy6diYTWLzzNP8S+mPcMeldnNpl5cUwzLowS82RvecvxkfiKiI6Utpr+UWua/RU9j EPuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PZv7Fgis4FYUVVv9uHAOg2JhEcCtaIMt3xECCmMaXRU=; b=lbsO/UH5DN57Q5DY2+/KjsvrEaBOk7sLP8rxhv5I5Pioq+72vy+V1aU3w6fSiYzeS2 yUJanhL9ThZgMogBjtGgb0Qcq0g/y55hHZM8i7v1vQSl4uzhFW0p1hYUMnxRbSpPNpQj 3pkewNfvbNDm1hyNsO8m3kZcUOFIDDFZIrbWLahQu1fmrFFNqVk9CStWRWD0mjeFUal5 NoStFhjj/nJX3bwfxGt4CCnteyUQXsiu71SM1jDirYObuPb3teFZImC8Bhxak5fUfnwj R97oisKJZH3a1WQwoWulNP60+UwY9KOnSEEBVPEZqZz+GzRAl6l0OzZunFBlg+Ca1pQr uLvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a056a00138800b0050d80e4935fsi17570238pfg.256.2023.01.30.20.28.30; Mon, 30 Jan 2023 20:28:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbjAaEEJ (ORCPT + 99 others); Mon, 30 Jan 2023 23:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjAaEEI (ORCPT ); Mon, 30 Jan 2023 23:04:08 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5F44113CB; Mon, 30 Jan 2023 20:04:07 -0800 (PST) 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 9D0AC1713; Mon, 30 Jan 2023 20:04:49 -0800 (PST) Received: from entos-ampere-02.shanghai.arm.com (entos-ampere-02.shanghai.arm.com [10.169.214.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 648883F64C; Mon, 30 Jan 2023 20:04:05 -0800 (PST) From: Jia He To: Ard Biesheuvel Cc: Huacai Chen , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandru Elisei , Jia He Subject: [PATCH 1/2] efi: libstub: Fix the retriving of supported rutime services Date: Tue, 31 Jan 2023 04:03:54 +0000 Message-Id: <20230131040355.3116-2-justin.he@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230131040355.3116-1-justin.he@arm.com> References: <20230131040355.3116-1-justin.he@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756510891386684013?= X-GMAIL-MSGID: =?utf-8?q?1756510891386684013?= If retrieving UEFI configuration table is failed, the supported runtime services mask should be regarded as 0 instead of EFI_RT_SUPPORTED_ALL. Otherwise efi_novamap might be incorrectly assigned to "false" on the Ampere Emag server. Signed-off-by: Jia He --- drivers/firmware/efi/libstub/efi-stub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c index 2955c1ac6a36..f24b5436729c 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -111,6 +111,8 @@ static u32 get_supported_rt_services(void) rt_prop_table = get_efi_config_table(EFI_RT_PROPERTIES_TABLE_GUID); if (rt_prop_table) supported &= rt_prop_table->runtime_services_supported; + else + supported = 0; return supported; }