From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, cohuck@redhat.com
Subject: Re: [Qemu-devel] [PATCH] include: update Linux headers to 4.21/5.0
Date: Thu, 3 Jan 2019 13:18:09 -0500 [thread overview]
Message-ID: <20190103130406-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20190103175113.18196-1-pbonzini@redhat.com>
On Thu, Jan 03, 2019 at 06:51:13PM +0100, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Note that in the past we just updated what we needed.
That approach has some advantages as linux doesn't
stand in place, so whatever renames we handle now
just might have to get undone down the road.
And, it allows cherry-picking headers from netdev-next etc.
So maybe include a bit of motivation in the commit log.
E.g. do you plan to do this every linux release from now on?
> ---
> include/standard-headers/drm/drm_fourcc.h | 63 +
> include/standard-headers/linux/ethtool.h | 19 +-
> .../linux/input-event-codes.h | 17 +
> include/standard-headers/linux/pci_regs.h | 1 +
> include/standard-headers/linux/vhost_types.h | 128 ++
> .../standard-headers/linux/virtio_balloon.h | 8 +
> include/standard-headers/linux/virtio_blk.h | 54 +
> .../standard-headers/linux/virtio_config.h | 3 +
> include/standard-headers/linux/virtio_gpu.h | 18 +
> include/standard-headers/linux/virtio_ring.h | 52 +
> linux-headers/asm-arm/unistd-common.h | 1 +
> linux-headers/asm-arm64/unistd.h | 1 +
> linux-headers/asm-generic/unistd.h | 10 +-
> linux-headers/asm-mips/sgidefs.h | 8 -
> linux-headers/asm-mips/unistd.h | 1074 +----------------
> linux-headers/asm-mips/unistd_n32.h | 338 ++++++
> linux-headers/asm-mips/unistd_n64.h | 334 +++++
> linux-headers/asm-mips/unistd_o32.h | 374 ++++++
> linux-headers/asm-powerpc/unistd.h | 389 +-----
> linux-headers/asm-powerpc/unistd_32.h | 381 ++++++
> linux-headers/asm-powerpc/unistd_64.h | 372 ++++++
> linux-headers/linux/kvm.h | 29 +
> linux-headers/linux/vfio.h | 92 ++
> linux-headers/linux/vhost.h | 113 +-
> linux-headers/linux/vhost_types.h | 1 +
> scripts/update-linux-headers.sh | 11 +
> 26 files changed, 2302 insertions(+), 1589 deletions(-)
> create mode 100644 include/standard-headers/linux/vhost_types.h
> create mode 100644 linux-headers/asm-mips/unistd_n32.h
> create mode 100644 linux-headers/asm-mips/unistd_n64.h
> create mode 100644 linux-headers/asm-mips/unistd_o32.h
> create mode 100644 linux-headers/asm-powerpc/unistd_32.h
> create mode 100644 linux-headers/asm-powerpc/unistd_64.h
> create mode 100644 linux-headers/linux/vhost_types.h
I'd prefer the shell script part and the new vhost_types header which
are actually reviewable to be split out to a separate patch.
And maybe split out unistd stuff that just happened to be there
since it's mostly just a jumbo list of numbers.
> diff --git a/linux-headers/linux/vhost_types.h b/linux-headers/linux/vhost_types.h
> new file mode 100644
> index 0000000000..473e3c0d81
> --- /dev/null
> +++ b/linux-headers/linux/vhost_types.h
> @@ -0,0 +1 @@
> +#include "standard-headers/linux/vhost_types.h"
Maybe add a comment here explaining where this came from and why?
BTW it can't hurt to add a preamble to each header we import that
says "this came from pdate-linux-headers.sh" - as it is once
in a while we have people try to edit these headers directly.
Doesn't need to be done right now naturally.
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index 0a964fe240..c933489cbc 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -101,6 +101,13 @@ for arch in $ARCHLIST; do
>
> if [ $arch = mips ]; then
> cp "$tmpdir/include/asm/sgidefs.h" "$output/linux-headers/asm-mips/"
> + cp "$tmpdir/include/asm/unistd_o32.h" "$output/linux-headers/asm-mips/"
> + cp "$tmpdir/include/asm/unistd_n32.h" "$output/linux-headers/asm-mips/"
> + cp "$tmpdir/include/asm/unistd_n64.h" "$output/linux-headers/asm-mips/"
> + fi
> + if [ $arch = powerpc ]; then
> + cp "$tmpdir/include/asm/unistd_32.h" "$output/linux-headers/asm-powerpc/"
> + cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-powerpc/"
> fi
>
> rm -rf "$output/include/standard-headers/asm-$arch"
A bit of an explanation about what happened here can't hurt.
> @@ -162,6 +169,9 @@ EOF
> cat <<EOF >$output/linux-headers/linux/virtio_ring.h
> #include "standard-headers/linux/virtio_ring.h"
> EOF
> +cat <<EOF >$output/linux-headers/linux/vhost_types.h
> +#include "standard-headers/linux/vhost_types.h"
> +EOF
I guess this is because we want vhost_types.h on non-linux systems,
but vhost.h only on linux systems? The disadvantage to this
approach is that one can use #include <linux/vhost_types.h> by mistake
and it will only break on non-linux.
An alternative is to replace #include <linux/vhost_types.h> with
#include "standard-headers/linux/vhost_types.h"
when we are importing vhost.h
Not a big deal, but I thought I'd mention this.
>
> rm -rf "$output/include/standard-headers/linux"
> mkdir -p "$output/include/standard-headers/linux"
> @@ -171,6 +181,7 @@ for i in "$tmpdir"/include/linux/*virtio*.h \
> "$tmpdir/include/linux/input-event-codes.h" \
> "$tmpdir/include/linux/pci_regs.h" \
> "$tmpdir/include/linux/ethtool.h" "$tmpdir/include/linux/kernel.h" \
> + "$tmpdir/include/linux/vhost_types.h" \
> "$tmpdir/include/linux/sysinfo.h"; do
> cp_portable "$i" "$output/include/standard-headers/linux"
> done
> --
> 2.20.1
next prev parent reply other threads:[~2019-01-03 18:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 17:51 [Qemu-devel] [PATCH] include: update Linux headers to 4.21/5.0 Paolo Bonzini
2019-01-03 18:18 ` Michael S. Tsirkin [this message]
2019-01-03 19:26 ` Peter Maydell
2019-01-04 8:07 ` Paolo Bonzini
2019-01-04 8:38 ` Cornelia Huck
2019-01-04 15:17 ` Michael S. Tsirkin
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=20190103130406-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=cohuck@redhat.com \
--cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).