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

Re: [PATCH v1 05/15] xen/riscv: implement stub for smp_send_event_check_mask()




On 1/7/26 4:47 PM, Jan Beulich wrote:
On 24.12.2025 18:03, Oleksii Kurochko wrote:
--- a/xen/arch/riscv/smp.c
+++ b/xen/arch/riscv/smp.c
@@ -1,3 +1,4 @@
+#include <xen/cpumask.h>
  #include <xen/smp.h>
/*
@@ -13,3 +14,10 @@
  struct pcpu_info pcpu_info[NR_CPUS] = { [0 ... NR_CPUS - 1] = {
      .processor_id = NR_CPUS,
  }};
+
+void smp_send_event_check_mask(const cpumask_t *mask)
+{
+#if CONFIG_NR_CPUS > 1
+# error "smp_send_event_check_mask() unimplemented"
+#endif
+}
CONFIG_NR_CPUS is 64 by default for 64-bit arch-es, from all I can tell, also
for RISC-V. And there's no "override" in riscv64_defconfig. How is the above
going to work in CI? Then again I must be overlooking something, as the config
used in CI has CONFIG_NR_CPUS=1. Just that I can't tell why that is.

It is 1 because of the defintion of NR_CPUS in KConfig:
config NR_CPUS
        int "Maximum number of CPUs"
        range 1 1 if ARM && MPU
        range 1 16383
        .... ( all other range props are condtional and there is no RISC-V in 
dependency)
so for RISC-V "range 1 16383" used and CONFIG_NR_CPUS is set to the minimal of 
this range,
so it is 1.


And no, I'm not meaning to ask that you override NR_CPUS (and wherever such an
override would live, I think it would better be dropped rather sooner than
later). Instead an option may be this:

void smp_send_event_check_mask(const cpumask_t *mask)
{
#if CONFIG_NR_CPUS > 1
     BUG_ON(!cpumask_subset(mask, cpumask_of(0)));
#endif
}

(I can't tell off the top of my head whether an empty mask may be passed to this
function. If not, cpumask_equal() could be used as well.)

I will double-check. Thanks for such hint.


Of course the #if may then not be necessary at all, and a TODO comment may want
putting there instead.

With suggested above approach, I think it isn't really needed to use #if.

Thanks!

~ Oleksii




 


Rackspace

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