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

Re: [PATCH v1 2/2] xen: move per-cpu area management into common code



On Sun, 2024-09-22 at 10:43 +0200, Andrew Cooper wrote:
> > > diff --git a/xen/common/percpu.c b/xen/common/percpu.c
> > > new file mode 100644
> > > index 0000000000..3837ef5714
> > > --- /dev/null
> > > +++ b/xen/common/percpu.c
> > > @@ -0,0 +1,127 @@
> > > +/* SPDX-License-Identifier: GPL-2.0 */
> > > +#include <xen/percpu.h>
> > > +#include <xen/cpu.h>
> > > +#include <xen/init.h>
> > > +#include <xen/mm.h>
> > > +#include <xen/rcupdate.h>
> > > +
> > > +unsigned long __per_cpu_offset[NR_CPUS];
> 
> unsigned long __per_cpu_offset[NR_CPUS] = {
>     [0 ... NR_CPUS - 1] = INVALID_PERCPU_AREA,
> };
> 
> should work, removing the need for percpu_init_areas() and avoids a
> window during boot where all CPUs "share" a percpu area.
If to define in this way, it will compilation error:
   ./arch/x86/include/asm/percpu.h:14:29: error: initializer element is
   not constant
      14 | #define INVALID_PERCPU_AREA (0x8000000000000000UL -
   (unsigned long)__per_cpu_start)

I think it is the reason why separate function was introduced.

~ Oleksii




 


Rackspace

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