From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZy6b-000484-Kl for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:25:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZy6a-0000pw-QD for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:25:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZy6a-0000pj-I7 for qemu-devel@nongnu.org; Thu, 10 Sep 2015 05:25:20 -0400 Date: Thu, 10 Sep 2015 12:25:17 +0300 From: "Michael S. Tsirkin" Message-ID: <20150910122258-mutt-send-email-mst@redhat.com> References: <1441816441-7730-1-git-send-email-pbonzini@redhat.com> <1441816441-7730-3-git-send-email-pbonzini@redhat.com> <20150910103319-mutt-send-email-mst@redhat.com> <55F14B34.5050906@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55F14B34.5050906@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/2] target-i386: move asm-x86/hyperv.h to standard-headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: cornelia.huck@de.ibm.com, den@openvz.org, qemu-devel@nongnu.org On Thu, Sep 10, 2015 at 11:19:48AM +0200, Paolo Bonzini wrote: > > > 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 > > > > 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 <$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 and you don't > want to pick the system version. I see. Makes sense. Then maybe don't bother with kvm.c either? Keeps it consistent ... > >> cat <$output/linux-headers/linux/virtio_config.h > >> #include "standard-headers/linux/virtio_config.h" > >> EOF > >> @@ -120,7 +122,12 @@ cat <$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 And Cornelia thinks s390 won't need anything new ever, either. OK then. > > Then we can reuse it for asm like we did. > > hyperv can use cp_portable if it wants to. > > > >> > >> cat <$output/include/standard-headers/linux/types.h > >> #include > >> 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 > >> +#include "standard-headers/asm-x86/hyperv.h" > >> #include "hw/pci/pci.h" > >> #include "migration/migration.h" > >> #include "exec/memattrs.h" > >> -- > >> 2.4.3