Re: [RFC PATCH v3 13/37] kvx: Add build infrastructure

From: Arnd Bergmann
Date: Tue Jul 23 2024 - 05:46:35 EST


On Mon, Jul 22, 2024, at 09:41, ysionneau@xxxxxxxxxxxxx wrote:
> +
> +config GENERIC_CALIBRATE_DELAY
> + def_bool y

You don't seem to define ARCH_HAS_READ_CURRENT_TIMER
or calibrate_delay_is_known(), so it appears that you are
measuring the loops per jiffy. Since you are using a
cycle counter for your delay loop, you should be able
to just set the value directly instead.

> + select GENERIC_IOMAP
> + select GENERIC_IOREMAP

GENERIC_IOMAP is something you should normally not
set, it is a bit misnamed and not at all generic ;-)

> +config ARCH_SPARSEMEM_ENABLE
> + def_bool y
> +
> +config ARCH_SPARSEMEM_DEFAULT
> + def_bool ARCH_SPARSEMEM_ENABLE
> +
> +config ARCH_SELECT_MEMORY_MODEL
> + def_bool ARCH_SPARSEMEM_ENABLE

There has been some discussion about removing traditional
sparsemem support in favor of just using SPARSEMEM_VMEMMAP,
which is simpler and more efficient on 64-bit architectures.

You should probably have a look at that.

> +config SMP
> + bool "Symmetric multi-processing support"
> + default n
> + select GENERIC_SMP_IDLE_THREAD
> + select GENERIC_IRQ_IPI
> + select IRQ_DOMAIN_HIERARCHY

Do you have a use case for turning SMP off in practice?
Non-SMP kernels can be a little more efficient, but it's
getting rare these days to actually have systems with
just one CPU.

> +config KVX_PAGE_SHIFT
> + int
> + default 12

There is now a generic CONFIG_PAGE_SIZE and CONFIG_PAGE_SHIFT
setting, so you can remove the custom ones and just use
'select HAVE_PAGE_SIZE_4KB'

> --- /dev/null
> +++ b/arch/kvx/include/asm/Kbuild
> @@ -0,0 +1,20 @@
> +generic-y += asm-offsets.h
> +generic-y += clkdev.h
> +generic-y += auxvec.h
> +generic-y += bpf_perf_event.h
> +generic-y += cmpxchg-local.h
> +generic-y += errno.h
> +generic-y += extable.h
> +generic-y += export.h
...

You seem to have more entries here than necessary, e.g.
clkdev.h and auxvec.h are no longer in asm-generic, and
export.h is deprecated.

Arnd