Patchwork [RFC] PowerPC: Added uapi directory into linux-header

login
register
mail settings
Submitter Bharat Bhushan
Date Dec. 14, 2012, 11:04 a.m.
Message ID <1355483059-20700-1-git-send-email-bharat.bhushan@freescale.com>
Download mbox | patch
Permalink /patch/206396/
State New
Headers show

Comments

Bharat Bhushan - Dec. 14, 2012, 11:04 a.m.
This is corrently done for powerpc.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
 configure                       |    1 +
 scripts/update-linux-headers.sh |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
Alexander Graf - Dec. 14, 2012, 11:35 a.m.
On 14.12.2012, at 12:04, Bharat Bhushan wrote:

> This is corrently done for powerpc.
> 
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>

Jan, could you please check if this is correct?

> ---
> configure                       |    1 +
> scripts/update-linux-headers.sh |    5 +++++
> 2 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/configure b/configure
> index 780b19a..bdc2d5e 100755
> --- a/configure
> +++ b/configure
> @@ -3701,6 +3701,7 @@ if test "$linux" = "yes" ; then
>     # For non-KVM architectures we will not have asm headers
>     if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
>       symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
> +      symlink "$source_path/linux-headers/uapi/asm-$linux_arch" linux-headers/uapi/asm
>     fi
> fi
> 
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index 4c7b566..9f6bf25 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -48,6 +48,11 @@ for arch in $ARCHLIST; do
> 
>     rm -rf "$output/linux-headers/asm-$arch"
>     mkdir -p "$output/linux-headers/asm-$arch"
> +    if [ $arch = powerpc ]; then

This looks bogus. There shouldn't be any powerpc specifics anywhere in this file.


Alex

> +	rm -rf $output/linux-headers/uapi/asm-$arch/*
> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h" "$output/linux-headers/uapi/asm-$arch/"
> +    fi
> +
>     for header in kvm.h kvm_para.h; do
>         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
>     done
> -- 
> 1.7.0.4
> 
>
Peter Maydell - Dec. 14, 2012, noon
On 14 December 2012 11:04, Bharat Bhushan <r65777@freescale.com> wrote:
> This is corrently done for powerpc.

This commit message is a bit cryptic.

> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---
>  configure                       |    1 +
>  scripts/update-linux-headers.sh |    5 +++++
>  2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 780b19a..bdc2d5e 100755
> --- a/configure
> +++ b/configure
> @@ -3701,6 +3701,7 @@ if test "$linux" = "yes" ; then
>      # For non-KVM architectures we will not have asm headers
>      if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
>        symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
> +      symlink "$source_path/linux-headers/uapi/asm-$linux_arch" linux-headers/uapi/asm
>      fi

This creates a broken symlink if you run it on an arch that
doesn't have a uapi directory:
cam-vm-266:precise:qemu$ file linux-headers/uapi/asm
linux-headers/uapi/asm: broken symbolic link to
`/home/petmay01/linaro/qemu-from-laptop/qemu/linux-headers/uapi/asm-x86'

Shouldn't it go in its own "if [ -e
"$source_path/linux-headers/uapi/asm-$linux_arch" ]"
guard ?

>  fi
>
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index 4c7b566..9f6bf25 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -48,6 +48,11 @@ for arch in $ARCHLIST; do
>
>      rm -rf "$output/linux-headers/asm-$arch"
>      mkdir -p "$output/linux-headers/asm-$arch"
> +    if [ $arch = powerpc ]; then
> +       rm -rf $output/linux-headers/uapi/asm-$arch/*
> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h" "$output/linux-headers/uapi/asm-$arch/"
> +    fi

(1) This doesn't seem to be doing the mkdir of
"$output/linux-headers/uapi/asm-$arch/" anywhere.

(2) The setup of the uapi/ subdirectory shouldn't be
inside an "if [ $arch = powerpc ]" guard, so it can
work on all archs with a uapi/. You want to rm-and-mkdir
the uapi/ directory if $linux/arch/$arch/include/uapi/
exists.

(3) it would be neater to put the "copy this ppc specific
header file" code at the bottom of the for loop next
to the existing "copy this x86 specific header file" code.

-- PMM
Bharat Bhushan - Dec. 14, 2012, 1:24 p.m.
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Friday, December 14, 2012 5:06 PM
> To: Bhushan Bharat-R65777
> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Bhushan Bharat-R65777; Jan
> Kiszka
> Subject: Re: [PATCH RFC] PowerPC: Added uapi directory into linux-header
> 
> 
> On 14.12.2012, at 12:04, Bharat Bhushan wrote:
> 
> > This is corrently done for powerpc.
> >
> > Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> 
> Jan, could you please check if this is correct?
> 
> > ---
> > configure                       |    1 +
> > scripts/update-linux-headers.sh |    5 +++++
> > 2 files changed, 6 insertions(+), 0 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 780b19a..bdc2d5e 100755
> > --- a/configure
> > +++ b/configure
> > @@ -3701,6 +3701,7 @@ if test "$linux" = "yes" ; then
> >     # For non-KVM architectures we will not have asm headers
> >     if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
> >       symlink "$source_path/linux-headers/asm-$linux_arch"
> > linux-headers/asm
> > +      symlink "$source_path/linux-headers/uapi/asm-$linux_arch"
> > + linux-headers/uapi/asm
> >     fi
> > fi
> >
> > diff --git a/scripts/update-linux-headers.sh
> > b/scripts/update-linux-headers.sh index 4c7b566..9f6bf25 100755
> > --- a/scripts/update-linux-headers.sh
> > +++ b/scripts/update-linux-headers.sh
> > @@ -48,6 +48,11 @@ for arch in $ARCHLIST; do
> >
> >     rm -rf "$output/linux-headers/asm-$arch"
> >     mkdir -p "$output/linux-headers/asm-$arch"
> > +    if [ $arch = powerpc ]; then
> 
> This looks bogus. There shouldn't be any powerpc specifics anywhere in this
> file.

This file have x86 specific also, why ?

-Bharat

> 
> 
> Alex
> 
> > +	rm -rf $output/linux-headers/uapi/asm-$arch/*
> > +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h"
> "$output/linux-headers/uapi/asm-$arch/"
> > +    fi
> > +
> >     for header in kvm.h kvm_para.h; do
> >         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
> >     done
> > --
> > 1.7.0.4
> >
> >
>

Patch

diff --git a/configure b/configure
index 780b19a..bdc2d5e 100755
--- a/configure
+++ b/configure
@@ -3701,6 +3701,7 @@  if test "$linux" = "yes" ; then
     # For non-KVM architectures we will not have asm headers
     if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
       symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
+      symlink "$source_path/linux-headers/uapi/asm-$linux_arch" linux-headers/uapi/asm
     fi
 fi
 
diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 4c7b566..9f6bf25 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -48,6 +48,11 @@  for arch in $ARCHLIST; do
 
     rm -rf "$output/linux-headers/asm-$arch"
     mkdir -p "$output/linux-headers/asm-$arch"
+    if [ $arch = powerpc ]; then
+	rm -rf $output/linux-headers/uapi/asm-$arch/*
+        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h" "$output/linux-headers/uapi/asm-$arch/"
+    fi
+
     for header in kvm.h kvm_para.h; do
         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
     done