Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2596862pxa; Mon, 24 Aug 2020 20:05:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVSoE2UQfvk+tBOZTJucCU29rVG7/G7l5loAHIlwhT9svhF1rzFrbegAI7yPMO2g9RsKxY X-Received: by 2002:a17:906:f292:: with SMTP id gu18mr8694080ejb.24.1598324747110; Mon, 24 Aug 2020 20:05:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598324747; cv=none; d=google.com; s=arc-20160816; b=a3p2gRxi2s/HO+l0z98G/nfXV8IR5ql5Rtg/lzmcdGb+IJ7Zgs+3kIhLQ6Tvo5rLiG cT7rvzvgO05np14xznJcr6g+q9km4n9PWMCCy0eZIcAHtsB6+xgwLHhl0WnA54GAO/rm 36odj1rsazapuYXhWirQ/sJmqbeOsBj9bholLfrhxvXNqalq2XY2aNo7CJ+eJGebd/ZH RsInPbdrEIMUkYozLA1y6qM4VUV9bc7s4ngOjeu0m2r/ErSfRiRGGGOTpII3KncWlVqa YdkNJlBsgxL1YkUJHkW4hfsWLxdBfC6DMnpGNl2EAtD2x2ZiTWn+mZylgr0Z6sJicL8T urlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=5zhRPU3HmYLfhE9Ywxmvx2rln/hgS1kDS4fW6WbB5ck=; b=o4nOehT1rLbVy8+yn3snO08HCBiw7jT89vew88VAjTi+W59hi3slvfh5CCCqofJGxj bCV0q3Hh2iSj4GooDrB+sDvBxZvLsawauG4E3XBFbQY7hFBAoPvtCoQB9rElX2UMGVOr 3ODqrjGgubGRgEYvpWlS5Hfxv/W6CSCKdctpiNoG8qGXuuOIlBaOhCV3GvB7NscuMc6I F86qWwpZQPcGShgOkkljvXMbSqFyfUMSGZJoWvOUEey+mVFSj9ugTV96lPQyYhHzkmn2 z94+IXh8fYFCpGfqRTwsWydetYJeuzHFtF0K5Z7RZtFWMcrunaMMKqu7lvPELq2hEJ0K hSoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg15si9181791edb.524.2020.08.24.20.05.23; Mon, 24 Aug 2020 20:05:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728386AbgHYCuf (ORCPT + 99 others); Mon, 24 Aug 2020 22:50:35 -0400 Received: from mga18.intel.com ([134.134.136.126]:37715 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728059AbgHYCuf (ORCPT ); Mon, 24 Aug 2020 22:50:35 -0400 IronPort-SDR: Qors4iWZYbqBXt/lBn3qkyABnoJ/iY1V4p6wqYxvklu9+BSNv6hP+LzBt5BIQ1Y6AUlbliNmFJ 7eOFojAjiROA== X-IronPort-AV: E=McAfee;i="6000,8403,9723"; a="143690740" X-IronPort-AV: E=Sophos;i="5.76,350,1592895600"; d="scan'208";a="143690740" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 19:50:35 -0700 IronPort-SDR: NkhXhGX6ymmoKAr1PyR+oG9ovyZnpt0ypxbAzBsBp1uiMDpfdl8wXKzSLi1RJdt8OIwA4GUUH5 tThq4ViqQ2Zg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,350,1592895600"; d="scan'208";a="312409680" Received: from shsi6026.sh.intel.com ([10.239.147.135]) by orsmga002.jf.intel.com with ESMTP; 24 Aug 2020 19:50:31 -0700 From: shuo.a.liu@intel.com To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sean Christopherson , Yu Wang , Reinette Chatre , x86@kernel.org, Shuo Liu Subject: [PATCH 00/17] HSM driver for ACRN hypervisor Date: Tue, 25 Aug 2020 10:45:00 +0800 Message-Id: <20200825024516.16766-1-shuo.a.liu@intel.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shuo Liu ACRN is a Type 1 reference hypervisor stack, running directly on the bare-metal hardware, and is suitable for a variety of IoT and embedded device solutions. ACRN implements a hybrid VMM architecture, using a privileged Service VM. The Service VM manages the system resources (CPU, memory, etc.) and I/O devices of User VMs. Multiple User VMs are supported, with each of them running Linux, Android OS or Windows. Both Service VM and User VMs are guest VM. Below figure shows the architecture. Service VM User VM +----------------------------+ | +------------------+ | +--------------+ | | | | | |ACRN userspace| | | | | | +--------------+ | | | | |-----------------ioctl------| | | | ... |kernel space +----------+ | | | | | | HSM | | | | Drivers | | +----------+ | | | | +--------------------|-------+ | +------------------+ +---------------------hypercall----------------------------------------+ | ACRN Hypervisor | +----------------------------------------------------------------------+ | Hardware | +----------------------------------------------------------------------+ There is only one Service VM which could run Linux as OS. In a typical case, the Service VM will be auto started when ACRN Hypervisor is booted. Then the ACRN userspace (an application running in Service VM) could be used to start/stop User VMs by communicating with ACRN Hypervisor Service Module (HSM). ACRN Hypervisor Service Module (HSM) is a middle layer that allows the ACRN userspace and Service VM OS kernel to communicate with ACRN Hypervisor and manage different User VMs. This middle layer provides the following functionalities, - Issues hypercalls to the hypervisor to manage User VMs: * VM/vCPU management * Memory management * Device passthrough * Interrupts injection - I/O requests handling from User VMs. - Exports ioctl through HSM char device. - Exports function calls for other kernel modules ACRN is focused on embedded system. So it doesn't support some features. E.g., - ACRN doesn't support VM migration. - ACRN doesn't support vCPU migration. This patch set adds the HSM to the Linux kernel. The basic ARCN support was merged to upstream already. https://lore.kernel.org/lkml/1559108037-18813-3-git-send-email-yakui.zhao@intel.com/ Shuo Liu (16): docs: acrn: Introduce ACRN x86/acrn: Introduce acrn_{setup, remove}_intr_handler() x86/acrn: Introduce hypercall interfaces virt: acrn: Introduce ACRN HSM basic driver virt: acrn: Introduce VM management interfaces virt: acrn: Introduce an ioctl to set vCPU registers state virt: acrn: Introduce EPT mapping management virt: acrn: Introduce I/O request management virt: acrn: Introduce PCI configuration space PIO accesses combiner virt: acrn: Introduce interfaces for PCI device passthrough virt: acrn: Introduce interrupt injection interfaces virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor virt: acrn: Introduce I/O ranges operation interfaces virt: acrn: Introduce ioeventfd virt: acrn: Introduce irqfd virt: acrn: Introduce an interface for Service VM to control vCPU Yin Fengwei (1): x86/acrn: Introduce an API to check if a VM is privileged .../userspace-api/ioctl/ioctl-number.rst | 1 + Documentation/virt/acrn/index.rst | 11 + Documentation/virt/acrn/introduction.rst | 40 ++ Documentation/virt/acrn/io-request.rst | 97 +++ Documentation/virt/index.rst | 1 + MAINTAINERS | 9 + arch/x86/include/asm/acrn.h | 74 ++ arch/x86/kernel/cpu/acrn.c | 38 +- drivers/virt/Kconfig | 2 + drivers/virt/Makefile | 1 + drivers/virt/acrn/Kconfig | 15 + drivers/virt/acrn/Makefile | 3 + drivers/virt/acrn/acrn_drv.h | 225 ++++++ drivers/virt/acrn/hsm.c | 439 ++++++++++++ drivers/virt/acrn/hypercall.h | 266 ++++++++ drivers/virt/acrn/ioeventfd.c | 275 ++++++++ drivers/virt/acrn/ioreq.c | 638 ++++++++++++++++++ drivers/virt/acrn/irqfd.c | 236 +++++++ drivers/virt/acrn/mm.c | 298 ++++++++ drivers/virt/acrn/vm.c | 120 ++++ include/uapi/linux/acrn.h | 499 ++++++++++++++ 21 files changed, 3287 insertions(+), 1 deletion(-) create mode 100644 Documentation/virt/acrn/index.rst create mode 100644 Documentation/virt/acrn/introduction.rst create mode 100644 Documentation/virt/acrn/io-request.rst create mode 100644 arch/x86/include/asm/acrn.h create mode 100644 drivers/virt/acrn/Kconfig create mode 100644 drivers/virt/acrn/Makefile create mode 100644 drivers/virt/acrn/acrn_drv.h create mode 100644 drivers/virt/acrn/hsm.c create mode 100644 drivers/virt/acrn/hypercall.h create mode 100644 drivers/virt/acrn/ioeventfd.c create mode 100644 drivers/virt/acrn/ioreq.c create mode 100644 drivers/virt/acrn/irqfd.c create mode 100644 drivers/virt/acrn/mm.c create mode 100644 drivers/virt/acrn/vm.c create mode 100644 include/uapi/linux/acrn.h base-commit: 18445bf405cb331117bc98427b1ba6f12418ad17 -- 2.28.0