Patchwork Added uapi directory into linux-header

login
register
mail settings
Submitter Bharat Bhushan
Date Dec. 17, 2012, 4:08 a.m.
Message ID <1355717290-28695-1-git-send-email-bharat.bhushan@freescale.com>
Download mbox | patch
Permalink /patch/206769/
State New
Headers show

Comments

Bharat Bhushan - Dec. 17, 2012, 4:08 a.m.
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 <bharat.bhushan@freescale.com>
---
 configure                       |    1 +
 scripts/update-linux-headers.sh |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
Alexander Graf - Dec. 17, 2012, 2:15 p.m.
On 17.12.2012, at 05:08, 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 <bharat.bhushan@freescale.com>

Please include people who were participating in the discussion previously in CC when you post a new version.

> ---
> configure                       |    1 +
> scripts/update-linux-headers.sh |   10 ++++++++++
> 2 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/configure b/configure
> index 38b1cc6..51cce6b 100755
> --- a/configure
> +++ b/configure
> @@ -3724,6 +3724,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

This is still wrong. You want this guarded by another if [ -e ].

>     fi
> fi
> 
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index 4c7b566..d40f9c4 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do
> 
>     make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch headers_install
> 
> +    if ! [ -e "$output/linux-headers/uapi" ] ; then
> +        mkdir "$output/linux-headers/uapi"
> +    fi

... which would mean you don't need this bit.

> +
>     rm -rf "$output/linux-headers/asm-$arch"
>     mkdir -p "$output/linux-headers/asm-$arch"
> +    rm -rf "$output/linux-headers/uapi/asm-$arch"
> +    mkdir -p "$output/linux-headers/uapi/asm-$arch"

Only if it exists, no?

> +
>     for header in kvm.h kvm_para.h; do
>         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
>     done
>     if [ $arch = x86 ]; then
>         cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
>     fi
> +    if [ $arch = powerpc ]; then
> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h" "$output/linux-headers/uapi/asm-$arch/"
> +    fi

Why is this pointing at $linux and not $tmpdir? Also, no need for $arch - be explicit and make it "powerpc".


Alex

> done
> 
> rm -rf "$output/linux-headers/linux"
> -- 
> 1.7.0.4
> 
>
Bharat Bhushan - Dec. 17, 2012, 2:51 p.m.
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Monday, December 17, 2012 7:45 PM
> To: Bhushan Bharat-R65777
> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Bhushan Bharat-R65777; Jan
> Kiszka; Peter Maydell
> Subject: Re: [PATCH] Added uapi directory into linux-header
> 
> 
> On 17.12.2012, at 05:08, 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 <bharat.bhushan@freescale.com>
> 
> Please include people who were participating in the discussion previously in CC
> when you post a new version.
> 
> > ---
> > configure                       |    1 +
> > scripts/update-linux-headers.sh |   10 ++++++++++
> > 2 files changed, 11 insertions(+), 0 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 38b1cc6..51cce6b 100755
> > --- a/configure
> > +++ b/configure
> > @@ -3724,6 +3724,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
> 
> This is still wrong. You want this guarded by another if [ -e ].

This is not wrong because .... 

> 
> >     fi
> > fi
> >
> > diff --git a/scripts/update-linux-headers.sh
> > b/scripts/update-linux-headers.sh index 4c7b566..d40f9c4 100755
> > --- a/scripts/update-linux-headers.sh
> > +++ b/scripts/update-linux-headers.sh
> > @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do
> >
> >     make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch
> > headers_install
> >
> > +    if ! [ -e "$output/linux-headers/uapi" ] ; then
> > +        mkdir "$output/linux-headers/uapi"
> > +    fi
> 
> ... which would mean you don't need this bit.

... because here we ensure that the directory exists.

> 
> > +
> >     rm -rf "$output/linux-headers/asm-$arch"
> >     mkdir -p "$output/linux-headers/asm-$arch"
> > +    rm -rf "$output/linux-headers/uapi/asm-$arch"
> > +    mkdir -p "$output/linux-headers/uapi/asm-$arch"
> 
> Only if it exists, no?

