Re: [PATCH v2] virt: acrn: Fix document of acrn_msi_inject()

2021-03-10 Thread Shuo A Liu
On Wed 10.Mar'21 at 18:27:53 +0100, Greg Kroah-Hartman wrote: On Thu, Mar 11, 2021 at 12:05:38AM +0800, Shuo Liu wrote: This fixes below build warning. ../drivers/virt/acrn/vm.c:105: warning: expecting prototype for acrn_inject_msi(). Prototype was for acrn_msi_inject() instead That's

[PATCH] virt: acrn: Correct type casting of argument of copy_from_user()

2021-03-10 Thread shuo . a . liu
From: Shuo Liu hsm.c:336:50: warning: incorrect type in argument 2 (different address spaces) hsm.c:336:50:expected void const [noderef] __user *from hsm.c:336:50:got void * This patch fixes above sparse warning. Fixes: 3d679d5aec64 ("virt: acrn: Introduce interfaces to query C-s

[PATCH] virt: acrn: Fix document of acrn_msi_inject()

2021-03-10 Thread shuo . a . liu
From: Shuo Liu This fixes below sparse warning. ../drivers/virt/acrn/vm.c:105: warning: expecting prototype for acrn_inject_msi(). Prototype was for acrn_msi_inject() instead Fixes: c7cf8d27244f ("virt: acrn: Introduce interrupt injection interfaces") Reported-by: kernel test robot

Re: [PATCH] virt: acrn: Use EPOLLIN instead of POLLIN

2021-03-10 Thread Shuo A Liu
se vfs_poll() instead of f_op->poll()") Reported-by: kernel test robot Signed-off-by: Yejune Deng Thanks for the patch. Acked-by: Shuo Liu --- drivers/virt/acrn/irqfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virt/acrn/irqfd.c b/drivers/virt/ac

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

2021-03-03 Thread Shuo A Liu
On Wed 3.Mar'21 at 18:37:19 +0100, Borislav Petkov wrote: On Sun, Feb 07, 2021 at 11:10:39AM +0800, shuo.a@intel.com wrote: 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

Re: [PATCH] virt: acrn: add hotplug_cpu dependency

2021-02-25 Thread Shuo A Liu
On Fri 26.Feb'21 at 7:25:18 +0100, Greg Kroah-Hartman wrote: On Fri, Feb 26, 2021 at 09:38:07AM +0800, Shuo A Liu wrote: Hi Arnd, There is already a patchset for this build issue. Please refer to https://lore.kernel.org/lkml/20210221134339.57851-1-shuo.a@intel.com/. Hi Greg, Would you

Re: [PATCH] virt: acrn: add hotplug_cpu dependency

2021-02-25 Thread Shuo A Liu
Hi Arnd, There is already a patchset for this build issue. Please refer to https://lore.kernel.org/lkml/20210221134339.57851-1-shuo.a@intel.com/. Hi Greg, Would you like accept that patchset in you tree? Thanks shuo On Thu 25.Feb'21 at 14:38:30 +0100, Arnd Bergmann wrote: From: Arnd

Re: [PATCH RESEND v2 2/2] virt: acrn: Make remove_cpu sysfs invisible with !CONFIG_HOTPLUG_CPU

2021-02-23 Thread Shuo A Liu
Hi, On Tue 23.Feb'21 at 15:25:30 +, Qais Yousef wrote: On 02/21/21 21:43, shuo.a@intel.com wrote: From: Shuo Liu Without cpu hotplug support, vCPU cannot be removed from a Service VM. Don't expose remove_cpu sysfs when CONFIG_HOTPLUG_CPU disabled. Signed-off-by: Shuo Liu Acked

[PATCH RESEND v2 2/2] virt: acrn: Make remove_cpu sysfs invisible with !CONFIG_HOTPLUG_CPU

2021-02-21 Thread shuo . a . liu
From: Shuo Liu Without cpu hotplug support, vCPU cannot be removed from a Service VM. Don't expose remove_cpu sysfs when CONFIG_HOTPLUG_CPU disabled. Signed-off-by: Shuo Liu Acked-by: Randy Dunlap # build-tested Cc: Stephen Rothwell Cc: Thomas Gleixner Cc: Greg Kroah-Hartman Cc: Qais

[PATCH RESEND v2 1/2] cpu/hotplug: Fix build error of using {add,remove}_cpu() with !CONFIG_SMP

2021-02-21 Thread shuo . a . liu
From: Shuo Liu 279dcf693ac7 ("virt: acrn: Introduce an interface for Service VM to control vCPU") introduced {add,remove}_cpu() usage and it hit below error with !CONFIG_SMP: ../drivers/virt/acrn/hsm.c: In function ‘remove_cpu_store’: ../drivers/virt/acrn/hsm.c:389:3: error

[PATCH RESEND] virt: acrn: Use vfs_poll() instead of f_op->poll()

2021-02-21 Thread shuo . a . liu
From: Yejune Deng Use a more advanced function vfs_poll() in acrn_irqfd_assign(). At the same time, modify the definition of events. Signed-off-by: Yejune Deng Signed-off-by: Shuo Liu --- drivers/virt/acrn/irqfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] virt: acrn: Use vfs_poll() instead of f_op->poll()

