[Xen-devel] [PATCH v13 2/3] x86/mem_sharing: reset a fork

2020-03-30 Thread Tamas K Lengyel
about a 2x speedup during normal fuzzing operations. Performance may vary depending how much memory got allocated for the forked VM. If it has been completely deduplicated from the parent VM then creating a new fork would likely be more performant. Signed-off-by: Tamas K Lengyel Reviewed-by: Roger

[Xen-devel] [PATCH v13 1/3] xen/mem_sharing: VM forking

2020-03-30 Thread Tamas K Lengyel
-by: Tamas K Lengyel Acked-by: Jan Beulich --- v13: Address issues pointed out by Roger & Jan Introduce & use PAGE_OFFSET to calculate vcpu_info offset --- xen/arch/x86/domain.c | 13 ++ xen/arch/x86/hvm/hvm.c| 4 +- xen/arch/x86/mm/hap/hap.c | 3 +-

Re: [Xen-devel] [PATCH v12 2/3] x86/mem_sharing: reset a fork

2020-03-26 Thread Tamas K Lengyel
On Thu, Mar 26, 2020 at 4:17 AM Jan Beulich wrote: > > On 23.03.2020 18:04, Tamas K Lengyel wrote: > > +static int mem_sharing_fork_reset(struct domain *d, struct domain *pd) > > +{ > > +int rc; > > +struct p2m_domain *p2m = p2m_get_hostp2m(d); > &g

Re: [Xen-devel] [PATCH v12 1/3] xen/mem_sharing: VM forking

2020-03-26 Thread Tamas K Lengyel
On Thu, Mar 26, 2020 at 6:33 AM Jan Beulich wrote: > > On 23.03.2020 18:04, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/domain.c > > +++ b/xen/arch/x86/domain.c > > @@ -2202,6 +2202,17 @@ int domain_relinquish_resources(struct domain *d) > > r

Re: [Xen-devel] [PATCH v12 2/3] x86/mem_sharing: reset a fork

2020-03-26 Thread Tamas K Lengyel
On Thu, Mar 26, 2020 at 8:52 AM Jan Beulich wrote: > > On 26.03.2020 15:48, Tamas K Lengyel wrote: > > On Thu, Mar 26, 2020 at 4:17 AM Jan Beulich wrote: > >> > >> On 23.03.2020 18:04, Tamas K Lengyel wrote: > >>> +static int mem_sharing_fork

[PATCH v2] mem_sharing: map shared_info page to same gfn during fork

2020-04-28 Thread Tamas K Lengyel
During a VM fork we copy the shared_info page; however, we also need to ensure that the page is mapped into the same GFN in the fork as its in the parent. Signed-off-by: Tamas K Lengyel Suggested-by: Roger Pau Monne --- xen/arch/x86/mm/mem_sharing.c | 25 + 1 file

Re: [PATCH v17 1/2] mem_sharing: fix sharability check during fork reset

2020-04-25 Thread Tamas K Lengyel
On Sat, Apr 25, 2020 at 3:01 AM Roger Pau Monné wrote: > > On Fri, Apr 24, 2020 at 06:18:24AM -0600, Tamas K Lengyel wrote: > > On Fri, Apr 24, 2020 at 3:44 AM Roger Pau Monné > > wrote: > > > > > > On Thu, Apr 23, 2020 at 08:30:06AM -0700, Tamas K Lengye

[PATCH] mem_sharing: map shared_info page to same gfn during fork

2020-04-27 Thread Tamas K Lengyel
During a VM fork we copy the shared_info page; however, we also need to ensure that the page is mapped into the same GFN in the fork as its in the parent. Signed-off-by: Tamas K Lengyel Suggested-by: Roger Pau Monne --- xen/arch/x86/mm/mem_sharing.c | 29 + 1 file

Re: [PATCH v17 1/2] mem_sharing: fix sharability check during fork reset

2020-04-24 Thread Tamas K Lengyel
On Fri, Apr 24, 2020 at 3:44 AM Roger Pau Monné wrote: > > On Thu, Apr 23, 2020 at 08:30:06AM -0700, Tamas K Lengyel wrote: > > When resetting a VM fork we ought to only remove pages that were allocated > > for > > the fork during it's execution and the contents cop

Re: [ANNOUNCE] Xen 4.14 Development Update

2020-04-24 Thread Tamas K Lengyel
> * VM forking (v11) > - Tamas K Lengyel v17 sent recently, hypervisor side is completely merged, only the toolstack patch is waiting for review & merge Tamas

Re: [PATCH v16 1/3] mem_sharing: fix sharability check during fork reset

2020-04-22 Thread Tamas K Lengyel
On Wed, Apr 22, 2020 at 9:50 AM Roger Pau Monné wrote: > > On Wed, Apr 22, 2020 at 06:42:42AM -0600, Tamas K Lengyel wrote: > > On Wed, Apr 22, 2020 at 3:00 AM Roger Pau Monné > > wrote: > > > > > > On Tue, Apr 21, 2020 at 10:47:23AM -0700, Tamas K Lengy

Re: [PATCH v16 2/3] mem_sharing: allow forking domain with IOMMU enabled

2020-04-22 Thread Tamas K Lengyel
On Wed, Apr 22, 2020 at 3:09 AM Roger Pau Monné wrote: > > On Tue, Apr 21, 2020 at 10:47:24AM -0700, Tamas K Lengyel wrote: > > The memory sharing subsystem by default doesn't allow a domain to share > > memory > > if it has an IOMMU active for obvious securit

Re: [PATCH v16 1/3] mem_sharing: fix sharability check during fork reset

2020-04-22 Thread Tamas K Lengyel
On Wed, Apr 22, 2020 at 3:00 AM Roger Pau Monné wrote: > > On Tue, Apr 21, 2020 at 10:47:23AM -0700, Tamas K Lengyel wrote: > > When resetting a VM fork we ought to only remove pages that were allocated > > for > > the fork during it's execution and the contents cop

[PATCH v17 2/2] xen/tools: VM forking toolstack side

2020-04-23 Thread Tamas K Lengyel
Add necessary bits to implement "xl fork-vm" commands. The command allows the user to specify how to launch the device model allowing for a late-launch model in which the user can execute the fork without the device model and decide to only later launch it. Signed-off-by: Tamas

[PATCH v17 1/2] mem_sharing: fix sharability check during fork reset

2020-04-23 Thread Tamas K Lengyel
removing pages from the p2m that may be used for other purposes. For example, currently the reset loop also removes the vcpu info pages from the p2m, potentially putting the guest into infinite page-fault loops. Signed-off-by: Tamas K Lengyel --- v17: Changes based on feedback from Roger --- xen

Re: [PATCH v17 2/2] xen/tools: VM forking toolstack side

2020-05-01 Thread Tamas K Lengyel
On Thu, Apr 23, 2020 at 9:33 AM Tamas K Lengyel wrote: > > Add necessary bits to implement "xl fork-vm" commands. The command allows the > user to specify how to launch the device model allowing for a late-launch > model > in which the user can execute the fork

[PATCH v16 2/3] mem_sharing: allow forking domain with IOMMU enabled

2020-04-21 Thread Tamas K Lengyel
. Signed-off-by: Tamas K Lengyel --- v16: Minor fixes based on feedback --- xen/arch/x86/mm/mem_sharing.c | 20 +--- xen/include/public/memory.h | 4 +++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm

[PATCH v16 0/3] VM forking

2020-04-21 Thread Tamas K Lengyel
0.0001s under the optimal circumstances. New in v16: A better bugfix for fork reset issue Minor fixes for the IOMMU allow patch based on feedback Patch 1 fix for VM fork reset removing pages from the p2m that it shouldn't Patch 2 adds option to fork a domain with IOMMU active Patch 3 adds the to

[PATCH v16 1/3] mem_sharing: fix sharability check during fork reset

2020-04-21 Thread Tamas K Lengyel
to perform a validation-only run without actually converting the page. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/mem_sharing.c | 79 ++- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c

[PATCH v16 3/3] xen/tools: VM forking toolstack side

2020-04-21 Thread Tamas K Lengyel
Add necessary bits to implement "xl fork-vm" commands. The command allows the user to specify how to launch the device model allowing for a late-launch model in which the user can execute the fork without the device model and decide to only later launch it. Signed-off-by: Tamas

Re: Xen Coding style

2020-05-08 Thread Tamas K Lengyel
On Fri, May 8, 2020 at 6:21 AM Julien Grall wrote: > > Hi Jan, > > On 08/05/2020 12:20, Jan Beulich wrote: > > On 08.05.2020 12:00, Julien Grall wrote: > >> You seem to be the maintainer with the most unwritten rules. Would > >> you mind to have a try at writing a coding style based on it? > > >

Re: Xen Coding style

2020-05-08 Thread Tamas K Lengyel
On Fri, May 8, 2020 at 8:18 AM Jürgen Groß wrote: > > On 08.05.20 14:55, Tamas K Lengyel wrote: > > On Fri, May 8, 2020 at 6:21 AM Julien Grall wrote: > >> > >> Hi Jan, > >> > >> On 08/05/2020 12:20, Jan Beulich wrote: > >>&

[PATCH 2/3] xen/vm_event: add vm_event_check_pending_op

2020-05-15 Thread Tamas K Lengyel
Perform sanity checking when shutting vm_event down to determine whether it is safe to do so. Error out with -EAGAIN in case pending operations have been found for the domain. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/vm_event.c| 23 +++ xen/common/vm_event.c

[PATCH 3/3] xen/vm_event: Add safe to disable vm_event

2020-05-15 Thread Tamas K Lengyel
Instead of having to repeatedly try to disable vm_events, request a specific vm_event to be sent when the domain is safe to continue with shutting down the vm_event interface. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/hvm/hvm.c| 38 ++- xen/arch/x86

[PATCH 1/3] xen/monitor: Control register values

2020-05-15 Thread Tamas K Lengyel
Extend the monitor_op domctl to include option that enables controlling what values certain registers are permitted to hold by a monitor subscriber. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/hvm/hvm.c | 31 +++ xen/arch/x86/monitor.c | 10

[PATCH 0/3] vm_event: fix race-condition when disabling monitor events

2020-05-15 Thread Tamas K Lengyel
squashing this nasty bug. Tamas K Lengyel (3): xen/monitor: Control register values xen/vm_event: add vm_event_check_pending_op xen/vm_event: Add safe to disable vm_event xen/arch/x86/hvm/hvm.c| 69 +++ xen/arch/x86/hvm/monitor.c| 14 +++

Re: [PATCH] x86/hvm: Fix memory leaks in hvm_copy_context_and_params()

2020-05-18 Thread Tamas K Lengyel
On Sat, May 16, 2020 at 6:22 AM Andrew Cooper wrote: > > Any error from hvm_save() or hvm_set_param() leaks the c.data allocation. > > Spotted by Coverity. > > Fixes: 353744830 "x86/hvm: introduce hvm_copy_context_and_params" > Signed-off-by: Andrew Cooper Thanks for the fix, my bad! Tamas

Re: [PATCH for-4.14 0/3] Remove the 1GB limitation on Rasberry Pi 4

2020-05-18 Thread Tamas K Lengyel
On Mon, May 18, 2020 at 5:32 AM Julien Grall wrote: > > From: Julien Grall > > Hi all, > > At the moment, a user who wants to boot Xen on the Raspberry Pi 4 can > only use the first GB of memory. > > This is because several devices cannot DMA above 1GB but Xen doesn't > necessarily allocate

Re: [PATCH v18 2/2] tools/libxl: VM forking toolstack side

2020-05-14 Thread Tamas K Lengyel
On Thu, May 14, 2020 at 8:52 AM Ian Jackson wrote: > > Tamas K Lengyel writes ("[PATCH v18 2/2] tools/libxl: VM forking toolstack > side"): > > Add necessary bits to implement "xl fork-vm" commands. The command allows > > the > > user to

Re: [Xen-devel] [PATCH v11 2/3] x86/mem_sharing: reset a fork

2020-03-18 Thread Tamas K Lengyel
On Wed, Mar 18, 2020 at 5:36 AM Jan Beulich wrote: > > On 28.02.2020 19:40, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/mm/mem_sharing.c > > +++ b/xen/arch/x86/mm/mem_sharing.c > > @@ -1775,6 +1775,91 @@ static int fork(struct domain *cd, struct domain

Re: [Xen-devel] [PATCH v11 2/3] x86/mem_sharing: reset a fork

2020-03-18 Thread Tamas K Lengyel
On Wed, Mar 18, 2020 at 8:13 AM Jan Beulich wrote: > > On 18.03.2020 15:00, Tamas K Lengyel wrote: > > On Wed, Mar 18, 2020 at 5:36 AM Jan Beulich wrote: > >> On 28.02.2020 19:40, Tamas K Lengyel wrote: > >>> +mfn = page_to_mfn(page); > >>>

[Xen-devel] [PATCH] x86/mem_sharing: move mem_sharing_domain declaration

2020-03-18 Thread Tamas K Lengyel
Due to recent reshuffling of header include paths mem_sharing no longer compiles. Fix it by moving mem_sharing_domain declaration to location it is used in. Signed-off-by: Tamas K Lengyel --- xen/include/asm-x86/hvm/domain.h | 13 + xen/include/asm-x86/mem_sharing.h | 11

[Xen-devel] [PATCH] travis: add mem_sharing compile test

2020-03-18 Thread Tamas K Lengyel
Add compile test for mem_sharing to avoid future breakage going unnoticed. Signed-off-by: Tamas K Lengyel --- .travis.yml | 3 +++ scripts/travis-build | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 15ca9e9047..908d205d27 100644

Re: [Xen-devel] [PATCH v11 1/3] xen/mem_sharing: VM forking

2020-03-17 Thread Tamas K Lengyel
On Tue, Mar 17, 2020 at 10:02 AM Jan Beulich wrote: > > On 28.02.2020 19:40, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/mm/p2m.c > > +++ b/xen/arch/x86/mm/p2m.c > > @@ -509,6 +509,12 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, > > unsigned long

Re: [Xen-devel] [PATCH v11 1/3] xen/mem_sharing: VM forking

2020-03-17 Thread Tamas K Lengyel
On Tue, Mar 17, 2020 at 10:35 AM Jan Beulich wrote: > > On 17.03.2020 17:23, Tamas K Lengyel wrote: > > On Tue, Mar 17, 2020 at 10:02 AM Jan Beulich wrote: > >> On 28.02.2020 19:40, Tamas K Lengyel wrote: > >>> @@ -588,7 +594,8 @@ struct

[Xen-devel] [PATCH v12 1/3] xen/mem_sharing: VM forking

2020-03-23 Thread Tamas K Lengyel
-by: Tamas K Lengyel --- v12: Minor style adjustments Jan pointed out Convert mem_sharing_is_fork to inline function v11: Fully copy vcpu_info pages Setup vcpu_runstate for forks Added TODO note for PV timers Copy shared_info page Add copy_settings function, to be shared

[Xen-devel] [PATCH v12 3/3] xen/tools: VM forking toolstack side

2020-03-23 Thread Tamas K Lengyel
Add necessary bits to implement "xl fork-vm" commands. The command allows the user to specify how to launch the device model allowing for a late-launch model in which the user can execute the fork without the device model and decide to only later launch it. Signed-off-by: Tamas

[Xen-devel] [PATCH v12 0/3] VM forking

2020-03-23 Thread Tamas K Lengyel
nces. New in v12: style cleanups & minor adjustments removing contiuation for fork reset and add TODO comment Patch 1 implements the VM fork Patch 2 implements fork reset operation Patch 3 adds the toolstack-side code implementing VM forking and reset Tamas K Lengyel (3): xen/mem

[Xen-devel] [PATCH v12 2/3] x86/mem_sharing: reset a fork

2020-03-23 Thread Tamas K Lengyel
about a 2x speedup during normal fuzzing operations. Performance may vary depending how much memory got allocated for the forked VM. If it has been completely deduplicated from the parent VM then creating a new fork would likely be more performant. Signed-off-by: Tamas K Lengyel --- v12: remove

Re: [Xen-devel] [PATCH] memaccess: reduce include dependencies

2020-03-09 Thread Tamas K Lengyel
On Mon, Mar 9, 2020 at 5:49 AM Jan Beulich wrote: > > The common header doesn't itself need to include public/vm_event.h nor > public/memory.h. Drop their inclusion. This requires using the non- > typedef names in two prototypes and an inline function; by not changing > the callers and function

Re: [Xen-devel] [PATCH] memaccess: reduce include dependencies

2020-03-09 Thread Tamas K Lengyel
On Mon, Mar 9, 2020 at 10:03 AM Jan Beulich wrote: > > On 09.03.2020 16:51, Tamas K Lengyel wrote: > > On Mon, Mar 9, 2020 at 5:49 AM Jan Beulich wrote: > >> --- a/xen/include/asm-arm/mem_access.h > >> +++ b/xen/include/asm-arm/mem_access.h > &g

[PATCH v18 1/2] tools/libxc: add VM forking functions

2020-05-06 Thread Tamas K Lengyel
Add functions to issue VM forking hypercalls Signed-off-by: Tamas K Lengyel --- tools/libxc/include/xenctrl.h | 14 ++ tools/libxc/xc_memshr.c | 26 ++ 2 files changed, 40 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include

Re: [PATCH v17 2/2] xen/tools: VM forking toolstack side

2020-05-06 Thread Tamas K Lengyel
On Wed, May 6, 2020 at 7:00 AM Wei Liu wrote: > > On Fri, May 01, 2020 at 07:59:45AM -0600, Tamas K Lengyel wrote: > > On Thu, Apr 23, 2020 at 9:33 AM Tamas K Lengyel > > wrote: > > > > > > Add necessary bits to implement "xl fork-vm" comm

[PATCH v18 2/2] tools/libxl: VM forking toolstack side

2020-05-06 Thread Tamas K Lengyel
Add necessary bits to implement "xl fork-vm" commands. The command allows the user to specify how to launch the device model allowing for a late-launch model in which the user can execute the fork without the device model and decide to only later launch it. Signed-off-by: Tamas

QEMU-Xen build failure

2020-05-06 Thread Tamas K Lengyel
Hi all, on a recent checkout of the Xen staging source I ran into the following build error with QEMU upstream: tools/qemu-xen-dir-remote/slirp/src/ip_input.c:330:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] int delta = (char *)q - (m->m_flags &

Re: [PATCH 3/3] xen/vm_event: Add safe to disable vm_event

2020-05-20 Thread Tamas K Lengyel
On Wed, May 20, 2020 at 7:45 AM Jan Beulich wrote: > > On 15.05.2020 18:53, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/hvm/hvm.c > > +++ b/xen/arch/x86/hvm/hvm.c > > @@ -563,15 +563,41 @@ void hvm_do_resume(struct vcpu *v) > > v->arch.hvm.inject_even

Re: [PATCH 1/3] xen/monitor: Control register values

2020-05-20 Thread Tamas K Lengyel
On Wed, May 20, 2020 at 7:36 AM Jan Beulich wrote: > > On 15.05.2020 18:53, Tamas K Lengyel wrote: > > Extend the monitor_op domctl to include option that enables > > controlling what values certain registers are permitted to hold > > by a monitor subscriber. > > Thi

Re: [PATCH 1/3] xen/monitor: Control register values

2020-05-20 Thread Tamas K Lengyel
On Wed, May 20, 2020 at 7:48 AM Jan Beulich wrote: > > On 20.05.2020 15:42, Tamas K Lengyel wrote: > > On Wed, May 20, 2020 at 7:36 AM Jan Beulich wrote: > >> > >> On 15.05.2020 18:53, Tamas K Lengyel wrote: > >>> Extend the monitor_op domctl to include

Re: [PATCH 3/3] xen/vm_event: Add safe to disable vm_event

2020-05-20 Thread Tamas K Lengyel
On Wed, May 20, 2020 at 7:45 AM Jan Beulich wrote: > > On 15.05.2020 18:53, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/hvm/hvm.c > > +++ b/xen/arch/x86/hvm/hvm.c > > @@ -563,15 +563,41 @@ void hvm_do_resume(struct vcpu *v) > > v->arch.hvm.inject_even

[PATCH v2 for-4.14 3/3] xen/vm_event: Add safe to disable vm_event

2020-05-20 Thread Tamas K Lengyel
Instead of having to repeatedly try to disable vm_events, request a specific vm_event to be sent when the domain is safe to continue with shutting down the vm_event interface. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/hvm/hvm.c| 38 ++- xen/arch/x86

[PATCH v2 for-4.14 2/3] xen/vm_event: add vm_event_check_pending_op

2020-05-20 Thread Tamas K Lengyel
Perform sanity checking when shutting vm_event down to determine whether it is safe to do so. Error out with -EAGAIN in case pending operations have been found for the domain. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/vm_event.c| 23 +++ xen/common/vm_event.c

[PATCH v2 for-4.14 0/3] vm_event: fix race-condition when disabling monitor events

2020-05-20 Thread Tamas K Lengyel
cial piece of information that lead to finally squashing this nasty bug. v2: minor adjustments based on Jan's comments Tamas K Lengyel (3): xen/monitor: Control register values xen/vm_event: add vm_event_check_pending_op xen/vm_event: Add safe to disable vm_event xen/arch/x86/hvm/hvm.c

[PATCH v2 for-4.14 1/3] xen/monitor: Control register values

2020-05-20 Thread Tamas K Lengyel
Extend the monitor_op domctl to include option that enables controlling what values certain registers are permitted to hold by a monitor subscriber. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/hvm/hvm.c | 25 - xen/arch/x86/monitor.c | 10 +- xen

Re: [PATCH for-4.14 0/3] Remove the 1GB limitation on Rasberry Pi 4

2020-05-19 Thread Tamas K Lengyel
On Tue, May 19, 2020 at 11:23 AM Julien Grall wrote: > > > > On 19/05/2020 04:08, Tamas K Lengyel wrote: > > On Mon, May 18, 2020 at 5:32 AM Julien Grall wrote: > >> > >> From: Julien Grall > >> > >> Hi all, > >> > >&g

Re: [PATCH for-4.14 0/3] Remove the 1GB limitation on Rasberry Pi 4

2020-05-19 Thread Tamas K Lengyel
On Tue, May 19, 2020 at 5:50 PM Roman Shaposhnik wrote: > > On Tue, May 19, 2020 at 4:44 PM Tamas K Lengyel > wrote: > > > > On Tue, May 19, 2020 at 11:23 AM Julien Grall wrote: > > > > > > > > > > > > On 19/05/2020 04:08, Tamas K Leng

Re: [PATCH for-4.14 0/3] Remove the 1GB limitation on Rasberry Pi 4

2020-05-19 Thread Tamas K Lengyel
On Tue, May 19, 2020 at 8:28 PM Roman Shaposhnik wrote: > > On Tue, May 19, 2020, 7:15 PM Tamas K Lengyel > wrote: >> >> On Tue, May 19, 2020 at 5:50 PM Roman Shaposhnik wrote: >> > >> > On Tue, May 19, 2020 at 4:44 PM Tamas K Lengyel >> > wrote

Re: [PATCH for-4.14 1/2] x86/mem_sharing: Prohibit interrupt injection for forks

2020-05-21 Thread Tamas K Lengyel
> diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c > index 000e14af49..3814795e3f 100644 > --- a/xen/arch/x86/hvm/vmx/intr.c > +++ b/xen/arch/x86/hvm/vmx/intr.c > @@ -256,6 +256,10 @@ void vmx_intr_assist(void) > if ( unlikely(v->arch.vm_event) &&

[PATCH for-4.14 2/2] tools/libxc: xc_memshr_fork with interrupts disabled

2020-05-21 Thread Tamas K Lengyel
Toolstack side for creating forks with interrupt injection disabled. Signed-off-by: Tamas K Lengyel --- tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_memshr.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc

[PATCH for-4.14 1/2] x86/mem_sharing: Prohibit interrupt injection for forks

2020-05-21 Thread Tamas K Lengyel
interference. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/hvm/vmx/intr.c | 4 xen/arch/x86/mm/mem_sharing.c| 6 +- xen/include/asm-x86/hvm/domain.h | 2 ++ xen/include/public/memory.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm

Re: i915 dma faults on Xen

2020-10-15 Thread Tamas K Lengyel
> > Can you paste the memory map as printed by Xen when booting, and what > > command line are you using to boot Xen. > > So this is OpenXT, and it's booting EFI -> xen -> tboot -> xen Unrelated comment: since tboot now has a PE build (http://hg.code.sf.net/p/tboot/code/rev/5c68f0963a78) I think

Re: [PATCH v2 3/5] x86: don't override INVALID_M2P_ENTRY with SHARED_M2P_ENTRY

2020-08-24 Thread Tamas K Lengyel
On Mon, Aug 24, 2020 at 9:06 AM Jan Beulich wrote: > > On 24.08.2020 15:00, Andrew Cooper wrote: > > On 24/08/2020 13:34, Jan Beulich wrote: > >> While in most cases code ahead of the invocation of set_gpfn_from_mfn() > >> deals with shared pages, at least in set_typed_p2m_entry() I can't spot >

Re: [PATCH v9 0/8] domain context infrastructure

2020-09-29 Thread Tamas K Lengyel
On Tue, Sep 29, 2020 at 7:54 AM Durrant, Paul wrote: > > > -Original Message- > > From: Lengyel, Tamas > > Sent: 28 September 2020 15:17 > > To: p...@xen.org; xen-devel@lists.xenproject.org > > Cc: Durrant, Paul ; 'Andrew Cooper' > > ; 'Daniel De > > Graaf' ; 'George Dunlap' ; > > 'Ian

Re: [PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-24 Thread Tamas K Lengyel
On Sun, May 24, 2020 at 8:33 PM Tian, Kevin wrote: > > > From: Lengyel, Tamas > > Sent: Saturday, May 23, 2020 12:34 AM > > > > When running shallow forks without device models it may be undesirable for > > Xen > > what is shallow forks? and why interrupt injection is not desired without >

Re: [PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-25 Thread Tamas K Lengyel
On Mon, May 25, 2020 at 6:18 AM Tamas K Lengyel wrote: > > On Mon, May 25, 2020 at 12:06 AM Jan Beulich wrote: > > > > On 22.05.2020 18:33, Tamas K Lengyel wrote: > > > When running shallow forks without device models it may be undesirable > > > for Xen >

Re: [PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-25 Thread Tamas K Lengyel
On Mon, May 25, 2020 at 8:06 AM Jan Beulich wrote: > > On 25.05.2020 15:46, Tamas K Lengyel wrote: > > On Mon, May 25, 2020 at 7:06 AM Jan Beulich wrote: > >> > >> On 25.05.2020 14:18, Tamas K Lengyel wrote: > >>> On Mon, May 25, 2020 at 12:06 AM Jan B

Re: [PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-25 Thread Tamas K Lengyel
On Mon, May 25, 2020 at 7:06 AM Jan Beulich wrote: > > On 25.05.2020 14:18, Tamas K Lengyel wrote: > > On Mon, May 25, 2020 at 12:06 AM Jan Beulich wrote: > >> > >> On 22.05.2020 18:33, Tamas K Lengyel wrote: > >>> When running shallow forks w

Re: [PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-25 Thread Tamas K Lengyel
On Mon, May 25, 2020 at 8:14 AM Tamas K Lengyel wrote: > > On Mon, May 25, 2020 at 8:06 AM Jan Beulich wrote: > > > > On 25.05.2020 15:46, Tamas K Lengyel wrote: > > > On Mon, May 25, 2020 at 7:06 AM Jan Beulich wrote: > > >> > > >> On 25.0

Re: [PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-25 Thread Tamas K Lengyel
On Mon, May 25, 2020 at 12:06 AM Jan Beulich wrote: > > On 22.05.2020 18:33, Tamas K Lengyel wrote: > > When running shallow forks without device models it may be undesirable for > > Xen > > to inject interrupts. With Windows forks we have observed the kernel going >

[PATCH] x86/mem_sharing: gate enabling on cpu_has_vmx

2020-05-25 Thread Tamas K Lengyel
From: Tamas K Lengyel It is unclear whether mem_sharing was ever made to work on other architectures but at this time the only verified platform for it is vmx. No plans to support or maintain it on other architectures. Make this explicit by checking during initialization. Signed-off-by: Tamas K

[PATCH v3 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-25 Thread Tamas K Lengyel
Note that this is part of the experimental VM forking feature that's completely disabled by default and can only be enabled by using XEN_CONFIG_EXPERT during compile time. Signed-off-by: Tamas K Lengyel --- v3: add comments in the public header how this option only makes sense for short lived f

[PATCH v3 for-4.14 2/2] tools/libxc: xc_memshr_fork with interrupts blocked

2020-05-25 Thread Tamas K Lengyel
Toolstack side for creating forks with interrupt injection blocked. Signed-off-by: Tamas K Lengyel Reviewed-by: Roger Pau Monné Acked-by: Ian Jackson --- tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_memshr.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

Re: [BUG] Core scheduling patches causing deadlock in some situations

2020-05-29 Thread Tamas K Lengyel
On Fri, May 29, 2020 at 7:51 AM Michał Leszczyński wrote: > > - 29 maj 2020 o 15:15, Jürgen Groß jgr...@suse.com napisał(a): > > > On 29.05.20 14:51, Michał Leszczyński wrote: > >> - 29 maj 2020 o 14:44, Jürgen Groß jgr...@suse.com napisał(a): > >> > >>> On 29.05.20 14:30, Michał

[PATCH for-4.14] tools/libxl: fix setting altp2m param broken by 1e9bc407cf0

2020-05-29 Thread Tamas K Lengyel
The patch 1e9bc407cf0 mistakenly converted the altp2m config option to a boolean. This is incorrect and breaks external-only usecases of altp2m that is set with a value of 2. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

Re: [BUG] Core scheduling patches causing deadlock in some situations

2020-05-29 Thread Tamas K Lengyel
On Fri, May 29, 2020 at 8:48 AM Tamas K Lengyel wrote: > > On Fri, May 29, 2020 at 7:51 AM Michał Leszczyński > wrote: > > > > - 29 maj 2020 o 15:15, Jürgen Groß jgr...@suse.com napisał(a): > > > > > On 29.05.20 14:51, Michał Leszczyński wrote: > >

Re: [PATCH for-4.14] tools/libxl: fix setting altp2m param broken by 1e9bc407cf0

2020-05-29 Thread Tamas K Lengyel
On Fri, May 29, 2020 at 10:15 AM Andrew Cooper wrote: > > On 29/05/2020 17:06, Tamas K Lengyel wrote: > > The patch 1e9bc407cf0 mistakenly converted the altp2m config option to a > > boolean. This is incorrect and breaks external-only usecases of altp2m that > >

[PATCH v2 for-4.14] tools/libxl: fix setting altp2m param broken by 1e9bc407cf0

2020-05-29 Thread Tamas K Lengyel
The patch 1e9bc407cf0 mistakenly converted the altp2m config option to a boolean. This is incorrect and breaks external-only usecases of altp2m that is set with a value of 2. Signed-off-by: Tamas K Lengyel --- v2: just convert bool to unsigned int --- tools/libxl/libxl_x86.c | 2 +- 1 file

Re: [PATCH v2 for-4.14] tools/libxl: fix setting altp2m param broken by 1e9bc407cf0

2020-05-29 Thread Tamas K Lengyel
On Fri, May 29, 2020 at 10:32 AM Ian Jackson wrote: > > Andrew Cooper writes ("Re: [PATCH v2 for-4.14] tools/libxl: fix setting > altp2m param broken by 1e9bc407cf0"): > > On 29/05/2020 17:22, Tamas K Lengyel wrote: > > > The patch 1e9bc407cf0 mistakenly

Re: [PATCH v19 for-4.14 00/13] VM forking

2020-06-01 Thread Tamas K Lengyel
On Mon, Jun 1, 2020 at 11:11 AM George Dunlap wrote: > > > > > On Jun 1, 2020, at 4:07 PM, Paul Durrant wrote: > > > >> -Original Message- > >> From: Xen-devel On Behalf Of > >> Tamas K Lengyel > >> Sent: 01 June 2020 14:22 &g

Re: [PATCH v2 for-4.14 0/3] vm_event: fix race-condition when disabling monitor events

2020-06-01 Thread Tamas K Lengyel
On Wed, May 20, 2020 at 8:31 PM Tamas K Lengyel wrote: > > For the last couple years we have received numerous reports from users of > monitor vm_events of spurious guest crashes when using events. In particular, > it has observed that the problem occurs when vm_events are be

[PATCH v19 for-4.14 08/13] tools/libxl: Adjust libxl__build_post

2020-06-01 Thread Tamas K Lengyel
Skips parts not relevant to VM forks. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_dom.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 1b55097a1a..52d49437cc 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl

[PATCH v19 for-4.14 06/13] tools/libxl: adjust domcreate_bootloader_done

2020-06-01 Thread Tamas K Lengyel
Add special handling when only the the device model needs launching for forks. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_create.c | 9 + tools/libxl/libxl_internal.h | 1 + 2 files changed, 10 insertions(+) diff --git a/tools/libxl/libxl_create.c b/tools/libxl

[PATCH v19 for-4.14 04/13] tools/libxl: populate xenstore entries when launching dm for VM fork

2020-06-01 Thread Tamas K Lengyel
No need to call libxl__domain_make since the domain already exists, only need to populate the xenstore entries via libxl__domain_make_xs_entries. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_create.c | 11 ++- tools/libxl/libxl_types.idl | 1 + 2 files changed, 11 insertions

[PATCH v19 for-4.14 00/13] VM forking

2020-06-01 Thread Tamas K Lengyel
to be made aware of being saved/migrated. New in v19: Including all the patches currently outstanding into the series Breaking up libxl/xl patch to many sub-patches to make it easier to review libxl/xl is now reduced to the bare essential to launch QEMU for a VM fork Tamas K Leng

[PATCH v19 for-4.14 02/13] tools/libxc: xc_memshr_fork with interrupts blocked

2020-06-01 Thread Tamas K Lengyel
Toolstack side for creating forks with interrupt injection blocked. Signed-off-by: Tamas K Lengyel Reviewed-by: Roger Pau Monné Acked-by: Ian Jackson --- tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_memshr.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH v19 for-4.14 09/13] tools/libxl: libxl__build_hvm_fork

2020-06-01 Thread Tamas K Lengyel
Add libxl__build_hvm_fork function that performs only the steps needed for VM forks, skipping a large chunk of libxl__build_hvm. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_dom.c | 32 +--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tools

[PATCH v19 for-4.14 01/13] x86/mem_sharing: block interrupt injection for forks

2020-06-01 Thread Tamas K Lengyel
part of the experimental VM forking feature that's completely disabled by default and can only be enabled by using XEN_CONFIG_EXPERT during compile time. Signed-off-by: Tamas K Lengyel Reviewed-by: Roger Pau Monné --- xen/arch/x86/hvm/vmx/intr.c | 6 ++ xen/arch/x86/mm/mem_sharing.c| 6 +-

[PATCH v19 for-4.14 03/13] tools/libxl: Split libxl__domain_make

2020-06-01 Thread Tamas K Lengyel
Make part of libxl__domain_make into a separate function. No functional change. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_create.c | 62 +++- tools/libxl/libxl_internal.h | 4 ++- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git

[PATCH v19 for-4.14 05/13] tools/libxl: Add checks for dm_restore_file

2020-06-01 Thread Tamas K Lengyel
We can skip a bunch of steps a normal domain creation would entail, similar to how domain restore & soft_reset skips them. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_create.c b/t

[PATCH v19 for-4.14 07/13] tools/libxl: Adjust libxl__build_pre

2020-06-01 Thread Tamas K Lengyel
Skips parts not relevant for VM forks. No functional change in existing code, only relocating some bits that don't need to be done at the very end. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_dom.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff

[PATCH v19 for-4.14 11/13] tools/libxl: Add VM forking public functions

2020-06-01 Thread Tamas K Lengyel
Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl.h| 10 + tools/libxl/libxl_create.c | 44 ++ 2 files changed, 54 insertions(+) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 71709dc585..79792d6e29 100644 --- a/tools/libxl

[PATCH v19 for-4.14 10/13] tools/libxl: set QEMU saved_state from dm_restore_file

2020-06-01 Thread Tamas K Lengyel
And make sure we don't remove the file once done. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_create.c | 4 tools/libxl/libxl_dm.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index ab3ac096ee

[PATCH v19 for-4.14 13/13] tools/xl: document fork-vm command

2020-06-01 Thread Tamas K Lengyel
Signed-off-by: Tamas K Lengyel --- docs/man/xl.1.pod.in | 39 +++ 1 file changed, 39 insertions(+) diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in index 09339282e6..9e87b0314f 100644 --- a/docs/man/xl.1.pod.in +++ b/docs/man/xl.1.pod.in @@ -708,6

[PATCH v19 for-4.14 12/13] tools/xl: Add xl fork-vm command

2020-06-01 Thread Tamas K Lengyel
Adding the xl fork-vm command, compiled only on x86. Only the essential bits are available via this command to create a fork and launch QEMU for it. The command still allows to perform the task in a split-model, first creating the fork and launching QEMU only later. Signed-off-by: Tamas K Lengyel

[PATCH v2 for-4.14 1/2] x86/mem_sharing: block interrupt injection for forks

2020-05-22 Thread Tamas K Lengyel
QEMU running. By disabling interrupt injection the fuzzer can exercise the target code without interference. Forks & memory sharing are only available on Intel CPUs so this only applies to vmx. Signed-off-by: Tamas K Lengyel --- v2: prohibit => block minor style adjustments --- xen/a

[PATCH v2 for-4.14 2/2] tools/libxc: xc_memshr_fork with interrupts blocked

2020-05-22 Thread Tamas K Lengyel
Toolstack side for creating forks with interrupt injection blocked. Signed-off-by: Tamas K Lengyel Reviewed-by: Roger Pau Monné Acked-by: Ian Jackson --- tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_memshr.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH v3 for-4.14] x86/monitor: revert default behavior when monitoring register write events

2020-06-02 Thread Tamas K Lengyel
ent occurs. To postpone them can be turned on as an option. In that case the user of the interface still has to take care of only disabling the interface when its safe as it remains buggy. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/hvm/hvm.c| 14 -- xen/arch/x86/hvm

Re: [PATCH v2 for-4.14 2/3] xen/vm_event: add vm_event_check_pending_op

2020-06-02 Thread Tamas K Lengyel
On Tue, Jun 2, 2020 at 5:47 AM Roger Pau Monné wrote: > > On Wed, May 20, 2020 at 08:31:53PM -0600, Tamas K Lengyel wrote: > > Perform sanity checking when shutting vm_event down to determine whether > > it is safe to do so. Error out with -EAGAIN in case pending operations &

Re: [PATCH v2 for-4.14 1/3] xen/monitor: Control register values

2020-06-02 Thread Tamas K Lengyel
On Tue, Jun 2, 2020 at 7:00 AM Jan Beulich wrote: > > On 02.06.2020 14:51, Tamas K Lengyel wrote: > > On Tue, Jun 2, 2020 at 6:47 AM Jan Beulich wrote: > >> > >> On 02.06.2020 14:40, Tamas K Lengyel wrote: > >>> On Tue, Jun 2, 2020 at 5:08 AM Roger Pau

Re: [PATCH v2 for-4.14 1/3] xen/monitor: Control register values

2020-06-02 Thread Tamas K Lengyel
On Tue, Jun 2, 2020 at 5:08 AM Roger Pau Monné wrote: > > On Wed, May 20, 2020 at 08:31:52PM -0600, Tamas K Lengyel wrote: > > Extend the monitor_op domctl to include option that enables > > controlling what values certain registers are permitted to hold > > by a monitor

Re: [PATCH v2 for-4.14 1/3] xen/monitor: Control register values

2020-06-02 Thread Tamas K Lengyel
On Tue, Jun 2, 2020 at 7:04 AM Jan Beulich wrote: > > On 02.06.2020 15:01, Roger Pau Monné wrote: > > On Tue, Jun 02, 2020 at 06:40:12AM -0600, Tamas K Lengyel wrote: > >> On Tue, Jun 2, 2020 at 5:08 AM Roger Pau Monné > >> wrote: > >>> On Wed, May 20,

<    3   4   5   6   7   8   9   10   11   >