From patchwork Fri Nov 19 23:39:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 12693162 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 E8483C433F5 for ; Fri, 19 Nov 2021 23:41:09 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jUXH9KDz61PzhNyn4gpkEHcZmAgGttSltX64I2az6cc=; b=aAK4SA87jef0dz Eb92ayAlkUZWwJtxi/EDqtSwhVm3n4QWHAMQ99w0tbN7nTbDgSwxwhDbONztXak3jwFHrni8bijyR EJsP7p/3pXDo3QNek2UiqX8bTPA//sICJqIUsLOmyzKYso09QDkR3uxQXIURWECyu02csJj+bTarO nSdfMQVbxjfyyshMyVfwYmnIW9eG3WutUvpELFFCpXHhVKVuaJKknHF36EeG8MTE/lLVaBq+Y6w20 Bav1NwXsLgrcqvEP+uzacF1NIGENd6jNQ+dxZuRyIjkCFlBM0EtxRHMdqU9ydEyhWeViIJyfvmDnI 7HDJSBbEmZJFsohKCI0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1moDTw-00Bnfk-3r; Fri, 19 Nov 2021 23:39:48 +0000 Received: from mail-cusazon11021019.outbound.protection.outlook.com ([52.101.62.19] helo=na01-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1moDTs-00Bner-EN for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 23:39:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m6RozdnmdRQrl/EVs4ejphrZjBclYmdvNqY1Se5AGrqFSsOuWTaZ7LDnFquo9kF8o2y8WbtqOCTVJBhAH9UuBj2+FQc9SsDbzdccqK8mNUkJ7WBkJrkIsppcx+9fZwE6dFxcDu90ExS3n0ch3MmcCmb9mVgNdgHYEhr99jnzp3S5zS2EYFYnn+9tL8SKXi14uL7H0oLMRMLbb50bzNTho1k7Xf/6LwIHdA/PNbj1YjEaBz9KiVbcTHuBoRk9aTtQp2bFFO/AcY/isumf6E2L+mWtYhuhgCApibF22CAInbatfnbu5QTB35XLdQnX3XiMaRa3YBbi7KDSUh7FbTHlWA== 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=bBcrA3GicMcPSiX1v4GySeuSNmJUZRkaDr3BIwU3pmE=; b=N6ZLbK9OYSVTTJ0tc50QWenRJSIlGa+71p+OY71wzZ+8uuYSp2uKzfJInDfP3/M026hcTVU/BRGJkS6lH9Yil0728WFiVJGjARzhea+F1xaKUf/R+NzziAmB/FuoFO4CGIfDa+PWGqmpLrooxdFS3g3QVRwj4kqB7zumVDrVAqo0IInQXQpu35S3LQ1AaOFonj6ITHNmHtlxkWGcE9ASKEu5InrqiLp11lyjRVKCrcDoUvDnBr5/wHERR6xXmsnvro/1I310sVB6WnAS3AUo79I2PRb0f0mjHq2AaWQC3utg54pmDic1W9KO+eMlvKE5T7fW1FnWkVPggUPv12h+tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bBcrA3GicMcPSiX1v4GySeuSNmJUZRkaDr3BIwU3pmE=; b=FKarZZoIdKTR/u78L8BShPaXD9WIzOXZfVSG+EmsCTVMVXCOYGIil5M4xvHfcn0ZwQDQsEwH/DTQOYLqsdYVO3EJfdI6/Z+Zx82Q3jwd13NcJRBdLg9+EWHo4JU0rin3cn4kipLVAdYqIFNDDqZBlNlcZdq/hYw9RpZDXupJv1k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) by DM5PR21MB0507.namprd21.prod.outlook.com (2603:10b6:3:eb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.13; Fri, 19 Nov 2021 23:39:39 +0000 Received: from DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::289a:20fc:5d8c:9142]) by DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::289a:20fc:5d8c:9142%3]) with mapi id 15.20.4713.009; Fri, 19 Nov 2021 23:39:39 +0000 From: Michael Kelley To: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, steven.price@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: mikelley@microsoft.com Subject: [PATCH 1/1] firmware: smccc: Fix check for ARCH_SOC_ID not implemented Date: Fri, 19 Nov 2021 15:39:01 -0800 Message-Id: <1637365141-16823-1-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: CO2PR04CA0150.namprd04.prod.outlook.com (2603:10b6:104::28) To DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mhkdev.corp.microsoft.com (131.107.147.144) by CO2PR04CA0150.namprd04.prod.outlook.com (2603:10b6:104::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.21 via Frontend Transport; Fri, 19 Nov 2021 23:39:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4105c54e-5c55-46c5-6a0f-08d9abb5daaa X-MS-TrafficTypeDiagnostic: DM5PR21MB0507: X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z+v7bbrErPeb/39RoNKb/bHExd5FzSx0k7y7zmyjLSYJS7Kq/Is7oqasgILhexPVmomGk+C7Pp0Grm70Qj02qDpuCptprvO7Jyfqy/MFUR1afhLg0iIAr2/getZ737adie2LEZOMo5T+liA8syYeI9s82EZys6dKwCFx321nhQDDHmoih8FibR7FMsSXclkmvovH9YSUvfYOS12QXVOiJ0dnlpOOx5dv2d/odw4+QrIhOsWqxkZxZtiwVn/eyM1z0HW7U+fdHtU52jhIh9B/vsq969T0g1450vSrz9C1I17LiBFyZQLogrBKp5TLns9HdThKaX9EaCYRY9qUGHc/5or4z72KIMO8aW6nwXF3uHvAhOVnqF58FoVjLDkzHQJn/JmU075NMLWmz8nyYJBbbGSkRHAbJ9I1+M+ed2e5/aL349Pvk/mXjXU61D9Ou0r4ISNu8oIJvSmzjIfFM8pT7Ojdx+gSZ5iZbMWn8mtCPfcPRPhieTHNqLzkbAYgFrhA29ds1bT2Tp0n3G7a5/HiD0HlowTsgoM8hOkY8EpbXqjFX7GQVYH8zA8vAHYpv8IpGLmBBH01c7qfF/eEOrggFw3mOEYSKPo3XQ4iyqFU2RtFJ5ELV0qYx6rHoBbD8f9zCo1AOu5Llm7HAvHiFEq4bgBuwfWowtkPeg+E5kbYK2iyAJ3GgoO7UrO5epD10xdX1fnbQGulv9AaBxp274t8Q3qS0pg3bjy6gcWlo+Os+x6jKcSvH4xPVNQ6KnSOJKY2 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR21MB1514.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(26005)(4326008)(10290500003)(83380400001)(186003)(52116002)(6486002)(36756003)(508600001)(956004)(2616005)(6666004)(7696005)(107886003)(38350700002)(5660300002)(82950400001)(66946007)(2906002)(66556008)(316002)(86362001)(66476007)(8936002)(8676002)(38100700002)(82960400001)(20210929001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IARyChbm7QJ/a5azSEG2n/5aJISPpVE+FT1S1UlKVeJmCFZMVfDyShkFIsofORxJV0gzmAWpmOjZSrsfvUtvtR+5j1m6U8eNEwzAjnwW2p66qa48v+V3uVk9Vvs/eUYUx5InxXlBCpxSJKUu2lhw2JyYZuwCA234SGS3XgPnSSUXdBy+c2J6A54B15kvKnYYnJQCuQeANPx+jsZrnQc7m0545v8udAlZ2X/rYSJ8hEaZYSEfl5CM1nLYnKn9Mc0mmhpJG6ZWWcLNuyCLSpaZXHX1yKzU95hXe1ZmF6DWUN5H38ivWlpW3sX937HX5jk0DWNLL97oW6lH+mOZYwkxmz6vPBgEqIgcJtNlbzdO1M3ABSYuZgUQiGK/k6gm+wcDL7C9UtZV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Xozuj0mbTz7qaXc5RWnbkwiCu++gQGYr2ld2lInQYnhTxQAJ3fDa9zvQ7LqJC941+bBJegbefrdoiLpTDoouVWYtI1GYjK0bkv5vUT9eRyInphBObusPjz/2SqWKLayRpXILcnJwgICpOXbyKQIZkQSrUkPpdDEvFHvUykuHQw9fQ= X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4105c54e-5c55-46c5-6a0f-08d9abb5daaa X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1514.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 23:39:39.6643 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JvTqc6sn17JoRnQXG/NBpnMFGLZSUPzvwpK35iNPiya+lh2eNZZR0SzCfuPt4S8IQ4ikErHDbWLR29m0C0KdUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0507 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_153944_635959_0BA93020 X-CRM114-Status: GOOD ( 12.86 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The ARCH_FEATURES function ID is a 32-bit SMC call, which returns a 32-bit result per the SMCCC spec. Current code is doing a 64-bit comparison against -1 (SMCCC_RET_NOT_SUPPORTED) to detect that the feature is unimplemented. That check doesn't work in a Hyper-V VM, where the upper 32-bits are zero as allowed by the spec. Cast the result as an 'int' so the comparison works. The change also makes the code consistent with other similar checks in this file. Fixes: 821b67fa4639 ("firmware: smccc: Add ARCH_SOC_ID support") Signed-off-by: Michael Kelley Reviewed-by: Sudeep Holla --- drivers/firmware/smccc/soc_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/smccc/soc_id.c b/drivers/firmware/smccc/soc_id.c index 581aa5e..dd7c3d5 100644 --- a/drivers/firmware/smccc/soc_id.c +++ b/drivers/firmware/smccc/soc_id.c @@ -50,7 +50,7 @@ static int __init smccc_soc_init(void) arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID, ARM_SMCCC_ARCH_SOC_ID, &res); - if (res.a0 == SMCCC_RET_NOT_SUPPORTED) { + if ((int)res.a0 == SMCCC_RET_NOT_SUPPORTED) { pr_info("ARCH_SOC_ID not implemented, skipping ....\n"); return 0; }