[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen/common: Move gic_preinit() to common code


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 31 Oct 2024 11:29:02 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6D13RHuKFNutF6U+Uy+kHpAoeuJDEwedRhhiK/+uX4U=; b=fZ0fUNfcdie21jiKg/Q1volfllCJThxfj4vgRMfkpcrj/kvzcQOIVfnBXncOWVHYAGdsjUoZD7jdSvL2zqbw5ch/E5fPjmrCPnlcuz8UXhrT8tiBQgZWTdvvm19k5R/r1rx8QF2Sf2UjjRh2Ve8GBlQW072dmCi8AHdsDdj6PiVkkSclANcUI5mL/cRdkCw1riLooMFiSxtVp2inuuhNxYT2j+zc57A9es173QARUbi5zLGOIuRGXgCBw+jOhY/73Yp8i+CIM1wGq4OUfayeogMNv+Da11By01NQzt9423fvnAbQ8OeqvdL/pcMscXdxqkpBzG0/hsMSnO4EansRjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HmbCvpwZHW+5CjuI0ZhsHM/Det2bGWo6RPqlAX2b6/F8b6h7IHtiqCABqdZRZmj8J+0QQixd93Eg4g+A3cWmlv4VOg5WxFXrCNh3ZDdLSshA78InTuXy3FzALIubRvQXV+DEHT/wx5HJ+mVPRS0XCtSrKH637QWV89mz0x40iAVlqb4Imfa6m7JvShmurygWukg5hinaCz38/uS+ofbbR4vKy4pPNXIb/ZIg8ZKMNV9Hf2G/3IUOoaDsp+zDuUMfFg7Ir7bTBVhP9LiPVi3+S5fFAvkFUBRJrvOojK23sAGgPkt5WafdCf16QRYFGgCgtgK1+T82DbrWFXwcWtJpkg==
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 31 Oct 2024 10:29:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 31/10/2024 10:34, Jan Beulich wrote:
> 
> 
> On 30.10.2024 14:14, Oleksii Kurochko wrote:
>> Introduce ic_preinit() in the common codebase, as it is not
>> architecture-specific and can be reused by both PPC and RISC-V.
>> This function identifies the node with the interrupt-controller property
>> in the device tree and calls device_init() to handle architecture-specific
>> initialization of the interrupt controller.
>>
>> Additionally, rename gic_acpi_preinit() to ic_acpi_preinit() as it is used
>> by ic_preinit(), while keeping it defined in architecture-specific as this
>> part is architecture-specific. In case if CONFIG_ACPI=n a stub for
>> ic_acpi_preinit() is provided. To declaration/defintion of ic_acpi_preint()
>> is added `inline` to deal with the compilation issue:
>>   error: 'ic_acpi_preinit' defined but not used [-Werror=unused-function]
>>
>> Make minor adjustments compared to the original ARM implementation of
>> gic_dt_preinit():
>>  - Remove the local rc variable in gic_dt_preinit() since it is only used 
>> once.
>>  - Change the prefix from gic to ic to clarify that the function is not
>>    specific to ARM’s GIC, making it suitable for other architectures as well.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
>> ---
>> Changes in v2:
>>  - Revert changes connected to moving of gic_acpi_preinit() to common code as
>>    it isn't really architecture indepent part.
>>  - Update the commit message.
>>  - Move stub of ic_acpi_preinit() to <asm-generic/device.h> for the case when
>>    CONFIG_ACPI=n.
>> ---
>>  xen/arch/arm/gic.c               | 45 +------------------------------
>>  xen/arch/arm/setup.c             |  3 ++-
>>  xen/common/device.c              | 46 ++++++++++++++++++++++++++++++++
>>  xen/include/asm-generic/device.h | 10 +++++++
>>  4 files changed, 59 insertions(+), 45 deletions(-)
> 
> Looks largely okay to me now, with a question and a nit at the bottom. The
> question is mainly to Arm folks, where the code is coming from, and DT
> maintainers: Is a file named device.c really an appropriate "home" for
> IC-related code? If IC is a common thing in the DT world, would such code
> maybe better live under common/device-tree/?
I think we will have more interrupt related dt stuff common, so it would make 
sense to create
device-tree/irq.c or intc.c.

@Olku, can you please s/ic/intc/ ? It's much more common abbreviation for 
interrupt controller.
You can do e.g. grep -Rw "ic" vs grep -Rw "intc" in Linux 
Documentation/devicetree/bindings/interrupt-controller.

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.