Re: [Xen-devel] [PATCH v9 5/5] xen/tools: VM forking toolstack side

2020-02-24 Thread Tamas K Lengyel
On Mon, Feb 24, 2020 at 9:13 AM Julien Grall wrote: > > Hi Tamas, > > On 21/02/2020 18:49, Tamas K Lengyel wrote: > > +int libxl_domain_fork_vm(libxl_ctx *ctx, uint32_t pdomid, uint32_t *domid) > > +{ > > +int rc; > > +struct xen_domctl_createdomain

Re: [Xen-devel] [PATCH v9 4/5] x86/mem_sharing: reset a fork

2020-02-24 Thread Tamas K Lengyel
On Mon, Feb 24, 2020 at 8:13 AM Roger Pau Monné wrote: > > On Fri, Feb 21, 2020 at 10:49:22AM -0800, Tamas K Lengyel wrote: > > Implement hypercall that allows a fork to shed all memory that got allocated > > for it during its execution and re-load its vCPU context

Re: [Xen-devel] [PATCH v9 3/5] xen/mem_sharing: VM forking

2020-02-24 Thread Tamas K Lengyel
On Mon, Feb 24, 2020 at 5:39 AM Roger Pau Monné wrote: > > On Fri, Feb 21, 2020 at 10:49:21AM -0800, Tamas K Lengyel wrote: > > VM forking is the process of creating a domain with an empty memory space > > and a > > parent domain specified from which to populate t

Re: [Xen-devel] [PATCH v9 4/5] x86/mem_sharing: reset a fork

2020-02-24 Thread Tamas K Lengyel
On Mon, Feb 24, 2020 at 8:42 AM Roger Pau Monné wrote: > > On Mon, Feb 24, 2020 at 08:35:09AM -0700, Tamas K Lengyel wrote: > > On Mon, Feb 24, 2020 at 8:13 AM Roger Pau Monné > > wrote: > > > > > > On Fri, Feb 21, 2020 at 10:49:22AM -0800, Tamas K Lengye

Re: [Xen-devel] [PATCH v9 4/5] x86/mem_sharing: reset a fork

2020-02-25 Thread Tamas K Lengyel
> >> In such a case, please put in a comment explaining why failure is > >> impossible. In the general case e.g. a 2Mb page may need splitting, > >> which may yield -ENOMEM. Such a comment will then also be useful in > >> case a new failure mode gets added to ->set_entry(), where it then > >> will

Re: [Xen-devel] [PATCH v9 3/5] xen/mem_sharing: VM forking

2020-02-25 Thread Tamas K Lengyel
> > Note also that during a restore the guest is aware of such process, > > and will know that it needs to re-register some stuff, but that's not > > the case when forking, since the guest is not aware you need to make > > sure everything is in place. There are also the grant table pages, > >

Re: [Xen-devel] [PATCH 5/6] mm: add 'is_special_page' macro...

2020-02-28 Thread Tamas K Lengyel
> diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c > index 3835bc928f..c14a724c6d 100644 > --- a/xen/arch/x86/mm/mem_sharing.c > +++ b/xen/arch/x86/mm/mem_sharing.c > @@ -842,7 +842,7 @@ static int nominate_page(struct domain *d, gfn_t gfn, > > /* Skip xen heap pages

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

2020-02-28 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 v11 1/3] xen/mem_sharing: VM forking

2020-02-28 Thread Tamas K Lengyel
-by: Tamas K Lengyel --- 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 with fork_reset in the next patch --- xen/arch/x86/domain.c | 11 + xen/arch/x86/hvm

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

2020-02-28 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 --- v11: use

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

2020-02-28 Thread Tamas K Lengyel
-2 implements the VM fork & reset operation hypervisor side bits Patch 3 adds the toolstack-side code implementing VM forking and reset Tamas K Lengyel (3): xen/mem_sharing: VM forking x86/mem_sharing: reset a fork xen/tools: VM forking toolstack side docs/man/xl.1.pod.in | 44 +

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

2020-02-26 Thread Tamas K Lengyel
On Wed, Feb 26, 2020 at 9:10 AM Roger Pau Monné wrote: > > On Wed, Feb 26, 2020 at 08:58:05AM -0700, Tamas K Lengyel wrote: > > On Wed, Feb 26, 2020 at 8:36 AM Roger Pau Monné > > wrote: > > > > > > On Wed, Feb 26, 2020 at 08:20:30AM -0700, Tamas K Le

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

2020-02-26 Thread Tamas K Lengyel
On Wed, Feb 26, 2020 at 8:36 AM Roger Pau Monné wrote: > > On Wed, Feb 26, 2020 at 08:20:30AM -0700, Tamas K Lengyel wrote: > > > > +static int populate_special_pages(struct domain *cd) > > > > +{ > > > > +struct p2m_domain *p2m = p2m_get_hostp2m(c

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

2020-02-26 Thread Tamas K Lengyel
On Wed, Feb 26, 2020 at 9:17 AM Tamas K Lengyel wrote: > > On Wed, Feb 26, 2020 at 9:10 AM Roger Pau Monné wrote: > > > > On Wed, Feb 26, 2020 at 08:58:05AM -0700, Tamas K Lengyel wrote: > > > On Wed, Feb 26, 2020 at 8:36 AM Roger Pau Monné > > > wrote:

Re: [Xen-devel] [PATCH v9 5/5] xen/tools: VM forking toolstack side

2020-02-24 Thread Tamas K Lengyel
On Mon, Feb 24, 2020 at 9:30 AM Julien Grall wrote: > > Hi, > > On 24/02/2020 16:19, Tamas K Lengyel wrote: > > On Mon, Feb 24, 2020 at 9:13 AM Julien Grall wrote: > >> > >> Hi Tamas, > >> > >> On 21/02/2020 18:49, Tamas K Lengyel wrote: &g

[Xen-devel] [PATCH] x86/mem_access: move _ve functions to x86 header

2020-01-24 Thread Tamas K Lengyel
These functions don't belong in the common mem_access header as there is no #VE equivalent on ARM. Signed-off-by: Tamas K Lengyel --- xen/include/asm-x86/mem_access.h | 10 ++ xen/include/xen/mem_access.h | 10 -- 2 files changed, 10 insertions(+), 10 deletions(-) diff

Re: [Xen-devel] [PATCH] x86/mem_access: move _ve functions to x86 header

2020-01-24 Thread Tamas K Lengyel
On Fri, Jan 24, 2020 at 6:57 AM Andrew Cooper wrote: > > On 24/01/2020 13:56, Tamas K Lengyel wrote: > > These functions don't belong in the common mem_access header as there is no > > #VE > > equivalent on ARM. > > > > Signed-off-by: Tamas K Lengyel &

Re: [Xen-devel] [PATCH] Arm/p2m: fix build after ea22bcd030da and 2aa977eb6baa

2020-01-24 Thread Tamas K Lengyel
On Fri, Jan 24, 2020 at 5:50 AM Jan Beulich wrote: > > On 24.01.2020 11:05, George Dunlap wrote: > > On 1/24/20 8:51 AM, Jan Beulich wrote: > >> Each of these commits introduced a function prototype referencing a > >> structure which hadn't at least been forward declared. Add such > >>

Re: [Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-29 Thread Tamas K Lengyel
On Wed, Jan 29, 2020 at 6:27 AM Jan Beulich wrote: > > On 28.01.2020 18:02, Tamas K Lengyel wrote: > > On Tue, Jan 28, 2020 at 9:56 AM Jan Beulich wrote: > >> > >> On 27.01.2020 19:06, Tamas K Lengyel wrote: > >>> When plugging a hole in the targ

Re: [Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-29 Thread Tamas K Lengyel
On Wed, Jan 29, 2020 at 7:44 AM Jan Beulich wrote: > > On 29.01.2020 15:05, Tamas K Lengyel wrote: > > On Wed, Jan 29, 2020 at 6:27 AM Jan Beulich wrote: > >> > >> On 28.01.2020 18:02, Tamas K Lengyel wrote: > >>> On Tue, Jan 28, 2020 at 9:56 AM Jan Beul

Re: [Xen-devel] [ANNOUNCE] Xen 4.14 Development Update

2020-01-29 Thread Tamas K Lengyel
> === x86 === VM forking series is at v6 Tamas ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v6 7/9] xen/mem_access: Use __get_gfn_type_access in set_mem_access

2020-01-29 Thread Tamas K Lengyel
On Wed, Jan 29, 2020 at 6:10 AM Jan Beulich wrote: > > On 27.01.2020 19:06, Tamas K Lengyel wrote: > > Use __get_gfn_type_access instead of p2m->get_entry to trigger page-forking > > when the mem_access permission is being set on a page that has not yet been > >

Re: [Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-29 Thread Tamas K Lengyel
On Wed, Jan 29, 2020 at 7:05 AM Tamas K Lengyel wrote: > > On Wed, Jan 29, 2020 at 6:27 AM Jan Beulich wrote: > > > > On 28.01.2020 18:02, Tamas K Lengyel wrote: > > > On Tue, Jan 28, 2020 at 9:56 AM Jan Beulich wrote: > > >> > > >> On 27

[Xen-devel] [PATCH v6 9/9] xen/tools: VM forking toolstack side

2020-01-27 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 v6 4/9] x86/mem_sharing: Replace MEM_SHARING_DEBUG with gdprintk

2020-01-27 Thread Tamas K Lengyel
Using XENLOG_ERR level since this is only used in debug paths (ie. it's expected the user already has loglvl=all set). Also use %pd to print the domain ids. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/mem_sharing.c | 82 +-- 1 file changed, 41 insertions

[Xen-devel] [PATCH v6 3/9] xen/x86: Make hap_get_allocation accessible

2020-01-27 Thread Tamas K Lengyel
before (or even completely without) the toolstack. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/hap/hap.c | 3 +-- xen/include/asm-x86/hap.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index 3d93f3451c..c7c7ff6e99

[Xen-devel] [PATCH v6 6/9] xen/mem_sharing: VM forking

2020-01-27 Thread Tamas K Lengyel
-by: Tamas K Lengyel --- v6: use get_domain/put_domain on parent to make sure it's not destroyed --- xen/arch/x86/domain.c | 11 ++ xen/arch/x86/hvm/hvm.c| 2 +- xen/arch/x86/mm/mem_sharing.c | 222 ++ xen/arch/x86/mm/p2m.c | 11

[Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-27 Thread Tamas K Lengyel
When plugging a hole in the target physmap don't use the access permission returned by __get_gfn_type_access as it can be non-sensical, leading to spurious vm_events being sent out for access violations at unexpected locations. Make use of p2m->default_access instead. Signed-off-by: Tama

[Xen-devel] [PATCH v6 8/9] x86/mem_sharing: reset a fork

2020-01-27 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 --- xen/arch/x86/mm

[Xen-devel] [PATCH v6 2/9] x86/hvm: introduce hvm_copy_context_and_params

2020-01-27 Thread Tamas K Lengyel
Currently the hvm parameters are only accessible via the HVMOP hypercalls. In this patch we introduce a new function that can copy both the hvm context and parameters directly into a target domain. No functional changes in existing code. Signed-off-by: Tamas K Lengyel --- v6: finish addressing

[Xen-devel] [PATCH v6 7/9] xen/mem_access: Use __get_gfn_type_access in set_mem_access

2020-01-27 Thread Tamas K Lengyel
Use __get_gfn_type_access instead of p2m->get_entry to trigger page-forking when the mem_access permission is being set on a page that has not yet been copied over from the parent. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/mem_access.c | 5 ++--- 1 file changed, 2 insertions(+)

[Xen-devel] [PATCH v6 1/9] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-01-27 Thread Tamas K Lengyel
The owner domain of shared pages is dom_cow, use that for get_page otherwise the function fails to return the correct page. Fixing the error now and simplifying the checks since we can't have any shared entries with dom_cow being NULL. Signed-off-by: Tamas K Lengyel --- v6: use simplified check

[Xen-devel] [PATCH v6 0/9] VM forking

2020-01-27 Thread Tamas K Lengyel
the VM fork reset operation hypervisor side bits. Patch 9 adds the toolstack-side code implementing VM forking and reset. Tamas K Lengyel (9): x86/hvm: introduce hvm_copy_context_and_params xen/x86: Make hap_get_allocation accessible x86/p2m: Allow p2m_get_page_from_gfn to return shared entr

Re: [Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-29 Thread Tamas K Lengyel
On Wed, Jan 29, 2020 at 7:56 AM Tamas K Lengyel wrote: > > On Wed, Jan 29, 2020 at 7:44 AM Jan Beulich wrote: > > > > On 29.01.2020 15:05, Tamas K Lengyel wrote: > > > On Wed, Jan 29, 2020 at 6:27 AM Jan Beulich wrote: > > >> > > >> On 28.0

Re: [Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-29 Thread Tamas K Lengyel
On Wed, Jan 29, 2020 at 9:09 AM Tamas K Lengyel wrote: > > On Wed, Jan 29, 2020 at 7:56 AM Tamas K Lengyel > wrote: > > > > On Wed, Jan 29, 2020 at 7:44 AM Jan Beulich wrote: > > > > > > On 29.01.2020 15:05, Tamas K Lengyel wrote: > > > >

Re: [Xen-devel] [PATCH] xen/hvm: Fix handling of obsolete HVM_PARAMs

2020-02-06 Thread Tamas K Lengyel
: Roger Pau Monné > CC: Ian Jackson > CC: Razvan Cojocaru > CC: Tamas K Lengyel > > Tamas: You introduced xc_hvm_param_deprecated_check() in 0a246b41ca while > introducing XEN_DOMCTL_monitor_op. Do you recall why? Well, from the looks of it the intent was to tell any remainin

Re: [Xen-devel] [PATCH v7 1/7] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-02-03 Thread Tamas K Lengyel
On Mon, Feb 3, 2020 at 9:24 AM Jan Beulich wrote: > > On 03.02.2020 17:12, Tamas K Lengyel wrote: > > The owner domain of shared pages is dom_cow, use that for get_page > > otherwise the function fails to return the correct page under some > > situations. The check i

[Xen-devel] [PATCH v7 5/7] xen/mem_sharing: VM forking

2020-02-03 Thread Tamas K Lengyel
-by: Tamas K Lengyel --- xen/arch/x86/domain.c | 11 ++ xen/arch/x86/hvm/hvm.c| 2 +- xen/arch/x86/mm/mem_sharing.c | 221 ++ xen/arch/x86/mm/p2m.c | 11 +- xen/include/asm-x86/mem_sharing.h | 17 +++ xen/include/public/memory.h

[Xen-devel] [PATCH v7 7/7] xen/tools: VM forking toolstack side

2020-02-03 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 v7 6/7] x86/mem_sharing: reset a fork

2020-02-03 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 --- xen/arch/x86/mm

[Xen-devel] [PATCH v7 0/7] VM forking

2020-02-03 Thread Tamas K Lengyel
n be committed out-of-order Patch 1 is a bugfix in existing code in p2m Patch 2-3 implement changes to make forking possible Patch 4 is a bugfix in mem_sharing Patch 5-6 implements the VM fork and reset operation hypervisor side bits Patch 7 adds the toolstack-side code implementing VM forking and r

[Xen-devel] [PATCH v7 3/7] xen/x86: Make hap_get_allocation accessible

2020-02-03 Thread Tamas K Lengyel
before (or even completely without) the toolstack. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/hap/hap.c | 3 +-- xen/include/asm-x86/hap.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index 3d93f3451c..c7c7ff6e99

[Xen-devel] [PATCH v7 1/7] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-02-03 Thread Tamas K Lengyel
any shared entries with dom_cow being NULL. Signed-off-by: Tamas K Lengyel --- v7: update commit message --- xen/arch/x86/mm/p2m.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index def13f657b..007fef720d 100644

[Xen-devel] [PATCH v7 2/7] x86/hvm: introduce hvm_copy_context_and_params

2020-02-03 Thread Tamas K Lengyel
Currently the hvm parameters are only accessible via the HVMOP hypercalls. In this patch we introduce a new function that can copy both the hvm context and parameters directly into a target domain. Signed-off-by: Tamas K Lengyel --- v7: get rid of goto's during code-movement as requested by Jan

[Xen-devel] [PATCH v7 4/7] x86/mem_sharing: use default_access in add_to_physmap

2020-02-03 Thread Tamas K Lengyel
of p2m->default_access instead and document the ambiguity surrounding "hole" types and corner-cases with custom mem_access being set on holes. Signed-off-by: Tamas K Lengyel --- v7: add detailed comment explaining the issue and why this fix is correct --- xen/arch/x86/mm/mem_s

Re: [Xen-devel] [PATCH] x86/p2m: drop p2m_access_t parameter from set_mmio_p2m_entry()

2020-02-07 Thread Tamas K Lengyel
On Fri, Feb 7, 2020 at 10:16 AM Tamas K Lengyel wrote: > > On Fri, Feb 7, 2020 at 9:54 AM Jan Beulich wrote: > > > > On 07.02.2020 10:52, Roger Pau Monné wrote: > > > On Fri, Feb 07, 2020 at 09:08:15AM +0100, Jan Beulich wrote: > > >> On 06.02.2020 16:2

Re: [Xen-devel] [PATCH] x86/p2m: drop p2m_access_t parameter from set_mmio_p2m_entry()

2020-02-07 Thread Tamas K Lengyel
On Fri, Feb 7, 2020 at 9:54 AM Jan Beulich wrote: > > On 07.02.2020 10:52, Roger Pau Monné wrote: > > On Fri, Feb 07, 2020 at 09:08:15AM +0100, Jan Beulich wrote: > >> On 06.02.2020 16:20, Jan Beulich wrote: > >>> --- a/xen/arch/x86/hvm/vmx/vmx.c > >>> +++ b/xen/arch/x86/hvm/vmx/vmx.c > >>> @@

Re: [Xen-devel] [PATCH v5 14/18] x86/mem_sharing: use default_access in add_to_physmap

2020-01-23 Thread Tamas K Lengyel
On Thu, Jan 23, 2020 at 9:44 AM George Dunlap wrote: > > On 1/22/20 5:08 PM, Tamas K Lengyel wrote: > > On Wed, Jan 22, 2020 at 8:35 AM Jan Beulich wrote: > >> > >> On 21.01.2020 18:49, Tamas K Lengyel wrote: > >>> When plugging a hole in the targ

[Xen-devel] Valgrind support upgraded to Xen 4.13

2020-01-23 Thread Tamas K Lengyel
Hi all, I just wanted to bring it to the community's attention that I've upped Valgrind's Xen support to include everything up to Xen 4.13. It's now merged and will be part of the next Valgrind release: https://sourceware.org/git/?p=valgrind.git;a=commit;h=c88133141a354d65568fb85037abc5e1f74ce46b

Re: [Xen-devel] [PATCH v5 03/18] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-01-23 Thread Tamas K Lengyel
On Thu, Jan 23, 2020 at 8:32 AM George Dunlap wrote: > > On 1/22/20 4:55 PM, Jan Beulich wrote: > > On 22.01.2020 17:51, Tamas K Lengyel wrote: > >> On Wed, Jan 22, 2020 at 8:23 AM Jan Beulich wrote: > >>> > >>> On 21.01.2020 18:49, Tamas K Lengyel w

Re: [Xen-devel] [PATCH v5 10/18] x86/mem_sharing: Convert MEM_SHARING_DESTROY_GFN to a bool

2020-01-23 Thread Tamas K Lengyel
On Thu, Jan 23, 2020 at 9:14 AM George Dunlap wrote: > > On 1/21/20 5:49 PM, Tamas K Lengyel wrote: > > MEM_SHARING_DESTROY_GFN is used on the 'flags' bitfield during unsharing. > > However, the bitfield is not used for anything else, so just convert it to a > > bool ins

Re: [Xen-devel] [PATCH v5 15/18] xen/mem_sharing: VM forking

2020-01-23 Thread Tamas K Lengyel
On Thu, Jan 23, 2020 at 10:21 AM George Dunlap wrote: > > On 1/21/20 5:49 PM, Tamas K Lengyel wrote: > > VM forking is the process of creating a domain with an empty memory space > > and a > > parent domain specified from which to populate the memory when necessary. &g

Re: [Xen-devel] [PATCH V8 1/4] x86/mm: Add array_index_nospec to guest provided index values

2020-01-23 Thread Tamas K Lengyel
> > Signed-off-by: Alexandru Isaila > > Acked-by: Tamas K Lengyel > > Something in this series broke the ARM build. Sorry, but I don't have > any further time to investigate. > > gcc -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes > -Wdeclaratio

Re: [Xen-devel] [PATCH v6 8/9] x86/mem_sharing: reset a fork

2020-01-28 Thread Tamas K Lengyel
> +if ( !(rc = hvm_copy_context_and_params(d, cd)) ) I just realized that I forgot to swap the order of the parameters here after the requested change was made in the prereq patch introducing the function. Tamas ___ Xen-devel mailing list

Re: [Xen-devel] [PATCH v6 2/9] x86/hvm: introduce hvm_copy_context_and_params

2020-01-28 Thread Tamas K Lengyel
On Tue, Jan 28, 2020 at 9:48 AM Jan Beulich wrote: > > On 27.01.2020 19:06, Tamas K Lengyel wrote: > > @@ -4139,49 +4140,32 @@ static int hvm_allow_set_param(struct domain *d, > > return rc; > > } > > > > -static int hvmop_set_param( > > -X

Re: [Xen-devel] [PATCH v6 2/9] x86/hvm: introduce hvm_copy_context_and_params

2020-01-28 Thread Tamas K Lengyel
On Tue, Jan 28, 2020 at 9:59 AM Jan Beulich wrote: > > On 28.01.2020 17:54, Tamas K Lengyel wrote: > > On Tue, Jan 28, 2020 at 9:48 AM Jan Beulich wrote: > >> > >> On 27.01.2020 19:06, Tamas K Lengyel wrote: > >>> @@ -4139,49 +4140,32 @@ stati

Re: [Xen-devel] [PATCH v6 5/9] x86/mem_sharing: use default_access in add_to_physmap

2020-01-28 Thread Tamas K Lengyel
On Tue, Jan 28, 2020 at 9:56 AM Jan Beulich wrote: > > On 27.01.2020 19:06, Tamas K Lengyel wrote: > > When plugging a hole in the target physmap don't use the access permission > > returned by __get_gfn_type_access as it can be non-sensical, leading to > > spurious

Re: [Xen-devel] [PATCH v6 1/9] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-01-28 Thread Tamas K Lengyel
On Tue, Jan 28, 2020 at 9:38 AM Jan Beulich wrote: > > On 27.01.2020 19:06, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/mm/p2m.c > > +++ b/xen/arch/x86/mm/p2m.c > > @@ -574,11 +574,12 @@ struct page_info *p2m_get_page_from_gfn( > >

Re: [Xen-devel] [PATCH v7 2/7] x86/hvm: introduce hvm_copy_context_and_params

2020-02-05 Thread Tamas K Lengyel
On Wed, Feb 5, 2020 at 4:40 AM Jan Beulich wrote: > > On 03.02.2020 17:12, Tamas K Lengyel wrote: > > @@ -4414,6 +4424,40 @@ static int hvm_allow_get_param(struct domain *d, > > return rc; > > } > > > > +static int hvm_get_param(struct domain

Re: [Xen-devel] [PATCH V3] x86/altp2m: Hypercall to set altp2m view visibility

2020-02-19 Thread Tamas K Lengyel
On Wed, Feb 19, 2020 at 2:19 AM Alexandru Stefan ISAILA wrote: > > At this moment a guest can call vmfunc to change the altp2m view. This > should be limited in order to avoid any unwanted view switch. > > The new xc_altp2m_set_visibility() solves this by making views invisible > to vmfunc. >

Re: [Xen-devel] [PATCH] xen/arm: Restrict access to most HVM_PARAM's

2020-02-19 Thread Tamas K Lengyel
On Mon, Feb 10, 2020 at 11:46 AM Andrew Cooper wrote: > > ARM currently has no restrictions on toolstack and guest access to the entire > HVM_PARAM block. As the paging/monitor/sharing features aren't under security > support, this doesn't need an XSA. There is no paging or sharing

Re: [Xen-devel] [PATCH v8 1/5] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-02-11 Thread Tamas K Lengyel
On Tue, Feb 11, 2020 at 2:17 AM Jan Beulich wrote: > > On 10.02.2020 20:21, Tamas K Lengyel wrote: > > The owner domain of shared pages is dom_cow, use that for get_page > > otherwise the function fails to return the correct page under some > > situations. The check i

Re: [Xen-devel] [PATCH v8 1/5] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-02-11 Thread Tamas K Lengyel
On Tue, Feb 11, 2020 at 4:04 AM Jan Beulich wrote: > > On 11.02.2020 11:29, Tamas K Lengyel wrote: > > On Tue, Feb 11, 2020 at 2:17 AM Jan Beulich wrote: > >> > >> On 10.02.2020 20:21, Tamas K Lengyel wrote: > >>> The owner domain of shared pages is dom_

[Xen-devel] [PATCH v9 5/5] xen/tools: VM forking toolstack side

2020-02-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

[Xen-devel] [PATCH v9 1/5] xen/x86: Make hap_get_allocation accessible

2020-02-21 Thread Tamas K Lengyel
before (or even completely without) the toolstack. Signed-off-by: Tamas K Lengyel --- xen/arch/x86/mm/hap/hap.c | 3 +-- xen/include/asm-x86/hap.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index 3d93f3451c..c7c7ff6e99

[Xen-devel] [PATCH v9 3/5] xen/mem_sharing: VM forking

2020-02-21 Thread Tamas K Lengyel
-by: Tamas K Lengyel --- v9: remove stale header fix tsc incarnation being bumped on set --- xen/arch/x86/domain.c | 11 ++ xen/arch/x86/hvm/hvm.c| 2 +- xen/arch/x86/mm/mem_sharing.c | 222 ++ xen/arch/x86/mm/p2m.c | 11

[Xen-devel] [PATCH v9 2/5] xen: add parent_domid field to createdomain domctl

2020-02-21 Thread Tamas K Lengyel
domctl so that Xen can copy the setting without the extra toolstack queries. Signed-off-by: Tamas K Lengyel --- xen/common/domctl.c | 14 ++ xen/include/public/domctl.h | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/xen/common/domctl.c b/xen/common

[Xen-devel] [PATCH v9 4/5] x86/mem_sharing: reset a fork

2020-02-21 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 --- xen/arch/x86/mm

[Xen-devel] [PATCH v9 0/5] VM forking

2020-02-21 Thread Tamas K Lengyel
out by Andrew Patch 1 exposes a hap internal function that will be used during VM forking Patch 2 extends the createdomain domctl with an extra used during VM forking Patch 3-4 implements the VM fork & reset operation hypervisor side bits Patch 5 adds the toolstack-side code implemen

Re: [Xen-devel] [PATCH v8 3/5] xen/mem_sharing: VM forking

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 10:47 AM Andrew Cooper wrote: > > On 21/02/2020 17:07, Tamas K Lengyel wrote: > > On Fri, Feb 21, 2020 at 7:42 AM Andrew Cooper > > wrote: > >> On 10/02/2020 19:21, Tamas K Lengyel wrote: > >>> +static int mem_sharing_f

Re: [Xen-devel] [PATCH v9 2/5] xen: add parent_domid field to createdomain domctl

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 3:34 PM Julien Grall wrote: > > Hi Tamas, > > On 21/02/2020 21:35, Tamas K Lengyel wrote: > > On Fri, Feb 21, 2020 at 2:03 PM Julien Grall wrote: > >> > >> Hi Tamas, > >> > >> On 21/02/2020 18:49, Tamas K Lengyel

Re: [Xen-devel] [PATCH v9 2/5] xen: add parent_domid field to createdomain domctl

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 2:03 PM Julien Grall wrote: > > Hi Tamas, > > On 21/02/2020 18:49, Tamas K Lengyel wrote: > > When creating a domain that will be used as a VM fork some information is > > required to set things up properly, like the max_vcpus count. Instead of

Re: [Xen-devel] [PATCH v8 3/5] xen/mem_sharing: VM forking

2020-02-21 Thread Tamas K Lengyel
> One question needing considering is whether such a hypercall could in > theory be useful without the mem_sharing infrastructure, or not. (i.e. > how tightly integrated we should aim for.) It would be possible to create domain forks without mem_sharing. The mem_sharing part just adds an extra

Re: [Xen-devel] [PATCH v8 3/5] xen/mem_sharing: VM forking

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 7:42 AM Andrew Cooper wrote: > > On 10/02/2020 19:21, Tamas K Lengyel wrote: > > +static int mem_sharing_fork(struct domain *d, struct domain *cd) > > +{ > > +int rc = -EINVAL; > > + > > +if ( !cd->controll

Re: [Xen-devel] [PATCH v9 2/5] xen: add parent_domid field to createdomain domctl

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 4:18 PM Julien Grall wrote: > > On Fri, 21 Feb 2020 at 22:53, Tamas K Lengyel > wrote: > > > > On Fri, Feb 21, 2020 at 3:34 PM Julien Grall wrote: > > > > > > Hi Tamas, > > > > > > On 21/02/2020 21:35, Tamas

Re: [Xen-devel] [PATCH v8 1/5] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 6:49 AM Andrew Cooper wrote: > > On 10/02/2020 19:21, Tamas K Lengyel wrote: > > The owner domain of shared pages is dom_cow, use that for get_page > > otherwise the function fails to return the correct page under some > > situations. The check i

Re: [Xen-devel] [PATCH v8 3/5] xen/mem_sharing: VM forking

2020-02-21 Thread Tamas K Lengyel
On Fri, Feb 21, 2020 at 7:02 AM Andrew Cooper wrote: > > On 21/02/2020 13:43, Andrew Cooper wrote: > > On 10/02/2020 19:21, Tamas K Lengyel wrote: > >> diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c > >> index 3835bc928f..ccf338918d 100

Re: [Xen-devel] [PATCH 2/2] Remove undocumented and unmaintained tools/memshr library

2020-01-10 Thread Tamas K Lengyel
On Fri, Jan 10, 2020 at 10:59 AM Andrew Cooper wrote: > > On 10/01/2020 02:30, Tamas K Lengyel wrote: > > The library has been largely untouched for over a decade at this point, it > > is > > undocumented and it's unclear what it was originally used for. Remove it >

Re: [Xen-devel] [PATCH v4 15/18] xen/mem_sharing: VM forking

2020-01-09 Thread Tamas K Lengyel
On Thu, Jan 9, 2020 at 3:29 AM Julien Grall wrote: > > Hi Tamas, > > On 08/01/2020 17:14, Tamas K Lengyel wrote: > > +static int mem_sharing_fork(struct domain *d, struct domain *cd) > > +{ > > +int rc; > > + > > +if ( !d-&g

Re: [Xen-devel] [PATCH v4 15/18] xen/mem_sharing: VM forking

2020-01-09 Thread Tamas K Lengyel
On Thu, Jan 9, 2020 at 8:34 AM Jan Beulich wrote: > > On 09.01.2020 16:10, Roger Pau Monné wrote: > > On Thu, Jan 09, 2020 at 06:41:12AM -0700, Tamas K Lengyel wrote: > >> On Thu, Jan 9, 2020 at 3:29 AM Julien Grall wrote: > >>> > >>> Hi Tamas, >

Re: [Xen-devel] [PATCH v4 15/18] xen/mem_sharing: VM forking

2020-01-09 Thread Tamas K Lengyel
On Thu, Jan 9, 2020 at 9:03 AM Jan Beulich wrote: > > On 09.01.2020 16:57, Tamas K Lengyel wrote: > > On Thu, Jan 9, 2020 at 8:34 AM Jan Beulich wrote: > >> > >> On 09.01.2020 16:10, Roger Pau Monné wrote: > >>> On Thu, Jan 09, 2020 at 06:41:12AM -0700,

Re: [Xen-devel] [PATCH v4 15/18] xen/mem_sharing: VM forking

2020-01-09 Thread Tamas K Lengyel
On Thu, Jan 9, 2020 at 8:10 AM Roger Pau Monné wrote: > > On Thu, Jan 09, 2020 at 06:41:12AM -0700, Tamas K Lengyel wrote: > > On Thu, Jan 9, 2020 at 3:29 AM Julien Grall wrote: > > > > > > Hi Tamas, > > > > > > On 08/01/2020 17:14, Tamas K Len

Re: [Xen-devel] [PATCH v2 00/20] VM forking

2020-01-09 Thread Tamas K Lengyel
On Thu, Jan 9, 2020 at 2:48 AM Roger Pau Monné wrote: > > On Wed, Jan 08, 2020 at 12:51:35PM -0700, Tamas K Lengyel wrote: > > On Wed, Jan 8, 2020 at 11:37 AM Roger Pau Monné > > wrote: > > > > > > On Wed, Jan 08, 2020 at 11:14:46AM -0700, Tamas K Lengye

Re: [Xen-devel] [PATCH v4 06/18] x86/mem_sharing: define mem_sharing_domain to hold some scattered variables

2020-01-16 Thread Tamas K Lengyel
On Thu, Jan 16, 2020 at 8:23 AM Jan Beulich wrote: > > On 08.01.2020 18:14, Tamas K Lengyel wrote: > > Create struct mem_sharing_domain under hvm_domain and move mem sharing > > variables into it from p2m_domain and hvm_domain. > > > > Expose the mem_sharing_enabled

Re: [Xen-devel] [PATCH v4 12/18] x86/mem_sharing: Enable mem_sharing on first memop

2020-01-16 Thread Tamas K Lengyel
On Thu, Jan 16, 2020 at 9:18 AM Jan Beulich wrote: > > On 08.01.2020 18:14, Tamas K Lengyel wrote: > > It is wasteful to require separate hypercalls to enable sharing on both the > > parent and the client domain during VM forking. To speed things up we enable > > sh

Re: [Xen-devel] [PATCH v4 01/18] x86/hvm: introduce hvm_copy_context_and_params

2020-01-16 Thread Tamas K Lengyel
On Thu, Jan 16, 2020 at 5:28 AM Jan Beulich wrote: > > On 08.01.2020 18:13, Tamas K Lengyel wrote: > > @@ -4129,49 +4130,32 @@ static int hvm_allow_set_param(struct domain *d, > > return rc; > > } > > > > -static int hvmop_set_param( > > -X

Re: [Xen-devel] [PATCH v4 05/18] x86/mem_sharing: don't try to unshare twice during page fault

2020-01-16 Thread Tamas K Lengyel
On Thu, Jan 16, 2020 at 7:55 AM Jan Beulich wrote: > > On 08.01.2020 18:14, Tamas K Lengyel wrote: > > @@ -1702,11 +1703,14 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned > > long gla, > > struct domain *currd = curr->domain; > > struct p2m_do

Re: [Xen-devel] [PATCH v4 00/18] VM forking

2020-01-16 Thread Tamas K Lengyel
On Thu, Jan 16, 2020 at 8:47 AM Jan Beulich wrote: > > On 08.01.2020 18:13, Tamas K Lengyel wrote: > > Tamas K Lengyel (18): > > x86/hvm: introduce hvm_copy_context_and_params > > xen/x86: Make hap_get_allocation accessible > > x86/mem_sharing: make get_two

Re: [Xen-devel] [PATCH v4 11/18] x86/mem_sharing: ASSERT that p2m_set_entry succeeds

2020-01-16 Thread Tamas K Lengyel
On Thu, Jan 16, 2020 at 9:07 AM Jan Beulich wrote: > > On 08.01.2020 18:14, Tamas K Lengyel wrote: > > Signed-off-by: Tamas K Lengyel > > --- > > xen/arch/x86/mm/mem_sharing.c | 42 +-- > > 1 file changed, 21 insertions(+), 21 d

Re: [Xen-devel] [PATCH v5 14/18] x86/mem_sharing: use default_access in add_to_physmap

2020-01-22 Thread Tamas K Lengyel
On Wed, Jan 22, 2020 at 8:35 AM Jan Beulich wrote: > > On 21.01.2020 18:49, Tamas K Lengyel wrote: > > When plugging a hole in the target physmap don't use the access permission > > returned by __get_gfn_type_access as it can be non-sensical, > > "can be" is to

Re: [Xen-devel] [PATCH v5 03/18] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries

2020-01-22 Thread Tamas K Lengyel
On Wed, Jan 22, 2020 at 8:23 AM Jan Beulich wrote: > > On 21.01.2020 18:49, Tamas K Lengyel wrote: > > The owner domain of shared pages is dom_cow, use that for get_page > > otherwise the function fails to return the correct page. > > I think this description needs improv

Re: [Xen-devel] [PATCH v5 11/18] x86/mem_sharing: Replace MEM_SHARING_DEBUG with gdprintk

2020-01-22 Thread Tamas K Lengyel
On Wed, Jan 22, 2020 at 8:30 AM Jan Beulich wrote: > > On 21.01.2020 18:49, Tamas K Lengyel wrote: > > @@ -538,24 +535,26 @@ static int audit(void) > > d = get_domain_by_id(g->domain); > > if ( d == NULL ) > > { >

Re: [Xen-devel] [PATCH v5 01/18] x86/hvm: introduce hvm_copy_context_and_params

2020-01-22 Thread Tamas K Lengyel
On Wed, Jan 22, 2020 at 8:01 AM Jan Beulich wrote: > > On 21.01.2020 18:49, Tamas K Lengyel wrote: > > Currently the hvm parameters are only accessible via the HVMOP hypercalls. > > In > > this patch we introduce a new function that can copy both the hvm context > &g

Re: [Xen-devel] [PATCH v4 00/18] VM forking

2020-01-17 Thread Tamas K Lengyel
On Fri, Jan 17, 2020 at 4:15 AM Anthony PERARD wrote: > > On Fri, Jan 17, 2020 at 10:12:14AM +0100, Jan Beulich wrote: > > Please note that my previous mail was _to_ George, with you only > > _cc_-ed. Hence the question was to George, not you. (It is a > > common issue which I keep mentioning on

Re: [Xen-devel] [PATCH v4 00/18] VM forking

2020-01-17 Thread Tamas K Lengyel
> > Provided this is v4 now of the series and no issues > > were raised so far for these particular patches they can be merged > > with your Reviewed-by. > > I don't think so, under the current (sufficiently) common > understanding of the rules. See George's proposal to change to a > model like

Re: [Xen-devel] [PATCH v4 11/18] x86/mem_sharing: ASSERT that p2m_set_entry succeeds

2020-01-17 Thread Tamas K Lengyel
On Fri, Jan 17, 2020 at 2:23 AM Jan Beulich wrote: > > On 16.01.2020 17:12, Tamas K Lengyel wrote: > > On Thu, Jan 16, 2020 at 9:07 AM Jan Beulich wrote: > >> > >> On 08.01.2020 18:14, Tamas K Lengyel wrote: > >>> Signed-off-by: Tamas K Lengyel >

Re: [Xen-devel] [PATCH V8 4/4] x86/mm: Make use of the default access param from xc_altp2m_create_view

2020-01-17 Thread Tamas K Lengyel
ed-off-by: Alexandru Isaila > Acked-by: Jan Beulich For the mem_access bits: Acked-by: Tamas K Lengyel ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v4 14/18] x86/mem_sharing: check page type count earlier

2020-01-20 Thread Tamas K Lengyel
On Mon, Jan 20, 2020 at 9:34 AM Jan Beulich wrote: > > On 08.01.2020 18:14, Tamas K Lengyel wrote: > > --- a/xen/arch/x86/mm/mem_sharing.c > > +++ b/xen/arch/x86/mm/mem_sharing.c > > @@ -652,19 +652,18 @@ static int page_make_sharable(struct domain *d, &g

Re: [Xen-devel] [PATCH v4 13/18] x86/mem_sharing: Skip xen heap pages in memshr nominate

2020-01-20 Thread Tamas K Lengyel
On Mon, Jan 20, 2020 at 9:23 AM Jan Beulich wrote: > > On 08.01.2020 18:14, Tamas K Lengyel wrote: > > Trying to share these would fail anyway, better to skip them early. > > > > Signed-off-by: Tamas K Lengyel > > Reviewed-by: Jan Beulich > albeit I w

Re: [Xen-devel] [PATCH v3 00/18] VM forking

2020-01-08 Thread Tamas K Lengyel
On Wed, Jan 8, 2020 at 7:58 AM George Dunlap wrote: > > On 12/30/19 4:11 PM, Tamas K Lengyel wrote: > > The following series implements VM forking for Intel HVM guests to allow for > > the fast creation of identical VMs without the assosciated high startup > > costs >

<    1   2   3   4   5   6   7   8   9   10   >