[Xen-devel] [PATCH v1] x86/mm: Supresses vm_events caused by page-walks

2017-10-30 Thread Alexandru Isaila
p2m_set_ad_bits the v->arch.sse_pg_dirty.eip and v->arch.sse_pg_dirty.gla are used to mark that this is the second time a fault occurs and the dirty bit is set. Signed-off-by: Alexandru Isaila --- tools/libxc/include/xenctrl.h | 2 ++ tools/libxc/xc_monitor.c | 14 ++ xe

[Xen-devel] [PATCH v2] x86/hvm: Add MSR old value

2017-10-13 Thread Alexandru Isaila
d-off-by: Alexandru Isaila Acked-by: Tamas K Lengyel --- Changes since V1: - Removed Stray blanks inside the inner parentheses - Added space after the if statement - Added * 8 to the set/clear/test_bit statements - Removed the blank line after monitored_msr. ---

[Xen-devel] [PATCH v1] x86/hvm: Add MSR old value

2017-10-12 Thread Alexandru Isaila
d-off-by: Alexandru Isaila --- tools/libxc/include/xenctrl.h | 2 +- tools/libxc/xc_monitor.c | 3 ++- xen/arch/x86/hvm/hvm.c| 10 -- xen/arch/x86/hvm/monitor.c| 9 ++--- xen/arch/x86/monitor.c| 26 +++--- xen/includ

[Xen-devel] [PATCH v9] x86/hvm: Implement hvmemul_write() using real mappings

2017-10-09 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- Changes since V8: - Removed comment - Changed the addr formula - Added blank space in the for statement. Note: Tested with win32/64 and ubuntu64 guests. --- xen/arch/x86/hvm/emulate.c| 179

[Xen-devel] [PATCH RFC v2] x86/domctl: Don't pause the whole domain if only getting vcpu state

2017-10-06 Thread Alexandru Isaila
This patch adds the hvm_save_one_cpu_ctxt() function. It optimizes by only pausing the vcpu on all HVMSR_PER_VCPU save callbacks where only data for one VCPU is required. Signed-off-by: Alexandru Isaila --- Changes since V1: - Integrated the vcpu check into all the save callbacks

[Xen-devel] [PATCH v8] x86/hvm: Implement hvmemul_write() using real mappings

2017-10-02 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- Changes since V7: - Removed blank lines - Moved the caluculation onf frame and addr in the for loop - Changed the if condition to nr_frames == 1 - Converted the while loop to for in the unmap func. Note: Tested with win32

[Xen-devel] [PATCH v7] x86/hvm: Implement hvmemul_write() using real mappings

2017-09-28 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- Changes since V6: - Added a direct way to calculate the nr_frames - The while loop uses a i counter - The frame address is calculated in the loop --- xen/arch/x86/hvm/emulate.c| 185

[Xen-devel] [PATCH v6] x86/hvm: Implement hvmemul_write() using real mappings

2017-09-27 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila Reviewed-by: Paul Durrant --- Changes since V5: - Added address size check - Added a pages local variable that holds the number of pages - Addded the !mapping check --- xen/arch/x86/hvm/emulate.c| 189

[Xen-devel] [PATCH v5] x86/hvm: Implement hvmemul_write() using real mappings

2017-09-27 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- Changes since V4: - Moved the mfn increment line back - Removed the new line between mfn++ and while Reviewed-by: Paul Durrant --- xen/arch/x86/hvm/emulate.c| 174 ++ xen/include/asm-x86/hvm

[Xen-devel] [PATCH v4 1/3] x86/hvm: Rename enum hvm_copy_result to hvm_translation_result

2017-09-20 Thread Alexandru Isaila
From: Andrew Cooper Signed-off-by: Andrew Cooper Acked-by: Tim Deegan Acked-by: Jan Beulich Reviewed-by: Kevin Tian Acked-by: George Dunlap --- xen/arch/x86/hvm/dom0_build.c | 2 +- xen/arch/x86/hvm/emulate.c| 40 ++-- xen/arch/x86/hvm/hvm.c|

[Xen-devel] [PATCH v4 3/3] x86/hvm: Implement hvmemul_write() using real mappings

2017-09-20 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- Changes since V3: - Changed the if condition form ... > ... -1 to ... >= ... - Removed long cast to the err var - Moved the mfn++ closer to the end of the loop - Integrated the ++frame in the while condition --- xe

[Xen-devel] [PATCH v4 0/3] Various XSA followups

2017-09-20 Thread Alexandru Isaila
XSA-219 was discovered while trying to implement the bugfix in patch 3. Andrew Cooper (3): [RFC] x86/hvm: Rename enum hvm_copy_result to hvm_translation_result x86/hvm: Break out __hvm_copy()'s translation logic x86/hvm: Implement hvmemul_write() using real mappings Alexandru Isaila (2):

[Xen-devel] [PATCH v4 2/3] x86/hvm: Break out __hvm_copy()'s translation logic

