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

Re: [PATCH v3 30/34] xen/riscv: add minimal stuff to processor.h to build full Xen



On Tue, 2024-01-23 at 12:39 +0100, Jan Beulich wrote:
> On 22.12.2023 16:13, Oleksii Kurochko wrote:
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> > ---
> > Changes in V3:
> >  - Update the commit message
> 
> ??? (again)
The same as with previous. asm/processor.h was changed to processor.h

> 
> > @@ -53,6 +56,18 @@ struct cpu_user_regs
> >      unsigned long pregs;
> >  };
> >  
> > +/* TODO: need to implement */
> > +#define cpu_to_core(cpu)   (0)
> > +#define cpu_to_socket(cpu) (0)
> > +
> > +static inline void cpu_relax(void)
> > +{
> > +    /* Encoding of the pause instruction */
> > +    __asm__ __volatile__ ( ".insn 0x100000F" );
> 
> binutils 2.40 knows "pause" - why use .insn then?
I thought that for this instruction it is needed to have extension
ZIHINTPAUSE ( according to Linux Kernel source code [1] ) and to cover
older version.
But looking at [2] and considering that I announced that we expected
binutils >= 2.40 ( or 2.39 as I mentioned as an reply to patch to
README file ) it can be used pause instruction.

> 
> > +    barrier();
> 
> Why?
Just to be aligned with Linux kernel implemetation from where this
function was taken.

~ Oleksii

[1]
https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/asm/vdso/processor.h#L9

[2]https://elixir.bootlin.com/linux/latest/source/arch/riscv/Kconfig#L582



 


Rackspace

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