Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2748573rwd; Fri, 19 May 2023 09:38:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bFTFrSwBLY3vMenZl/wcoXtshp7M9ykrWQ/fTlXQ2m+a6FeXsKKU+I3ESitNbS+JbIiIb X-Received: by 2002:a17:90b:2393:b0:253:572f:79b7 with SMTP id mr19-20020a17090b239300b00253572f79b7mr2536185pjb.30.1684514326266; Fri, 19 May 2023 09:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684514326; cv=none; d=google.com; s=arc-20160816; b=U1Zob1iBqlc6cg9VSlzVz6oFQyRQfxC47upV8MyZIJHmWCZXeXt/n/Y7+lGd1f6jdl gTp47EzZKNDmKFUBowFtJHJ8uNkzdmeXt259ooKylKMSKx4fOhK9JTUI97QUdOgQ9e6O 8lxaGsWMmr+dHJzTOThb/MywTOfgbRoASAmAK/e94FcwnfYIRfLU9LBnlBCKXlMHz8LM 1E4Wcp4yjJBIe02LBGvO0Xu1JsYFVIxdeEDrarSvKJR5waRp81e99RSzWTe0SHIJWH6H /5rdSL26Zs/JhklPooGsLkzKOY/Z321OoQ6l8TdFet73ItAG/lp2vvpYJeXUS5f+sPMa f1+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yZ+c8uZcJrlAlno5FxTnPElzATRQ31IF/+qQxmh4X7Y=; b=0S0VYDZfoHNgnT7ZQuB/9WXb8LyA55vPFg4mHweRFWIy5Hc7+GsBvQ8croibXnVWh6 oUCIlzjaYsEH30StxJAHD43QISzX4KRKMifsQfnLUiaRy8cIzmvLYQAAH7EDCrdtrhOd 1TJXGf/08BgS6bjxS3WKNK1nUg5mSUcsrQ00jmd6pwr0fKkh6QMFsCWDr/rRYOOAzPsn q3vtKSGFApsb4cwbZe2mksM/FPCR/RyWU4SRaCAq7krWTJuE25AiChzeO8nlyhbdkOxS VXHosGBwH9vqFi2Y/kNLhqX0Tp4dwRyXA+Gi77VyDW5CP46xPTf07Rg5wC11Y05N8ODN KzVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JXYLKwcI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j192-20020a638bc9000000b00517d81adf00si4146754pge.624.2023.05.19.09.38.31; Fri, 19 May 2023 09:38:46 -0700 (PDT) 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; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JXYLKwcI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjESQbn (ORCPT + 99 others); Fri, 19 May 2023 12:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjESQbl (ORCPT ); Fri, 19 May 2023 12:31:41 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45E84CA; Fri, 19 May 2023 09:31:13 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34JBfjsB011872; Fri, 19 May 2023 16:29:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=yZ+c8uZcJrlAlno5FxTnPElzATRQ31IF/+qQxmh4X7Y=; b=JXYLKwcI2GbfAQOyp3pqNSg6DjU0Y7APV0UkqvAq+7mPhE6jU2niZ2R4O5GEnV8Jv3vY GKGhPl9R8u8z9GTQRJNoPGaU+0mzwGn4MRHzlqrkBUJqPBmbmvIdtKopPW+l45x2R2N4 N53tfhOYno5CyDkZBijlZR00Ad7cvVpDEdEpXoDABtsI85/Pq3Lm9EQeADaOgh7BPKhU vCAzv/tTJH7NrLUDiiqElo6FSx31LTwIxiOoWrGKsGUnDbsEy4Z69PrEn6OpGxkbbO+u mhtvqcavuyOXh7qnKKh25rs7jG7FJgFRefJwgVrMfeYuSSMcB+UmlbDChCuJ2ha23dwu fw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qp4ccs7tp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 16:29:01 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34JGSxwm014994 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 16:28:59 GMT Received: from [10.226.59.182] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 19 May 2023 09:28:57 -0700 Message-ID: <16562305-3bc0-c69f-0cb5-1b9da1014f19@quicinc.com> Date: Fri, 19 May 2023 10:28:56 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [patch V4 36/37] x86/smpboot: Support parallel startup of secondary CPUs Content-Language: en-US To: Thomas Gleixner , LKML , David Woodhouse CC: , Andrew Cooper , Brian Gerst , Arjan van de Veen , Paolo Bonzini , Paul McKenney , Tom Lendacky , Sean Christopherson , Oleksandr Natalenko , Paul Menzel , "Guilherme G. Piccoli" , Piotr Gorski , Usama Arif , Juergen Gross , Boris Ostrovsky , , Russell King , Arnd Bergmann , , Catalin Marinas , Will Deacon , Guo Ren , , Thomas Bogendoerfer , , "James E.J. Bottomley" , Helge Deller , , Paul Walmsley , Palmer Dabbelt , , Mark Rutland , Sabin Rapan , "Michael Kelley (LINUX)" , Ross Philipson , David Woodhouse References: <20230512203426.452963764@linutronix.de> <20230512205257.411554373@linutronix.de> From: Jeffrey Hugo In-Reply-To: <20230512205257.411554373@linutronix.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: l2X6Bcn3k_Nws-GO_lVKOQ5EQSj3BbaM X-Proofpoint-ORIG-GUID: l2X6Bcn3k_Nws-GO_lVKOQ5EQSj3BbaM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 impostorscore=0 spamscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305190140 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 5/12/2023 3:07 PM, Thomas Gleixner wrote: > From: David Woodhouse > > In parallel startup mode the APs are kicked alive by the control CPU > quickly after each other and run through the early startup code in > parallel. The real-mode startup code is already serialized with a > bit-spinlock to protect the real-mode stack. > > In parallel startup mode the smpboot_control variable obviously cannot > contain the Linux CPU number so the APs have to determine their Linux CPU > number on their own. This is required to find the CPUs per CPU offset in > order to find the idle task stack and other per CPU data. > > To achieve this, export the cpuid_to_apicid[] array so that each AP can > find its own CPU number by searching therein based on its APIC ID. > > Introduce a flag in the top bits of smpboot_control which indicates that > the AP should find its CPU number by reading the APIC ID from the APIC. > > This is required because CPUID based APIC ID retrieval can only provide the > initial APIC ID, which might have been overruled by the firmware. Some AMD > APUs come up with APIC ID = initial APIC ID + 0x10, so the APIC ID to CPU > number lookup would fail miserably if based on CPUID. Also virtualization > can make its own APIC ID assignements. The only requirement is that the > APIC IDs are consistent with the APCI/MADT table. > > For the boot CPU or in case parallel bringup is disabled the control bits > are empty and the CPU number is directly available in bit 0-23 of > smpboot_control. > > [ tglx: Initial proof of concept patch with bitlock and APIC ID lookup ] > [ dwmw2: Rework and testing, commit message, CPUID 0x1 and CPU0 support ] > [ seanc: Fix stray override of initial_gs in common_cpu_up() ] > [ Oleksandr Natalenko: reported suspend/resume issue fixed in > x86_acpi_suspend_lowlevel ] > [ tglx: Make it read the APIC ID from the APIC instead of using CPUID, > split the bitlock part out ] > > Co-developed-by: Thomas Gleixner > Co-developed-by: Brian Gerst > Signed-off-by: Thomas Gleixner > Signed-off-by: Brian Gerst > Signed-off-by: David Woodhouse > Signed-off-by: Thomas Gleixner > Tested-by: Michael Kelley > --- I pulled in this change via the next tree, tag next-20230519 and I get a build failure using the x86_64_defconfig - DESCEND objtool INSTALL libsubcmd_headers CALL scripts/checksyscalls.sh AS arch/x86/kernel/head_64.o arch/x86/kernel/head_64.S: Assembler messages: arch/x86/kernel/head_64.S:261: Error: missing ')' arch/x86/kernel/head_64.S:261: Error: junk `UL<<10)' after expression CC arch/x86/kernel/head64.o CC arch/x86/kernel/ebda.o CC arch/x86/kernel/platform-quirks.o scripts/Makefile.build:374: recipe for target 'arch/x86/kernel/head_64.o' failed make[3]: *** [arch/x86/kernel/head_64.o] Error 1 make[3]: *** Waiting for unfinished jobs.... scripts/Makefile.build:494: recipe for target 'arch/x86/kernel' failed make[2]: *** [arch/x86/kernel] Error 2 scripts/Makefile.build:494: recipe for target 'arch/x86' failed make[1]: *** [arch/x86] Error 2 make[1]: *** Waiting for unfinished jobs.... Makefile:2026: recipe for target '.' failed make: *** [.] Error 2 This is with GCC 5.4.0, if it matters. Reverting this change allows the build to move forward, although I also need to revert "x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it" for the build to fully succeed. I'm not familiar with this code, and nothing obvious stands out to me. What can I do to help root cause this? -Jeff