Above it is ensured that the directory always exists .. 

> 
> > +
> >     for header in kvm.h kvm_para.h; do
> >         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
> >     done
> >     if [ $arch = x86 ]; then
> >         cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
> >     fi
> > +    if [ $arch = powerpc ]; then
> > +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h"
> "$output/linux-headers/uapi/asm-$arch/"
> > +    fi
> 
> Why is this pointing at $linux and not $tmpdir?

Because I found that $tmpdir does not have epapr_haclls.h, though I do not know why ? any idea why ?

> Also, no need for $arch - be
> explicit and make it "powerpc".

Ok.

-Bharat

> 
> 
> Alex
> 
> > done
> >
> > rm -rf "$output/linux-headers/linux"
> > --
> > 1.7.0.4
> >
> >
>
Alexander Graf - Dec. 17, 2012, 2:54 p.m.
On 17.12.2012, at 15:51, Bhushan Bharat-R65777 wrote:

> 
> 
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Monday, December 17, 2012 7:45 PM
>> To: Bhushan Bharat-R65777
>> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Bhushan Bharat-R65777; Jan
>> Kiszka; Peter Maydell
>> Subject: Re: [PATCH] Added uapi directory into linux-header
>> 
>> 
>> On 17.12.2012, at 05:08, 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 <bharat.bhushan@freescale.com>
>> 
>> Please include people who were participating in the discussion previously in CC
>> when you post a new version.
>> 
>>> ---
>>> configure                       |    1 +
>>> scripts/update-linux-headers.sh |   10 ++++++++++
>>> 2 files changed, 11 insertions(+), 0 deletions(-)
>>> 
>>> diff --git a/configure b/configure
>>> index 38b1cc6..51cce6b 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -3724,6 +3724,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
>> 
>> This is still wrong. You want this guarded by another if [ -e ].
> 
> This is not wrong because .... 
> 
>> 
>>>    fi
>>> fi
>>> 
>>> diff --git a/scripts/update-linux-headers.sh
>>> b/scripts/update-linux-headers.sh index 4c7b566..d40f9c4 100755
>>> --- a/scripts/update-linux-headers.sh
>>> +++ b/scripts/update-linux-headers.sh
>>> @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do
>>> 
>>>    make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch
>>> headers_install
>>> 
>>> +    if ! [ -e "$output/linux-headers/uapi" ] ; then
>>> +        mkdir "$output/linux-headers/uapi"
>>> +    fi
>> 
>> ... which would mean you don't need this bit.
> 
> ... because here we ensure that the directory exists.

But that means we create a uapi directory for archs that don't have one, right?

> 
>> 
>>> +
>>>    rm -rf "$output/linux-headers/asm-$arch"
>>>    mkdir -p "$output/linux-headers/asm-$arch"
>>> +    rm -rf "$output/linux-headers/uapi/asm-$arch"
>>> +    mkdir -p "$output/linux-headers/uapi/asm-$arch"
>> 
>> Only if it exists, no?
> 
> Above it is ensured that the directory always exists .. 
> 
>> 
>>> +
>>>    for header in kvm.h kvm_para.h; do
>>>        cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
>>>    done
>>>    if [ $arch = x86 ]; then
>>>        cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
>>>    fi
>>> +    if [ $arch = powerpc ]; then
>>> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h"
>> "$output/linux-headers/uapi/asm-$arch/"
>>> +    fi
>> 
>> Why is this pointing at $linux and not $tmpdir?
> 
> Because I found that $tmpdir does not have epapr_haclls.h, though I do not know why ? any idea why ?

Smells like a kernel bug :). In fact, I remember that we used to forget uapi/asm/epapr_hcalls.h in the header list a while ago. Are you sure you're basing on the latest kvm code?


Alex

