Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1973191rda; Tue, 24 Oct 2023 08:36:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYc81ZuxgkcmQ+lPw1JUIWS7j4G9ZFOvyYSMd/z/B8ausNKVjnkO93atuBwi0am9aW9Be6 X-Received: by 2002:a17:902:e54e:b0:1bf:2e5c:7367 with SMTP id n14-20020a170902e54e00b001bf2e5c7367mr15609084plf.42.1698161808727; Tue, 24 Oct 2023 08:36:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698161808; cv=pass; d=google.com; s=arc-20160816; b=UFzihKkcRmv6xZACOVfYbu9JFWvV1el7dT7OONnUsSMhRdGS0lVUB/slHC8iwq9hMl u8ZLMMauGQM5kknKHdxBQ1nd1psopJfva4Qu8YDVK5dARHmgMaJsF7d0SnW66GPWnsCl P5s9UClyRI+skL3BmCNTKEkgaWkgUnn46PkMcUfR+ebVSvjsKsrYFxE6hIxKu+n2eka6 jLvbhyXbUzIAU9501KZ2RKY+DpHEW1Zb6T6w38zxeYkuiTr98t3XxowlhU3CfP+LLOEb JERPTPxmZEvZlUyBNWA17LRwwmgOKTlkOF7guRhYo1OikA9GWnrSdzfu9PK8T91nYmzD xf2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=Ji0yUnoPULjGwGVr61/pw8L16ZAAwL+/bkHT/09o8aA=; fh=t4i+Ef9mJ8Ayw5n0yYb5SrOhKssINr3NcA0ylngCL80=; b=f4f3JQn2DDFOAwIIC3e8cPaFtNkDa2TPdf+Xy1+khsYA0Vynt6Q8Ax4uthWFFrxdb+ y1okfdX8grxcl4qWi7+FbtvSGq1Z2TEh/u5vl//IsB/HupEjCFNjox8l3r+FF7dg6A3V QzpafaM3XykTv+JGN8fYndMxpAPRERxWiBM0yBVsxrC3aERA754ExOl56iRWevGNa9jE HOG5ofXC65j5qD/ZlQGP+sQNuQzFperZRiZZecj+d7TbD2eCmVlQ0DxlbLHvYKB1TcLN I4tbEPf8KcbwEnbgiYbvdpLg7KKN8sTydPJ5vTFOJDD37bbtHIFwKtHsscrb/DDTzVxN X6gg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="mW1oZm/t"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s14-20020a170902ea0e00b001bddcd8c6acsi8548387plg.311.2023.10.24.08.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="mW1oZm/t"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DA2718049056; Tue, 24 Oct 2023 08:36:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343547AbjJXPgb (ORCPT + 99 others); Tue, 24 Oct 2023 11:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbjJXPga (ORCPT ); Tue, 24 Oct 2023 11:36:30 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2069.outbound.protection.outlook.com [40.107.243.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E68BA; Tue, 24 Oct 2023 08:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQlVJmDo0EoC8JPyhBIJFjDNyTT2EkR8HSbB9ubyTy3XgR+UrHYrjyo+T64VLKA8ZkBaqBYZpD5Wz6+7m7oULoXdPRBObOM33dnQgUOmr658JZ1NzWokhVOiiGzAG3Ik8VgBjNTKMxq2tRnRxcPaApQLoVI3g5Qz4GRVBGnhj1uK09ZUtBpQ93Li2rhNwuLSVx4GBj35cAl+K028kMrvvUjAvrY233tnNfwGdSCKCo8jldIz4Lk3cRagRh7tCIDc1SgAYYr2wWeWvzxSX8pXuMB+FdHWt9kdxvIt7WCVdFQbZ6VQsN/iyoz59QWmEoVCGMlpxvRWjF+/yATVQnPfGg== 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=Ji0yUnoPULjGwGVr61/pw8L16ZAAwL+/bkHT/09o8aA=; b=XHjx7su1ZL/KuoGVWseXxRrSbYHHd9xcmZWvUT4cHXorsdcfWth92B6QkoJo230kPxmcUS+C4x4y8Db88TsZM1Q2uJ6as1a3xbHW2SNGT/UzQoea37rNRkF8mQLPtdwrpJdNXrCFJXPWFIartQ48MQtz20RuDiqSEgJ5Bm4xjO4knFWSugCqEZl6VcQsGhh75Zs2eGeztSCxNXeWzxgyO5EAGa0BZWJqQV+FqqxM78dUCYKsiKTfKeE42Ag0csDP0rxth83JkEB9m5Z5irwFoojsznODter6WOoRAA8LqIWmnXx4DfGwsxJP/YM7tHhttZ9AGM9y0egb2qm9AFkSdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ji0yUnoPULjGwGVr61/pw8L16ZAAwL+/bkHT/09o8aA=; b=mW1oZm/tA/R5xupH+icQnEdhfyr1YCakVRICJQ3bvuVfYKo3Xi39XgT6LJ9EH2kxAg26zDBHYxdZrqt1pLmAafUjZkNw1U42ipmRJhCV0Yk4Pxz1vw1OyALC10z0hUdcTSDIbe9lkRqt3W3rPyjgFSQ4Lb1zgFPKO+jf1eL0UYg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by SN7PR12MB8789.namprd12.prod.outlook.com (2603:10b6:806:34b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.31; Tue, 24 Oct 2023 15:36:24 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::83d7:9c4f:4d9b:1f2a]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::83d7:9c4f:4d9b:1f2a%4]) with mapi id 15.20.6907.022; Tue, 24 Oct 2023 15:36:23 +0000 Message-ID: <6894bebf-15ed-4bd2-aebc-f4ac0a30a395@amd.com> Date: Tue, 24 Oct 2023 10:36:18 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] x86: Enable x2apic during resume from suspend if used previously Content-Language: en-US To: Ingo Molnar , Tom Lendacky Cc: Peter Zijlstra , Borislav Petkov , Thomas Gleixner , Dave Hansen , Sandipan Das , "H . Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org, pavel@ucw.cz, linux-perf-users@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter References: <20231023160018.164054-1-mario.limonciello@amd.com> <20231023160018.164054-2-mario.limonciello@amd.com> From: Mario Limonciello In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DS7PR03CA0252.namprd03.prod.outlook.com (2603:10b6:5:3b3::17) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|SN7PR12MB8789:EE_ X-MS-Office365-Filtering-Correlation-Id: a055088c-fd51-4c6a-343e-08dbd4a6fa35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y1Z+lkzASPFTXmg3S05ldcmDit7eLIBlZBJSOf83HCy3ANTrR9PHqvrEMbTmgcqWIphJGW/OAi4RfRZHfoV/+jtQ794pCnlZFX09LJ7mULGmpgXmsVeGdkLxiGpZ3NLRtlj34d20GYH1pZQvuahunmQvuBbHoWSr7uO7IHH5DXKqvEquGoln9HMm7WWMChquLpEUF10Tu8xxRGzG59PvD+topm1pC83mbcwgbyC6leup0RlMI7BTRm+mGUri98KJtrcE5jmJzUnSuu20l7Ux8Aq88MRVIgSB94zavlAKpLGooJdANLf4ledoWAAZNxKcz7IjIPKnzr0FdpQm5xhKjgRk7990xUs6BEgHDkvxM1de0nHDmbCEMT+pJK6JFekUnL1wmVnaXwweIHrzIBxek269wXy533bbw6mHwyDpRA95vsC7ZEy9Vh55sxbCD1aLcwFc7R+ZGGqi1XpHKnv62cZFcLu8sCiALyyrA5ZD4PNo38OMMbg5QEPR3/zDeDUmADytxgIvyFHAoKcgKLMpBx8N9hDPDNgQDqwvsBXGhb2tM/HD7YFNIFxKFdc6NSbVY+SUagHIQovrnynChovO4xb5E/GV6y1mtJ9Z9kpBflTCDWcCi79NmKKn3CUvIepygNtqyKQdJBGa1iIOrtKPZW2u/V7TZl9AK/24d0cmwBQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(39860400002)(376002)(346002)(396003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(26005)(31686004)(38100700002)(2906002)(86362001)(36756003)(31696002)(5660300002)(4326008)(7416002)(15650500001)(41300700001)(8936002)(8676002)(2616005)(478600001)(6666004)(110136005)(6506007)(316002)(66476007)(66946007)(54906003)(6636002)(66556008)(44832011)(83380400001)(6486002)(53546011)(6512007)(87944015)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZEJkK1FtRXE3U1E0bTVXcS83bmV6bzNyaThlLzJ3cnV0dlVxTSt4UnMwMGx1?= =?utf-8?B?ekZjREgvTTJUeTkxeGRkVHBNWDVzUXJRWDhuQlgwaXJxZy9peWdPU3ZtNlUv?= =?utf-8?B?UnAyTVNabmR1cG5BTHBOcU9JQU85YjFKUE85clo4T0p3Yjc5TmdiZ2hvNk4r?= =?utf-8?B?QUhXOFRPVyswNDMxM0M2YWFxMVM3bnlIUk9uL3lwTnh5K0NvZi9k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mhxbTZjcVlwOEQ3akZPYTB2U1JodEFZa3Q2Sjh6SCswNW9HNTli?= =?utf-8?B?dEQzb2NBWUZtdForMUltRk45WFRLNVdYUWxKYVBOZ01sd3hsM3ZocXJLZHkx?= =?utf-8?Q?LBLYbt/zkqwVIZL+1qtHCcG8q?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a055088c-fd51-4c6a-343e-08dbd4a6fa35 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2023 15:36:23.3276 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: htI67J5Mi4d1FeLJYuhjdTZpu+stlEgtZjTVMAr7OEJw/uTbxSpFA3kz2ETjbpuOZ1s22Sy/GBdWhKzncNHRvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8789 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:36:46 -0700 (PDT) +Tom On 10/24/2023 03:36, Ingo Molnar wrote: > > * Mario Limonciello wrote: > >> If x2apic was enabled during boot with parallel startup >> it will be needed during resume from suspend to ram as well. >> >> Store whether to enable into the smpboot_control global variable >> and during startup re-enable it if necessary. >> >> Cc: stable@vger.kernel.org # 6.5+ >> Fixes: 0c7ffa32dbd6 ("x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it") >> Signed-off-by: Mario Limonciello >> --- >> arch/x86/include/asm/smp.h | 1 + >> arch/x86/kernel/acpi/sleep.c | 12 ++++++++---- >> arch/x86/kernel/head_64.S | 15 +++++++++++++++ >> 3 files changed, 24 insertions(+), 4 deletions(-) >> >> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h >> index c31c633419fe..86584ffaebc3 100644 >> --- a/arch/x86/include/asm/smp.h >> +++ b/arch/x86/include/asm/smp.h >> @@ -190,6 +190,7 @@ extern unsigned long apic_mmio_base; >> #endif /* !__ASSEMBLY__ */ >> >> /* Control bits for startup_64 */ >> +#define STARTUP_ENABLE_X2APIC 0x40000000 >> #define STARTUP_READ_APICID 0x80000000 >> >> /* Top 8 bits are reserved for control */ >> diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c >> index 6dfecb27b846..29734a1299f6 100644 >> --- a/arch/x86/kernel/acpi/sleep.c >> +++ b/arch/x86/kernel/acpi/sleep.c >> @@ -11,6 +11,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -129,11 +130,14 @@ int x86_acpi_suspend_lowlevel(void) >> */ >> current->thread.sp = (unsigned long)temp_stack + sizeof(temp_stack); >> /* >> - * Ensure the CPU knows which one it is when it comes back, if >> - * it isn't in parallel mode and expected to work that out for >> - * itself. >> + * Ensure x2apic is re-enabled if necessary and the CPU knows which >> + * one it is when it comes back, if it isn't in parallel mode and >> + * expected to work that out for itself. >> */ >> - if (!(smpboot_control & STARTUP_PARALLEL_MASK)) >> + if (smpboot_control & STARTUP_PARALLEL_MASK) { >> + if (x2apic_enabled()) >> + smpboot_control |= STARTUP_ENABLE_X2APIC; >> + } else >> smpboot_control = smp_processor_id(); > > Yeah, so instead of adding further kludges to the 'parallel bringup is > possible' code path, which is arguably a functional feature that shouldn't > have hardware-management coupled to it, would it be possible to fix > parallel bringup to AMD-SEV systems, so that this code path isn't a > quirk-dependent "parallel boot" codepath, but simply the "x86 SMP boot > codepath", where all SMP x86 systems do a parallel bootup? > > The original commit by Thomas says: > > 0c7ffa32dbd6 ("x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it") > > | Unfortunately there is no RDMSR GHCB protocol at the moment, so enabling > | AMD-SEV guests for parallel startup needs some more thought. > > But that was half a year ago, isn't there RDMSR GHCB access code available now? > > This code would all read a lot more natural if it was the regular x86 SMP > bootup path - which it is 'almost' today already, modulo quirk. > > Obviously coupling functional features with hardware quirks is fragile, for > example your patch extending x86 SMP parallel bringup doesn't extend the > AMD-SEV case, which may or may not matter in practice. > > So, if it's possible, it would be nice to fix AMD-SEV systems as well and > remove this artificial coupling. It probably isn't clear since I didn't mention it in the commit message, but this is not a system that supports AMD-SEV. This is a workstation that supports x2apic. I'll clarify that for V2. I've looped Tom in to comment whether it's possible to improve AMD-SEV as well. > > Also, side note #1: curly braces should be balanced. > >> #endif >> initial_code = (unsigned long)wakeup_long64; >> diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S >> index ea6995920b7a..fcfa79105928 100644 >> --- a/arch/x86/kernel/head_64.S >> +++ b/arch/x86/kernel/head_64.S >> @@ -236,10 +236,15 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL) >> * used to look up the CPU number. For booting a single CPU, the >> * CPU number is encoded in smpboot_control. >> * >> + * Bit 30 STARTUP_ENABLE_X2APIC (Enable X2APIC mode) >> * Bit 31 STARTUP_READ_APICID (Read APICID from APIC) >> * Bit 0-23 CPU# if STARTUP_xx flags are not set > > Side note #2: you mixed up the comment ordering here. > > Thanks, > > Ingo Sure, thanks for the feedback. I'll adjust the style for v2.