From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B4A017F3 for ; Mon, 13 Nov 2023 00:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TgTj/4UA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699833812; 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=+ZHIbA5dSDa0YFUBZZETUQKKTVizuf5JaF0jClraxRM=; b=TgTj/4UApWxNeGaes9b7tshvwhY7vgS7Sb65KO5EaISeV0T2KT6mhR1dKp4TN6KfP5OvcN FyiKucpmX0rmhU9nnAWcSswhQmJMOeg6fgqxHpwbPRpyIKtHkIPUe8DcOwVua+KyQcM/QH OnV0Tb8ihjhr1U2luOFxTCtASjkUl5o= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-3PlbZA_5NdWTzaUo6uWpSw-1; Sun, 12 Nov 2023 19:03:28 -0500 X-MC-Unique: 3PlbZA_5NdWTzaUo6uWpSw-1 Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-1cc281f1214so43559225ad.2 for ; Sun, 12 Nov 2023 16:03:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699833808; x=1700438608; 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=+ZHIbA5dSDa0YFUBZZETUQKKTVizuf5JaF0jClraxRM=; b=DRfNGFsdBl6Z5LijZVdubzvPFEXrcWcgb/J0wF+Rp42YWqWm0grdn0ZsVAh7D4bVf5 o1y6Y7q1lEpv2crKHy8Kae8U09WhqdHQXVFhHetTc+YDZAXQdd6mh/m4rtvshgcl5Xl7 rtMjAAmxFbp8NDQVqJ6eEFYX+bVkxePNMibrEXQKxhYz2024S4eJ8G0h7IXOu8kYe/SB gDOzIp7iMzCLc0hxm/SdVWsL+1nuvA8SCusfKRDVbeMUFpGnszOcZKoIqYv079WEDc6k ELsZ0jTY2kMxirLWr0BX0Bzqld0PB6lR/XcznvEGbE6MPz6nYocH7X2Yz3Lyk31k8x/J ALhg== X-Gm-Message-State: AOJu0YxM2+kygiyOA84TgRo85NhXbNMYUIWVVBWCMEgMlTwZrNsUKmTA /OMiWcwzw29lJuhRvFFTTejLQfSJBWvhHEWnget56tPnS0SpO5oNWBQXkpsED8WAGLFLUEWOrq2 jvgDhQ0uFW/oRdtaVP28M X-Received: by 2002:a17:903:124a:b0:1ca:7f91:aa5d with SMTP id u10-20020a170903124a00b001ca7f91aa5dmr7816468plh.16.1699833807823; Sun, 12 Nov 2023 16:03:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IECTuRNfb72TOfAtkV7pMmjD+8xBNsdITfj8lqsTmhB+HwPaZ/5CGTlMF5gZ/CbtXGVZnzltA== X-Received: by 2002:a17:903:124a:b0:1ca:7f91:aa5d with SMTP id u10-20020a170903124a00b001ca7f91aa5dmr7816433plh.16.1699833807525; Sun, 12 Nov 2023 16:03:27 -0800 (PST) Received: from ?IPV6:2001:8003:e5b0:9f00:b890:3e54:96bb:2a15? ([2001:8003:e5b0:9f00:b890:3e54:96bb:2a15]) by smtp.gmail.com with ESMTPSA id jj3-20020a170903048300b001cc29ffcd96sm3038705plb.192.2023.11.12.16.03.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 16:03:27 -0800 (PST) Message-ID: Date: Mon, 13 Nov 2023 10:03:17 +1000 Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 02/22] x86: intel_epb: Don't rely on link order To: "Russell King (Oracle)" , 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, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" References: From: Gavin Shan In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/7/23 20:29, Russell King (Oracle) wrote: > From: James Morse > > intel_epb_init() is called as a subsys_initcall() to register cpuhp > callbacks. The callbacks make use of get_cpu_device() which will return > NULL unless register_cpu() has been called. register_cpu() is called > from topology_init(), which is also a subsys_initcall(). > > This is fragile. Moving the register_cpu() to a different > subsys_initcall() leads to a NULL dereference during boot. > > Make intel_epb_init() a late_initcall(), user-space can't provide a > policy before this point anyway. > > Signed-off-by: James Morse > Signed-off-by: Russell King (Oracle) > --- > subsys_initcall_sync() would be an option, but moving the register_cpu() > calls into ACPI also means adding a safety net for CPUs that are online > but not described properly by firmware. This lives in subsys_initcall_sync(). > --- > arch/x86/kernel/cpu/intel_epb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Gavin Shan