From mboxrd@z Thu Jan 1 00:00:00 1970 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 CDBEFC04FFE for ; Fri, 26 Apr 2024 09:19:01 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=viPiez2gFi7zhf3CGUPplFI3hTz+5glkqUlvuJmCG1o=; b=VtK1b6HTcSGi/b hGNvfbpE9wHOxds+f2aF34p5Wnkj6Cba+x3GTFXsp7y153yQPN4HfdcwCVP0VqE1FujEhp5OGtvtS hY4l/2153g0Oh4XAwwg/2PRTLl0nN+xiOAZmkUrdIlp71yg9b9GCRPLXNlzobtQ7R4GWgEQrPZzwd eZqXzK+3lYRGclhLRiiUrzr/VpTJeabP9ykv+bhlqsyUJgE/SOnvFc+vNnjdnuVkwneyi025WDpmQ 47W71FOpi4I7F1ku2/sOpwoi5DfGvjC30fg7yyBJW6LUtfa/Rx2m1VaI+or93YHumSZWr6tZxhXc0 7jg4EvlMDfqfVP13WyKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0HjE-0000000BsQf-1gR0; Fri, 26 Apr 2024 09:18:48 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0HjB-0000000BsPW-1Bg9 for linux-arm-kernel@lists.infradead.org; Fri, 26 Apr 2024 09:18:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714123124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G1NbTRHbQ7U0GF+15RrhvfyGaj1mUIGy4Pli01lUXKI=; b=ggNwOoTP9ArKA0dUTvRHoUmFSj9sWrRPqq9UYgdY2bhYG7kwACl8s/i/MDxAizoIgkE+3O ov7rbNdb9d/2ITj2Vj7i/Wgv8z7O9dkXshPL5aqBwz8pkDE5zztkn7nXjaVAoJ9r/R8L/H 3+/GkSsag3UHXNnln6nHHi9LkoPyGzA= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-656-sAUWEAZDNeyWtOcc_q7o3Q-1; Fri, 26 Apr 2024 05:18:42 -0400 X-MC-Unique: sAUWEAZDNeyWtOcc_q7o3Q-1 Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-6ed613bb4d1so2006859b3a.3 for ; Fri, 26 Apr 2024 02:18:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714123121; x=1714727921; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G1NbTRHbQ7U0GF+15RrhvfyGaj1mUIGy4Pli01lUXKI=; b=TVlf7V7ygfakEh/dQG0vSfMEG0H+BaLwfV0b93D5WkTuGdqoBJFwDh2uLXvqXNraQM 7kurdwnpOE++8yBGVDACOBu9eg++j88dIcMtH2GuKqWP1pvrBh1Cap16g+YBxWKcQ1yY SmmUhinLAD17jOiGUgph9kkmeaKndIcYn6QLJT8kAYjvsWAnVvUk8leuJGLEf7yGOBkw lCs8D4RbR3z797kJnIqq6L4CzCcbBbmjJubKBL3/MFRDsyNrQaQXgw5jPgA2sPkCO8Yd aYkbjdbKWvAW9Y3oQUiLgbYzzWcHn8wVY4ytbKlkZkfuCAarAUfbOkzzlPa/vKKTG0ud BspQ== X-Forwarded-Encrypted: i=1; AJvYcCXvbeCJLHoXFs68tzJ/UxTLQA6v5HbcpJHZKIts5kJjO3mhujsdtLuJP/N6TJPRYP9KnDdpEfeKHyt7zGGonUigUaVx79pkEzCgLSi9PpNPZGqIh3s= X-Gm-Message-State: AOJu0YyTxiAZuFAh2pbX66/2ScF2uv1xojq++GIqBBsEc8gJK9w9bjTB w+tQXXEa1tp0pnD+OZ+Dk7+g4J36VC4zimaBTOiPrBiPZxC97y6j6e2ntfXNVn1kdUcog7lAKZx lGm/NpcDHVxv/MJI+IIM38R1iHd7hAun9GkfhElf0xc9ifskl411aEL5bhDaFnmuhbWQHAcPA X-Received: by 2002:a05:6a21:168c:b0:1ae:431b:c53b with SMTP id np12-20020a056a21168c00b001ae431bc53bmr323808pzb.35.1714123121579; Fri, 26 Apr 2024 02:18:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEStifC6QEJp3sMK/8R6KuO9lazU0QJGymTFO9aPTPCPf5v6oHPNuoPbZcboZcvieVYxOB7Ww== X-Received: by 2002:a05:6a21:168c:b0:1ae:431b:c53b with SMTP id np12-20020a056a21168c00b001ae431bc53bmr323789pzb.35.1714123121191; Fri, 26 Apr 2024 02:18:41 -0700 (PDT) Received: from [192.168.68.50] ([43.252.112.88]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e512537a5fsm15114388plf.9.2024.04.26.02.18.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 02:18:40 -0700 (PDT) Message-ID: Date: Fri, 26 Apr 2024 19:18:30 +1000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 06/16] ACPI: processor: Register deferred CPUs from acpi_processor_get_info() To: Jonathan Cameron , Thomas Gleixner , Peter Zijlstra , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-7-Jonathan.Cameron@huawei.com> From: Gavin Shan In-Reply-To: <20240418135412.14730-7-Jonathan.Cameron@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240426_021845_466000_F44CF249 X-CRM114-Status: GOOD ( 33.79 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/18/24 23:54, Jonathan Cameron wrote: > From: James Morse > > The arm64 specific arch_register_cpu() call may defer CPU registration > until the ACPI interpreter is available and the _STA method can > be evaluated. > > If this occurs, then a second attempt is made in > acpi_processor_get_info(). Note that the arm64 specific call has > not yet been added so for now this will be called for the original > hotplug case. > > For architectures that do not defer until the ACPI Processor > driver loads (e.g. x86), for initially present CPUs there will > already be a CPU device. If present do not try to register again. > > Systems can still be booted with 'acpi=off', or not include an > ACPI description at all as in these cases arch_register_cpu() > will not have deferred registration when first called. > > This moves the CPU register logic back to a subsys_initcall(), > while the memory nodes will have been registered earlier. > Note this is where the call was prior to the cleanup series so > there should be no side effects of moving it back again for this > specific case. > > [PATCH 00/21] Initial cleanups for vCPU HP. > https://lore.kernel.org/all/ZVyz%2FVe5pPu8AWoA@shell.armlinux.org.uk/ > commit 5b95f94c3b9f ("x86/topology: Switch over to GENERIC_CPU_DEVICES") > > Signed-off-by: James Morse > Reviewed-by: Gavin Shan > Tested-by: Miguel Luis > Tested-by: Vishnu Pajjuri > Tested-by: Jianyong Wu > Signed-off-by: Russell King (Oracle) > Co-developed-by: Jonathan Cameron > Signed-off-by: Joanthan Cameron > --- s/Joanthan/Jonathan ? > v7: Simplify the logic on whether to hotadd the CPU. > This path can only be reached either for coldplug in which > case all we care about is has register_cpu() already been > called (identifying deferred), or hotplug in which case > whether register_cpu() has been called is also sufficient. > Checks on _STA related elements or the validity of the ID > are no longer necessary here due to similar checks having > moved elsewhere in the path. > v6: Squash the two paths for conventional CPU Hotplug and arm64 > vCPU HP. > --- > drivers/acpi/acpi_processor.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index 127ae8dcb787..4e65011e706c 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -350,14 +350,14 @@ static int acpi_processor_get_info(struct acpi_device *device) > } > > /* > - * Extra Processor objects may be enumerated on MP systems with > - * less than the max # of CPUs. They should be ignored _iff > - * they are physically not present. > - * > - * NOTE: Even if the processor has a cpuid, it may not be present > - * because cpuid <-> apicid mapping is persistent now. > + * This code is not called unless we know the CPU is present and > + * enabled. The two paths are: > + * a) Initially present CPUs on architectures that do not defer > + * their arch_register_cpu() calls until this point. > + * b) Hotplugged CPUs (enabled bit in _STA has transitioned from not > + * enabled to enabled) > */ > - if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) { > + if (!get_cpu_device(pr->id)) { > ret = acpi_processor_hotadd_init(pr, device); > > if (ret) Thanks, Gavin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel