From patchwork Mon Dec 14 16:36:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2216C2BBCF for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8381022510 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8381022510 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52380.91569 (Exim 4.92) (envelope-from ) id 1koshF-0001pC-84; Mon, 14 Dec 2020 18:35:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52380.91569; Mon, 14 Dec 2020 18:35:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshE-0001ox-U4; Mon, 14 Dec 2020 18:35:44 +0000 Received: by outflank-mailman (input) for mailman id 52380; Mon, 14 Dec 2020 16:36:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqA-0006vN-IE for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:36:50 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0b64aa07-f16c-437c-8ee1-cbd63850eb72; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaW2U004851; Mon, 14 Dec 2020 17:36:32 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaWEe015623; Mon, 14 Dec 2020 17:36:32 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id AA212AAC65; Mon, 14 Dec 2020 17:36:32 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0b64aa07-f16c-437c-8ee1-cbd63850eb72 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 01/24] Fix lock directory path for NetBSD Date: Mon, 14 Dec 2020 17:36:00 +0100 Message-Id: <20201214163623.2127-2-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:32 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- m4/paths.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/paths.m4 b/m4/paths.m4 index 89d3bb8312..1c107b1a61 100644 --- a/m4/paths.m4 +++ b/m4/paths.m4 @@ -142,7 +142,7 @@ AC_SUBST(XEN_SCRIPT_DIR) case "$host_os" in *freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;; -*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;; +*netbsd*) XEN_LOCK_DIR=$rundir_path ;; *) XEN_LOCK_DIR=$localstatedir/lock ;; esac AC_SUBST(XEN_LOCK_DIR) From patchwork Mon Dec 14 16:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1082C4361B for ; Mon, 14 Dec 2020 18:36:01 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C4EF224D1 for ; Mon, 14 Dec 2020 18:36:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C4EF224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52388.91618 (Exim 4.92) (envelope-from ) id 1koshH-0001tF-DQ; Mon, 14 Dec 2020 18:35:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52388.91618; Mon, 14 Dec 2020 18:35:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshG-0001sh-Rh; Mon, 14 Dec 2020 18:35:46 +0000 Received: by outflank-mailman (input) for mailman id 52388; Mon, 14 Dec 2020 16:37:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqU-0006vN-JD for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:10 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id de156a27-9ec4-4675-91d3-84c974aff5bf; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaWYu006863; Mon, 14 Dec 2020 17:36:32 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaWeD021269; Mon, 14 Dec 2020 17:36:32 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id B9906AAC67; Mon, 14 Dec 2020 17:36:32 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: de156a27-9ec4-4675-91d3-84c974aff5bf From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 02/24] NetBSD doens't need xenbackendd with xl toolstack Date: Mon, 14 Dec 2020 17:36:01 +0100 Message-Id: <20201214163623.2127-3-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index ed71474421..757a560be0 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -18,7 +18,6 @@ SUBDIRS-$(CONFIG_X86) += firmware SUBDIRS-y += console SUBDIRS-y += xenmon SUBDIRS-y += xentop -SUBDIRS-$(CONFIG_NetBSD) += xenbackendd SUBDIRS-y += libfsimage SUBDIRS-$(CONFIG_Linux) += vchan From patchwork Mon Dec 14 16:36:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80489C2BBCD for ; Mon, 14 Dec 2020 18:36:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 195B222512 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 195B222512 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52376.91547 (Exim 4.92) (envelope-from ) id 1koshE-0001ni-Aw; Mon, 14 Dec 2020 18:35:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52376.91547; Mon, 14 Dec 2020 18:35:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshE-0001nX-59; Mon, 14 Dec 2020 18:35:44 +0000 Received: by outflank-mailman (input) for mailman id 52376; Mon, 14 Dec 2020 16:36:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqq0-0006vN-Hq for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:36:40 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id af584279-f0a1-4295-b802-776de9f7ff87; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaWHF022880; Mon, 14 Dec 2020 17:36:32 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaWlB002558; Mon, 14 Dec 2020 17:36:32 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id CBC52AAC67; Mon, 14 Dec 2020 17:36:32 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: af584279-f0a1-4295-b802-776de9f7ff87 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 03/24] Fix lock directory path for NetBSD Date: Mon, 14 Dec 2020 17:36:02 +0100 Message-Id: <20201214163623.2127-4-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/configure b/tools/configure index 8a708e9baa..131112c41e 100755 --- a/tools/configure +++ b/tools/configure @@ -4030,7 +4030,7 @@ XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts case "$host_os" in *freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;; -*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;; +*netbsd*) XEN_LOCK_DIR=$localstatedir/run ;; *) XEN_LOCK_DIR=$localstatedir/lock ;; esac From patchwork Mon Dec 14 16:36:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A669DC2BB9A for ; Mon, 14 Dec 2020 18:36:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F3C12256F for ; Mon, 14 Dec 2020 18:36:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F3C12256F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52386.91604 (Exim 4.92) (envelope-from ) id 1koshG-0001rz-NQ; Mon, 14 Dec 2020 18:35:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52386.91604; Mon, 14 Dec 2020 18:35:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshG-0001rW-Cw; Mon, 14 Dec 2020 18:35:46 +0000 Received: by outflank-mailman (input) for mailman id 52386; Mon, 14 Dec 2020 16:37:05 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqP-0006vN-If for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:05 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 67e0c9a6-fb09-457e-b95d-83f6c8056612; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXKv022303; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXZt022112; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id E245AAAC68; Mon, 14 Dec 2020 17:36:32 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 67e0c9a6-fb09-457e-b95d-83f6c8056612 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 04/24] Make xg_main.c build on NetBSD Date: Mon, 14 Dec 2020 17:36:03 +0100 Message-Id: <20201214163623.2127-5-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/debugger/gdbsx/xg/xg_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c index a4e8653168..fa2741ccf8 100644 --- a/tools/debugger/gdbsx/xg/xg_main.c +++ b/tools/debugger/gdbsx/xg/xg_main.c @@ -49,7 +49,11 @@ #include "xg_public.h" #include #include +#ifdef __NetBSD__ +#include +#else #include +#endif #include #include @@ -126,12 +130,19 @@ xg_init() int flags, saved_errno; XGTRC("E\n"); +#ifdef __NetBSD__ + if ((_dom0_fd=open("/kern/xen/privcmd", O_RDWR)) == -1) { + perror("Failed to open /kern/xen/privcmd\n"); + return -1; + } +#else if ((_dom0_fd=open("/dev/xen/privcmd", O_RDWR)) == -1) { if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) { perror("Failed to open /dev/xen/privcmd or /proc/xen/privcmd\n"); return -1; } } +#endif /* Although we return the file handle as the 'xc handle' the API * does not specify / guarentee that this integer is in fact * a file handle. Thus we must take responsiblity to ensure From patchwork Mon Dec 14 16:36:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F144C2BBCA for ; Mon, 14 Dec 2020 18:36:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2380B22525 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2380B22525 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52392.91638 (Exim 4.92) (envelope-from ) id 1koshI-0001xQ-Mb; Mon, 14 Dec 2020 18:35:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52392.91638; Mon, 14 Dec 2020 18:35:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshI-0001wh-Ak; Mon, 14 Dec 2020 18:35:48 +0000 Received: by outflank-mailman (input) for mailman id 52392; Mon, 14 Dec 2020 16:37:20 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqe-0006vN-JC for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:20 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3ee0e64c-6f61-4b85-982b-7d787e7a9922; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXek012603; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXpP018804; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 0C78EAAC66; Mon, 14 Dec 2020 17:36:32 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3ee0e64c-6f61-4b85-982b-7d787e7a9922 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 05/24] Introduce locking functions for block device setup on NetBSD Date: Mon, 14 Dec 2020 17:36:04 +0100 Message-Id: <20201214163623.2127-6-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/hotplug/NetBSD/Makefile | 1 + tools/hotplug/NetBSD/block | 5 ++- tools/hotplug/NetBSD/locking.sh | 72 +++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 tools/hotplug/NetBSD/locking.sh diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile index 6926885ab8..114b223207 100644 --- a/tools/hotplug/NetBSD/Makefile +++ b/tools/hotplug/NetBSD/Makefile @@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk # Xen script dir and scripts to go there. XEN_SCRIPTS = +XEN_SCRIPTS += locking.sh XEN_SCRIPTS += block XEN_SCRIPTS += vif-bridge XEN_SCRIPTS += vif-ip diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block index 32c20b6c89..23c8e38ebf 100644 --- a/tools/hotplug/NetBSD/block +++ b/tools/hotplug/NetBSD/block @@ -6,6 +6,7 @@ DIR=$(dirname "$0") . "${DIR}/hotplugpath.sh" +. "${DIR}/locking.sh" PATH=${bindir}:${sbindir}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin export PATH @@ -62,6 +63,7 @@ case $xstatus in available_disks="$available_disks $disk" eval $disk=free done + claim_lock block # Mark the used vnd(4) devices as ``used''. for disk in `sysctl hw.disknames`; do case $disk in @@ -77,6 +79,7 @@ case $xstatus in break fi done + release_lock block if [ x$device = x ] ; then error "no available vnd device" fi @@ -86,7 +89,7 @@ case $xstatus in device=$xparams ;; esac - physical_device=$(stat -f '%r' "$device") + physical_device=$(stat -L -f '%r' "$device") xenstore-write $xpath/physical-device $physical_device xenstore-write $xpath/hotplug-status connected exit 0 diff --git a/tools/hotplug/NetBSD/locking.sh b/tools/hotplug/NetBSD/locking.sh new file mode 100644 index 0000000000..88257f62b7 --- /dev/null +++ b/tools/hotplug/NetBSD/locking.sh @@ -0,0 +1,72 @@ +#!/bin/sh +# +# Copyright (c) 2016, Christoph Badura. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +LOCK_BASEDIR="$XEN_LOCK_DIR/xen-hotplug" + +_lockfd=9 +_have_lock=0 # lock not taken yet. + +SHLOCK="shlock ${_shlock_debug-}" + +_lock_set_vars() { + _lockfile="$LOCK_BASEDIR/$1.lock" + _lockfifo="$LOCK_BASEDIR/$1.fifo" +} + +_lock_init() { + mkdir -p "$LOCK_BASEDIR" 2>/dev/null || true + mkfifo $_lockfifo 2>/dev/null || true +} + +# +# use a named pipe as condition variable +# opening for read-only blocks when there's no writer. +# opening for read-write never blocks but unblocks any waiting readers. +# +_lock_wait_cv() { + eval "exec $_lockfd< $_lockfifo ; exec $_lockfd<&-" +} +_lock_signal_cv() { + eval "exec $_lockfd<> $_lockfifo ; exec $_lockfd<&-" +} + +claim_lock() { + _lock_set_vars $1 + _lock_init + until $SHLOCK -f $_lockfile -p $$; do + _lock_wait_cv + done + _have_lock=1 + # be sure to release the lock when the shell exits + trap "release_lock $1" 0 1 2 15 +} + +release_lock() { + _lock_set_vars $1 + [ "$_have_lock" != 0 -a -f $_lockfile ] && rm $_lockfile + _have_lock=0 + _lock_signal_cv; +} From patchwork Mon Dec 14 16:36:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16E00C4361B for ; Mon, 14 Dec 2020 18:36:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AB512250F for ; Mon, 14 Dec 2020 18:36:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AB512250F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52419.91798 (Exim 4.92) (envelope-from ) id 1koshl-0003F6-KP; Mon, 14 Dec 2020 18:36:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52419.91798; Mon, 14 Dec 2020 18:36:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshk-0003Di-75; Mon, 14 Dec 2020 18:36:16 +0000 Received: by outflank-mailman (input) for mailman id 52419; Mon, 14 Dec 2020 16:39:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqt-0006vN-JV for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:35 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 43a2499d-851f-42d2-b0b1-c68e681c84f0; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXng010884; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXBX017131; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 1CC31AAC68; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 43a2499d-851f-42d2-b0b1-c68e681c84f0 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 06/24] Handle the case where vifname is not present in xenstore. Date: Mon, 14 Dec 2020 17:36:05 +0100 Message-Id: <20201214163623.2127-7-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/hotplug/NetBSD/vif-bridge | 5 ++++- tools/hotplug/NetBSD/vif-ip | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/hotplug/NetBSD/vif-bridge b/tools/hotplug/NetBSD/vif-bridge index b58e922601..cd428b5936 100644 --- a/tools/hotplug/NetBSD/vif-bridge +++ b/tools/hotplug/NetBSD/vif-bridge @@ -23,7 +23,10 @@ case $xstatus in xbridge=$(xenstore-read "$xpath/bridge") xfid=$(xenstore-read "$xpath/frontend-id") xhandle=$(xenstore-read "$xpath/handle") - iface=$(xenstore-read "$xpath/vifname") + iface=$(xenstore-read "$xpath/vifname") || true + if [ x${iface} = "x" ] ; then + iface=xvif$xfid.$xhandle + fi ifconfig $iface up brconfig $xbridge add $iface xenstore-write $xpath/hotplug-status connected diff --git a/tools/hotplug/NetBSD/vif-ip b/tools/hotplug/NetBSD/vif-ip index 83cbfe20e2..944f50f881 100644 --- a/tools/hotplug/NetBSD/vif-ip +++ b/tools/hotplug/NetBSD/vif-ip @@ -24,6 +24,10 @@ case $xstatus in xfid=$(xenstore-read "$xpath/frontend-id") xhandle=$(xenstore-read "$xpath/handle") iface=$(xenstore-read "$xpath/vifname") + iface=$(xenstore-read "$xpath/vifname") || true + if [ x${iface} = "x" ] ; then + iface=xvif$xfid.$xhandle + fi ifconfig $iface $xip up xenstore-write $xpath/hotplug-status connected exit 0 From patchwork Mon Dec 14 16:36:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0BE9C4361B for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 479CA224D1 for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 479CA224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52396.91678 (Exim 4.92) (envelope-from ) id 1koshM-00025H-0U; Mon, 14 Dec 2020 18:35:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52396.91678; Mon, 14 Dec 2020 18:35:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshL-00024m-51; Mon, 14 Dec 2020 18:35:51 +0000 Received: by outflank-mailman (input) for mailman id 52396; Mon, 14 Dec 2020 16:39:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrS-0006vN-LG for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:10 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3300b86f-0b1d-4ac4-8ba9-60faeafc2272; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXKp004605; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaWlD002558; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 24E1CAAC65; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3300b86f-0b1d-4ac4-8ba9-60faeafc2272 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 07/24] Remove NetBSD's system headers. We'll use the system-provided ones, which are up to date. Date: Mon, 14 Dec 2020 17:36:06 +0100 Message-Id: <20201214163623.2127-8-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/include/Makefile | 2 +- tools/include/xen-sys/NetBSD/evtchn.h | 86 -------------------- tools/include/xen-sys/NetBSD/privcmd.h | 106 ------------------------- 3 files changed, 1 insertion(+), 193 deletions(-) delete mode 100644 tools/include/xen-sys/NetBSD/evtchn.h delete mode 100644 tools/include/xen-sys/NetBSD/privcmd.h diff --git a/tools/include/Makefile b/tools/include/Makefile index 4d4ec5f974..5e90179e66 100644 --- a/tools/include/Makefile +++ b/tools/include/Makefile @@ -68,7 +68,7 @@ install: all $(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(includedir)/xen/foreign $(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(includedir)/xen/hvm $(INSTALL_DATA) xen/io/*.h $(DESTDIR)$(includedir)/xen/io - $(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(includedir)/xen/sys + $(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(includedir)/xen/sys || true $(INSTALL_DATA) xen/xsm/*.h $(DESTDIR)$(includedir)/xen/xsm .PHONY: uninstall diff --git a/tools/include/xen-sys/NetBSD/evtchn.h b/tools/include/xen-sys/NetBSD/evtchn.h deleted file mode 100644 index 2d8a1f9164..0000000000 --- a/tools/include/xen-sys/NetBSD/evtchn.h +++ /dev/null @@ -1,86 +0,0 @@ -/* $NetBSD: evtchn.h,v 1.1.1.1 2007/06/14 19:39:45 bouyer Exp $ */ -/****************************************************************************** - * evtchn.h - * - * Interface to /dev/xen/evtchn. - * - * Copyright (c) 2003-2005, K A Fraser - * - * This file may be distributed separately from the Linux kernel, or - * incorporated into other software packages, subject to the following license: - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this source file (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifndef __NetBSD_EVTCHN_H__ -#define __NetBSD_EVTCHN_H__ - -/* - * Bind a fresh port to VIRQ @virq. - */ -#define IOCTL_EVTCHN_BIND_VIRQ \ - _IOWR('E', 4, struct ioctl_evtchn_bind_virq) -struct ioctl_evtchn_bind_virq { - unsigned int virq; - unsigned int port; -}; - -/* - * Bind a fresh port to remote <@remote_domain, @remote_port>. - */ -#define IOCTL_EVTCHN_BIND_INTERDOMAIN \ - _IOWR('E', 5, struct ioctl_evtchn_bind_interdomain) -struct ioctl_evtchn_bind_interdomain { - unsigned int remote_domain, remote_port; - unsigned int port; -}; - -/* - * Allocate a fresh port for binding to @remote_domain. - */ -#define IOCTL_EVTCHN_BIND_UNBOUND_PORT \ - _IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port) -struct ioctl_evtchn_bind_unbound_port { - unsigned int remote_domain; - unsigned int port; -}; - -/* - * Unbind previously allocated @port. - */ -#define IOCTL_EVTCHN_UNBIND \ - _IOW('E', 7, struct ioctl_evtchn_unbind) -struct ioctl_evtchn_unbind { - unsigned int port; -}; - -/* - * Send event to previously allocated @port. - */ -#define IOCTL_EVTCHN_NOTIFY \ - _IOW('E', 8, struct ioctl_evtchn_notify) -struct ioctl_evtchn_notify { - unsigned int port; -}; - -/* Clear and reinitialise the event buffer. Clear error condition. */ -#define IOCTL_EVTCHN_RESET \ - _IO('E', 9) - -#endif /* __NetBSD_EVTCHN_H__ */ diff --git a/tools/include/xen-sys/NetBSD/privcmd.h b/tools/include/xen-sys/NetBSD/privcmd.h deleted file mode 100644 index 555bad973e..0000000000 --- a/tools/include/xen-sys/NetBSD/privcmd.h +++ /dev/null @@ -1,106 +0,0 @@ -/* NetBSD: xenio.h,v 1.3 2005/05/24 12:07:12 yamt Exp $ */ - -/****************************************************************************** - * privcmd.h - * - * Copyright (c) 2003-2004, K A Fraser - * - * This file may be distributed separately from the Linux kernel, or - * incorporated into other software packages, subject to the following license: - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this source file (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifndef __NetBSD_PRIVCMD_H__ -#define __NetBSD_PRIVCMD_H__ - -/* Interface to /dev/xen/privcmd */ - -typedef struct privcmd_hypercall -{ - unsigned long op; - unsigned long arg[5]; - long retval; -} privcmd_hypercall_t; - -typedef struct privcmd_mmap_entry { - unsigned long va; - unsigned long mfn; - unsigned long npages; -} privcmd_mmap_entry_t; - -typedef struct privcmd_mmap { - int num; - domid_t dom; /* target domain */ - privcmd_mmap_entry_t *entry; -} privcmd_mmap_t; - -typedef struct privcmd_mmapbatch { - int num; /* number of pages to populate */ - domid_t dom; /* target domain */ - unsigned long addr; /* virtual address */ - unsigned long *arr; /* array of mfns - top nibble set on err */ -} privcmd_mmapbatch_t; - -typedef struct privcmd_blkmsg -{ - unsigned long op; - void *buf; - int buf_size; -} privcmd_blkmsg_t; - -/* - * @cmd: IOCTL_PRIVCMD_HYPERCALL - * @arg: &privcmd_hypercall_t - * Return: Value returned from execution of the specified hypercall. - */ -#define IOCTL_PRIVCMD_HYPERCALL \ - _IOWR('P', 0, privcmd_hypercall_t) - -#if defined(_KERNEL) -/* compat */ -#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN_OLD \ - _IO('P', 1) -#endif /* defined(_KERNEL) */ - -#define IOCTL_PRIVCMD_MMAP \ - _IOW('P', 2, privcmd_mmap_t) -#define IOCTL_PRIVCMD_MMAPBATCH \ - _IOW('P', 3, privcmd_mmapbatch_t) -#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \ - _IOR('P', 4, unsigned long) - -/* - * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN - * @arg: n/a - * Return: Port associated with domain-controller end of control event channel - * for the initial domain. - */ -#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \ - _IOR('P', 5, int) - -/* Interface to /dev/xenevt */ -/* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */ -#define EVTCHN_RESET _IO('E', 1) -/* EVTCHN_BIND: Bind to the specified event-channel port. */ -#define EVTCHN_BIND _IOW('E', 2, unsigned long) -/* EVTCHN_UNBIND: Unbind from the specified event-channel port. */ -#define EVTCHN_UNBIND _IOW('E', 3, unsigned long) - -#endif /* __NetBSD_PRIVCMD_H__ */ From patchwork Mon Dec 14 16:36:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2991C2BBD4 for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EA032250F for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EA032250F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52390.91627 (Exim 4.92) (envelope-from ) id 1koshH-0001v6-Vc; Mon, 14 Dec 2020 18:35:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52390.91627; Mon, 14 Dec 2020 18:35:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshH-0001uT-HJ; Mon, 14 Dec 2020 18:35:47 +0000 Received: by outflank-mailman (input) for mailman id 52390; Mon, 14 Dec 2020 16:37:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqZ-0006vN-JH for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:15 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 529ef58c-2875-4c18-8456-429b71c1dbf1; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaX4U008860; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaX6J007339; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 34CCCAAC68; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 529ef58c-2875-4c18-8456-429b71c1dbf1 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 08/24] Make libs/call build on NetBSD Date: Mon, 14 Dec 2020 17:36:07 +0100 Message-Id: <20201214163623.2127-9-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/call/netbsd.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/libs/call/netbsd.c b/tools/libs/call/netbsd.c index a5502da377..1a771e9928 100644 --- a/tools/libs/call/netbsd.c +++ b/tools/libs/call/netbsd.c @@ -19,12 +19,14 @@ * Split from xc_netbsd.c */ -#include "xc_private.h" #include #include #include +#include #include +#include +#include "private.h" int osdep_xencall_open(xencall_handle *xcall) { @@ -69,12 +71,13 @@ int osdep_xencall_close(xencall_handle *xcall) return close(fd); } -void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages) +void *osdep_alloc_pages(xencall_handle *xcall, size_t npages) { - size_t size = npages * XC_PAGE_SIZE; + size_t size = npages * PAGE_SIZE; void *p; + int ret; - ret = posix_memalign(&p, XC_PAGE_SIZE, size); + ret = posix_memalign(&p, PAGE_SIZE, size); if ( ret != 0 || !p ) return NULL; @@ -86,14 +89,13 @@ void *osdep_alloc_hypercall_buffer(xencall_handle *xcall, size_t npages) return p; } -void osdep_free_hypercall_buffer(xencall_handle *xcall, void *ptr, - size_t npages) +void osdep_free_pages(xencall_handle *xcall, void *ptr, size_t npages) { - (void) munlock(ptr, npages * XC_PAGE_SIZE); + (void) munlock(ptr, npages * PAGE_SIZE); free(ptr); } -int do_xen_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall) +int osdep_hypercall(xencall_handle *xcall, privcmd_hypercall_t *hypercall) { int fd = xcall->fd; int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall); From patchwork Mon Dec 14 16:36:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D432C2BB40 for ; Mon, 14 Dec 2020 18:36:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD92E224D1 for ; Mon, 14 Dec 2020 18:36:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD92E224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52374.91542 (Exim 4.92) (envelope-from ) id 1koshE-0001nG-0E; Mon, 14 Dec 2020 18:35:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52374.91542; Mon, 14 Dec 2020 18:35:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshD-0001n9-SK; Mon, 14 Dec 2020 18:35:43 +0000 Received: by outflank-mailman (input) for mailman id 52374; Mon, 14 Dec 2020 16:36:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqpv-0006vN-Ng for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:36:35 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2def1db3-153e-4a2f-8db9-8c5861d6e445; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXr1007897; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXTs001450; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 43F21AAC69; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2def1db3-153e-4a2f-8db9-8c5861d6e445 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 09/24] Use xen/xenio.h on NetBSD Date: Mon, 14 Dec 2020 17:36:08 +0100 Message-Id: <20201214163623.2127-10-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/call/private.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h index 21f992b37e..96922e03d5 100644 --- a/tools/libs/call/private.h +++ b/tools/libs/call/private.h @@ -7,13 +7,19 @@ #include #include +#ifdef __NetBSD__ +#include +#else #include +#endif #ifndef PAGE_SHIFT /* Mini-os, Yukk */ #define PAGE_SHIFT 12 #endif -#ifndef __MINIOS__ /* Yukk */ +#ifndef PAGE_SIZE #define PAGE_SIZE (1UL << PAGE_SHIFT) +#endif +#ifndef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) #endif From patchwork Mon Dec 14 16:36:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7AF0C2BB40 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 861F622525 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 861F622525 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52384.91594 (Exim 4.92) (envelope-from ) id 1koshG-0001r1-Aj; Mon, 14 Dec 2020 18:35:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52384.91594; Mon, 14 Dec 2020 18:35:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshF-0001qp-Ub; Mon, 14 Dec 2020 18:35:45 +0000 Received: by outflank-mailman (input) for mailman id 52384; Mon, 14 Dec 2020 16:37:00 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqK-0006vN-Ii for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:00 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 850d1873-3bc1-4c17-8819-5aba59513026; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXNY025686; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXTu001450; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 59050AAC67; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 850d1873-3bc1-4c17-8819-5aba59513026 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 10/24] Make libs/evtchn build on NetBSD Date: Mon, 14 Dec 2020 17:36:09 +0100 Message-Id: <20201214163623.2127-11-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/evtchn/netbsd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Roger Pau Monné diff --git a/tools/libs/evtchn/netbsd.c b/tools/libs/evtchn/netbsd.c index 8b8545d2f9..6d4ce28011 100644 --- a/tools/libs/evtchn/netbsd.c +++ b/tools/libs/evtchn/netbsd.c @@ -25,10 +25,10 @@ #include -#include - #include "private.h" +#include + #define EVTCHN_DEV_NAME "/dev/xenevt" int osdep_evtchn_open(xenevtchn_handle *xce) @@ -131,7 +131,7 @@ xenevtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce) int fd = xce->fd; evtchn_port_t port; - if ( read_exact(fd, (char *)&port, sizeof(port)) == -1 ) + if ( read(fd, (char *)&port, sizeof(port)) == -1 ) return -1; return port; @@ -140,7 +140,7 @@ xenevtchn_port_or_error_t xenevtchn_pending(xenevtchn_handle *xce) int xenevtchn_unmask(xenevtchn_handle *xce, evtchn_port_t port) { int fd = xce->fd; - return write_exact(fd, (char *)&port, sizeof(port)); + return write(fd, (char *)&port, sizeof(port)); } /* From patchwork Mon Dec 14 16:36:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E3F8C4361B for ; Mon, 14 Dec 2020 18:36:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D8D0224D1 for ; Mon, 14 Dec 2020 18:36:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D8D0224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52399.91708 (Exim 4.92) (envelope-from ) id 1koshR-0002I7-AX; Mon, 14 Dec 2020 18:35:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52399.91708; Mon, 14 Dec 2020 18:35:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshO-0002G2-RK; Mon, 14 Dec 2020 18:35:54 +0000 Received: by outflank-mailman (input) for mailman id 52399; Mon, 14 Dec 2020 16:39:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqy-0006vN-Jn for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:40 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 36f209d1-9377-407d-8c57-ce478a8fd182; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXAO005133; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXTw001450; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 6A40CAAC65; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 36f209d1-9377-407d-8c57-ce478a8fd182 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 11/24] Implement foreignmemory on NetBSD Date: Mon, 14 Dec 2020 17:36:10 +0100 Message-Id: <20201214163623.2127-12-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/foreignmemory/Makefile | 2 +- tools/libs/foreignmemory/netbsd.c | 76 ++++++++++++++++++++++++++---- tools/libs/foreignmemory/private.h | 10 +++- 3 files changed, 75 insertions(+), 13 deletions(-) diff --git a/tools/libs/foreignmemory/Makefile b/tools/libs/foreignmemory/Makefile index 13850f7988..f191cdbed0 100644 --- a/tools/libs/foreignmemory/Makefile +++ b/tools/libs/foreignmemory/Makefile @@ -8,7 +8,7 @@ SRCS-y += core.c SRCS-$(CONFIG_Linux) += linux.c SRCS-$(CONFIG_FreeBSD) += freebsd.c SRCS-$(CONFIG_SunOS) += compat.c solaris.c -SRCS-$(CONFIG_NetBSD) += compat.c netbsd.c +SRCS-$(CONFIG_NetBSD) += netbsd.c SRCS-$(CONFIG_MiniOS) += minios.c include $(XEN_ROOT)/tools/libs/libs.mk diff --git a/tools/libs/foreignmemory/netbsd.c b/tools/libs/foreignmemory/netbsd.c index 54a418ebd6..6d740ec2a3 100644 --- a/tools/libs/foreignmemory/netbsd.c +++ b/tools/libs/foreignmemory/netbsd.c @@ -19,7 +19,9 @@ #include #include +#include #include +#include #include "private.h" @@ -66,15 +68,17 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem) return close(fd); } -void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom, - void *addr, int prot, int flags, - xen_pfn_t *arr, int num) +void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem, + uint32_t dom, void *addr, + int prot, int flags, size_t num, + const xen_pfn_t arr[/*num*/], int err[/*num*/]) + { int fd = fmem->fd; - privcmd_mmapbatch_t ioctlx; - addr = mmap(addr, num*XC_PAGE_SIZE, prot, flags | MAP_ANON | MAP_SHARED, -1, 0); + privcmd_mmapbatch_v2_t ioctlx; + addr = mmap(addr, num*PAGE_SIZE, prot, flags | MAP_ANON | MAP_SHARED, -1, 0); if ( addr == MAP_FAILED ) { - PERROR("osdep_map_foreign_batch: mmap failed"); + PERROR("osdep_xenforeignmemory_map: mmap failed"); return NULL; } @@ -82,11 +86,12 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom, ioctlx.dom=dom; ioctlx.addr=(unsigned long)addr; ioctlx.arr=arr; - if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx) < 0 ) + ioctlx.err=err; + if ( ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH_V2, &ioctlx) < 0 ) { int saved_errno = errno; - PERROR("osdep_map_foreign_batch: ioctl failed"); - (void)munmap(addr, num*XC_PAGE_SIZE); + PERROR("osdep_xenforeignmemory_map: ioctl failed"); + (void)munmap(addr, num*PAGE_SIZE); errno = saved_errno; return NULL; } @@ -97,7 +102,58 @@ void *osdep_map_foreign_batch(xenforeignmem_handle *fmem, uint32_t dom, int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem, void *addr, size_t num) { - return munmap(addr, num*XC_PAGE_SIZE); + return munmap(addr, num*PAGE_SIZE); +} + +int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem, + domid_t domid) +{ + return 0; +} + +int osdep_xenforeignmemory_unmap_resource( + xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres) +{ + return fres ? munmap(fres->addr, fres->nr_frames << PAGE_SHIFT) : 0; +} + +int osdep_xenforeignmemory_map_resource( + xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres) +{ + privcmd_mmap_resource_t mr = { + .dom = fres->domid, + .type = fres->type, + .id = fres->id, + .idx = fres->frame, + .num = fres->nr_frames, + }; + int rc; + + fres->addr = mmap(fres->addr, fres->nr_frames << PAGE_SHIFT, + fres->prot, fres->flags | MAP_ANON | MAP_SHARED, -1, 0); + if ( fres->addr == MAP_FAILED ) + return -1; + + mr.addr = (uintptr_t)fres->addr; + + rc = ioctl(fmem->fd, IOCTL_PRIVCMD_MMAP_RESOURCE, &mr); + if ( rc ) + { + int saved_errno; + + if ( errno != fmem->unimpl_errno && errno != EOPNOTSUPP ) + PERROR("ioctl failed"); + else + errno = EOPNOTSUPP; + + saved_errno = errno; + (void)osdep_xenforeignmemory_unmap_resource(fmem, fres); + errno = saved_errno; + + return -1; + } + + return 0; } /* diff --git a/tools/libs/foreignmemory/private.h b/tools/libs/foreignmemory/private.h index 8f1bf081ed..abeceb8720 100644 --- a/tools/libs/foreignmemory/private.h +++ b/tools/libs/foreignmemory/private.h @@ -8,7 +8,13 @@ #include #include + +#ifdef __NetBSD__ +#include +#include +#else #include +#endif #ifndef PAGE_SHIFT /* Mini-os, Yukk */ #define PAGE_SHIFT 12 @@ -38,7 +44,7 @@ int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem, #if defined(__NetBSD__) || defined(__sun__) /* Strictly compat for those two only only */ -void *compat_mapforeign_batch(xenforeignmem_handle *fmem, uint32_t dom, +void *osdep_map_foreign_batch(xenforeignmemory_handle *fmem, uint32_t dom, void *addr, int prot, int flags, xen_pfn_t *arr, int num); #endif @@ -54,7 +60,7 @@ struct xenforeignmemory_resource_handle { int flags; }; -#ifndef __linux__ +#if !defined(__linux__) && !defined(__NetBSD__) static inline int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem, domid_t domid) { From patchwork Mon Dec 14 16:36:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56FACC3526A for ; Mon, 14 Dec 2020 18:36:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E3D0224D1 for ; Mon, 14 Dec 2020 18:36:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E3D0224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52397.91683 (Exim 4.92) (envelope-from ) id 1koshM-00027P-D5; Mon, 14 Dec 2020 18:35:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52397.91683; Mon, 14 Dec 2020 18:35:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshL-00026r-Tk; Mon, 14 Dec 2020 18:35:51 +0000 Received: by outflank-mailman (input) for mailman id 52397; Mon, 14 Dec 2020 16:39:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrr-0006vN-MO for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:35 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c384c0fc-48f1-4fa8-8421-2f70ab499674; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXYK008956; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXQ1024496; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 7F396AAC66; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c384c0fc-48f1-4fa8-8421-2f70ab499674 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 12/24] Implement gnttab on NetBSD Date: Mon, 14 Dec 2020 17:36:11 +0100 Message-Id: <20201214163623.2127-13-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/gnttab/Makefile | 2 +- tools/libs/gnttab/netbsd.c | 267 +++++++++++++++++++++++++++++++++++++ 2 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 tools/libs/gnttab/netbsd.c diff --git a/tools/libs/gnttab/Makefile b/tools/libs/gnttab/Makefile index d86c49d243..ae390ce60f 100644 --- a/tools/libs/gnttab/Makefile +++ b/tools/libs/gnttab/Makefile @@ -10,7 +10,7 @@ SRCS-GNTSHR += gntshr_core.c SRCS-$(CONFIG_Linux) += $(SRCS-GNTTAB) $(SRCS-GNTSHR) linux.c SRCS-$(CONFIG_MiniOS) += $(SRCS-GNTTAB) gntshr_unimp.c minios.c SRCS-$(CONFIG_FreeBSD) += $(SRCS-GNTTAB) $(SRCS-GNTSHR) freebsd.c +SRCS-$(CONFIG_NetBSD) += $(SRCS-GNTTAB) $(SRCS-GNTSHR) netbsd.c SRCS-$(CONFIG_SunOS) += gnttab_unimp.c gntshr_unimp.c -SRCS-$(CONFIG_NetBSD) += gnttab_unimp.c gntshr_unimp.c include $(XEN_ROOT)/tools/libs/libs.mk diff --git a/tools/libs/gnttab/netbsd.c b/tools/libs/gnttab/netbsd.c new file mode 100644 index 0000000000..2df7058cd7 --- /dev/null +++ b/tools/libs/gnttab/netbsd.c @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2007-2008, D G Murray + * Copyright (c) 2016-2017, Akshay Jaggi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; If not, see . + * + * Split out from linux.c + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "private.h" + +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) + +#define DEVXEN "/kern/xen/privcmd" + +int osdep_gnttab_open(xengnttab_handle *xgt) +{ + int fd = open(DEVXEN, O_RDWR|O_CLOEXEC); + + if ( fd == -1 ) + return -1; + xgt->fd = fd; + + return 0; +} + +int osdep_gnttab_close(xengnttab_handle *xgt) +{ + if ( xgt->fd == -1 ) + return 0; + + return close(xgt->fd); +} + +int osdep_gnttab_set_max_grants(xengnttab_handle *xgt, uint32_t count) +{ + return 0; +} + +void *osdep_gnttab_grant_map(xengnttab_handle *xgt, + uint32_t count, int flags, int prot, + uint32_t *domids, uint32_t *refs, + uint32_t notify_offset, + evtchn_port_t notify_port) +{ + uint32_t i; + int fd = xgt->fd; + struct ioctl_gntdev_mmap_grant_ref map; + void *addr = NULL; + int domids_stride; + unsigned int refs_size = count * sizeof(struct ioctl_gntdev_grant_ref); + int rv; + + domids_stride = (flags & XENGNTTAB_GRANT_MAP_SINGLE_DOMAIN) ? 0 : 1; + map.refs = malloc(refs_size); + + for ( i = 0; i < count; i++ ) + { + map.refs[i].domid = domids[i * domids_stride]; + map.refs[i].ref = refs[i]; + } + + map.count = count; + addr = mmap(NULL, count * PAGE_SIZE, + prot, flags | MAP_ANON | MAP_SHARED, -1, 0); + + if (map.va == MAP_FAILED) { + GTERROR(xgt->logger, "osdep_gnttab_grant_map: mmap failed"); + munmap((void *)map.va, count * PAGE_SIZE); + addr = MAP_FAILED; + } + map.va = addr; + + map.notify.offset = 0; + map.notify.action = 0; + if ( notify_offset < PAGE_SIZE * count ) + { + map.notify.offset = notify_offset; + map.notify.action |= UNMAP_NOTIFY_CLEAR_BYTE; + } + if ( notify_port != -1 ) + { + map.notify.event_channel_port = notify_port; + map.notify.action |= UNMAP_NOTIFY_SEND_EVENT; + } + + rv = ioctl(fd, IOCTL_GNTDEV_MMAP_GRANT_REF, &map); + if ( rv ) + { + GTERROR(xgt->logger, + "ioctl IOCTL_GNTDEV_MMAP_GRANT_REF failed: %d", rv); + munmap(addr, count * PAGE_SIZE); + addr = MAP_FAILED; + } + free(map.refs); + return addr; +} + +int osdep_gnttab_unmap(xengnttab_handle *xgt, + void *start_address, + uint32_t count) +{ + int rc; + if ( start_address == NULL ) + { + errno = EINVAL; + return -1; + } + + /* Next, unmap the memory. */ + rc = munmap(start_address, count * PAGE_SIZE); + + return rc; +} + +int osdep_gnttab_grant_copy(xengnttab_handle *xgt, + uint32_t count, + xengnttab_grant_copy_segment_t *segs) +{ + errno = ENOSYS; + return -1; +} + +int osdep_gntshr_open(xengntshr_handle *xgs) +{ + + int fd = open(DEVXEN, O_RDWR); + + if ( fd == -1 ) + return -1; + xgs->fd = fd; + + return 0; +} + +int osdep_gntshr_close(xengntshr_handle *xgs) +{ + if ( xgs->fd == -1 ) + return 0; + + return close(xgs->fd); +} + +void *osdep_gntshr_share_pages(xengntshr_handle *xgs, + uint32_t domid, int count, + uint32_t *refs, int writable, + uint32_t notify_offset, + evtchn_port_t notify_port) +{ + int err; + int fd = xgs->fd; + void *area = NULL; + struct ioctl_gntdev_alloc_grant_ref alloc; + + alloc.gref_ids = malloc(count * sizeof(uint32_t)); + if ( alloc.gref_ids == NULL ) + return NULL; + alloc.domid = domid; + alloc.flags = writable ? GNTDEV_ALLOC_FLAG_WRITABLE : 0; + alloc.count = count; + area = mmap(NULL, count * PAGE_SIZE, + PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); + + if (area == MAP_FAILED) { + GTERROR(xgs->logger, "osdep_gnttab_grant_map: mmap failed"); + area = MAP_FAILED; + goto out; + } + alloc.va = area; + + alloc.notify.offset = 0; + alloc.notify.action = 0; + if ( notify_offset < PAGE_SIZE * count ) + { + alloc.notify.offset = notify_offset; + alloc.notify.action |= UNMAP_NOTIFY_CLEAR_BYTE; + } + if ( notify_port != -1 ) + { + alloc.notify.event_channel_port = notify_port; + alloc.notify.action |= UNMAP_NOTIFY_SEND_EVENT; + } + err = ioctl(fd, IOCTL_GNTDEV_ALLOC_GRANT_REF, &alloc); + if ( err ) + { + GSERROR(xgs->logger, "IOCTL_GNTDEV_ALLOC_GRANT_REF failed"); + munmap(area, count * PAGE_SIZE); + area = MAP_FAILED; + goto out; + } + memcpy(refs, alloc.gref_ids, count * sizeof(uint32_t)); + + out: + free(alloc.gref_ids); + return area; +} + +int osdep_gntshr_unshare(xengntshr_handle *xgs, + void *start_address, uint32_t count) +{ + return munmap(start_address, count * PAGE_SIZE); +} + +/* + * The functions below are Linux-isms that will likely never be implemented + * on FreeBSD unless FreeBSD also implements something akin to Linux dmabuf. + */ +int osdep_gnttab_dmabuf_exp_from_refs(xengnttab_handle *xgt, uint32_t domid, + uint32_t flags, uint32_t count, + const uint32_t *refs, + uint32_t *dmabuf_fd) +{ + abort(); +} + +int osdep_gnttab_dmabuf_exp_wait_released(xengnttab_handle *xgt, + uint32_t fd, uint32_t wait_to_ms) +{ + abort(); +} + +int osdep_gnttab_dmabuf_imp_to_refs(xengnttab_handle *xgt, uint32_t domid, + uint32_t fd, uint32_t count, uint32_t *refs) +{ + abort(); +} + +int osdep_gnttab_dmabuf_imp_release(xengnttab_handle *xgt, uint32_t fd) +{ + abort(); +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Mon Dec 14 16:36:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03281C2BBD5 for ; Mon, 14 Dec 2020 18:36:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9B33224D1 for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9B33224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52378.91555 (Exim 4.92) (envelope-from ) id 1koshE-0001oQ-Ny; Mon, 14 Dec 2020 18:35:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52378.91555; Mon, 14 Dec 2020 18:35:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshE-0001o8-Fc; Mon, 14 Dec 2020 18:35:44 +0000 Received: by outflank-mailman (input) for mailman id 52378; Mon, 14 Dec 2020 16:36:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqq5-0006vN-JV for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:36:45 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1bf79bc0-6229-4603-89c1-3e683c759290; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXcQ012841; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXMp002012; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 8B14CAAC67; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1bf79bc0-6229-4603-89c1-3e683c759290 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 13/24] Don't assume tv_sec is a unsigned long (for NetBSD) Date: Mon, 14 Dec 2020 17:36:12 +0100 Message-Id: <20201214163623.2127-14-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/light/libxl_create.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Roger Pau Monné diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c index 321a13e519..44691010bc 100644 --- a/tools/libs/light/libxl_create.c +++ b/tools/libs/light/libxl_create.c @@ -496,7 +496,7 @@ int libxl__domain_build(libxl__gc *gc, vments[2] = "image/ostype"; vments[3] = "hvm"; vments[4] = "start_time"; - vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000); + vments[5] = GCSPRINTF("%jd.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000); localents = libxl__calloc(gc, 13, sizeof(char *)); i = 0; @@ -535,7 +535,7 @@ int libxl__domain_build(libxl__gc *gc, vments[i++] = "image/kernel"; vments[i++] = (char *) state->pv_kernel.path; vments[i++] = "start_time"; - vments[i++] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000); + vments[i++] = GCSPRINTF("%jd.%02d", (intmax_t)start_time.tv_sec,(int)start_time.tv_usec/10000); if (state->pv_ramdisk.path) { vments[i++] = "image/ramdisk"; vments[i++] = (char *) state->pv_ramdisk.path; @@ -1502,7 +1502,7 @@ static void domcreate_stream_done(libxl__egc *egc, vments[2] = "image/ostype"; vments[3] = "hvm"; vments[4] = "start_time"; - vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000); + vments[5] = GCSPRINTF("%jd.%02d", (intmax_t)start_time.tv_sec,(int)start_time.tv_usec/10000); break; case LIBXL_DOMAIN_TYPE_PV: vments = libxl__calloc(gc, 11, sizeof(char *)); @@ -1512,7 +1512,7 @@ static void domcreate_stream_done(libxl__egc *egc, vments[i++] = "image/kernel"; vments[i++] = (char *) state->pv_kernel.path; vments[i++] = "start_time"; - vments[i++] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000); + vments[i++] = GCSPRINTF("%jd.%02d", (intmax_t)start_time.tv_sec,(int)start_time.tv_usec/10000); if (state->pv_ramdisk.path) { vments[i++] = "image/ramdisk"; vments[i++] = (char *) state->pv_ramdisk.path; From patchwork Mon Dec 14 16:36:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31335C4361B for ; Mon, 14 Dec 2020 18:36:17 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E039D224D1 for ; Mon, 14 Dec 2020 18:36:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E039D224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52402.91747 (Exim 4.92) (envelope-from ) id 1koshb-0002oV-Lg; Mon, 14 Dec 2020 18:36:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52402.91747; Mon, 14 Dec 2020 18:36:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshZ-0002lg-Jq; Mon, 14 Dec 2020 18:36:05 +0000 Received: by outflank-mailman (input) for mailman id 52402; Mon, 14 Dec 2020 16:39:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrh-0006vN-Lq for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:25 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5f338a86-e757-4555-9dbd-e383e782b2e1; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXW1000190; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaWlF002558; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 9F8C5AAC67; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5f338a86-e757-4555-9dbd-e383e782b2e1 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 14/24] Pass bridge name to qemu and set XEN_DOMAIN_ID Date: Mon, 14 Dec 2020 17:36:13 +0100 Message-Id: <20201214163623.2127-15-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 Pass bridge name to qemu When starting qemu, set an environnement variable XEN_DOMAIN_ID, to be used by qemu helper scripts --- tools/libs/light/libxl_dm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index 3da83259c0..5948ace60d 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -761,6 +761,10 @@ static int libxl__build_device_model_args_old(libxl__gc *gc, int nr_set_cpus = 0; char *s; + static char buf[12]; + snprintf(buf, sizeof(buf), "%d", domid); + flexarray_append_pair(dm_envs, "XEN_DOMAIN_ID", buf); + if (b_info->kernel) { LOGD(ERROR, domid, "HVM direct kernel boot is not supported by " "qemu-xen-traditional"); @@ -1547,8 +1551,10 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, "-netdev"); flexarray_append(dm_args, GCSPRINTF("type=tap,id=net%d,ifname=%s," + "br=%s," "script=%s,downscript=%s", nics[i].devid, ifname, + nics[i].bridge, libxl_tapif_script(gc), libxl_tapif_script(gc))); @@ -1825,6 +1831,10 @@ static int libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, GCSPRINTF("%"PRId64, ram_size)); if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) { + static char buf[12]; + snprintf(buf, sizeof(buf), "%d", guest_domid); + flexarray_append_pair(dm_envs, "XEN_DOMAIN_ID", buf); + if (b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) flexarray_append_pair(dm_args, "-device", "ahci,id=ahci0"); for (i = 0; i < num_disks; i++) { From patchwork Mon Dec 14 16:36:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03008C2BB48 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8612822512 for ; Mon, 14 Dec 2020 18:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8612822512 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52395.91668 (Exim 4.92) (envelope-from ) id 1koshL-00022k-05; Mon, 14 Dec 2020 18:35:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52395.91668; Mon, 14 Dec 2020 18:35:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshK-00021l-5H; Mon, 14 Dec 2020 18:35:50 +0000 Received: by outflank-mailman (input) for mailman id 52395; Mon, 14 Dec 2020 16:39:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqj-0006vN-JB for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:25 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3cc2c6c1-de36-4084-bf41-baca4af23928; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXZL001596; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaX6L007339; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id ADC85AAC68; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3cc2c6c1-de36-4084-bf41-baca4af23928 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 15/24] Make libs/light build on NetBSD Date: Mon, 14 Dec 2020 17:36:14 +0100 Message-Id: <20201214163623.2127-16-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/light/libxl_dm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index 5948ace60d..c93bdf2cc9 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -3659,6 +3659,14 @@ static int kill_device_model_uid_child(libxl__destroy_devicemodel_state *ddms, LOGD(DEBUG, domid, "DM reaper: calling setresuid(%d, %d, 0)", reaper_uid, dm_kill_uid); +#ifdef __NetBSD__ + r = setuid(dm_kill_uid); + if (r) { + LOGED(ERROR, domid, "setuid to %d", dm_kill_uid); + rc = rc ?: ERROR_FAIL; + goto out; + } +#else /* __NetBSD__ */ r = setresuid(reaper_uid, dm_kill_uid, 0); if (r) { LOGED(ERROR, domid, "setresuid to (%d, %d, 0)", @@ -3666,6 +3674,7 @@ static int kill_device_model_uid_child(libxl__destroy_devicemodel_state *ddms, rc = rc ?: ERROR_FAIL; goto out; } +#endif /* __NetBSD__ */ /* * And kill everyone but me. From patchwork Mon Dec 14 16:36:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 804BEC4361B for ; Mon, 14 Dec 2020 18:36:23 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 43653224D1 for ; Mon, 14 Dec 2020 18:36:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43653224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52415.91773 (Exim 4.92) (envelope-from ) id 1koshg-00031u-VX; Mon, 14 Dec 2020 18:36:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52415.91773; Mon, 14 Dec 2020 18:36:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshe-0002zv-VH; Mon, 14 Dec 2020 18:36:10 +0000 Received: by outflank-mailman (input) for mailman id 52415; Mon, 14 Dec 2020 16:39:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqr3-0006vN-K2 for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:45 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5a4bbe2a-34ba-49bf-b439-89a8eb3a5f4a; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXws020700; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXU0001450; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id BE55BAAC66; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5a4bbe2a-34ba-49bf-b439-89a8eb3a5f4a From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 16/24] Switch NetBSD to QEMU_XEN (!traditional) Date: Mon, 14 Dec 2020 17:36:15 +0100 Message-Id: <20201214163623.2127-17-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/light/libxl_netbsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_netbsd.c b/tools/libs/light/libxl_netbsd.c index e66a393d7f..31334f932c 100644 --- a/tools/libs/light/libxl_netbsd.c +++ b/tools/libs/light/libxl_netbsd.c @@ -110,7 +110,7 @@ out: libxl_device_model_version libxl__default_device_model(libxl__gc *gc) { - return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; + return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; } int libxl__pci_numdevs(libxl__gc *gc) From patchwork Mon Dec 14 16:36:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972691 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EB0CC2BB48 for ; Mon, 14 Dec 2020 18:36:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC9F7224D1 for ; Mon, 14 Dec 2020 18:36:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC9F7224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52400.91724 (Exim 4.92) (envelope-from ) id 1koshV-0002V6-Ux; Mon, 14 Dec 2020 18:36:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52400.91724; Mon, 14 Dec 2020 18:36:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshS-0002Qo-Ab; Mon, 14 Dec 2020 18:35:58 +0000 Received: by outflank-mailman (input) for mailman id 52400; Mon, 14 Dec 2020 16:39:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqqo-0006vN-JO for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:30 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 518c5fc0-b439-4fb1-9fa8-41c5df3b2e58; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXl0021417; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaX6N007339; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id D0DE8AAC66; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 518c5fc0-b439-4fb1-9fa8-41c5df3b2e58 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 17/24] Make libs/light build on NetBSD Date: Mon, 14 Dec 2020 17:36:16 +0100 Message-Id: <20201214163623.2127-18-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:33 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/light/libxl_uuid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libs/light/libxl_uuid.c b/tools/libs/light/libxl_uuid.c index dadb79bad8..a8ee5f253e 100644 --- a/tools/libs/light/libxl_uuid.c +++ b/tools/libs/light/libxl_uuid.c @@ -82,7 +82,7 @@ void libxl_uuid_generate(libxl_uuid *uuid) uuid_enc_be(uuid->uuid, &nat_uuid); } -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__NetBSD__) int libxl_uuid_from_string(libxl_uuid *uuid, const char *in) { uint32_t status; @@ -120,7 +120,7 @@ void libxl_uuid_clear(libxl_uuid *uuid) memset(&uuid->uuid, 0, sizeof(uuid->uuid)); } -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__NetBSD__) int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2) { uuid_t nat_uuid1, nat_uuid2; From patchwork Mon Dec 14 16:36:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34471C2BB40 for ; Mon, 14 Dec 2020 18:36:24 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2226224D1 for ; Mon, 14 Dec 2020 18:36:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2226224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52418.91786 (Exim 4.92) (envelope-from ) id 1koshj-0003A9-LI; Mon, 14 Dec 2020 18:36:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52418.91786; Mon, 14 Dec 2020 18:36:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshi-000381-15; Mon, 14 Dec 2020 18:36:14 +0000 Received: by outflank-mailman (input) for mailman id 52418; Mon, 14 Dec 2020 16:39:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrI-0006vN-Kd for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:00 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 66502db2-5ab0-4a6e-a577-5b48f32b7801; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaXBI008620; Mon, 14 Dec 2020 17:36:33 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaXb6020782; Mon, 14 Dec 2020 17:36:33 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id E6B77AAC66; Mon, 14 Dec 2020 17:36:33 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 66502db2-5ab0-4a6e-a577-5b48f32b7801 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 18/24] xeneventchn_stubs.c doens't need xen/sys/evtchn.h (NetBSD fix) Date: Mon, 14 Dec 2020 17:36:17 +0100 Message-Id: <20201214163623.2127-19-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/ocaml/libs/eventchn/xeneventchn_stubs.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Roger Pau Monné diff --git a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c index ba40078d09..f889a7a2e4 100644 --- a/tools/ocaml/libs/eventchn/xeneventchn_stubs.c +++ b/tools/ocaml/libs/eventchn/xeneventchn_stubs.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #define CAML_NAME_SPACE From patchwork Mon Dec 14 16:36:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22346C2BB40 for ; Mon, 14 Dec 2020 18:36:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFB16224D1 for ; Mon, 14 Dec 2020 18:36:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFB16224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52401.91735 (Exim 4.92) (envelope-from ) id 1koshY-0002fc-Q7; Mon, 14 Dec 2020 18:36:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52401.91735; Mon, 14 Dec 2020 18:36:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshW-0002by-C9; Mon, 14 Dec 2020 18:36:02 +0000 Received: by outflank-mailman (input) for mailman id 52401; Mon, 14 Dec 2020 16:39:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrN-0006vN-Kv for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:05 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2c42ed7b-9363-41a8-b7e8-ed1062ae1223; Mon, 14 Dec 2020 16:36:34 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaYbe026385; Mon, 14 Dec 2020 17:36:34 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaYbT014229; Mon, 14 Dec 2020 17:36:34 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 0101BAAC66; Mon, 14 Dec 2020 17:36:34 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2c42ed7b-9363-41a8-b7e8-ed1062ae1223 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 19/24] errno may not be a gobal R/W variable, use a local variable instead (fix build on NetBSD) Date: Mon, 14 Dec 2020 17:36:18 +0100 Message-Id: <20201214163623.2127-20-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/xenpaging/xenpaging.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index 33098046c2..39c8c83b4b 100644 --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -180,10 +180,11 @@ static int xenpaging_get_tot_pages(struct xenpaging *paging) static void *init_page(void) { void *buffer; + int rc; /* Allocated page memory */ - errno = posix_memalign(&buffer, XC_PAGE_SIZE, XC_PAGE_SIZE); - if ( errno != 0 ) + rc = posix_memalign(&buffer, XC_PAGE_SIZE, XC_PAGE_SIZE); + if ( rc != 0 ) return NULL; /* Lock buffer in memory so it can't be paged out */ From patchwork Mon Dec 14 16:36:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0F97C2D0E4 for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BE8022512 for ; Mon, 14 Dec 2020 18:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BE8022512 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52394.91658 (Exim 4.92) (envelope-from ) id 1koshJ-0001zy-U4; Mon, 14 Dec 2020 18:35:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52394.91658; Mon, 14 Dec 2020 18:35:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshJ-0001yw-8y; Mon, 14 Dec 2020 18:35:49 +0000 Received: by outflank-mailman (input) for mailman id 52394; Mon, 14 Dec 2020 16:39:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrD-0006vN-KY for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:55 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cb74707c-f3c6-477f-b60f-5f9713a046bb; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaY9l012882; Mon, 14 Dec 2020 17:36:34 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaYu8020075; Mon, 14 Dec 2020 17:36:34 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 11BAFAAC66; Mon, 14 Dec 2020 17:36:34 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cb74707c-f3c6-477f-b60f-5f9713a046bb From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 20/24] If FILENAME_MAX is defined, use it instead of arbitrary value (fix format-truncation errors with GCC >= 7) Date: Mon, 14 Dec 2020 17:36:19 +0100 Message-Id: <20201214163623.2127-21-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/xenpmd/xenpmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c index 12b82cf43e..cfd22e64e3 100644 --- a/tools/xenpmd/xenpmd.c +++ b/tools/xenpmd/xenpmd.c @@ -101,7 +101,11 @@ FILE *get_next_battery_file(DIR *battery_dir, { FILE *file = 0; struct dirent *dir_entries; +#ifdef FILENAME_MAX + char file_name[FILENAME_MAX]; +#else char file_name[284]; +#endif int ret; do From patchwork Mon Dec 14 16:36:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22043C2BB48 for ; Mon, 14 Dec 2020 18:36:29 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3459224D1 for ; Mon, 14 Dec 2020 18:36:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3459224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52420.91809 (Exim 4.92) (envelope-from ) id 1koshn-0003Ke-N4; Mon, 14 Dec 2020 18:36:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52420.91809; Mon, 14 Dec 2020 18:36:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshm-0003Ie-04; Mon, 14 Dec 2020 18:36:18 +0000 Received: by outflank-mailman (input) for mailman id 52420; Mon, 14 Dec 2020 16:39:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrc-0006vN-Lp for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:20 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8bcad583-616e-4839-92f7-87b1ad9ad5fa; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaYZu023577; Mon, 14 Dec 2020 17:36:34 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaYxu022690; Mon, 14 Dec 2020 17:36:34 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 22A26AAC66; Mon, 14 Dec 2020 17:36:34 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8bcad583-616e-4839-92f7-87b1ad9ad5fa From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 21/24] Fix unused functions/variables error Date: Mon, 14 Dec 2020 17:36:20 +0100 Message-Id: <20201214163623.2127-22-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/stat/xenstat_netbsd.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tools/libs/stat/xenstat_netbsd.c b/tools/libs/stat/xenstat_netbsd.c index 6e9d6aee10..64eda9e1ae 100644 --- a/tools/libs/stat/xenstat_netbsd.c +++ b/tools/libs/stat/xenstat_netbsd.c @@ -55,11 +55,6 @@ get_priv_data(xenstat_handle *handle) } /* Expected format of /proc/net/dev */ -static const char PROCNETDEV_HEADER[] = - "Inter-| Receive |" - " Transmit\n" - " face |bytes packets errs drop fifo frame compressed multicast|" - "bytes packets errs drop fifo colls carrier compressed\n"; /* Collect information about networks */ int xenstat_collect_networks(xenstat_node * node) @@ -76,12 +71,6 @@ void xenstat_uninit_networks(xenstat_handle * handle) fclose(priv->procnetdev); } -static int read_attributes_vbd(const char *vbd_directory, const char *what, char *ret, int cap) -{ - /* XXX implement */ - return 0; -} - /* Collect information about VBDs */ int xenstat_collect_vbds(xenstat_node * node) { From patchwork Mon Dec 14 16:36:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4830AC2BB48 for ; Mon, 14 Dec 2020 18:36:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC806224D1 for ; Mon, 14 Dec 2020 18:36:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC806224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52398.91696 (Exim 4.92) (envelope-from ) id 1koshO-0002CM-68; Mon, 14 Dec 2020 18:35:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52398.91696; Mon, 14 Dec 2020 18:35:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshM-00029u-Rf; Mon, 14 Dec 2020 18:35:52 +0000 Received: by outflank-mailman (input) for mailman id 52398; Mon, 14 Dec 2020 16:39:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqr8-0006vN-KF for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:37:50 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a833fa82-3c8c-441c-9cab-68892c90c994; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaYlm002086; Mon, 14 Dec 2020 17:36:34 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaY9S010884; Mon, 14 Dec 2020 17:36:34 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 354D6AAC66; Mon, 14 Dec 2020 17:36:34 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a833fa82-3c8c-441c-9cab-68892c90c994 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 22/24] If PTHREAD_STACK_MIN is not defined, use DEFAULT_THREAD_STACKSIZE Date: Mon, 14 Dec 2020 17:36:21 +0100 Message-Id: <20201214163623.2127-23-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/store/xs.c | 4 ++++ 1 file changed, 4 insertions(+) Reviewed-by: Roger Pau Monné diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c index 4ac73ec317..8e646b98d6 100644 --- a/tools/libs/store/xs.c +++ b/tools/libs/store/xs.c @@ -811,9 +811,13 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token) #ifdef USE_PTHREAD #define DEFAULT_THREAD_STACKSIZE (16 * 1024) +#ifndef PTHREAD_STACK_MIN +#define READ_THREAD_STACKSIZE DEFAULT_THREAD_STACKSIZE +#else #define READ_THREAD_STACKSIZE \ ((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ? \ PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE) +#endif /* We dynamically create a reader thread on demand. */ mutex_lock(&h->request_mutex); From patchwork Mon Dec 14 16:36:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E979C4361B for ; Mon, 14 Dec 2020 18:36:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49C59224D1 for ; Mon, 14 Dec 2020 18:36:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49C59224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52421.91821 (Exim 4.92) (envelope-from ) id 1koshq-0003RX-3D; Mon, 14 Dec 2020 18:36:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52421.91821; Mon, 14 Dec 2020 18:36:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kosho-0003QQ-Fp; Mon, 14 Dec 2020 18:36:20 +0000 Received: by outflank-mailman (input) for mailman id 52421; Mon, 14 Dec 2020 16:39:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrX-0006vN-LY for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:15 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id fcbac439-46ba-41f8-8fb9-3b1a9d40e0c3; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaYjL018346; Mon, 14 Dec 2020 17:36:34 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaYxR010544; Mon, 14 Dec 2020 17:36:34 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 44A4CAAC66; Mon, 14 Dec 2020 17:36:34 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fcbac439-46ba-41f8-8fb9-3b1a9d40e0c3 From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 23/24] Use xen/xenio.h on NetBSD Date: Mon, 14 Dec 2020 17:36:22 +0100 Message-Id: <20201214163623.2127-24-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/ctrl/xc_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h index f0b5f83ac8..68e388f488 100644 --- a/tools/libs/ctrl/xc_private.h +++ b/tools/libs/ctrl/xc_private.h @@ -39,7 +39,11 @@ #include #include +#ifdef __NetBSD__ +#include +#else #include +#endif #include From patchwork Mon Dec 14 16:36:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Bouyer X-Patchwork-Id: 11972695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A831EC4361B for ; Mon, 14 Dec 2020 18:36:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62938224D1 for ; Mon, 14 Dec 2020 18:36:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62938224D1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=netbsd.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.52403.91760 (Exim 4.92) (envelope-from ) id 1koshe-0002vN-2f; Mon, 14 Dec 2020 18:36:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 52403.91760; Mon, 14 Dec 2020 18:36:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koshc-0002tE-8S; Mon, 14 Dec 2020 18:36:08 +0000 Received: by outflank-mailman (input) for mailman id 52403; Mon, 14 Dec 2020 16:39:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1koqrm-0006vN-Lw for xen-devel@lists.xenproject.org; Mon, 14 Dec 2020 16:38:30 +0000 Received: from isis.lip6.fr (unknown [2001:660:3302:283c::2]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id aa988afb-11e3-4515-8642-5030b4b9fb4a; Mon, 14 Dec 2020 16:36:35 +0000 (UTC) Received: from asim.lip6.fr (asim.lip6.fr [132.227.86.2]) by isis.lip6.fr (8.15.2/8.15.2) with ESMTP id 0BEGaYF2021664; Mon, 14 Dec 2020 17:36:34 +0100 (CET) Received: from borneo.soc.lip6.fr (borneo [132.227.103.47]) by asim.lip6.fr (8.15.2/8.14.4) with ESMTP id 0BEGaY2G005438; Mon, 14 Dec 2020 17:36:34 +0100 (MET) Received: by borneo.soc.lip6.fr (Postfix, from userid 373) id 555F5AAC66; Mon, 14 Dec 2020 17:36:34 +0100 (MET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: aa988afb-11e3-4515-8642-5030b4b9fb4a From: Manuel Bouyer To: xen-devel@lists.xenproject.org Cc: Manuel Bouyer Subject: [PATCH 24/24] Fix error: array subscript has type 'char' [-Werror=char-subscripts] Date: Mon, 14 Dec 2020 17:36:23 +0100 Message-Id: <20201214163623.2127-25-bouyer@netbsd.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201214163623.2127-1-bouyer@netbsd.org> References: <20201214163623.2127-1-bouyer@netbsd.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (isis.lip6.fr [132.227.60.2]); Mon, 14 Dec 2020 17:36:34 +0100 (CET) X-Scanned-By: MIMEDefang 2.78 on 132.227.60.2 --- tools/libs/light/libxl_qmp.c | 2 +- tools/xentrace/xentrace.c | 2 +- xen/tools/symbols.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/libs/light/libxl_qmp.c b/tools/libs/light/libxl_qmp.c index c394000ea9..9b638e6f54 100644 --- a/tools/libs/light/libxl_qmp.c +++ b/tools/libs/light/libxl_qmp.c @@ -1249,7 +1249,7 @@ static int qmp_error_class_to_libxl_error_code(libxl__gc *gc, se++; continue; } - if (tolower(*s) != tolower(*se)) + if (tolower((unsigned char)*s) != tolower((unsigned char)*se)) break; s++, se++; } diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c index 4b50b8a53e..a8903ebf46 100644 --- a/tools/xentrace/xentrace.c +++ b/tools/xentrace/xentrace.c @@ -957,7 +957,7 @@ static int parse_cpumask_range(const char *mask_str, xc_cpumap_t map) { unsigned int a, b; int nmaskbits; - char c; + unsigned char c; int in_range; const char *s; diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c index 9f9e2c9900..0b12452616 100644 --- a/xen/tools/symbols.c +++ b/xen/tools/symbols.c @@ -173,11 +173,11 @@ static int read_symbol(FILE *in, struct sym_entry *s) /* include the type field in the symbol name, so that it gets * compressed together */ s->len = strlen(str) + 1; - if (islower(stype) && filename) + if (islower((unsigned char)stype) && filename) s->len += strlen(filename) + 1; s->sym = malloc(s->len + 1); sym = SYMBOL_NAME(s); - if (islower(stype) && filename) { + if (islower((unsigned char)stype) && filename) { sym = stpcpy(sym, filename); *sym++ = '#'; }