On 22/12/2025 4:54 pm, Jan Beulich wrote:
> --- a/tools/tests/cpu-policy/Makefile
> +++ b/tools/tests/cpu-policy/Makefile
> @@ -42,11 +42,15 @@ CFLAGS += $(APPEND_CFLAGS)
>  
>  LDFLAGS += $(APPEND_LDFLAGS)
>  
> -vpath %.c ../../../xen/lib/x86
> +vpath %.c $(XEN_ROOT)/xen/lib/x86
> +vpath %.c $(XEN_ROOT)/xen/arch/x86/lib
> +
> +lib-y :=
> +include $(XEN_ROOT)/xen/arch/x86/lib/Makefile.cpu-policy
>  
>  %.o: Makefile
>  
> -test-cpu-policy: test-cpu-policy.o msr.o cpuid.o policy.o
> +test-cpu-policy: test-cpu-policy.o cpuid.o policy.o $(lib-y)
>       $(CC) $^ -o $@ $(LDFLAGS)
>  
>  -include $(DEPS_INCLUDE)
> --- a/xen/arch/x86/lib/Makefile
> +++ b/xen/arch/x86/lib/Makefile
> @@ -6,3 +6,5 @@ lib-y += generic-hweightl.o
>  lib-y += memcpy.o
>  lib-y += memset.o
>  lib-y += scrub-page.o
> +
> +include $(srcdir)/Makefile.cpu-policy
> --- /dev/null
> +++ b/xen/arch/x86/lib/Makefile.cpu-policy
> @@ -0,0 +1,2 @@
> +lib-y += cp-copy-from-buffer.o
> +lib-y += cp-copy-to-buffer.o

cp works as a name in source code because it's used by a type called
cpu_policy.

In this case, cp with it's UNIX association makes the file name very weird.


If we're going to be properly lib-ing the whole thing, then we're going
to have enough TUs for a directory anyway.

So, I think we want xen/arch/x86/lib/cpu-policy/copy-{to,from}-buffer.o
right from the outset.

Also, I'd really prefer not to have things split between the old and new
locations.  Everything wants to move in one go.

I'd suggest having one patch doing a wholesale move of xen/lib/x86 into
xen/arch/x86/lib/cpu-policy and fixing up the vpath's, then a subsequent
patch splitting copy-{to,from}-buffer.o out.

> --- /dev/null
> +++ b/xen/arch/x86/lib/cp-copy-from-buffer.c
> @@ -0,0 +1,238 @@
> +#ifdef __XEN__

Hmm.  I should sort out SPDX tags.  Defaults would say GPL-2-only, but
libxenguest is LGPL-2.1 so it probably ought to be LGPL.

~Andrew

Reply via email to