[PATCH v2 05/17] virt: acrn: Introduce ACRN HSM basic driver

2020-09-03 Thread shuo . a . liu
From: Shuo Liu ACRN Hypervisor Service Module (HSM) is a kernel module in Service VM which communicates with ACRN userspace through ioctls and talks to ACRN Hypervisor through hypercalls. Add a basic HSM driver which allows Service VM userspace to communicate with ACRN. The following patches wil

Re: [PATCH 06/17] virt: acrn: Introduce VM management interfaces

2020-08-30 Thread Shuo A Liu
Hi Greg, On Sun 30.Aug'20 at 9:23:42 +0200, Greg Kroah-Hartman wrote: On Sat, Aug 29, 2020 at 07:04:36PM +0800, Shuo A Liu wrote: On Fri 28.Aug'20 at 12:27:38 +0200, Greg Kroah-Hartman wrote: > On Tue, Aug 25, 2020 at 10:45:06AM +0800, shuo.a@intel.com wrote: >

Re: [PATCH 05/17] virt: acrn: Introduce ACRN HSM basic driver

2020-08-30 Thread Shuo A Liu
Hi Dave, On Sat 29.Aug'20 at 9:12:22 -0700, Dave Hansen wrote: On 8/29/20 3:46 AM, Shuo A Liu wrote: On Fri 28.Aug'20 at 12:25:59 +0200, Greg Kroah-Hartman wrote: On Tue, Aug 25, 2020 at 10:45:05AM +0800, shuo.a@intel.com wrote: +static long acrn_dev_ioctl(struct file *filp

Re: [PATCH 06/17] virt: acrn: Introduce VM management interfaces

2020-08-29 Thread Shuo A Liu
Hi Greg, On Fri 28.Aug'20 at 12:27:38 +0200, Greg Kroah-Hartman wrote: On Tue, Aug 25, 2020 at 10:45:06AM +0800, shuo.a@intel.com wrote: + default: + pr_warn("Unknown IOCTL 0x%x!\n", cmd); + ret = -EINVAL; Wrong error value here, right? Right, it should

Re: [PATCH 06/17] virt: acrn: Introduce VM management interfaces

2020-08-29 Thread Shuo A Liu
Hi Greg, On Fri 28.Aug'20 at 12:27:04 +0200, Greg Kroah-Hartman wrote: On Tue, Aug 25, 2020 at 10:45:06AM +0800, shuo.a@intel.com wrote: From: Shuo Liu The VM management interfaces expose several VM operations to ACRN userspace via ioctls. For example, creating VM, starting VM, destroying

Re: [PATCH 05/17] virt: acrn: Introduce ACRN HSM basic driver

2020-08-29 Thread Shuo A Liu
Hi Greg, On Fri 28.Aug'20 at 12:25:59 +0200, Greg Kroah-Hartman wrote: On Tue, Aug 25, 2020 at 10:45:05AM +0800, shuo.a@intel.com wrote: +static long acrn_dev_ioctl(struct file *filp, unsigned int cmd, + unsigned long ioctl_param) +{ + if (cmd == ACRN_IOCTL_GE

[PATCH 10/17] virt: acrn: Introduce PCI configuration space PIO accesses combiner

2020-08-24 Thread shuo . a . liu
From: Shuo Liu A User VM can access its virtual PCI configuration spaces via port IO approach, which has two following steps: 1) writes address into port 0xCF8 2) put/get data in/from port 0xCFC To distribute a complete PCI configuration space access one time, HSM need to combine such two acce

[PATCH 17/17] virt: acrn: Introduce an interface for Service VM to control vCPU

2020-08-24 Thread shuo . a . liu
From: Shuo Liu ACRN supports partition mode to achieve real-time requirements. In partition mode, a CPU core can be dedicated to a vCPU of User VM. The local APIC of the dedicated CPU core can be passthrough to the User VM. The Service VM controls the assignment of the CPU cores. Introduce an in

[PATCH 07/17] virt: acrn: Introduce an ioctl to set vCPU registers state

2020-08-24 Thread shuo . a . liu
From: Shuo Liu A virtual CPU of User VM has different context due to the different registers state. ACRN userspace needs to set the virtual CPU registers state (e.g. giving a initial registers state to a virtual BSP of a User VM). HSM provides an ioctl ACRN_IOCTL_SET_VCPU_REGS to do the virtual

[PATCH 15/17] virt: acrn: Introduce ioeventfd

2020-08-24 Thread shuo . a . liu
From: Shuo Liu ioeventfd is a mechanism to register PIO/MMIO regions to trigger an eventfd signal when written to by a User VM. ACRN userspace can register any arbitrary I/O address with a corresponding eventfd and then pass the eventfd to a specific end-point of interest for handling. Vhost is

[PATCH 13/17] virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor

2020-08-24 Thread shuo . a . liu
From: Shuo Liu The C-states and P-states data are used to support CPU power management. The hypervisor controls C-states and P-states for a User VM. ACRN userspace need to query the data from the hypervisor to build ACPI tables for a User VM. HSM provides ioctls for ACRN userspace to query C-st

