From patchwork Wed Feb 14 19:22:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 10219787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EC31C601C2 for ; Wed, 14 Feb 2018 19:24:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCF0B28FF1 for ; Wed, 14 Feb 2018 19:24:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D177F29046; Wed, 14 Feb 2018 19:24:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A1A528FF1 for ; Wed, 14 Feb 2018 19:24:22 +0000 (UTC) Received: from localhost ([::1]:51814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2fF-0004ZC-Mv for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Feb 2018 14:24:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em2dn-00035m-VT for qemu-devel@nongnu.org; Wed, 14 Feb 2018 14:22:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em2dm-0008Di-QN for qemu-devel@nongnu.org; Wed, 14 Feb 2018 14:22:51 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35414 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1em2dm-0008DQ-Ld for qemu-devel@nongnu.org; Wed, 14 Feb 2018 14:22:50 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3830640FB648; Wed, 14 Feb 2018 19:22:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.35.206.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29D4AFA282; Wed, 14 Feb 2018 19:22:47 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Wed, 14 Feb 2018 21:22:23 +0200 Message-Id: <20180214192230.70287-4-marcel@redhat.com> In-Reply-To: <20180214192230.70287-1-marcel@redhat.com> References: <20180214192230.70287-1-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Feb 2018 19:22:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Feb 2018 19:22:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH V11 03/10] scripts/update-linux-headers: import pvrdma headers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, ehabkost@redhat.com, mst@redhat.com, ghammer@redhat.com, yuval.shaia@oracle.com, yanjun.zhu@oracle.com, dotanb@mellanox.com, marcel@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modify the script to import the headers used by the pvrdma device. Part of them are interfaces between the guest driver and the device, import them under include/standart-headers/drivers/infiniband/... . Remove the unused functions from pvrdma_verbs.h avoiding the unnecessary import of several infiniband/networking/other headers. Reviewed-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Yuval Shaia --- scripts/update-linux-headers.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 135a10d96a..be065704df 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -38,6 +38,7 @@ cp_portable() { -e 'linux/if_ether' \ -e 'input-event-codes' \ -e 'sys/' \ + -e 'pvrdma_verbs' \ > /dev/null then echo "Unexpected #include in input file $f". @@ -46,6 +47,7 @@ cp_portable() { header=$(basename "$f"); sed -e 's/__u\([0-9][0-9]*\)/uint\1_t/g' \ + -e 's/u\([0-9][0-9]*\)/uint\1_t/g' \ -e 's/__s\([0-9][0-9]*\)/int\1_t/g' \ -e 's/__le\([0-9][0-9]*\)/uint\1_t/g' \ -e 's/__be\([0-9][0-9]*\)/uint\1_t/g' \ @@ -56,6 +58,7 @@ cp_portable() { -e 's/__inline__/inline/' \ -e '/sys\/ioctl.h/d' \ -e 's/SW_MAX/SW_MAX_/' \ + -e 's/atomic_t/int/' \ "$f" > "$to/$header"; } @@ -147,6 +150,33 @@ for i in "$tmpdir"/include/linux/*virtio*.h "$tmpdir/include/linux/input.h" \ cp_portable "$i" "$output/include/standard-headers/linux" done +rm -rf "$output/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma" +mkdir -p "$output/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma" + +# Remove the unused functions from pvrdma_verbs.h avoiding the unnecessary +# import of several infiniband/networking/other headers +tmp_pvrdma_verbs="$tmpdir/pvrdma_verbs.h" +# Parse the entire file instead of single lines to match +# function declarations expanding over multiple lines +# and strip the declarations starting with pvrdma prefix. +sed -e '1h;2,$H;$!d;g' -e 's/[^};]*pvrdma[^(| ]*([^)]*);//g' \ + "$linux/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h" > \ + "$tmp_pvrdma_verbs"; + +for i in "$linux/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h" \ + "$linux/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h" \ + "$tmp_pvrdma_verbs"; do \ + cp_portable "$i" \ + "$output/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/" +done + +rm -rf "$output/include/standard-headers/rdma/" +mkdir -p "$output/include/standard-headers/rdma/" +for i in "$tmpdir/include/rdma/vmw_pvrdma-abi.h"; do + cp_portable "$i" \ + "$output/include/standard-headers/rdma/" +done + cat <$output/include/standard-headers/linux/types.h /* For QEMU all types are already defined via osdep.h, so this * header does not need to do anything.