From patchwork Mon Jun 1 13:21:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tamas K Lengyel X-Patchwork-Id: 11582055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E94B13B6 for ; Mon, 1 Jun 2020 13:23:25 +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 64A022077D for ; Mon, 1 Jun 2020 13:23:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64A022077D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jfkOA-0006a6-Dz; Mon, 01 Jun 2020 13:22:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jfkO9-0006Zz-SF for xen-devel@lists.xenproject.org; Mon, 01 Jun 2020 13:22:01 +0000 X-Inumbo-ID: ddea53d0-a40a-11ea-ab1b-12813bfff9fa Received: from mga12.intel.com (unknown [192.55.52.136]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ddea53d0-a40a-11ea-ab1b-12813bfff9fa; Mon, 01 Jun 2020 13:21:56 +0000 (UTC) IronPort-SDR: Ji+TwovGG1LW3mC7YDXtNoadPZpzsZgTKai+7RNf0SB1nKJj3xYVIwGblJs44kWIDMGttKAe2H WuVxZrpAZHRg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2020 06:21:54 -0700 IronPort-SDR: vyNToxXCPi1GYxEewQa8wW777KqdP2qZ/RwvvSPnmhxqv3gdY14S+abDy4+ksqb8Di5N8DUPHz Jb66VM7jxTIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,460,1583222400"; d="scan'208";a="303887260" Received: from alayek-mobl.amr.corp.intel.com (HELO ubuntu.localdomain) ([10.209.11.99]) by orsmga008.jf.intel.com with ESMTP; 01 Jun 2020 06:21:54 -0700 From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Subject: [PATCH v19 for-4.14 02/13] tools/libxc: xc_memshr_fork with interrupts blocked Date: Mon, 1 Jun 2020 06:21:36 -0700 Message-Id: <03b382a38c62b5431c63d00f9acffacf43b55c1d.1591017086.git.tamas.lengyel@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , Tamas K Lengyel , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Toolstack side for creating forks with interrupt injection blocked. Signed-off-by: Tamas K Lengyel Reviewed-by: Roger Pau Monné Acked-by: Ian Jackson Acked-by: Wei Liu --- tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_memshr.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index f9e17ae424..5eeee1de46 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -2241,7 +2241,8 @@ int xc_memshr_range_share(xc_interface *xch, int xc_memshr_fork(xc_interface *xch, uint32_t source_domain, uint32_t client_domain, - bool allow_with_iommu); + bool allow_with_iommu, + bool block_interrupts); /* * Note: this function is only intended to be used on short-lived forks that diff --git a/tools/libxc/xc_memshr.c b/tools/libxc/xc_memshr.c index 2300cc7075..a6cfd7dccf 100644 --- a/tools/libxc/xc_memshr.c +++ b/tools/libxc/xc_memshr.c @@ -240,7 +240,7 @@ int xc_memshr_debug_gref(xc_interface *xch, } int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid, - bool allow_with_iommu) + bool allow_with_iommu, bool block_interrupts) { xen_mem_sharing_op_t mso; @@ -251,6 +251,8 @@ int xc_memshr_fork(xc_interface *xch, uint32_t pdomid, uint32_t domid, if ( allow_with_iommu ) mso.u.fork.flags |= XENMEM_FORK_WITH_IOMMU_ALLOWED; + if ( block_interrupts ) + mso.u.fork.flags |= XENMEM_FORK_BLOCK_INTERRUPTS; return xc_memshr_memop(xch, domid, &mso); }