2017-09-20 Thread Alexandru Isaila
From: Andrew Cooper It will be reused by later changes. Signed-off-by: Andrew Cooper Signed-off-by: Alexandru Isaila Reviewed-by: Paul Durrant Acked-by: Jan Beulich --- xen/arch/x86/hvm/hvm.c| 144 +++--- xen/include/asm-x86/hvm/support.h | 12

[Xen-devel] [PATCH v3 3/3] x86/hvm: Implement hvmemul_write() using real mappings

2017-09-19 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- Changes since V2: - Added linear & ~PAGE_MASK to return statement - Modified mfn - hvmemul_ctxt->mfn to final - first + 1 - Remove useless else statement --- xen/arch/x86/hvm/emulate.c

[Xen-devel] [PATCH v3 2/3] x86/hvm: Break out __hvm_copy()'s translation logic

2017-09-19 Thread Alexandru Isaila
From: Andrew Cooper It will be reused by later changes. Signed-off-by: Andrew Cooper Signed-off-by: Alexandru Isaila --- Changes since V2: - Changed _gfn() to gaddr_to_gfn - Changed gfn_x to gfn_to_gaddr --- xen/arch/x86/hvm/hvm.c| 144

[Xen-devel] [PATCH v3 1/3] x86/hvm: Rename enum hvm_copy_result to hvm_translation_result

2017-09-19 Thread Alexandru Isaila
From: Andrew Cooper Signed-off-by: Andrew Cooper --- Acked-by: Jan Beulich Reviewed-by: Kevin Tian Acked-by: George Dunlap --- xen/arch/x86/hvm/dom0_build.c | 2 +- xen/arch/x86/hvm/emulate.c| 40 ++-- xen/arch/x86/hvm/hvm.c| 56 +

[Xen-devel] [PATCH v3 0/3] Various XSA followups

2017-09-19 Thread Alexandru Isaila
XSA-219 was discovered while trying to implement the bugfix in patch 3. Andrew Cooper (3): [RFC] x86/hvm: Rename enum hvm_copy_result to hvm_translation_result x86/hvm: Break out __hvm_copy()'s translation logic x86/hvm: Implement hvmemul_write() using real mappings Alexandru Isaila (2):

[Xen-devel] [PATCH] x86/domctl: Don't pause the whole domain if only getting vcpu state

2017-09-12 Thread Alexandru Isaila
This patch adds the hvm_save_one_cpu_ctxt() function, called for the XEN_DOMCTL_gethvmcontext_partial domctl. It optimizes by only pausing the vcpu, and no longer the whole domain. Signed-off-by: Alexandru Isaila --- xen/arch/x86/domctl.c | 20 + xen/arch/x86/hvm/hvm.c| 194

[Xen-devel] [PATCH v2 2/4] x86/hvm: Rename enum hvm_copy_result to hvm_translation_result

2017-09-08 Thread Alexandru Isaila
From: Andrew Cooper Signed-off-by: Andrew Cooper --- CC: Jan Beulich --- xen/arch/x86/hvm/dom0_build.c | 2 +- xen/arch/x86/hvm/emulate.c| 40 ++-- xen/arch/x86/hvm/hvm.c| 56 +++ xen/arch/x86/hvm/intercept.c

[Xen-devel] [PATCH v2 3/4] x86/hvm: Break out __hvm_copy()'s translation logic

2017-09-08 Thread Alexandru Isaila
From: Andrew Cooper It will be reused by later changes. Signed-off-by: Andrew Cooper Signed-off-by: Alexandru Isaila --- CC: Jan Beulich Changes since V1: - Changed param name - Added ASSERT --- xen/arch/x86/hvm/hvm.c| 144

[Xen-devel] [PATCH v2 1/4] x86/shadow: Use ERR_PTR infrastructure for sh_emulate_map_dest()

2017-09-08 Thread Alexandru Isaila
From: Andrew Cooper sh_emulate_map_dest() predates the introduction of the generic ERR_PTR() infrastructure, but take the opportunity to avoid opencoding it. The chosen error constants require need to be negative to work with IS_ERR(), but no other changes. Signed-off-by: Andrew Cooper --- CC

[Xen-devel] [PATCH v2 0/4] Various XSA followups

2017-09-08 Thread Alexandru Isaila
6/hvm: Implement hvmemul_write() using real mappings Alexandru Isaila (2): x86/hvm: Break out __hvm_copy()'s translation logic x86/hvm: Implement hvmemul_write() using real mappings ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.x

[Xen-devel] [PATCH v2 4/4] x86/hvm: Implement hvmemul_write() using real mappings

2017-09-08 Thread Alexandru Isaila
Cooper Signed-off-by: Alexandru Isaila --- CC: Jan Beulich CC: Paul Durrant CC: Razvan Cojocaru CC: Mihai Donțu Changes since V1: - Moved ASSERT to the begining of the loop - Corrected the decrement on mfn int the while statement - Modified the comment to PAGE_SIZE+1

