qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH v2] Added uapi directory into linux-header


From: Alexander Graf
Subject: Re: [Qemu-ppc] [PATCH v2] Added uapi directory into linux-header
Date: Mon, 17 Dec 2012 18:48:33 +0100

On 17.12.2012, at 17:01, Bharat Bhushan wrote:

> Linux ARCH specific header files are now in uapi/ directory also.
> These header files (epapr_hcalls.h on powerpc) are needed in qemu
> in linux-headers/uapi/asm/ directory as these are referenced by
> other header files in linux-headers/asm/.
> 
> This patch is about changing the scripts for same.
> 
> Signed-off-by: Bharat Bhushan <address@hidden>
> ---
> v2:
> - remove symlink on distclean
> - review comments on v1
> 
> Makefile                        |    1 +
> configure                       |    4 ++++
> scripts/update-linux-headers.sh |   12 ++++++++++++
> 3 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 9ecbcbb..ed320ea 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -282,6 +282,7 @@ distclean: clean
>       rm -f qemu-doc.vr
>       rm -f config.log
>       rm -f linux-headers/asm
> +     rm -f linux-headers/uapi/asm
>       rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi 
> qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf 
> qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
>       for d in $(TARGET_DIRS) $(QEMULIBS); do \
>       rm -rf $$d || exit 1 ; \
> diff --git a/configure b/configure
> index 38b1cc6..4c11e3d 100755
> --- a/configure
> +++ b/configure
> @@ -3725,6 +3725,10 @@ if test "$linux" = "yes" ; then
>     if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
>       symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
>     fi
> +    if [ -e "$source_path/linux-headers/uapi/asm-$linux_arch" ]; then
> +      symlink "$source_path/linux-headers/uapi/asm-$linux_arch" 
> linux-headers/uapi/asm
> +    fi
> +
> fi
> 
> for target in $target_list; do
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index 4c7b566..44e6cad 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -46,14 +46,26 @@ for arch in $ARCHLIST; do
> 
>     make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch headers_install
> 
> +    if [ -e "$linux/arch/$arch/include/uapi" ] &&
> +        ! [ -e "$output/linux-headers/uapi" ] ; then
> +        mkdir "$output/linux-headers/uapi"

mkdir -p

But looking through this whole thing, it seems like the root cause is actually 
different. We don't want any uapi directories exposed to user space. So let's 
go back a step:

Why do we need the uapi include dir? Because some header is using it.

linux-headers/asm-powerpc/kvm_para.h:

    #include <uapi/asm/epapr_hcalls.h>

This is the root cause of the problem. We must never manually include any uapi 
header paths. We only ever include their normal asm-counterparts which then may 
include uapi (in kernel) or actually are uapi (in user space). David, please 
correct me if I'm wrong.

Could you please try and see if this kernel side patch makes things work for 
you too?


Alex


diff --git a/arch/powerpc/include/uapi/asm/kvm_para.h 
b/arch/powerpc/include/uapi/asm/kvm_para.h
index ed0e025..e3af328 100644
--- a/arch/powerpc/include/uapi/asm/kvm_para.h
+++ b/arch/powerpc/include/uapi/asm/kvm_para.h
@@ -78,7 +78,7 @@ struct kvm_vcpu_arch_shared {
 
 #define KVM_HCALL_TOKEN(num)     _EV_HCALL_TOKEN(EV_KVM_VENDOR_ID, num)
 
-#include <uapi/asm/epapr_hcalls.h>
+#include <asm/epapr_hcalls.h>
 
 #define KVM_FEATURE_MAGIC_PAGE 1
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]