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

Re: [PATCH v1 17/29] xen/asm-generic: introduce stub header percpu.h


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 19 Oct 2023 12:39:17 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=T8SIpwPF5aJzeTuL54KsKhXZBw0b3XmBVdSEEynAM6U=; b=NmCg/5d2AUF1FOpbv9ig8Xdk5dAJbftwVUsvjqFByJtlAoBQAR9u+c+pytFz+3Ep5SVM9/q5WH1UWXT9Y61k2XuffPDzDMes9mFzaicwzwh3yryMrLDRwIvnxxhXYWEE/G16bmNP4iQZ/9x4mxwRwuqzsbl8LDO0sN+k1G9j7Hl0JlGiE1EuEJvikz2/CUxLRK5A6Kwa4o20syuVJDHKIzafRljZ5TV7VEpovmJ37+rHY6oD1zJYuHjIMoZtKI4BFnSWmRcGlkkCLTbymJUUUu0GtlUMWWEK59qkWYMrN++JZb+9242QDtHoFe2KYlOyJ2YzF9wDav5rLEpajWRn1Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oW/mYG/B+yyK9KiKQxxqROzcTmiUGuImuRBOs0UkzehhfC8hAJ/CAuR2wYiy2am6MSitJtjW5JeoVeaGMo9CatvlHzfvTQEg80Q3PlZIRf8+WXYAL8naLtdl2gS7C5GT+ACwJWqDmeUEeoscSxZTjpKwy4WIKivTwnZ6VHptyO22FINDdMKDjCu2ibJ38Z2KsE9R6Ir5odfdqY7Gbzjrvg3g7NZTGEh9bcC1L3uSD8Ec+WW9c91b4zPgNtwc5o75uZHgco9GR8+FQXzkQpZw6o6SgOBA1V65KF6dX+lBTW9qGTsji6b9e46BNjtfAr9CEUi57b9zx29YI2CirIEbCQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 19 Oct 2023 10:39:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.09.2023 16:56, Oleksii Kurochko wrote:
> --- /dev/null
> +++ b/xen/include/asm-generic/percpu.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_PERCPU_H__
> +#define __ASM_GENERIC_PERCPU_H__
> +
> +#ifndef __ASSEMBLY__
> +
> +#include <xen/types.h>
> +
> +extern char __per_cpu_start[], __per_cpu_data_end[];
> +extern unsigned long __per_cpu_offset[NR_CPUS];
> +void percpu_init_areas(void);
> +
> +#define per_cpu(var, cpu)  \
> +    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
> +
> +#define this_cpu(var) \
> +    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[get_processor_id()]))
> +
> +#define per_cpu_ptr(var, cpu)  \
> +    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
> +#define this_cpu_ptr(var) \
> +    (*RELOC_HIDE(var, get_processor_id()))
> +
> +#endif
> +
> +#endif /* __ASM_GENERIC_PERCPU_H__ */

This looks okay, just one request: Please use smp_processor_id(). You
may have seen on the Matrix channel that there's the intention to do
away with the get_processor_id() alias that's used in only very few
places.

Jan



 


Rackspace

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