From patchwork Mon Mar 27 19:10:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 667489 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 66743C6FD1D for ; Mon, 27 Mar 2023 19:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbjC0TR5 (ORCPT ); Mon, 27 Mar 2023 15:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232568AbjC0TRu (ORCPT ); Mon, 27 Mar 2023 15:17:50 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83D001721; Mon, 27 Mar 2023 12:17:49 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32RJ5Kmd008836; Mon, 27 Mar 2023 19:17:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=DyQf1+mmfNAtItp04y3HdJ554+++s0Sgg1tKKOc2Jcg=; b=l6dCPuMn211E83sf+tgGUDzhw97+zCuTWv/uYEHVvZujkGQErbssC3TKkkrpOszeuekQ O1j7+r+UD6lIscqnxGdFwAf563cy+GiYOiITy0ZCWi5UAPN0qUirvfZHjIA1vBdBU6W6 Zi1wmZXxjebSA3OP+K45MSYBQCm+QW87LnvEMbmLoz+mAx9wjxXRdgqPVBtws5v/94EO zTK024ZY4phNEinGCuIVvkhgo8UrAPxdlCh5bhc8H2uTDAWVayPe3l6MX5xfGo7u2QlT ksMCI1Qs9zEoYgGcm3cRyEXzFJp7VMlLy+J/kiXaJ4Lz9K6gq2kKlcOd7Y3ZEp7VmSVS XA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pkgytr0r2-15 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Mar 2023 19:17:37 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32RITinB019759; Mon, 27 Mar 2023 19:10:44 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3phqd5n09d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Mar 2023 19:10:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx8U5yxRgxmAaA+3VkIu2lUE9/+eOEHFBe9FgUajK1fF4PYUSFh3C/uo+3fbirCZE5iLzy52wxNVRynY+3ozV+ipegoFquyXbVt0th04THOqX8ahd8vOldmIF61sj7Cjrv/FBAy8r2Yw9ZBiJGh1Nh7gw5TrETrAt3TbEXTKdn2TE8zVyf0BDaNkxNiiqXYFGYuLLsfvmEWUt1xtutlNgf85+m2ljGNP9aigbhpXfhkF9LdGacODI1xsuGRoJU5PHVYRoDlWrLQLMgJsnGYZWPLDDIyyMxMD7VvcdNYJFOyfG/5ylmg3IxQMRI+6rIXXlAQ6LJ+Jhj4ZGH5ro0aGfA== 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=DyQf1+mmfNAtItp04y3HdJ554+++s0Sgg1tKKOc2Jcg=; b=e6TtCqktGdXf43f4kXRKznggqVxpWo8FgJnu6S1fB/Rf4vaZeckeLvSnKHPxOLU/PeRNQgh0Y7HoFNvv4tVFldB/15hyVty+abnMR4W2S+pwpOv7OJayJB167kA7eSoPuSUbkE8Xjc1tnAepM2GvBdFG5THBw2f1vp1cnEDXYIWutPsgAlAlZsKnAWGnX67TbQ5sO1eb32/gs64XSKx6eWOCly5Lx1+4KjnX8H8npAZSFXZNZJtJdgtwjJqnhviIzY4EJAMpN1bSWevvLTAdleGnwnjfC8BYKcF9PbSEwIRFX9GapCg6HXfqDqgDJjYuwK9+szW89GgrvVZMSIA9AA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DyQf1+mmfNAtItp04y3HdJ554+++s0Sgg1tKKOc2Jcg=; b=rjk6Jp/xv21MM6OJke+nmyUJcujueiSCdHdwReirrNs1t8+KF7k8nk/G9lwhKoW0/CDyWC7sIghWVZvoFwrf8slSvpH0gDeYc0vb9Q5cfk+6IBK7LE8hjVZtTEhFUtx6UWBVjraFGk5fZlc3RqcOFlmq00RGPwAk1lSipyKvsIc= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by CO6PR10MB5538.namprd10.prod.outlook.com (2603:10b6:303:135::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.41; Mon, 27 Mar 2023 19:10:41 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::e9ed:8782:64cb:cfc3]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::e9ed:8782:64cb:cfc3%6]) with mapi id 15.20.6222.028; Mon, 27 Mar 2023 19:10:41 +0000 From: Eric DeVolder To: rafael@kernel.org, lenb@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, mario.limonciello@amd.com, kvijayab@amd.com Cc: miguel.luis@oracle.com, boris.ostrovsky@oracle.com, eric.devolder@oracle.com Subject: [PATCH 1/1] x86/acpi: acpi_is_processor_usable() dropping possible cpus Date: Mon, 27 Mar 2023 15:10:26 -0400 Message-Id: <20230327191026.3454-2-eric.devolder@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230327191026.3454-1-eric.devolder@oracle.com> References: <20230327191026.3454-1-eric.devolder@oracle.com> X-ClientProxiedBy: SA9PR13CA0035.namprd13.prod.outlook.com (2603:10b6:806:22::10) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4531:EE_|CO6PR10MB5538:EE_ X-MS-Office365-Filtering-Correlation-Id: f385ac9b-a4a2-4287-b550-08db2ef6f522 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pRilchcWtJEEIun6zJ5sy6KMH5r1U1TCWNiloRkaUMZZyIRgMXQgaTDEcmM9FDp91kjuQot6rx4hhXC4jXUrx1zuGKqY4OVYKtgBsh1pWHIWb5V6tmNjEwWNfyw4496VdkqJAp26v7VOrtrw/hWnZtFljP9mrFkgIlmiYPFhWlxUTIJoim+Kq/sjDj4nQNA9rmKX+d6JSqcnmXtC9lBgPP4ndXumNk8IMH80uiKdXsFTb7L3RyL5XCC0RQxlNDOrJo2wtif/7eJ2h4nBc3vNCVGrT+TNDdEr+z0ERYm3YV6wp4g39EP62xueu6gzxP47pGVkkryqWkt7iKwU5+uQ202kntEhHRhXcv5rCVGEfx1sEbUXR5UvKSyEiLnDEnF7+a5CJUYl/6+HweW36mXo70zZ94rthBVsvFwThGO5ikR6LUGXfmngMGX+ESK4WB/jqBLKUuvOmONNFnbDicHP3TAGHUR9xrX80N2gJYwWB56bvXU/lanm7GbRbieDKluNzaBRJNMNexOOigYzCSp1+yP7GxXMzh5iWeg7sB0/LU/4pXtArwaEIOyROnvsoK9ZA/xo+WOr+qstyliA/m4atKiHsTRlNTYPKHwe8M1Xx9Y= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4531.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(346002)(396003)(39860400002)(376002)(366004)(451199021)(107886003)(6666004)(41300700001)(6506007)(6512007)(1076003)(26005)(38100700002)(4326008)(66556008)(66946007)(66476007)(316002)(36756003)(86362001)(8676002)(478600001)(2906002)(7416002)(8936002)(5660300002)(921005)(6486002)(2616005)(83380400001)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jG3nsQQL7JbereBXObEI4p1EWVymrBZ2gqexpMMiYQaimGD76zrI4cmZBOk0S6K/EMIjCxYLliUwllVnfFGjqEIGwLs5Uj+Y8H6DFuYluMTexprGYnPLp8yEIem8Gb3gqEk8flEzM61uQ4uRV4uUnv/K7cqEi7LXrfRAy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ZYLeiXg9BMwcg5Do0b3yYpW3/fWYDleXzg5hVg/xHCWZvyt6TxiUsLVLE7xg90q6ooujXe836ox86Oq2UtJhmyJzp9JBsVKL4hkUC+l0kl/QLShCqhRV0ieP+zjmj60CEtQbW0t/roMJ47OCwz1BXNLiD5RAjRbLWqkBswFVk5/is6aJ8paRw98ibacX+F7dPjHfGqhckbaYxG8o9FXgnyGW5JJA9WKrdLHKck+f7yQc0KCAwteybN/FzJrQ+6UWS+I1zuPPDQgYZU+jHU5/7JJZ0hBNiq90nO882BWccF1hh71MIzVZgw537ie8OzMQoiadoa0ie21RPr8pDsDZVwlw8sjijLkDgWgw8RbHucY28xqYEnSL3+bl8ntg2EZQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f385ac9b-a4a2-4287-b550-08db2ef6f522 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2023 19:10:41.4007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uvv8CyjQYuxhtJAvv8KnI82/yTORFVRf3iBh2/by4VYUqQpMhl1sJm8gaMVwgp3EdvzkQ8NDGO2LQeBROdY0SOYfyMtiZtS20MVz0hsBhYY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5538 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-27_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=970 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303270157 X-Proofpoint-ORIG-GUID: PHqgH0EoLbTP6PDgJKHWl_PISscFUurp X-Proofpoint-GUID: PHqgH0EoLbTP6PDgJKHWl_PISscFUurp Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The logic in acpi_is_processor_usable() requires the Online Capable bit be set for hotpluggable cpus. The Online Capable bit is introduced in ACPI 6.3 and MADT.revision 5. However, as currently coded, for MADT.revision < 5, acpi_is_processor_usable() no longer allows for possible hot pluggable cpus, which is a regressive change in behavior. This patch restores the behavior where for MADT.revision < 5, the presence of the lapic/x2apic structure implies a possible hotpluggable cpu. Fixes: e2869bd7af60 ("x86/acpi/boot: Do not register processors that cannot be onlined for x2APIC") Suggested-by: Miguel Luis Suggested-by: Boris Ostrovsky Signed-off-by: Eric DeVolder Reviewed-by: Mario Limonciello Tested-by: David R --- arch/x86/kernel/acpi/boot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 1c38174b5f01..7b5b8ed018b0 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -193,7 +193,13 @@ static bool __init acpi_is_processor_usable(u32 lapic_flags) if (lapic_flags & ACPI_MADT_ENABLED) return true; - if (acpi_support_online_capable && (lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) + /* + * Prior to MADT.revision 5, the presence of the Local x2/APIC + * structure _implicitly_ noted a possible hotpluggable cpu. + * Starting with MADT.revision 5, the Online Capable bit + * _explicitly_ indicates a hotpluggable cpu. + */ + if (!acpi_support_online_capable || (lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) return true; return false;