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.129.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 3B37423B5 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="CgLNu87/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699833813; 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=CgLNu87/0f2j3qHubsegimmVfpDJAu0QQ+cJ7DoyfG3nLidAVY3LBpePvAon8DOVUFdSof qhSAlGUXRwa961Vf15yKJiNvVRhVkQDdb+p7aq3tzfhaj0we/+WmIVigY2Ka4GpzNHGbwM X9zM1oK3WXho/gDxm39Anop2jpj1KXc= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-BgB0bW-iPMyaH00cjOoEEg-1; Sun, 12 Nov 2023 19:03:28 -0500 X-MC-Unique: BgB0bW-iPMyaH00cjOoEEg-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1cc281f1214so43559215ad.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=Mlf8B4k8HhEZ6Y+mMJG3xDrqCHxtQZc15nLX1IdY4ryqFRNYs4p0RZ1Aa9bNvzOcLI NzwM3hwhIYh1nLML4H8vpAJw2sudftX+dFiCFE9XlQGBGeXwkY1eyYNdySz+tf1ZlE60 /rqvNm9eVGV++0G4wJWmWXNEG9WPoDBj6JRXJ7ipZXFuU6VYURwowQBXjmuTOPO2qVLe GndfCft4WOCIaqso+vbbW0OwRsj8ppQid2TYZnXSyWCthb0n3UGuRbl4tNfqewP95QRf 39cfevaZQU80dZHgcA+LlL7qVqoORJuzM00V1CEBJo5xBrfYXlo9AfjIgtXf0Qj+1t+x 2LIw== X-Gm-Message-State: AOJu0YwfvP6KR9ADvWXwf2PDJ/SCKMcWzdCQr2COnaBVjQHlo+Q0lyxd 90AQ4rQrwmbuBxkSfrgMcKqeHqayuQ3m1DdL/yzBvIpmhNHy+yQkQXhhVenKtCVe2JQgzehxew+ j7sUhRInCwQoBLy7y X-Received: by 2002:a17:903:124a:b0:1ca:7f91:aa5d with SMTP id u10-20020a170903124a00b001ca7f91aa5dmr7816445plh.16.1699833807797; 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: kvmarm@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