2021-02-21 Thread Shuo A Liu
On Sun 21.Feb'21 at 8:54:06 +0100, Greg Kroah-Hartman wrote: On Sun, Feb 21, 2021 at 09:50:42AM +0800, Liu, Shuo A wrote: On 2/20/2021 22:53, Yejune Deng wrote: > Use vfs_poll() is a more advanced function in acrn_irqfd_assign(). > as the same time, modify the definition of

Re: [PATCH] virt: acrn: Use vfs_poll() instead of f_op->poll()

2021-02-20 Thread Shuo A Liu
Thanks for the patch. On Fri 19.Feb'21 at 17:26:12 +0800, Yejune Deng wrote: In acrn_irqfd_assign(), use vfs_poll() is a more advanced function, as the same time, modify the definition of events. Signed-off-by: Yejune Deng --- drivers/virt/acrn/irqfd.c | 4 ++-- 1 file changed, 2

[PATCH v2 2/2] virt: acrn: Make remove_cpu sysfs invisible with !CONFIG_HOTPLUG_CPU

2021-02-12 Thread shuo . a . liu
From: Shuo Liu Without cpu hotplug support, vCPU cannot be removed from a Service VM. Don't expose remove_cpu sysfs when CONFIG_HOTPLUG_CPU disabled. Signed-off-by: Shuo Liu --- drivers/virt/acrn/hsm.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/virt/acrn/hsm.c b

[PATCH v2 1/2] cpu/hotplug: Fix build error of using {add,remove}_cpu() with !CONFIG_SMP

2021-02-12 Thread shuo . a . liu
From: Shuo Liu 279dcf693ac7 ("virt: acrn: Introduce an interface for Service VM to control vCPU") introduced {add,remove}_cpu() usage and it hit below error with !CONFIG_SMP: ../drivers/virt/acrn/hsm.c: In function ‘remove_cpu_store’: ../drivers/virt/acrn/hsm.c:389:3: error

Re: [PATCH] virt: acrn: Fix vCPU removing code build error

2021-02-12 Thread Shuo A Liu
On Fri 12.Feb'21 at 12:02:18 +0100, Greg Kroah-Hartman wrote: On Fri, Feb 12, 2021 at 06:58:53PM +0800, Shuo A Liu wrote: Hi Greg, On Fri 12.Feb'21 at 8:52:33 +0100, Greg Kroah-Hartman wrote: > On Fri, Feb 12, 2021 at 12:57:24PM +0800, shuo.a@intel.com wrote: > > From:

Re: [PATCH] virt: acrn: Fix vCPU removing code build error

2021-02-12 Thread Shuo A Liu
Hi Greg, On Fri 12.Feb'21 at 8:52:33 +0100, Greg Kroah-Hartman wrote: On Fri, Feb 12, 2021 at 12:57:24PM +0800, shuo.a@intel.com wrote: From: Shuo Liu vCPU removing code depends on CONFIG_HOTPLUG_CPU as it uses remove_cpu() and add_cpu(). Make the vCPU removing interface building