> 
>> Also, no need for $arch - be
>> explicit and make it "powerpc".
> 
> Ok.
> 
> -Bharat
> 
>> 
>> 
>> Alex
>> 
>>> done
>>> 
>>> rm -rf "$output/linux-headers/linux"
>>> --
>>> 1.7.0.4
>>> 
>>> 
>> 
> 
>
Bharat Bhushan - Dec. 17, 2012, 3:02 p.m.
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Monday, December 17, 2012 8:24 PM
> To: Bhushan Bharat-R65777
> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Jan Kiszka; Peter Maydell
> Subject: Re: [PATCH] Added uapi directory into linux-header
> 
> 
> On 17.12.2012, at 15:51, Bhushan Bharat-R65777 wrote:
> 
> >
> >
> >> -----Original Message-----
> >> From: Alexander Graf [mailto:agraf@suse.de]
> >> Sent: Monday, December 17, 2012 7:45 PM
> >> To: Bhushan Bharat-R65777
> >> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Bhushan
> >> Bharat-R65777; Jan Kiszka; Peter Maydell
> >> Subject: Re: [PATCH] Added uapi directory into linux-header
> >>
> >>
> >> On 17.12.2012, at 05:08, 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 <bharat.bhushan@freescale.com>
> >>
> >> Please include people who were participating in the discussion
> >> previously in CC when you post a new version.
> >>
> >>> ---
> >>> configure                       |    1 +
> >>> scripts/update-linux-headers.sh |   10 ++++++++++
> >>> 2 files changed, 11 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/configure b/configure
> >>> index 38b1cc6..51cce6b 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -3724,6 +3724,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
> >>
> >> This is still wrong. You want this guarded by another if [ -e ].
> >
> > This is not wrong because ....
> >
> >>
> >>>    fi
> >>> fi
> >>>
> >>> diff --git a/scripts/update-linux-headers.sh
> >>> b/scripts/update-linux-headers.sh index 4c7b566..d40f9c4 100755
> >>> --- a/scripts/update-linux-headers.sh
> >>> +++ b/scripts/update-linux-headers.sh
> >>> @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do
> >>>
> >>>    make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch
> >>> headers_install
> >>>
> >>> +    if ! [ -e "$output/linux-headers/uapi" ] ; then
> >>> +        mkdir "$output/linux-headers/uapi"
> >>> +    fi
> >>
> >> ... which would mean you don't need this bit.
> >
> > ... because here we ensure that the directory exists.
> 
> But that means we create a uapi directory for archs that don't have one, right?

Yes, I think that's the direction going forward (user specific header files in uapi/).

> 
> >
> >>
> >>> +
> >>>    rm -rf "$output/linux-headers/asm-$arch"
> >>>    mkdir -p "$output/linux-headers/asm-$arch"
> >>> +    rm -rf "$output/linux-headers/uapi/asm-$arch"
> >>> +    mkdir -p "$output/linux-headers/uapi/asm-$arch"
> >>
> >> Only if it exists, no?
> >
> > Above it is ensured that the directory always exists ..
> >
> >>
> >>> +
> >>>    for header in kvm.h kvm_para.h; do
> >>>        cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
> >>>    done
> >>>    if [ $arch = x86 ]; then
> >>>        cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
> >>>    fi
> >>> +    if [ $arch = powerpc ]; then
> >>> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h"
> >> "$output/linux-headers/uapi/asm-$arch/"
> >>> +    fi
> >>
> >> Why is this pointing at $linux and not $tmpdir?
> >
> > Because I found that $tmpdir does not have epapr_haclls.h, though I do not
> know why ? any idea why ?
> 
> Smells like a kernel bug :). In fact, I remember that we used to forget
> uapi/asm/epapr_hcalls.h in the header list a while ago.

I am not able to locate which command (set of commands) are installing the header files (all/selectively header files of arch/powerpc/include/asm/ and arch/powerp/include/uapi/asm/) in $tmpdir/

> Are you sure you're
> basing on the latest kvm code?

kvm-ppc-next branch of http://github.com/agraf/linux-2.6.git 

-Bharat

> 
> 
> Alex
> 
> >
> >> Also, no need for $arch - be
> >> explicit and make it "powerpc".
> >
> > Ok.
> >
> > -Bharat
> >
> >>
> >>
> >> Alex
> >>
> >>> done
> >>>
> >>> rm -rf "$output/linux-headers/linux"
> >>> --
> >>> 1.7.0.4
> >>>
> >>>
> >>
> >
> >
>
Alexander Graf - Dec. 17, 2012, 3:08 p.m.
On 17.12.2012, at 16:02, Bhushan Bharat-R65777 wrote:

> 
> 
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Monday, December 17, 2012 8:24 PM
>> To: Bhushan Bharat-R65777
>> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Jan Kiszka; Peter Maydell
>> Subject: Re: [PATCH] Added uapi directory into linux-header
>> 
>> 
>> On 17.12.2012, at 15:51, Bhushan Bharat-R65777 wrote:
>> 
>>> 
>>> 
>>>> -----Original Message-----
>>>> From: Alexander Graf [mailto:agraf@suse.de]
>>>> Sent: Monday, December 17, 2012 7:45 PM
>>>> To: Bhushan Bharat-R65777
>>>> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Bhushan
>>>> Bharat-R65777; Jan Kiszka; Peter Maydell
>>>> Subject: Re: [PATCH] Added uapi directory into linux-header
>>>> 
>>>> 
>>>> On 17.12.2012, at 05:08, 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 <bharat.bhushan@freescale.com>
>>>> 
>>>> Please include people who were participating in the discussion
>>>> previously in CC when you post a new version.
>>>> 
>>>>> ---
>>>>> configure                       |    1 +
>>>>> scripts/update-linux-headers.sh |   10 ++++++++++
>>>>> 2 files changed, 11 insertions(+), 0 deletions(-)
>>>>> 
>>>>> diff --git a/configure b/configure
>>>>> index 38b1cc6..51cce6b 100755
>>>>> --- a/configure
>>>>> +++ b/configure
>>>>> @@ -3724,6 +3724,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
>>>> 
>>>> This is still wrong. You want this guarded by another if [ -e ].
>>> 
>>> This is not wrong because ....
>>> 
>>>> 
>>>>>   fi
>>>>> fi
>>>>> 
>>>>> diff --git a/scripts/update-linux-headers.sh
>>>>> b/scripts/update-linux-headers.sh index 4c7b566..d40f9c4 100755
>>>>> --- a/scripts/update-linux-headers.sh
>>>>> +++ b/scripts/update-linux-headers.sh
>>>>> @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do
>>>>> 
>>>>>   make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch
>>>>> headers_install
>>>>> 
>>>>> +    if ! [ -e "$output/linux-headers/uapi" ] ; then
>>>>> +        mkdir "$output/linux-headers/uapi"
>>>>> +    fi
>>>> 
>>>> ... which would mean you don't need this bit.
>>> 
>>> ... because here we ensure that the directory exists.
>> 
>> But that means we create a uapi directory for archs that don't have one, right?
> 
> Yes, I think that's the direction going forward (user specific header files in uapi/).

Sure, but we shouldn't be faster than Linux itself here ;).

> 
>> 
>>> 
>>>> 
>>>>> +
>>>>>   rm -rf "$output/linux-headers/asm-$arch"
>>>>>   mkdir -p "$output/linux-headers/asm-$arch"
>>>>> +    rm -rf "$output/linux-headers/uapi/asm-$arch"
>>>>> +    mkdir -p "$output/linux-headers/uapi/asm-$arch"
>>>> 
>>>> Only if it exists, no?
>>> 
>>> Above it is ensured that the directory always exists ..
>>> 
>>>> 
>>>>> +
>>>>>   for header in kvm.h kvm_para.h; do
>>>>>       cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
>>>>>   done
>>>>>   if [ $arch = x86 ]; then
>>>>>       cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
>>>>>   fi
>>>>> +    if [ $arch = powerpc ]; then
>>>>> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h"
>>>> "$output/linux-headers/uapi/asm-$arch/"
>>>>> +    fi
>>>> 
>>>> Why is this pointing at $linux and not $tmpdir?
>>> 
>>> Because I found that $tmpdir does not have epapr_haclls.h, though I do not
>> know why ? any idea why ?
>> 
>> Smells like a kernel bug :). In fact, I remember that we used to forget
>> uapi/asm/epapr_hcalls.h in the header list a while ago.
> 
> I am not able to locate which command (set of commands) are installing the header files (all/selectively header files of arch/powerpc/include/asm/ and arch/powerp/include/uapi/asm/) in $tmpdir/

There is a make target headers_install to install user space headers into a directory. To be installed by this, the file needs to be listed in arch/powerpc/include/uapi/asm/Kbuild. Commit c99ec973a63e2249020d6d93a46d7572432da6a2 put it in there, so it should get installed...

> 
>> Are you sure you're
>> basing on the latest kvm code?
> 
> kvm-ppc-next branch of http://github.com/agraf/linux-2.6.git 

Yeah, that one is good :)


Alex
Bharat Bhushan - Dec. 17, 2012, 3:15 p.m.
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Monday, December 17, 2012 8:39 PM
> To: Bhushan Bharat-R65777
> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Jan Kiszka; Peter Maydell
> Subject: Re: [PATCH] Added uapi directory into linux-header
> 
> 
> On 17.12.2012, at 16:02, Bhushan Bharat-R65777 wrote:
> 
> >
> >
> >> -----Original Message-----
> >> From: Alexander Graf [mailto:agraf@suse.de]
> >> Sent: Monday, December 17, 2012 8:24 PM
> >> To: Bhushan Bharat-R65777
> >> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Jan Kiszka;
> >> Peter Maydell
> >> Subject: Re: [PATCH] Added uapi directory into linux-header
> >>
> >>
> >> On 17.12.2012, at 15:51, Bhushan Bharat-R65777 wrote:
> >>
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Alexander Graf [mailto:agraf@suse.de]
> >>>> Sent: Monday, December 17, 2012 7:45 PM
> >>>> To: Bhushan Bharat-R65777
> >>>> Cc: qemu-devel qemu-devel; qemu-ppc@nongnu.org List; Bhushan
> >>>> Bharat-R65777; Jan Kiszka; Peter Maydell
> >>>> Subject: Re: [PATCH] Added uapi directory into linux-header
> >>>>
> >>>>
> >>>> On 17.12.2012, at 05:08, 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 <bharat.bhushan@freescale.com>
> >>>>
> >>>> Please include people who were participating in the discussion
> >>>> previously in CC when you post a new version.
> >>>>
> >>>>> ---
> >>>>> configure                       |    1 +
> >>>>> scripts/update-linux-headers.sh |   10 ++++++++++
> >>>>> 2 files changed, 11 insertions(+), 0 deletions(-)
> >>>>>
> >>>>> diff --git a/configure b/configure index 38b1cc6..51cce6b 100755
> >>>>> --- a/configure
> >>>>> +++ b/configure
> >>>>> @@ -3724,6 +3724,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
> >>>>
> >>>> This is still wrong. You want this guarded by another if [ -e ].
> >>>
> >>> This is not wrong because ....
> >>>
> >>>>
> >>>>>   fi
> >>>>> fi
> >>>>>
> >>>>> diff --git a/scripts/update-linux-headers.sh
> >>>>> b/scripts/update-linux-headers.sh index 4c7b566..d40f9c4 100755
> >>>>> --- a/scripts/update-linux-headers.sh
> >>>>> +++ b/scripts/update-linux-headers.sh
> >>>>> @@ -46,14 +46,24 @@ for arch in $ARCHLIST; do
> >>>>>
> >>>>>   make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch
> >>>>> headers_install
> >>>>>
> >>>>> +    if ! [ -e "$output/linux-headers/uapi" ] ; then
> >>>>> +        mkdir "$output/linux-headers/uapi"
> >>>>> +    fi
> >>>>
> >>>> ... which would mean you don't need this bit.
> >>>
> >>> ... because here we ensure that the directory exists.
> >>
> >> But that means we create a uapi directory for archs that don't have one,
> right?
> >
> > Yes, I think that's the direction going forward (user specific header files in
> uapi/).
> 
> Sure, but we shouldn't be faster than Linux itself here ;).

