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

Re: [PATCH v4 6/6] xen/common: move device initialization code to common code


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 27 Sep 2024 09:40:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.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=01WnzSD1bPsSkEUgOfFgjgEIzWiWB6w6krbBtRjz8Dw=; b=ubnfy4xKpTjrjJCowSkz3GM8cgIPmrN8UWkcz+J+0l7eMQS1V0xyJONwnmlc8th7Gg5JKUnWodWqEVw3wMkVnvlbzNUWy5m/YWWYU4Or5EooUsIeIGInz6U+oAXGEHKxEdiZ3ql7m8DWyG5NLZ/ymKErIOKjbuJWszyDi8WLb5sfU/Og0703dWnznTrqy9IaiNPfx8yeZRxt0tDyTaqYjhB0X4OVRZf3IYGLssbwa9Ywcdm7dqpvm36KeYgj+CNXHBRrmwpDkt9oJvCZX4U5bH/d6zAt3g4LA/sBX17OsVxItcCuxrNSm62l0IUX/dasRb7e+DMLT9Zn+OaYQxXhPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qb6mCLJ2husD8xkPdqXG+KOv9IoJn7Sg2RA0EMFLjEkWkAl6PK3QIB6ynbs0h4A2LJYZq9pNp7dI8DnUhBCXROHWof22k2ga1/bw9/nooSXs2wu07PPfj8cBVuS5ZtdDjO9rCslBNtyukfappvndkdXZOOjj986T8AKYAsi/g8BK0r3A3gTJwfhtaDjFjNlcbdqr1HkCYVIPzKWJLRq69OLcY64Kia3/G8juRPhwgaskpHlLthC9KltsqYeDM2i1EOBQ3k6KGWhkprmpRWQyY4Fy0oBq9/mGzlmqFofq4lsW1Fc9BZ+y05WOnC6oLkmw+IBaMIcBFzudGcVmxd0aYA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Fri, 27 Sep 2024 07:40:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 26/09/2024 18:54, Oleksii Kurochko wrote:
> 
> 
> Remove the device initialization code from `xen/arch/arm/device.c`
> and move it to the common code to avoid duplication and make it accessible
> for both ARM and other architectures.
> device_get_class(), device_init(), _sdevice[] and _edevice[] are wrapped by
> "#ifdef CONFIG_HAS_DEVICE_TREE" for the case if an arch doesn't support
> device tree.
> 
> Remove unnecessary inclusions of <asm/device.h> and <xen/init.h> from
> `xen/arch/arm/device.c` as no code in the file relies on these headers.
> Fix the inclusion order by moving <asm/setup.h> after <xen/*> headers to
> resolve a compilation error:
>    ./include/public/xen.h:968:35: error: unknown type name 'uint64_t'
>     968 | __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t);
>         |                                   ^~~~~~~~
>    ./include/public/arch-arm.h:191:21: note: in definition of macro 
> '___DEFINE_XEN_GUEST_HANDLE'
>    191 |     typedef union { type *p; uint64_aligned_t q; }              \
>        |                     ^~~~
>    ./include/public/xen.h:968:1: note: in expansion of macro 
> '__DEFINE_XEN_GUEST_HANDLE'
>    968 | __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t);
> because <asm/setup.h> includes <public/version.h>, which in turn includes
> "xen.h", which requires <xen/types.h> to be processed correctly.
> Additionally, add <xen/device_tree.h> to `device.c` as functions from this
> header are used within the file.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal



 


Rackspace

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