From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: cornelia.huck@de.ibm.com, den@openvz.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 2/2] target-i386: move asm-x86/hyperv.h to standard-headers
Date: Thu, 10 Sep 2015 11:19:48 +0200 [thread overview]
Message-ID: <55F14B34.5050906@redhat.com> (raw)
In-Reply-To: <20150910103319-mutt-send-email-mst@redhat.com>
On 10/09/2015 09:42, Michael S. Tsirkin wrote:
> On Wed, Sep 09, 2015 at 06:34:01PM +0200, Paolo Bonzini wrote:
>> The Hyper-V definitions are an industry standard and can be used
>> from code that is not KVM-specific.
>>
>> The changes to scripts/update-linux-headers.sh are required because there
>> is both an asm-x86/hyperv.h and a linux/hyperv.h file. linux/hyperv.h
>> introduces dependencies on additional Linux uapi headers, so we only
>> want the former.
>>
>> The solution is to make cp_virtio (now renamed to cp_portable) copy
>> one file only, instead of using the "find" command, and call it multiple
>> times. The new function is really just a reindentation of the old one.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> I'd rather see a script update, then result of running it
> in a separate patch.
Okay, I'll split the patch in two.
>> @@ -68,6 +61,7 @@ cp_virtio() {
>> ARCHLIST=$(cd "$linux/arch" && echo *)
>>
>> for arch in $ARCHLIST; do
>> +
>> # Discard anything which isn't a KVM-supporting architecture
>> if ! [ -e "$linux/arch/$arch/include/asm/kvm.h" ] &&
>> ! [ -e "$linux/arch/$arch/include/uapi/asm/kvm.h" ] ; then
>
> This empty line looks ugly imho.
Right.
>> +cat <<EOF >$output/linux-headers/asm-x86/hyperv.h
>> +#include "standard-headers/asm-x86/hyperv.h"
>> +EOF
>
> I don't think this is needed. We only did this for
> virtio_config to avoid the code churn. Hyperv has
> a single user, so no issue.
It is needed because kvm headers include <asm/hyperv.h> and you don't
want to pick the system version.
>> cat <<EOF >$output/linux-headers/linux/virtio_config.h
>> #include "standard-headers/linux/virtio_config.h"
>> EOF
>> @@ -120,7 +122,12 @@ cat <<EOF >$output/linux-headers/linux/virtio_ring.h
>> #include "standard-headers/linux/virtio_ring.h"
>> EOF
>>
>> -cp_virtio "$tmpdir/include/linux/" "$output/include/standard-headers/linux"
>> +rm -rf "$output/include/standard-headers/linux"
>> +mkdir -p "$output/include/standard-headers/linux"
>> +for i in "$tmpdir"/include/linux/*virtio*.h "$tmpdir/include/linux/input.h" \
>> + "$tmpdir/include/linux/pci_regs.h"; do
>> + cp_portable "$i" "$output/include/standard-headers/linux"
>> +done
>
> How about we move the above loop into cp_virtio?
I disagree, because input.h and pci_regs.h make no sense for s390.
Paolo
> Then we can reuse it for asm like we did.
> hyperv can use cp_portable if it wants to.
>
>>
>> cat <<EOF >$output/include/standard-headers/linux/types.h
>> #include <stdint.h>
>> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
>> index 066d03d..d8a11be 100644
>> --- a/target-i386/kvm.c
>> +++ b/target-i386/kvm.c
>> @@ -33,7 +33,7 @@
>> #include "hw/i386/apic_internal.h"
>> #include "hw/i386/apic-msidef.h"
>> #include "exec/ioport.h"
>> -#include <asm/hyperv.h>
>> +#include "standard-headers/asm-x86/hyperv.h"
>> #include "hw/pci/pci.h"
>> #include "migration/migration.h"
>> #include "exec/memattrs.h"
>> --
>> 2.4.3
next prev parent reply other threads:[~2015-09-10 9:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 16:33 [Qemu-devel] [PATCH v2 0/2] update-linux-headers changes Paolo Bonzini
2015-09-09 16:34 ` [Qemu-devel] [PATCH v2 1/2] update Linux headers to 4.2 Paolo Bonzini
2015-09-10 7:31 ` Michael S. Tsirkin
2015-09-09 16:34 ` [Qemu-devel] [PATCH v2 2/2] target-i386: move asm-x86/hyperv.h to standard-headers Paolo Bonzini
2015-09-10 7:22 ` Cornelia Huck
2015-09-10 7:42 ` Michael S. Tsirkin
2015-09-10 8:04 ` Cornelia Huck
2015-09-10 9:19 ` Paolo Bonzini [this message]
2015-09-10 9:25 ` Michael S. Tsirkin
2015-09-10 9:28 ` Paolo Bonzini
2015-09-10 9:32 ` Michael S. Tsirkin
2015-09-10 9:40 ` Paolo Bonzini
2015-09-10 18:51 ` [Qemu-devel] [PATCH v2 0/2] update-linux-headers changes Denis V. Lunev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F14B34.5050906@redhat.com \
--to=pbonzini@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=den@openvz.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.