I am fine with what makes you happier :)

> 
> >
> >>
> >>>
> >>>>
> >>>>> +
> >>>>>   rm -rf "$output/linux-headers/asm-$arch"
> >>>>>   mkdir -p "$output/linux-headers/asm-$arch"
> >>>>> +    rm -rf "$output/linux-headers/uapi/asm-$arch"
> >>>>> +    mkdir -p "$output/linux-headers/uapi/asm-$arch"
> >>>>
> >>>> Only if it exists, no?
> >>>
> >>> Above it is ensured that the directory always exists ..
> >>>
> >>>>
> >>>>> +
> >>>>>   for header in kvm.h kvm_para.h; do
> >>>>>       cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
> >>>>>   done
> >>>>>   if [ $arch = x86 ]; then
> >>>>>       cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
> >>>>>   fi
> >>>>> +    if [ $arch = powerpc ]; then
> >>>>> +        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h"
> >>>> "$output/linux-headers/uapi/asm-$arch/"
> >>>>> +    fi
> >>>>
> >>>> Why is this pointing at $linux and not $tmpdir?
> >>>
> >>> Because I found that $tmpdir does not have epapr_haclls.h, though I
> >>> do not
> >> know why ? any idea why ?
> >>
> >> Smells like a kernel bug :). In fact, I remember that we used to
> >> forget uapi/asm/epapr_hcalls.h in the header list a while ago.
> >
> > I am not able to locate which command (set of commands) are installing
> > the header files (all/selectively header files of
> > arch/powerpc/include/asm/ and arch/powerp/include/uapi/asm/) in
> > $tmpdir/
> 
> There is a make target headers_install to install user space headers into a
> directory. To be installed by this, the file needs to be listed in
> arch/powerpc/include/uapi/asm/Kbuild. Commit
> c99ec973a63e2249020d6d93a46d7572432da6a2 put it in there, so it should get
> installed...

Ahh, thanks . Actually all the files are getting installed in $tmpdir/include/asm/ while I was looking for the header file in $tmpdir/include/uapi/asm/

-Bharat

> 
> >
> >> Are you sure you're
> >> basing on the latest kvm code?
> >
> > kvm-ppc-next branch of http://github.com/agraf/linux-2.6.git
> 
> Yeah, that one is good :)
> 
> 
> Alex
>

Patch

diff --git a/configure b/configure
index 38b1cc6..51cce6b 100755
--- a/configure
+++ b/configure
@@ -3724,6 +3724,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..d40f9c4 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -46,14 +46,24 @@  for arch in $ARCHLIST; do
 
     make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch headers_install
 
+    if ! [ -e "$output/linux-headers/uapi" ] ; then
+        mkdir "$output/linux-headers/uapi"
+    fi
+
     rm -rf "$output/linux-headers/asm-$arch"
     mkdir -p "$output/linux-headers/asm-$arch"
+    rm -rf "$output/linux-headers/uapi/asm-$arch"
+    mkdir -p "$output/linux-headers/uapi/asm-$arch"
+
     for header in kvm.h kvm_para.h; do
         cp "$tmpdir/include/asm/$header" "$output/linux-headers/asm-$arch"
     done
     if [ $arch = x86 ]; then
         cp "$tmpdir/include/asm/hyperv.h" "$output/linux-headers/asm-x86"
     fi
+    if [ $arch = powerpc ]; then
+        cp "$linux/arch/$arch/include/uapi/asm/epapr_hcalls.h" "$output/linux-headers/uapi/asm-$arch/"
+    fi
 done
 
 rm -rf "$output/linux-headers/linux"