|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 31/39] xen/riscv: add required things to asm/current.h
On Thu, 2023-12-14 at 16:55 +0100, Jan Beulich wrote:
> On 24.11.2023 11:30, Oleksii Kurochko wrote:
> > --- a/xen/arch/riscv/include/asm/current.h
> > +++ b/xen/arch/riscv/include/asm/current.h
> > @@ -3,6 +3,22 @@
> > #ifndef __ASM_CURRENT_H
> > #define __ASM_CURRENT_H
> >
> > +#include <xen/percpu.h>
> > +#include <asm/processor.h>
> > +
> > +#ifndef __ASSEMBLY__
> > +
> > +struct vcpu;
>
> I don't think you need this here?
Shouldn't forward declaration be for the case of curr_vcpu declaration
in the next line ?
>
> > +/* Which VCPU is "current" on this PCPU. */
> > +DECLARE_PER_CPU(struct vcpu *, curr_vcpu);
> > +
> > +#define current (this_cpu(curr_vcpu))
>
> Nit: No need for the extra parentheses.
Thanks.
>
> > +#define set_current(vcpu) do { current = (vcpu); } while (0)
> > +#define get_cpu_current(cpu) (per_cpu(curr_vcpu, cpu))
>
> Same here then.
>
> > +#define guest_cpu_user_regs() (0)
>
> 0 or NULL? Also perhaps better
>
> #define guest_cpu_user_regs() ({ BUG(); NULL; })
>
> until it's properly implemented?
Thanks. I'll use your definition.
>
> > @@ -10,4 +26,8 @@
> > unreachable(); \
> > } while ( false )
> >
> > +#define get_per_cpu_offset() __per_cpu_offset[get_processor_id()]
>
> I'd like to remind you that there's no get_processor_id() anymore.
Yeah, missed that. Thanks.
~ Oleksii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |