Re: [RFC PATCH 11/15] drivers/acrn: add the support of handling emulated ioreq

2019-08-18 Thread Zhao, Yakui
On 2019年08月16日 21:39, Dan Carpenter wrote: On Fri, Aug 16, 2019 at 10:25:52AM +0800, Zhao Yakui wrote: +int acrn_ioreq_create_client(unsigned short vmid, +ioreq_handler_t handler, +void *client_priv, +char

Re: [RFC PATCH 10/15] drivers/acrn: add interrupt injection support

2019-08-18 Thread Zhao, Yakui
On 2019年08月16日 21:12, Dan Carpenter wrote: On Fri, Aug 16, 2019 at 10:25:51AM +0800, Zhao Yakui wrote: + case IC_VM_INTR_MONITOR: { + struct page *page; + + ret = get_user_pages_fast(ioctl_param, 1, 1, ); + if (unlikely(ret != 1) || !page

Re: [RFC PATCH 00/15] acrn: add the ACRN driver module

2019-08-18 Thread Zhao, Yakui
On 2019年08月16日 14:39, Borislav Petkov wrote: On Fri, Aug 16, 2019 at 10:25:41AM +0800, Zhao Yakui wrote: The first three patches are the changes under x86/acrn, which adds the required APIs for the driver and reports the X2APIC caps. The remaining patches add the ACRN driver module, which

[RFC PATCH 10/15] drivers/acrn: add interrupt injection support

2019-08-15 Thread Zhao Yakui
: monitor the interrupt info for one guest OS Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Co-developed-by: Mingqiang Chi Signed-off-by: Mingqiang Chi Signed-off-by: Zhao Yakui --- drivers/staging/acrn/acrn_dev.c | 48 +++ drivers/staging

[RFC PATCH 14/15] drivers/acrn: add the support of irqfd and eventfd

2019-08-15 Thread Zhao Yakui
the interrupt injection on acrn_hsm side. Co-developed-by: Shuo Liu Signed-off-by: Shuo Liu Signed-off-by: Zhao Yakui --- drivers/staging/acrn/Makefile | 4 +- drivers/staging/acrn/acrn_dev.c | 19 ++ drivers/staging/acrn/acrn_drv_internal.h | 10 + drivers/staging/acrn

[RFC PATCH 08/15] drivers/acrn: add VM memory management for ACRN char device

2019-08-15 Thread Zhao Yakui
Signed-off-by: Zhao Yakui --- drivers/staging/acrn/Makefile | 4 +- drivers/staging/acrn/acrn_dev.c | 27 +++ drivers/staging/acrn/acrn_drv_internal.h | 90 +++--- drivers/staging/acrn/acrn_mm.c| 227 drivers/staging/acrn

[RFC PATCH 12/15] drivers/acrn: add driver-specific IRQ handle to dispatch IO_REQ request

2019-08-15 Thread Zhao Yakui
-by: Zhao Yakui --- drivers/staging/acrn/acrn_dev.c | 41 + 1 file changed, 41 insertions(+) diff --git a/drivers/staging/acrn/acrn_dev.c b/drivers/staging/acrn/acrn_dev.c index 28258fb..93f45e3 100644 --- a/drivers/staging/acrn/acrn_dev.c +++ b/drivers/staging

[RFC PATCH 04/15] drivers/acrn: add the basic framework of acrn char device driver

2019-08-15 Thread Zhao Yakui
-by: Zhao Yakui --- drivers/staging/Kconfig | 2 + drivers/staging/Makefile| 1 + drivers/staging/acrn/Kconfig| 18 ++ drivers/staging/acrn/Makefile | 2 + drivers/staging/acrn/acrn_dev.c | 123 5 files changed, 146 insertions

[RFC PATCH 09/15] drivers/acrn: add passthrough device support

2019-08-15 Thread Zhao Yakui
interrupt is triggered. Co-developed-by: Gao, Shiqing Signed-off-by: Gao, Shiqing Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- drivers/staging/acrn/acrn_dev.c | 77 +++ drivers/staging/acrn/acrn_drv_internal.h

[RFC PATCH 13/15] drivers/acrn: add service to obtain Power data transition

2019-08-15 Thread Zhao Yakui
can construct the DSDT with Power frequence/C-state idle for guest system. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Co-developed-by: Victor Sun Signed-off-by: Victor Sun Signed-off-by: Zhao Yakui --- drivers/staging/acrn/acrn_dev.c | 75

[RFC PATCH 15/15] drivers/acrn: add the support of offline SOS cpu

2019-08-15 Thread Zhao Yakui
vices/system/cpu/cpuX/online Currently this is mainly used in user-space device model before booting other ACRN guest. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- drivers/staging/acrn/acrn_dev.c | 45 + 1

[RFC PATCH 11/15] drivers/acrn: add the support of handling emulated ioreq

2019-08-15 Thread Zhao Yakui
(int client_id); Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Co-developed-by: Yin FengWei Signed-off-by: Yin FengWei Co-developed-by: Liu Shuo Signed-off-by: Liu Shuo Signed-off-by: Zhao Yakui --- drivers/staging/acrn/Makefile | 3 +- drivers/staging/acrn

[RFC PATCH 02/15] x86/acrn: Add two APIs to add/remove driver-specific upcall ISR handler

2019-08-15 Thread Zhao Yakui
. This is similar to that in XEN/HyperV. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- arch/x86/include/asm/acrn.h | 3 +++ arch/x86/kernel/cpu/acrn.c | 12 2 files changed, 15 insertions(+) diff --git a/arch/x86/include/asm/acrn.h b

[RFC PATCH 00/15] acrn: add the ACRN driver module

2019-08-15 Thread Zhao Yakui
the X2APIC caps. The remaining patches add the ACRN driver module, which accepts the ioctl from user-space and then communicate with the low-level ACRN hypervisor by using hypercall. Zhao Yakui (15): x86/acrn: Report X2APIC for ACRN guest x86/acrn: Add two APIs to add/remove driver-specific upcall ISR

[RFC PATCH 05/15] drivers/acrn: add driver-specific hypercall for ACRN_HSM

2019-08-15 Thread Zhao Yakui
Co-developed-by: Liu Shuo Signed-off-by: Liu Shuo Signed-off-by: Zhao Yakui --- drivers/staging/acrn/Makefile | 3 +- drivers/staging/acrn/acrn_hv_defs.h | 65 drivers/staging/acrn/acrn_hypercall.c | 136 ++ drivers/staging/acrn

[RFC PATCH 07/15] drivers/acrn: add acrn vm/vcpu management for ACRN_HSM char device

2019-08-15 Thread Zhao Yakui
is destroyed, the low-level ACRN hypervisor will free the corresponding vcpu implicitly. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Co-developed-by: Liu Shuo Signed-off-by: Liu Shuo Signed-off-by: Zhao Yakui --- drivers/staging/acrn/Makefile | 3 +- drivers/staging/acrn

[RFC PATCH 01/15] x86/acrn: Report X2APIC for ACRN guest

2019-08-15 Thread Zhao Yakui
CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- arch/x86/kernel/cpu/acrn.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c index 676022e..95db5c4 100644 --- a/arch/x86/kernel/cpu/acrn.c +++ b/arch

[RFC PATCH 06/15] drivers/acrn: add the support of querying ACRN api version

2019-08-15 Thread Zhao Yakui
module also needs to check the driver version. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Co-developed-by: Liu Shuo Signed-off-by: Liu Shuo Signed-off-by: Zhao Yakui --- drivers/staging/acrn/acrn_dev.c | 47 +++ include/uapi/linux/acrn

[RFC PATCH 03/15] x86/acrn: Add hypercall for ACRN guest

2019-08-15 Thread Zhao Yakui
instruction. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- arch/x86/include/asm/acrn.h | 54 + 1 file changed, 54 insertions(+) diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h index

Re: [RFC PATCH 08/15] drivers/acrn: add VM memory management for ACRN char device

2019-08-19 Thread Zhao, Yakui
On 2019年08月19日 15:39, Dan Carpenter wrote: On Mon, Aug 19, 2019 at 01:32:54PM +0800, Zhao, Yakui wrote: In fact as this driver is mainly used for embedded IOT usage, it doesn't handle the complex cleanup when such error is encountered. Instead the clean up is handled in free_guest_vm. A use

Re: [RFC PATCH 15/15] drivers/acrn: add the support of offline SOS cpu

2019-08-19 Thread Zhao, Yakui
On 2019年08月19日 18:34, Dan Carpenter wrote: On Fri, Aug 16, 2019 at 10:25:56AM +0800, Zhao Yakui wrote: diff --git a/drivers/staging/acrn/acrn_dev.c b/drivers/staging/acrn/acrn_dev.c index 0602125..6868003 100644 --- a/drivers/staging/acrn/acrn_dev.c +++ b/drivers/staging/acrn/acrn_dev.c

Re: [RFC PATCH 08/15] drivers/acrn: add VM memory management for ACRN char device

2019-08-18 Thread Zhao, Yakui
On 2019年08月16日 20:58, Dan Carpenter wrote: On Fri, Aug 16, 2019 at 10:25:49AM +0800, Zhao Yakui wrote: +int hugepage_map_guest(struct acrn_vm *vm, struct vm_memmap *memmap) +{ + struct page *page = NULL, *regions_buf_pg = NULL; + unsigned long len, guest_gpa, vma; + struct

Re: [RFC PATCH 00/15] acrn: add the ACRN driver module

2019-08-18 Thread Zhao, Yakui
On 2019年08月16日 15:03, Greg KH wrote: On Fri, Aug 16, 2019 at 08:39:25AM +0200, Borislav Petkov wrote: On Fri, Aug 16, 2019 at 10:25:41AM +0800, Zhao Yakui wrote: The first three patches are the changes under x86/acrn, which adds the required APIs for the driver and reports the X2APIC caps

Re: [RFC PATCH 04/15] drivers/acrn: add the basic framework of acrn char device driver

2019-08-18 Thread Zhao, Yakui
On 2019年08月16日 15:05, Greg KH wrote: On Fri, Aug 16, 2019 at 10:25:45AM +0800, Zhao Yakui wrote: ACRN hypervisor service module is the important middle layer that allows the Linux kernel to communicate with the ACRN hypervisor. It includes the management of virtualized CPU/memory/device

Re: [RFC PATCH 00/15] acrn: add the ACRN driver module

2019-08-18 Thread Zhao, Yakui
On 2019年08月19日 13:25, Greg KH wrote: On Mon, Aug 19, 2019 at 09:44:25AM +0800, Zhao, Yakui wrote: On 2019年08月16日 14:39, Borislav Petkov wrote: On Fri, Aug 16, 2019 at 10:25:41AM +0800, Zhao Yakui wrote: The first three patches are the changes under x86/acrn, which adds the required APIs

Re: [RFC PATCH 09/15] drivers/acrn: add passthrough device support

2019-09-01 Thread Zhao, Yakui
On 2019年08月16日 21:05, Dan Carpenter wrote: On Fri, Aug 16, 2019 at 10:25:50AM +0800, Zhao Yakui wrote: + case IC_ASSIGN_PTDEV: { + unsigned short bdf; + + if (copy_from_user(, (void *)ioctl_param, This casting is ugly and you also need a __user tag