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?
> +/* 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.
> +#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?
> @@ -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.
Jan