[PATCH 11/17] virt: acrn: Introduce interfaces for PCI device passthrough

2020-08-24 Thread shuo . a . liu
From: Shuo Liu PCI device passthrough enables an OS in a virtual machine to directly access a PCI device in the host. It promises almost the native performance, which is required in performance-critical scenarios of ACRN. HSM provides the following ioctls: - Assign - ACRN_IOCTL_ASSIGN_PCIDEV

[PATCH 14/17] virt: acrn: Introduce I/O ranges operation interfaces

2020-08-24 Thread shuo . a . liu
From: Shuo Liu An I/O request of a User VM, which is constructed by hypervisor, is distributed by the ACRN Hypervisor Service Module to an I/O client corresponding to the address range of the I/O request. I/O client maintains a list of address ranges. Introduce acrn_ioreq_range_{add,del}() to ma

[PATCH 16/17] virt: acrn: Introduce irqfd

2020-08-24 Thread shuo . a . liu
From: Shuo Liu irqfd is a mechanism to inject a specific interrupt to a User VM using a decoupled eventfd mechanism. Vhost is a kernel-level virtio server which uses eventfd for interrupt injection. To support vhost on ACRN, irqfd is introduced in HSM. HSM provides ioctls to associate a virtual

[PATCH 09/17] virt: acrn: Introduce I/O request management

2020-08-24 Thread shuo . a . liu
From: Shuo Liu An I/O request of a User VM, which is constructed by the hypervisor, is distributed by the ACRN Hypervisor Service Module to an I/O client corresponding to the address range of the I/O request. For each User VM, there is a shared 4-KByte memory region used for I/O requests communi

[PATCH 12/17] virt: acrn: Introduce interrupt injection interfaces

2020-08-24 Thread shuo . a . liu
From: Shuo Liu ACRN userspace need to inject virtual interrupts into a User VM in devices emulation. HSM needs provide interfaces to do so. Introduce following interrupt injection interfaces: ioctl ACRN_IOCTL_SET_IRQLINE: Pass data from userspace to the hypervisor, and inform the hypervisor

[PATCH 08/17] virt: acrn: Introduce EPT mapping management

2020-08-24 Thread shuo . a . liu
From: Shuo Liu The HSM provides hypervisor services to the ACRN userspace. While launching a User VM, ACRN userspace needs to allocate memory and request the ACRN Hypervisor to set up the EPT mapping for the VM. A mapping cache is introduced for accelerating the translation between the Service V

[PATCH 04/17] x86/acrn: Introduce hypercall interfaces

2020-08-24 Thread shuo . a . liu
From: Shuo Liu The Service VM communicates with the hypervisor via conventional hypercalls. VMCALL instruction is used to make the hypercalls. ACRN hypercall ABI: * Hypercall number is in R8 register. * Up to 2 parameters are in RDI and RSI registers. * Return value is in RAX register. In

[PATCH 03/17] x86/acrn: Introduce an API to check if a VM is privileged

2020-08-24 Thread shuo . a . liu
From: Yin Fengwei ACRN Hypervisor reports hypervisor features via CPUID leaf 0x4001 which is similar to KVM. A VM can check if it's the privileged VM using the feature bits. The Service VM is the only privileged VM by design. Signed-off-by: Yin Fengwei Signed-off-by: Shuo Liu Reviewed-by:

[PATCH 01/17] docs: acrn: Introduce ACRN

2020-08-24 Thread shuo . a . liu
From: Shuo Liu Add documentation on the following aspects of ACRN: 1) A brief introduction on the architecture of ACRN. 2) I/O request handling in ACRN. To learn more about ACRN, please go to ACRN project website https://projectacrn.org, or the documentation page https://projectacrn.github.

[PATCH 05/17] virt: acrn: Introduce ACRN HSM basic driver

2020-08-24 Thread shuo . a . liu
From: Shuo Liu ACRN Hypervisor Service Module (HSM) is a kernel module in Service VM which communicates with ACRN userspace through ioctls and talks to ACRN Hypervisor through hypercalls. Add a basic HSM driver which allows Service VM userspace to communicate with ACRN. The following patches wil

[PATCH 06/17] virt: acrn: Introduce VM management interfaces

2020-08-24 Thread shuo . a . liu
From: Shuo Liu The VM management interfaces expose several VM operations to ACRN userspace via ioctls. For example, creating VM, starting VM, destroying VM and so on. The ACRN Hypervisor needs to exchange data with the ACRN userspace during the VM operations. HSM provides VM operation ioctls to

[PATCH 00/17] HSM driver for ACRN hypervisor

2020-08-24 Thread shuo . a . liu
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,

[PATCH 02/17] x86/acrn: Introduce acrn_{setup, remove}_intr_handler()

2020-08-24 Thread shuo . a . liu
From: Shuo Liu The ACRN Hypervisor builds an I/O request when a trapped I/O access happens in User VM. Then, ACRN Hypervisor issues an upcall by sending a notification interrupt to the Service VM. HSM in the Service VM needs to hook the notification interrupt to handle I/O requests. Notification

<    1   2   3