[PATCH] virt: acrn: Fix vCPU removing code build error

2021-02-11 Thread shuo . a . liu
From: Shuo Liu vCPU removing code depends on CONFIG_HOTPLUG_CPU as it uses remove_cpu() and add_cpu(). Make the vCPU removing interface building with CONFIG_HOTPLUG_CPU. ../drivers/virt/acrn/hsm.c: In function ‘remove_cpu_store’: ../drivers/virt/acrn/hsm.c:389:3: error: implicit declaration

Re: [PATCH v9 00/18] HSM driver for ACRN hypervisor

2021-02-09 Thread Shuo A Liu
On Tue 9.Feb'21 at 11:00:55 +0100, Greg Kroah-Hartman wrote: On Sun, Feb 07, 2021 at 11:10:22AM +0800, shuo.a@intel.com wrote: 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

Re: [PATCH v9 01/18] docs: acrn: Introduce ACRN

2021-02-08 Thread Shuo A Liu
Hi Randy, On Mon 8.Feb'21 at 11:48:07 -0800, Randy Dunlap wrote: On 2/6/21 7:10 PM, shuo.a@intel.com wrote: 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. 3) CPUID functions

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

2021-02-06 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

[PATCH v9 18/18] sample/acrn: Introduce a sample of HSM ioctl interface usage

2021-02-06 Thread shuo . a . liu
From: Shuo Liu Launch a simple guest (with several instructions as payload) on ACRN with demonstration ioctl usage. Signed-off-by: Shuo Liu --- samples/acrn/Makefile| 12 samples/acrn/guest.ld| 9 +++ samples/acrn/payload.ld | 9 +++ samples/acrn/vm-sample.c | 136

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

2021-02-06 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

[PATCH v9 16/18] virt: acrn: Introduce irqfd

2021-02-06 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

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

2021-02-06 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

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

2021-02-06 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 v9 10/18] virt: acrn: Introduce PCI configuration space PIO accesses combiner

2021-02-06 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

[PATCH v9 15/18] virt: acrn: Introduce ioeventfd

2021-02-06 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

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

2021-02-06 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

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

2021-02-06 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 v9 07/18] virt: acrn: Introduce an ioctl to set vCPU registers state

2021-02-06 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 v9 08/18] virt: acrn: Introduce EPT mapping management

2021-02-06 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

[PATCH v9 04/18] x86/acrn: Introduce hypercall interfaces

2021-02-06 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

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

2021-02-06 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

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

2021-02-06 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

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

2021-02-06 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

[PATCH v9 03/18] x86/acrn: Introduce acrn_cpuid_base() and hypervisor feature bits

2021-02-06 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

[PATCH v9 01/18] docs: acrn: Introduce ACRN

2021-02-06 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. 3) CPUID functions of ACRN. To learn more about ACRN, please go to ACRN project website https://projectacrn.org, or the documentation

[PATCH v9 00/18] HSM driver for ACRN hypervisor

2021-02-06 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

Re: [PATCH v8 15/18] virt: acrn: Introduce ioeventfd

2021-01-28 Thread Shuo A Liu
On Wed 27.Jan'21 at 15:20:34 +0100, Greg Kroah-Hartman wrote: On Fri, Jan 22, 2021 at 07:01:19PM +0800, shuo.a@intel.com wrote: 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

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

2021-01-22 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

[PATCH v8 03/18] x86/acrn: Introduce acrn_cpuid_base() and hypervisor feature bits

2021-01-22 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

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

2021-01-22 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

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

2021-01-22 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

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

2021-01-22 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

[PATCH v8 04/18] x86/acrn: Introduce hypercall interfaces

2021-01-22 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

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

2021-01-22 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 v8 12/18] virt: acrn: Introduce interrupt injection interfaces

2021-01-22 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 v8 18/18] sample/acrn: Introduce a sample of HSM ioctl interface usage

2021-01-22 Thread shuo . a . liu
From: Shuo Liu Launch a simple guest (with several instructions as payload) on ACRN with demonstration ioctl usage. Signed-off-by: Shuo Liu --- samples/acrn/Makefile| 12 samples/acrn/guest.ld| 9 +++ samples/acrn/payload.ld | 9 +++ samples/acrn/vm-sample.c | 136

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