[Xen-devel] [PATCH v1] x86/hvm: Expose MSR_SHADOW_GS_BASE

2017-09-01 Thread Alexandru Isaila
This patch is adding an new param in the hvm_hw_cpu structure so it can be exposed to user space. Signed-off-by: Alexandru Isaila --- xen/arch/x86/hvm/hvm.c | 4 xen/include/public/arch-x86/hvm/save.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/xen/arch/x86/hvm

[Xen-devel] [PATCH v6] common/vm_event: Initialize vm_event lists on domain creation

2017-08-30 Thread Alexandru Isaila
The patch splits the vm_event into three structures:vm_event_share, vm_event_paging, vm_event_monitor. The allocation for the structure is moved to vm_event_enable so that it can be allocated/init when needed and freed in vm_event_disable. Signed-off-by: Alexandru Isaila --- Changes since V5

[Xen-devel] [PATCH v5] common/vm_event: Initialize vm_event lists on domain creation

2017-08-29 Thread Alexandru Isaila
The patch splits the vm_event into three structures:vm_event_share, vm_event_paging, vm_event_monitor. The allocation for the structure is moved to vm_event_enable so that it can be allocated/init when needed and freed in vm_event_disable. Signed-off-by: Alexandru Isaila --- Changes since V4

[Xen-devel] [PATCH v10] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-29 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila Acked-by: Wei Liu --- Changes since V9: - Changed allow_userspace type from uint8_t ro bool - Added Wei Liu's ack from v7 Note: Could not test on ARM, compiled both on ar

[Xen-devel] [PATCH v9] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-29 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila Acked-by: Wei Liu --- Changes since V8: - Changed funtion name from arch_allow_userspace to arch_monitor_allow_userspace - Added Wei Liu's ack from v7 Note: Coul

[Xen-devel] [PATCH v8] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-28 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila Acked-by: Jan Beulich Acked-by: Wei Liu --- Changes since V7: - Passed domain* instead of arch* for the new arch specific function - Added Wei Liu's ack fr

[Xen-devel] [PATCH v4] common/vm_event: Initialize vm_event lists on domain creation

2017-08-28 Thread Alexandru Isaila
The patch splits the vm_event into three structures:vm_event_share, vm_event_paging, vm_event_monitor. The allocation for the structure is moved to vm_event_enable so that it can be allocated/init when needed and freed in vm_event_disable. Signed-off-by: Alexandru Isaila --- Changes since V3

[Xen-devel] [PATCH v7] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-28 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila --- Changes since V6: - Added arch specific function in both x86 monitor and arm monitor to replace the assignment from common monitor Note: Could not test on ARN, compiled

[Xen-devel] [PATCH v3] common/vm_event: Initialize vm_event lists on domain creation

2017-08-25 Thread Alexandru Isaila
The patch splits the vm_event into three structures:vm_event_share, vm_event_paging, vm_event_monitor. The allocation for the structure is moved to vm_event_enable so that it can be allocated/init when needed and freed in vm_event_disable. Signed-off-by: Alexandru Isaila --- Changes since V2

[Xen-devel] [PATCH v2] common/vm_event: Initialize vm_event lists on domain creation

2017-08-24 Thread Alexandru Isaila
The patch splits the vm_event into three structures:vm_event_share, vm_event_paging, vm_event_monitor. The allocation for the structure is moved to vm_event_enable so that it can be allocated/init when needed and freed in vm_event_disable. Signed-off-by: Alexandru Isaila --- xen/arch/arm

[Xen-devel] [PATCH v6] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-17 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila --- Changes since V5: - Added the bool allow_userspace to the xc_monitor_guest_request function --- tools/libxc/include/xenctrl.h | 2 +- tools/libxc/xc_monitor.c | 3

[Xen-devel] [PATCH v5] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-08 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila --- Changes since V4: - Changed function mane from xc_allow_guest_userspace_event to xc_monitor_guest_userspace_event - Fixed guest_request_enabled check

[Xen-devel] [PATCH v4] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-04 Thread Alexandru Isaila
whitelist the use of HVMOP_guest_request_vm_event directly from userspace. Signed-off-by: Alexandru Isaila --- Changes since V3: - Changed commit message - Added new lines - Indent the maximum space on the defines - Chaned the name of the define/function name/struct

[Xen-devel] [PATCH v3] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-03 Thread Alexandru Isaila
munication between a userspace application in the guest and the introspection application in dom0. Signed-off-by: Alexandru Isaila --- Changes since V2: -Added a new flag to enable the vm call from the guest userspace --- tools/libxc/include/xenctrl.h | 2 ++ tools/libxc/xc

[Xen-devel] [PATCH v2] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-01 Thread Alexandru Isaila
munication between a userspace application in the guest and the introspection application in dom0. Signed-off-by: Alexandru Isaila --- Changes since V1: - Added Fallthrough check on mode == 2 --- xen/arch/x86/hvm/hypercall.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen/ar