From patchwork Thu Feb 9 00:28:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 652168 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03BCAC636CC for ; Thu, 9 Feb 2023 00:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbjBIA2p (ORCPT ); Wed, 8 Feb 2023 19:28:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjBIA2o (ORCPT ); Wed, 8 Feb 2023 19:28:44 -0500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2123.outbound.protection.outlook.com [40.107.100.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 999511E5F5; Wed, 8 Feb 2023 16:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gvx00PVpJcEpgf/9I9FW3qbtsLTmI+oYQwLXAe70n5Y5Y7CfQC9sFxzg0nqCOk7IO0TA398YPXKTgH+c/hwhtin4vFaULQzvHuaRn407b0IkDqybW33a7Xfnhm7k2hbCx2KG4Gmu0/ivtii8DJgZwgfxy/5t+2319p3S+wvCqL7RNa24y1eFLHcXeMXGgqTQlfkdckyi/7MPEfA60wJfTjAtZU9Ysu2nfMvm8QYCjFBprHD6U2sVhgHQItsgChge1w/gXJ711UsTcQdpom3A/iPseBs03v51nuVwP/R/U2IpHAYHb61+LPd75rLhNKxd3NSs+Cbm/oGDFUMEsxJrNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OwIoYF3jsNMsL422ZxZgDHc+rw7lvKu+tOw0tbm5tJA=; b=aRgFZXgBb3I2mJ5Ed8U+XUDdkCW+xikoGA/SP3gGOyYevVurMxK3mNSJGJk63v2LjD+zDiogBtuR455ARh6eZD1W6G57Jz90dWCcYsZtKVWpqt+6fdyFRGNnIDiEJ1QMuQfZPtyRUKSfjgu5E9Dv6sob3Gv+arIIOHXtoeb0Xnu6pTdn4hUB8puLvwQ9l/H+lF1+lyUV8UN90fPVQPZSwoTsBPFZybPwEvlKRVsdPgRUZIkhBGrdL0SH8CiJLAZvgTF9tVw6Jslc4TdMBg3mze5Njejklk56343xcXDsQqbx+6BdVwTZwb76/XFfcbWBjkb1tgZTUwLBBC9fpMpNUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OwIoYF3jsNMsL422ZxZgDHc+rw7lvKu+tOw0tbm5tJA=; b=b/swWV8cBrCzXtVR25gpPg83R8jAJVcvNibtM2m9v/oHMAd+/t2Tb/svoSR8GcjIab1loajwRWZr7q57GE46rfw3QDmdfWLPsaPT09kvbbuwe28id8g5PBuFbx6TrXKJL0uA+hyUUFJu3TJQ+42MQsAcg/Z6lBCcgN93PFeAWog= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7432.prod.exchangelabs.com (2603:10b6:a03:3d3::16) by BN7PR01MB3747.prod.exchangelabs.com (2603:10b6:406:85::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 00:28:38 +0000 Received: from SJ0PR01MB7432.prod.exchangelabs.com ([fe80::5208:e5ea:6ab3:19b5]) by SJ0PR01MB7432.prod.exchangelabs.com ([fe80::5208:e5ea:6ab3:19b5%9]) with mapi id 15.20.6086.017; Thu, 9 Feb 2023 00:28:37 +0000 From: Darren Hart To: LKML Cc: stable@vger.kernel.org, linux-efi@vger.kernel.org, Alexandru Elisei , Justin He , Huacai Chen , "Jason A. Donenfeld" , Ard Biesheuvel Subject: [PATCH v2] arm64: efi: Force the use of SetVirtualAddressMap() on eMAG and Altra Max machines Date: Wed, 8 Feb 2023 16:28:21 -0800 Message-Id: <2ab9645789707f31fd37c49435e476d4b5c38a0a.1675901828.git.darren@os.amperecomputing.com> X-Mailer: git-send-email 2.34.3 X-ClientProxiedBy: CH2PR14CA0045.namprd14.prod.outlook.com (2603:10b6:610:56::25) To SJ0PR01MB7432.prod.exchangelabs.com (2603:10b6:a03:3d3::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR01MB7432:EE_|BN7PR01MB3747:EE_ X-MS-Office365-Filtering-Correlation-Id: 0814d5cd-d7ff-4b7b-983e-08db0a349592 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BnhLTiGwzEntsegU7ueJEPMbrmsCe5OEhj/uvo7HVbuzQ0PQbo8yBJFMCWmkqugjQl3OzbiUmSFEejWeZ+Abb/JjxlP1wbt3qBQjviUtfOArDHj0dpmzpJbdX4QgzRSdzXW3mKBV9nHWRmMLyqI4kMjJQQjnzClK5GZW3aBp/CUJy6nmuIvehAyhhvPuUzconBrAho9hwTlDA/Nkk1ww+zm7JrFv7QnFlg/LPUwrG8/2er8mm8+N+6IDiropPLlYodqOAssdSYXeLgP0trNk0R+keKZBP7QBvDhj0U6vImw78ODcMdii8mVSByBdS9NY0evJILnr8mG47LiMnNzVZ57FZU0/GIHEotRgTOCPOaJtjmGl9R3JrvadsHpTanhJc0iHmXL9pDDYJbAs6l8xFsXNz/ZcFYQ5r9Yu2ZLAYBO3E+nFiDWiShpMFEZOHO6tD3e96NI7whNwNp66GnO8xC04lh0W05ePpHuY/1f6xXlNlApgHo0b/3L8c5akqx3u5ErxEOqkeBUqbpCTX0pX5+xfgUH0StJmwNn8vMAIE4BUEV0Do8ABi5/vvqUWF6UlEzI5DIo/zc362S0Zq/pZCmPyfJ1NEqNZD8ERogkU7s0QB8IP0l+5x7hWSVABk/KnurGHJH7uOb5zCl+Yq1RVo0g9ZWEKli9KfpULuC+Q+ZDBTohTPD/gWbdOOh/6H191K2frkxleUjopzOPybsElQg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR01MB7432.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(396003)(39850400004)(346002)(366004)(376002)(451199018)(66476007)(6916009)(4326008)(66946007)(8676002)(316002)(38350700002)(38100700002)(66556008)(83380400001)(54906003)(86362001)(5660300002)(6486002)(478600001)(6506007)(2906002)(6512007)(26005)(186003)(6666004)(41300700001)(8936002)(2616005)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pYnpVmhMuug9lGXZ0/8sH7ZZFCqBMBluGXYT5eMxi+yjzSyGo1FEdzR+l3J+CrtgOAEYfmaZOnrZVhmllITIYmMlz+TBok2TGG+Bh16P5nzDaSakhJYe9GiDydoMWSpSP3TMyrqxEhu2+dG8H3CgcuWKtjs3rhD74yFrDDdhcs6QRHJPH9laY7mWG9dW1gBGmEH10OPE7DCl2ZcY0Xi9fA5dOFN7DM6INkhm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iWvtlwNuztRtzjb4jL8ivjf0JmNGVI16uZd42PssemqhBoNBvAbhBljulpllYV66OKAZPA8D7WkTujTrHzlOQAqA+OzvLcs49SCtAw+hIefR/UmjOE37AMKQRo8kIBRwcFTYscLL6rcTZHGE2KNOsIpQY1m3hlKMpJS+co5LDFlBg6y2CO1DJLUk6C6BXu37s6eN7i/o+QJ3JoFhqFPKhiY6+rT8EXaoS3BwDDhnA5K2WAJtOR1bsptylMDEBUPPe0t1VnZ/sO5Al8u3vmQOeL7f3UyDIg5mzC4WLwk7Iv5xRm6Ztf6OqiG+nAWGyYtlicA6EPx/9NkDY4= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0814d5cd-d7ff-4b7b-983e-08db0a349592 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7432.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 00:28:36.9702 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kpnh8q8FJFTrkEZu6BpqrwHZDy7JpFNjeu4NIgFk8BVy9w3j6MGxJgkCM23uPZL1eCMADZonG6/3rCJS3hpyP2y7e+KKcHa79QfZ2BE/CXJeuVX7cOq/jQIOGjJoEkcq X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR01MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Commit 550b33cfd445 ("arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines") identifies the Altra family via the family field in the type#1 SMBIOS record. eMAG and Altra Max machines are similarly affected but not detected with the strict strcmp test. The type1_family smbios string is not an entirely reliable means of identifying systems with this issue as OEMs can, and do, use their own strings for these fields. However, until we have a better solution, capture the bulk of these systems by adding strcmp matching for "eMAG" and "Altra Max". Fixes: 550b33cfd445 ("arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines") Cc: # 6.1.x Cc: Cc: Alexandru Elisei Cc: Justin He Cc: Huacai Chen Cc: "Jason A. Donenfeld" Cc: Ard Biesheuvel Signed-off-by: Darren Hart Tested-by: justin.he@arm.com Tested-by: Justin He --- V1 -> V2: include eMAG drivers/firmware/efi/libstub/arm64.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/libstub/arm64.c b/drivers/firmware/efi/libstub/arm64.c index ff2d18c42ee7..4501652e11ab 100644 --- a/drivers/firmware/efi/libstub/arm64.c +++ b/drivers/firmware/efi/libstub/arm64.c @@ -19,10 +19,13 @@ static bool system_needs_vamap(void) const u8 *type1_family = efi_get_smbios_string(1, family); /* - * Ampere Altra machines crash in SetTime() if SetVirtualAddressMap() - * has not been called prior. + * Ampere eMAG, Altra, and Altra Max machines crash in SetTime() if + * SetVirtualAddressMap() has not been called prior. */ - if (!type1_family || strcmp(type1_family, "Altra")) + if (!type1_family || ( + strcmp(type1_family, "eMAG") && + strcmp(type1_family, "Altra") && + strcmp(type1_family, "Altra Max"))) return false; efi_warn("Working around broken SetVirtualAddressMap()\n");