2021-01-22 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

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

2021-01-22 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

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

2021-01-22 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

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

2021-01-22 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

[PATCH v8 15/18] virt: acrn: Introduce ioeventfd

2021-01-22 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

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

2021-01-22 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 v8 16/18] virt: acrn: Introduce irqfd

2021-01-22 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

[PATCH v8 00/18] HSM driver for ACRN hypervisor

2021-01-22 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 v8 10/18] virt: acrn: Introduce PCI configuration space PIO accesses combiner

2021-01-22 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

[PATCH v8 01/18] docs: acrn: Introduce ACRN

2021-01-22 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. 3) CPUID functions of ACRN. To learn more about ACRN, please go to ACRN project website https://projectacrn.org, or the documentation

Re: [PATCH v7 01/18] docs: acrn: Introduce ACRN

2021-01-18 Thread Shuo A Liu
Hi Randy, Thanks for review. On Mon 18.Jan'21 at 14:30:51 -0800, Randy Dunlap wrote: On 1/5/21 11:50 PM, shuo.a@intel.com wrote: 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

Re: [PATCH v7 09/18] virt: acrn: Introduce I/O request management

2021-01-11 Thread Shuo A Liu
On Mon 11.Jan'21 at 13:52:19 -0800, Davidlohr Bueso wrote: On Wed, 06 Jan 2021, shuo.a@intel.com wrote: The processing flow of I/O requests are listed as following: a) The I/O handler of the hypervisor will fill an I/O request with PENDING state when a trapped I/O access happens in a User

Re: [PATCH v7 08/18] virt: acrn: Introduce EPT mapping management

2021-01-10 Thread Shuo A Liu
On Fri 8.Jan'21 at 16:34:06 +0100, Greg Kroah-Hartman wrote: On Wed, Jan 06, 2021 at 03:50:45PM +0800, shuo.a@intel.com wrote: +/** + * struct acrn_vm_memmap - A EPT memory mapping info for a User VM. + * @type: Type of the memory mapping (ACRM_MEMMAP_*). + *

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

2021-01-10 Thread Shuo A Liu
On Fri 8.Jan'21 at 16:33:22 +0100, Greg Kroah-Hartman wrote: On Wed, Jan 06, 2021 at 03:50:44PM +0800, shuo.a@intel.com wrote: 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

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

2021-01-10 Thread Shuo A Liu
On Fri 8.Jan'21 at 16:31:34 +0100, Greg Kroah-Hartman wrote: On Wed, Jan 06, 2021 at 03:50:43PM +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 VM

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

2021-01-05 Thread Shuo A Liu
On Tue 5.Jan'21 at 15:03:06 +0100, Greg Kroah-Hartman wrote: On Tue, Dec 15, 2020 at 06:02:51PM +0800, Shuo A Liu wrote: On Tue 15.Dec'20 at 11:00:57 +0100, Greg Kroah-Hartman wrote: > On Tue, Dec 15, 2020 at 05:52:59PM +0800, Shuo A Liu wrote: > > On Wed 2.Dec'20 at 10:14:29 +0

[PATCH v7 18/18] sample/acrn: Introduce a sample of HSM ioctl interface usage

2021-01-05 Thread shuo . a . liu
From: Shuo Liu Launch a simple guest (with several instructions as payload) on ACRN with demonstration ioctl usage. Signed-off-by: Shuo Liu --- samples/acrn/Makefile| 12 samples/acrn/guest.ld| 9 +++ samples/acrn/payload.ld | 9 +++ samples/acrn/vm-sample.c | 136

[PATCH v7 16/18] virt: acrn: Introduce irqfd

2021-01-05 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

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

2021-01-05 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

Re: [PATCH v6 04/18] x86/acrn: Introduce hypercall interfaces

2021-01-05 Thread Shuo A Liu
On Wed 30.Dec'20 at 18:33:05 +0100, Borislav Petkov wrote: On Tue, Dec 01, 2020 at 05:38:39PM +0800, shuo.a@intel.com wrote: From: Shuo Liu The Service VM communicates with the hypervisor via conventional hypercalls. VMCALL instruction is used to make the hypercalls. ACRN hypercall ABI

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

