Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1189699lqm; Thu, 2 May 2024 07:42:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW29wBUfjoz7hBZuz/BpqenWjJaAX09tYLxxFwRjfzdPyarX/OcNdk1fcTZxEgjihOfCqPaIeUaQKWzLVtor/Mcp52P63hwc3/wIyHroA== X-Google-Smtp-Source: AGHT+IEwXCCsUvH49oxV5b1UPU6O7u1yERiOYkJmnbKWu9OswgfI0pm5DeYCG5zHJNsyQolLIV7m X-Received: by 2002:a17:906:1609:b0:a58:be1f:9134 with SMTP id m9-20020a170906160900b00a58be1f9134mr3754701ejd.30.1714660938721; Thu, 02 May 2024 07:42:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714660938; cv=pass; d=google.com; s=arc-20160816; b=O2VPfi9oavUDBAz9CDb/SVoXmmpiMapkUq291I7Ab3y1NukP2nJQ9MaNf+ckNWRoZj LP37OlQ6KNEo5S9xPSGhr7SP6W7rxcmUVH+cHSkcK8NjAN08PvsbjcxaoNnxGIpPHUls 143Mpo2+9gvxKNtadgIu4UP8OfRR+DZInExzvanmHzg01LgO55TecvKUydYCmWsEkuZR xggETWAWM6NBRgw5kj0xX8DfkHsaDFRZlkngO+9beIHISVBZImHRMZUcaq2iAdWBrMb2 c/RNAeptLxSstdlYRlFS1Ex6n1Jy5g11L/GjyLhUTdoh5FxYTAgXpqeaUSEkqhCI3p2c 9ESw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qEMCswWL6Qvit5lVMRGJgC9X1ArZFQq7W3NBO8MPxTQ=; fh=go1b6vRQXNlopuzcMiMRZ0EDZvjxAUpsz0UoUiPH+7M=; b=xnAwSBCSf/yuwjhk55q0UVoRWQStxAKWVAzL/frdZXqkeTwGlZ8v/fxwhx4Jpvqd2/ XoaQ6lLrJQW326R7Zy5vwJJcRN48XorwwfKarNB8YeIwXzGf6uig9In7w4OSVC2rVql7 Gxe06h606Xe5KJr+QhaKKI5ctVlOw/flppX66NEtjg5MflRs3pJZ/G7sNBTuN9eXguyD 301DNQ1lGnBMtv76Qp12Yp/RFGNsUfxitDgmSJCsnWR39WPmvNRLyqFu+eZd0BPsaCHH uPjYLBTq2uTkm5UI8+oaIQ1F6qv8J3BvVnYEozf11CPuCc+KXwlAaF/FC/K0oWyxPeGx yFog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=ZKeXpYvS; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-166576-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id go43-20020a1709070dab00b00a51c4d61266si614908ejc.308.2024.05.02.07.42.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 07:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166576-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=ZKeXpYvS; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-166576-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 13E6D1F2253F for ; Thu, 2 May 2024 14:42:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E29351534F4; Thu, 2 May 2024 14:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ZKeXpYvS" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D350913C687 for ; Thu, 2 May 2024 14:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714660927; cv=none; b=I56oqB+zSMm4Gx8CZb6pzr5SsBI9iDy0Gyrjs4ik5rcM3U2TnToZ2xaDyiWlhYs3pwXZlORGewJuUpliJ1AAXJGo4l/qqb2AExYZMQ46iNRBEY3faogXffgDolDqxjDLMWAd97vwMXUYw9eOhF3Kr5Vbtf4Crz3Z8L2R8gN2XkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714660927; c=relaxed/simple; bh=31r3Q7wEIk+tZYT2/alRNJj4qJTd5yscIn8kGo7vZPM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tQhQc7M4AdJBYna1CjguJmY1+84Fl7+07d1VfAHtYuHeCuTgnq8g+7ADxbwtahBcL4mc11PG9Rf7sZCslihX0BgRVitK1WoOsguaqLArcVJPG5M5BepB2kjul14+LwFJalyLqMUSFjmkbQJxb+MWafa4DbdUfe9qlOwIEKVBm+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ZKeXpYvS; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a5544fd07easo1122212266b.0 for ; Thu, 02 May 2024 07:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1714660923; x=1715265723; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qEMCswWL6Qvit5lVMRGJgC9X1ArZFQq7W3NBO8MPxTQ=; b=ZKeXpYvSqiMC291C0NvpQO6+Z73NO9L5uuPjGQshV7zBmTdbVmJ0DdPahCLXhRorsI PQRdn8SjMDlaFluuGdzHxQXbsiOjiNURYWHhPmDFXB6jFtUdPrjrNrgPzV4GgG3F/cln RJn6V3IbKfUdx9pso+j3XgfFE//K1P1UB5+bAg9DG/Fjr/9I3NUsYewiobeOiJXP4RGD hNh5eu514NO28UzEOrpW9sgvC3hbKCyuZAni3ycsqDcpI6FTPovR2lXagaE08Ktz6wv7 0hzHWD/8yodmGdDB8iO2hZXmP3QDz0g4rvcdJLRMIL8NuPdce0/ayTsHoSc4je4EAPL8 M7Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714660923; x=1715265723; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qEMCswWL6Qvit5lVMRGJgC9X1ArZFQq7W3NBO8MPxTQ=; b=Eb1BSe7NqtrK9eoCI0Hi1cPebJg9upfPDjh3WWKMNwpJ3jgG44TChOLBvUlngXXm8v 1sXGTx8J9UYne4aCVOQmBVBPm/RE4GOFvnetveajSmI6xm0JYfw0xF4bpyiE99/Rs3ZS ssgbsRXLHT7dTfMLYfuRMVO73gTcBIHoS2VnHzbcchKxqZt+CjllQdIHIGVgRaxZqbfD HAQ+F7oSx7T1iUQogbZkcvlKKQ1XMPJycPhbh+6ZL4sP8U9d+x+6fms6ab7JYZq2qQvK 6p1ng4y+yGp4WDxfPsw5kbiratL5HJcTHWD64iIIjeIWZn+I/iSL7HTDkPf9a970sOMC fh7A== X-Forwarded-Encrypted: i=1; AJvYcCV3/NtDo740CT1Y14ESLMWpPW8c22/vIeCzR0jAYhggffATii5p06q5zLJU1C0qbFXEzMYSRmzElWjTq0Wiif+kKgGpdl1wbzF+aoQ2 X-Gm-Message-State: AOJu0YwNfa/7UKwML7tV1Y0y5QfxUlwufUzb0vFAHnlbbcZs2aLF6I0r urvhoVw6NAtI9KjcWArVS7oceFl9mFFx87AFNW8e4pYZtOh73vWvktzrnBqV9HY= X-Received: by 2002:a50:8d17:0:b0:572:5bc3:3871 with SMTP id s23-20020a508d17000000b005725bc33871mr4144277eds.10.1714660923070; Thu, 02 May 2024 07:42:03 -0700 (PDT) Received: from ?IPV6:2003:e5:8738:9a00:3771:d6c0:aec6:f5ea? (p200300e587389a003771d6c0aec6f5ea.dip0.t-ipconnect.de. [2003:e5:8738:9a00:3771:d6c0:aec6:f5ea]) by smtp.gmail.com with ESMTPSA id n16-20020a05640205d000b00572a9c7d58bsm607330edx.6.2024.05.02.07.42.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 May 2024 07:42:02 -0700 (PDT) Message-ID: Date: Thu, 2 May 2024 16:42:02 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86/xen/smp_pv: Register the boot CPU APIC properly To: Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andrew Cooper References: <20240405123434.24822-1-jgross@suse.com> <20240405123434.24822-2-jgross@suse.com> <87ttjisu9l.ffs@tglx> <27de9ba0-cbe9-4256-b378-45ede5d29517@suse.com> <87a5l8s2fg.ffs@tglx> Content-Language: en-US From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= In-Reply-To: <87a5l8s2fg.ffs@tglx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 02.05.24 16:39, Thomas Gleixner wrote: > The topology core expects the boot APIC to be registered from earhy APIC > detection first and then again when the firmware tables are evaluated. This > is used for detecting the real BSP CPU on a kexec kernel. > > The recent conversion of XEN/PV to register fake APIC IDs failed to > register the boot CPU APIC correctly as it only registers it once. This > causes the BSP detection mechanism to trigger wrongly: > > CPU topo: Boot CPU APIC ID not the first enumerated APIC ID: 0 > 1 > > Additionally this results in one CPU being ignored. > > Register the boot CPU APIC twice so that the XEN/PV fake enumeration > behaves like real firmware. > > Reported-by: Juergen Gross > Fixes: e75307023466 ("x86/xen/smp_pv: Register fake APICs") > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross Reviewed-by: Juergen Gross Thanks for the patch, I'll take it via the Xen tree. Juergen > --- > arch/x86/xen/smp_pv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/arch/x86/xen/smp_pv.c > +++ b/arch/x86/xen/smp_pv.c > @@ -154,9 +154,9 @@ static void __init xen_pv_smp_config(voi > u32 apicid = 0; > int i; > > - topology_register_boot_apic(apicid++); > + topology_register_boot_apic(apicid); > > - for (i = 1; i < nr_cpu_ids; i++) > + for (i = 0; i < nr_cpu_ids; i++) > topology_register_apic(apicid++, CPU_ACPIID_INVALID, true); > > /* Pretend to be a proper enumerated system */