From patchwork Thu Aug 16 15:16:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 958476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LWxjS5pJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41rsJK3x9Dz9sBn for ; Fri, 17 Aug 2018 02:30:25 +1000 (AEST) Received: from localhost ([::1]:56815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqLAE-0000O2-NF for incoming@patchwork.ozlabs.org; Thu, 16 Aug 2018 12:30:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqKBT-0005xq-Q0 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 11:27:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqKBJ-00006w-N4 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 11:27:33 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:38765) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fqKBH-00005A-Gk for qemu-devel@nongnu.org; Thu, 16 Aug 2018 11:27:23 -0400 Received: by mail-wm0-x22c.google.com with SMTP id t25-v6so4707352wmi.3 for ; Thu, 16 Aug 2018 08:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZyVby1NC51c7kuMOVKwvfz3pN8s8Rys7IvAqJpqoLos=; b=LWxjS5pJWRuyur8RZvo1o7PGjHA+gHpUP/KXTD1sbp7cVMgcra3X0FhC85i5O0nD14 tB7yXoEaXGNdkoU2Fhs2xQSrO3P7SdVhUlX6Qux/KW7ek4pA10UrApUL4T6G2hRDmOXk jRrq64S/vo+6hjoFx4OHoMr12VIqcn0199ygrSizL+0FpUlNhYzN6fbdep7ZMaCbomkq vxcEPeIfCN42Y4wY32Q99rqc7KT0eyvUjNbEe00fteHIbRvDsH6KTOtdZUqqY2wbXNp8 6aIFrxzUV01aYbtPKcJf0RgSbAHU9fyoV2MPtTLPuCHUeXztDn4iI/RuqPbLNUsDNk2h H94w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZyVby1NC51c7kuMOVKwvfz3pN8s8Rys7IvAqJpqoLos=; b=CZFbpZkcKCssKxX/8nvZNlaezHg6dg/wZ4N8audaLcBm1w0n93VefjyX9YDMKWWYT4 oGmuLp9C9BMTL7CWHshmfWRFL9L+3xAOxcohUm6N6Gowo0K1i/Hpx/gdbpsgPO9S6BHn h+5CB6Pm6cr7LS274ONvUtZ3KRGr/PUQ8DpMCWt9mfT197atKAuSqTq07BIzfaZOc86J QBgrP6WRTDYE2jKVZPNkgzHrSktFUamlNUSd6j8AHFva1/LFDi2ZRW1H2c3lBshGiOqH f2kH0hJ7Wmr40FNSgq/Zw5JW4IzryivYx5zNeNpVfml4pTPdI9skY61pfgTKNnbdFFbG 5UfA== X-Gm-Message-State: AOUpUlFlqUzl0h2mfJe3xUIzZ9V8EzqUfeiqG2l1lUN5ffP+yxgF6hrv vNIwwHu9TEpwjrozCWR1ocw15Y/F X-Google-Smtp-Source: AA+uWPxJXWao4T1+PFWYTfhaSKmd3PbTOQ0WXUmS6rw+rfRe6pSwWtBpsuzZLLE4jPvbXhO698xbCw== X-Received: by 2002:a1c:e54:: with SMTP id 81-v6mr17371073wmo.84.1534433241448; Thu, 16 Aug 2018 08:27:21 -0700 (PDT) Received: from localhost.localdomain ([176.228.154.53]) by smtp.gmail.com with ESMTPSA id h14-v6sm31435721wro.15.2018.08.16.08.27.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Aug 2018 08:27:20 -0700 (PDT) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 18:16:37 +0300 Message-Id: <20180816151637.24553-1-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22c Subject: [Qemu-devel] [PATCH V2] config: split PVRDMA from RDMA 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: rebecca@bluestop.org, thuth@redhat.com, yuval.shaia@oracle.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" In some BSD systems RDMA migration is possible while the pvrdma device can't be used because the mremap system call is missing. Signed-off-by: Marcel Apfelbaum Reviewed-by: Thomas Huth --- configure | 55 ++++++++++++++++++++++++++++++++++++++++++- hw/rdma/Makefile.objs | 2 +- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 2a7796ea80..b6d37a735b 100755 --- a/configure +++ b/configure @@ -375,6 +375,7 @@ hax="no" hvf="no" whpx="no" rdma="" +pvrdma="" gprof="no" debug_tcg="no" debug="no" @@ -1363,6 +1364,10 @@ for opt do ;; --disable-rdma) rdma="no" ;; + --enable-pvrdma) pvrdma="yes" + ;; + --disable-pvrdma) pvrdma="no" + ;; --with-gtkabi=*) gtkabi="$optarg" ;; --disable-vte) vte="no" @@ -1669,7 +1674,8 @@ disabled with --disable-FEATURE, default is enabled if available: hax HAX acceleration support hvf Hypervisor.framework acceleration support whpx Windows Hypervisor Platform acceleration support - rdma Enable RDMA-based migration and PVRDMA support + rdma Enable RDMA-based migration + pvrdma Enable PVRDMA support vde support for vde network netmap support for netmap network linux-aio Linux AIO support @@ -3064,6 +3070,48 @@ EOF fi fi +########################################## +# PVRDMA detection + +cat > $TMPC < + +int +main(void) +{ + char buf = 0; + void *addr = &buf; + addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED); + + return 0; +} +EOF + +if test "$rdma" = "yes" ; then + case "$pvrdma" in + "") + if compile_prog "" ""; then + pvrdma="yes" + else + pvrdma="no" + fi + ;; + "yes") + if ! compile_prog "" ""; then + error_exit "PVRDMA is not supported since mremap is not implemented" + fi + pvrdma="yes" + ;; + "no") + pvrdma="no" + ;; + esac +else + if test "$pvrdma" = "yes" ; then + error_exit "PVRDMA requires rdma suppport" + fi + pvrdma="no" +fi ########################################## # VNC SASL detection @@ -5952,6 +6000,7 @@ if test "$tcg" = "yes" ; then fi echo "malloc trim support $malloc_trim" echo "RDMA support $rdma" +echo "PVRDMA support $pvrdma" echo "fdt support $fdt" echo "membarrier $membarrier" echo "preadv support $preadv" @@ -6708,6 +6757,10 @@ if test "$rdma" = "yes" ; then echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak fi +if test "$pvrdma" = "yes" ; then + echo "CONFIG_PVRDMA=y" >> $config_host_mak +fi + if test "$have_rtnetlink" = "yes" ; then echo "CONFIG_RTNETLINK=y" >> $config_host_mak fi diff --git a/hw/rdma/Makefile.objs b/hw/rdma/Makefile.objs index 3504c39d21..bd36cbf51c 100644 --- a/hw/rdma/Makefile.objs +++ b/hw/rdma/Makefile.objs @@ -1,4 +1,4 @@ -ifeq ($(CONFIG_RDMA),y) +ifeq ($(CONFIG_PVRDMA),y) obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \ vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o