2021-01-05 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

[PATCH v7 15/18] virt: acrn: Introduce ioeventfd

2021-01-05 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

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

2021-01-05 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 v7 14/18] virt: acrn: Introduce I/O ranges operation interfaces

2021-01-05 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

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

2021-01-05 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 v7 09/18] virt: acrn: Introduce I/O request management

2021-01-05 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

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

2021-01-05 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

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

2021-01-05 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

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

2021-01-05 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 v7 05/18] virt: acrn: Introduce ACRN HSM basic driver

2021-01-05 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

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

2021-01-05 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

[PATCH v7 04/18] x86/acrn: Introduce hypercall interfaces

2021-01-05 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

[PATCH v7 03/18] x86/acrn: Introduce acrn_cpuid_base() and hypervisor feature bits

2021-01-05 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

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

2021-01-05 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

[PATCH v7 01/18] docs: acrn: Introduce ACRN

2021-01-05 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. 3) CPUID functions of ACRN. To learn more about ACRN, please go to ACRN project website https://projectacrn.org, or the documentation

[PATCH v7 00/18] HSM driver for ACRN hypervisor

2021-01-05 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

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

2020-12-15 Thread Shuo A Liu
On Tue 15.Dec'20 at 11:00:57 +0100, Greg Kroah-Hartman wrote: On Tue, Dec 15, 2020 at 05:52:59PM +0800, Shuo A Liu wrote: On Wed 2.Dec'20 at 10:14:29 +0800, Shuo A Liu wrote: > On Tue 1.Dec'20 at 11:09:47 +0100, Greg Kroah-Hartman wrote: > > On Tue, Dec 01, 2020 at 05:38:41PM +080

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

2020-12-15 Thread Shuo A Liu
On Wed 2.Dec'20 at 10:14:29 +0800, Shuo A Liu wrote: On Tue 1.Dec'20 at 11:09:47 +0100, Greg Kroah-Hartman wrote: On Tue, Dec 01, 2020 at 05:38:41PM +0800, shuo.a@intel.com wrote: + vm_param->reserved0 = 0; + vm_param->reserved1 = 0; NO! This

Re: [PATCH v6 01/18] docs: acrn: Introduce ACRN

2020-12-08 Thread Shuo A Liu
On Tue 8.Dec'20 at 12:52:49 +0100, Borislav Petkov wrote: On Tue, Dec 01, 2020 at 05:38:36PM +0800, shuo.a@intel.com wrote: From: Shuo Liu Add documentation on the following aspects of ACRN: Thanks for doing this! +=== +ACRN CPUID bits +=== + +A guest VM

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

2020-12-01 Thread Shuo A Liu
On Tue 1.Dec'20 at 11:09:47 +0100, Greg Kroah-Hartman wrote: On Tue, Dec 01, 2020 at 05:38:41PM +0800, shuo.a@intel.com wrote: + vm_param->reserved0 = 0; + vm_param->reserved1 = 0; NO! This means that userspace can put whatever crud they want in those fields,

[PATCH v6 15/18] virt: acrn: Introduce ioeventfd

2020-12-01 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

[PATCH v6 18/18] sample/acrn: Introduce a sample of HSM ioctl interface usage

2020-12-01 Thread shuo . a . liu
From: Shuo Liu Launch a simple guest (with several instructions as payload) on ACRN with demonstration ioctl usage. Signed-off-by: Shuo Liu --- samples/acrn/Makefile| 12 samples/acrn/guest.ld| 9 +++ samples/acrn/payload.ld | 9 +++ samples/acrn/vm-sample.c | 136

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

2020-12-01 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

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

2020-12-01 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

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

2020-12-01 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 v6 13/18] virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor

2020-12-01 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

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

2020-12-01 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

[PATCH v6 16/18] virt: acrn: Introduce irqfd

2020-12-01 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

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

2020-12-01 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

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

2020-12-01 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 v6 05/18] virt: acrn: Introduce ACRN HSM basic driver

2020-12-01 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

  1   2   3   >