From patchwork Thu May 30 14:18:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petre Ovidiu PIRCALABU X-Patchwork-Id: 10968935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31B2C1902 for ; Thu, 30 May 2019 14:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 242D228AD9 for ; Thu, 30 May 2019 14:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14D8E28609; Thu, 30 May 2019 14:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E89E028600 for ; Thu, 30 May 2019 14:20:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hWLsz-00036p-3r; Thu, 30 May 2019 14:18:29 +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.89) (envelope-from ) id 1hWLsy-00036Z-5E for xen-devel@lists.xenproject.org; Thu, 30 May 2019 14:18:28 +0000 X-Inumbo-ID: c9a33f00-82e5-11e9-82a2-030d3ed30760 Received: from mx01.bbu.dsd.mx.bitdefender.com (unknown [91.199.104.161]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c9a33f00-82e5-11e9-82a2-030d3ed30760; Thu, 30 May 2019 14:18:26 +0000 (UTC) Received: from smtp.bitdefender.com (smtp02.buh.bitdefender.net [10.17.80.76]) by mx01.bbu.dsd.mx.bitdefender.com (Postfix) with ESMTPS id 095733011FC2; Thu, 30 May 2019 17:18:25 +0300 (EEST) Received: from bitdefender.com (unknown [195.189.155.70]) by smtp.bitdefender.com (Postfix) with ESMTPSA id D0D8C306E4AC; Thu, 30 May 2019 17:18:24 +0300 (EEST) From: Petre Pircalabu To: xen-devel@lists.xenproject.org Date: Thu, 30 May 2019 17:18:14 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 0/9] Per vcpu vm_event channels X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Petre Pircalabu , Stefano Stabellini , Razvan Cojocaru , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Tamas K Lengyel , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patchset adds a new mechanism of sending synchronous vm_event requests and handling vm_event responses without using a ring. As each synchronous request pauses the vcpu until the corresponding response is handled, it can be stored in a slotted memory buffer (one per vcpu) shared between the hypervisor and the controlling domain. The main advantages of this approach are: - the ability to dynamicaly allocate the necessary memory used to hold the requests/responses (the size of vm_event_request_t/vm_event_response_t can grow unrestricted by the ring's one page limitation) - the ring's waitqueue logic is unnecessary in this case because the vcpu sending the request is blocked until a response is received. Petre Pircalabu (9): tools/libxc: Consistent usage of xc_vm_event_* interface vm_event: Define VM_EVENT type vm_event: Make ‘local’ functions ‘static’ vm_event: Remove "ring" suffix from vm_event_check_ring vm_event: Simplify vm_event interface vm_event: Move struct vm_event_domain to vm_event.c vm_event: Decouple implementation details from interface. vm_event: Add vm_event_ng interface xen-access: Add support for vm_event_ng interface tools/libxc/include/xenctrl.h | 56 +--- tools/libxc/xc_mem_paging.c | 23 +- tools/libxc/xc_memshr.c | 34 --- tools/libxc/xc_monitor.c | 46 ++- tools/libxc/xc_private.h | 16 +- tools/libxc/xc_vm_event.c | 175 +++++++----- tools/tests/xen-access/Makefile | 7 +- tools/tests/xen-access/vm-event-ng.c | 210 ++++++++++++++ tools/tests/xen-access/vm-event.c | 193 +++++++++++++ tools/tests/xen-access/xen-access.c | 408 ++++++++++----------------- tools/tests/xen-access/xen-access.h | 91 ++++++ tools/xenpaging/xenpaging.c | 42 +-- xen/arch/arm/mem_access.c | 2 +- xen/arch/x86/mm.c | 5 + xen/arch/x86/mm/mem_access.c | 4 +- xen/arch/x86/mm/mem_paging.c | 2 +- xen/arch/x86/mm/mem_sharing.c | 5 +- xen/arch/x86/mm/p2m.c | 11 +- xen/common/Makefile | 1 + xen/common/domctl.c | 7 + xen/common/mem_access.c | 2 +- xen/common/monitor.c | 4 +- xen/common/vm_event.c | 527 ++++++++++++++++++----------------- xen/common/vm_event_ng.c | 449 +++++++++++++++++++++++++++++ xen/drivers/passthrough/pci.c | 2 +- xen/include/public/domctl.h | 101 +++---- xen/include/public/memory.h | 2 + xen/include/public/vm_event.h | 47 ++++ xen/include/xen/sched.h | 25 +- xen/include/xen/vm_event.h | 80 +++++- 30 files changed, 1720 insertions(+), 857 deletions(-) create mode 100644 tools/tests/xen-access/vm-event-ng.c create mode 100644 tools/tests/xen-access/vm-event.c create mode 100644 tools/tests/xen-access/xen-access.h create mode 100644 xen/common/vm_event_ng.c