From patchwork Tue Jan 31 04:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin He X-Patchwork-Id: 4743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2553048wrn; Mon, 30 Jan 2023 20:29:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXvAMVEmpfSBUqES4OM64LcTohcTDvoI32YOs9dsK5Ejxo+aHzZf584pd4xn8NflcdyHr7kn X-Received: by 2002:a05:6402:294c:b0:48e:c0c3:7974 with SMTP id ed12-20020a056402294c00b0048ec0c37974mr59301454edb.12.1675139385970; Mon, 30 Jan 2023 20:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675139385; cv=none; d=google.com; s=arc-20160816; b=rpRT9N0hai8x0uNdp7RVTWw64DVIsqYjUK0LePcMcBC4w9fpSutsq7gcYuGKgGvMkJ 2hiLIhg0ff17ZfPPC0Q8Yc725N1z7pD7x71F08IE+97Yh4Ne6T+Is5J2lOWi1baYFOL5 dn31/IQwUPhC7YS2MllNfMZu+nqkPfliOn8pcAXISs9XkOOK2Rxso6Y9GtrT8StFCJOP gAyTDx3fE2IeNWWii+UIa9wcny6y5HXaludVOBA4njvJZCLwPPMhG+IgbDx3pT2qzd0L 6b5/s1BI6oxAzcf+gLoGKDzBCWYfWzBJu//SsYEkht1X9ES02QxlgOndAyzBVMDCnUk/ G7Ug== 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 :message-id:date:subject:cc:to:from; bh=Pl653a2ILgqnecASS5fHWJZFs4as/Dw3hxGLc2gAfT4=; b=yOfBxj1kgR9YQ/JwKfYjEb/MFkofakINn2KFqrhYzqHiCtGfpnTzbDG97JMkiQPj7g dHINeOtaDWDmwscUiU0TAgFylxwNuzKNunxkULYLtPur8rkMjyle51B+3v4fOeQa11DL UuZPVjpdO5acBkvMJlYwEQvdpfML4utLIadcFsSYK2DLG1kOyUeubdgNHaLD1OXDBlX5 aqx98k8dm9OaaZ15SXzJ+Eo+YnJsRu8io81wp8XVQFu54bOx9nyWvXqMNSwmL+7TLxZN FXgixgR/svSKQNmc0xnDteXSxQ19Ms2WP3yEpWxDm/7YOALDFEQz/C5nGCfmFxVotZmg PEtw== 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 m2-20020a509302000000b0046b2d74c08csi17391993eda.38.2023.01.30.20.29.22; Mon, 30 Jan 2023 20:29:45 -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 S230399AbjAaEEH (ORCPT + 99 others); Mon, 30 Jan 2023 23:04:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjAaEEG (ORCPT ); Mon, 30 Jan 2023 23:04:06 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 39C5E113CB; Mon, 30 Jan 2023 20:04:05 -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 DEF262F4; Mon, 30 Jan 2023 20:04:46 -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 A40E23F64C; Mon, 30 Jan 2023 20:04:02 -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 0/2] Fix boot hang issue on Ampere Emag server Date: Tue, 31 Jan 2023 04:03:53 +0000 Message-Id: <20230131040355.3116-1-justin.he@arm.com> X-Mailer: git-send-email 2.25.1 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?1756510956929385869?= X-GMAIL-MSGID: =?utf-8?q?1756510956929385869?= I met a hung task warning and then kernel was hung forever with latest kernel on an Ampere Emag server. The root cause is kernel was hung when invoking an efi rts call to set the RandomSeed variable during the booting stage. The arch_efi_call_virt call (set_variable) was never returned and then caused the hung task error. On the Emag server, efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE) is returned with "true" Fix it by introducing the efi_get_supported_rt_services() and then determine to set or clear the runtime services bit of efi.flags. Jia He (2): efi: libstub: Fix the retriving of supported rutime services efi: Introduce efi_get_supported_rt_services() to get the runtime services mask drivers/firmware/efi/arm-runtime.c | 5 ++++- drivers/firmware/efi/efi.c | 28 +++++++++++++++++-------- drivers/firmware/efi/libstub/efi-stub.c | 2 ++ include/linux/efi.h | 1 + 4 files changed, 26 insertions(+), 10 deletions(-)