Re: [Xen-devel] Xen clocksource and PV shim

2020-01-31 Thread Jan Beulich
On 31.01.2020 04:02, Igor Druzhinin wrote: > On 30/01/2020 23:14, Igor Druzhinin wrote: >> I was debugging constant freezes of PV shim on AMD hardware >> after going out of a long suspend. What is "suspend" here? S3? If so, ... >> As it turned out the root cause >> of this is platform time jumpin

Re: [Xen-devel] [XEN PATCH v2 02/12] xen/build: Use obj-y += subdir/ instead of subdir-y

2020-01-31 Thread Jan Beulich
On 30.01.2020 17:54, Anthony PERARD wrote: > On Wed, Jan 29, 2020 at 03:19:05PM +0100, Jan Beulich wrote: >> On 17.01.2020 11:53, Anthony PERARD wrote: >>> +# Handle objects in subdirs >>> +# >>> --- >>> +# o if we encounter f

Re: [Xen-devel] [XEN PATCH v2 04/12] xen/build: extract clean target from Rules.mk

2020-01-31 Thread Jan Beulich
On 30.01.2020 19:10, Anthony PERARD wrote: > On Wed, Jan 29, 2020 at 03:30:19PM +0100, Jan Beulich wrote: >> On 17.01.2020 11:53, Anthony PERARD wrote: >>> From: Anthony PERARD >>> >>> Most of the code executed by Rules.mk isn't necessary for the clean >>> target, especially not the CFLAGS. This m

Re: [Xen-devel] [XEN PATCH v2 05/12] xen/include: remove include of Config.mk

2020-01-31 Thread Jan Beulich
On 30.01.2020 19:34, Anthony PERARD wrote: > On Wed, Jan 29, 2020 at 04:33:02PM +0100, Jan Beulich wrote: >> On 29.01.2020 16:28, Jan Beulich wrote: >>> On 17.01.2020 11:53, Anthony PERARD wrote: It isn't necessary to include Config.mk here because this Makefile is only used by xen/Rules.

Re: [Xen-devel] Xen clocksource and PV shim

2020-01-31 Thread Roger Pau Monné
On Fri, Jan 31, 2020 at 09:26:50AM +0100, Jan Beulich wrote: > On 31.01.2020 04:02, Igor Druzhinin wrote: > > On 30/01/2020 23:14, Igor Druzhinin wrote: > >> I was debugging constant freezes of PV shim on AMD hardware > >> after going out of a long suspend. > > What is "suspend" here? S3? If so, .

Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Xen-devel On Behalf Of > Roger Pau Monné > Sent: 22 January 2020 14:53 > To: Durrant, Paul > Cc: Anthony PERARD ; xen- > de...@lists.xenproject.org; Ian Jackson ; Wei > Liu > Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of > INVALID_DOMID to

Re: [Xen-devel] [PATCH v4 4/7] libxl: add infrastructure to track and query 'recent' domids

2020-01-31 Thread Anthony PERARD
On Wed, Jan 22, 2020 at 02:44:43PM +, Paul Durrant wrote: > A domid is considered recent if the domain it represents was destroyed > less than a specified number of seconds ago. The number can be set using > the environment variable LIBXL_DOMID_REUSE_TIMEOUT. If the variable does > not exist th

Re: [Xen-devel] [PATCH v4 4/7] libxl: add infrastructure to track and query 'recent' domids

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Anthony PERARD > Sent: 31 January 2020 10:55 > To: Durrant, Paul > Cc: xen-devel@lists.xenproject.org; Ian Jackson > ; Wei Liu > Subject: Re: [PATCH v4 4/7] libxl: add infrastructure to track and query > 'recent' domids > > On Wed, Jan 22, 2020 at 02:44:43

Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API

2020-01-31 Thread Roger Pau Monné
On Fri, Jan 31, 2020 at 10:31:49AM +, Durrant, Paul wrote: > > -Original Message- > > From: Xen-devel On Behalf Of > > Roger Pau Monné > > Sent: 22 January 2020 14:53 > > To: Durrant, Paul > > Cc: Anthony PERARD ; xen- > > de...@lists.xenproject.org; Ian Jackson ; Wei > > Liu > > Sub

Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Roger Pau Monné > Sent: 31 January 2020 11:06 > To: Durrant, Paul > Cc: Anthony PERARD ; xen- > de...@lists.xenproject.org; Ian Jackson ; Wei > Liu > Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of > INVALID_DOMID to the API > > On Fri, Jan

Re: [Xen-devel] [PATCH] xen-bus/block: explicitly assign event channels to an AioContext

2020-01-31 Thread Anthony PERARD
On Wed, Jan 29, 2020 at 10:22:14PM +, Julien Grall wrote: > Hi Anthony, > > On 19/12/2019 17:11, Anthony PERARD wrote: > > On Mon, Dec 16, 2019 at 02:34:51PM +, Paul Durrant wrote: > > > It is not safe to close an event channel from the QEMU main thread when > > > that channel's poller is

[Xen-devel] [ovmf test] 146615: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146615 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/146615/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemuu-ovmf-amd64 10 debian-hvm-install fail REGR. vs. 145767 test-amd64-amd64-xl-qemuu

Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API

2020-01-31 Thread Andrew Cooper
On 31/01/2020 11:10, Durrant, Paul wrote: >> -Original Message- >> From: Roger Pau Monné >> Sent: 31 January 2020 11:06 >> To: Durrant, Paul >> Cc: Anthony PERARD ; xen- >> de...@lists.xenproject.org; Ian Jackson ; Wei >> Liu >> Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definiti

Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Andrew Cooper > Sent: 31 January 2020 12:08 > To: Durrant, Paul ; Roger Pau Monné > > Cc: Anthony PERARD ; xen- > de...@lists.xenproject.org; Ian Jackson ; Wei > Liu > Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of > INVALID_DOMID to the API

[Xen-devel] [qemu-mainline test] 146617: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146617 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/146617/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm 6 xen-buildfail REGR. vs. 144861 build-arm64

Re: [Xen-devel] Windows HVM no longer boots with AMD Ryzen 3700X

2020-01-31 Thread Joost Heijne
Hi, I ran into this list looking for a solution for the exact same problem as described here. I'm trying to migrate an existing Windows Server 2016 image to a Ryzen 3900x and encountered the same difficulties. I disabled the processor's SMT feature in the BIOS and now it works perfectly. Regards,

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-31 Thread Wei Liu
On Thu, Jan 30, 2020 at 01:11:59PM +0100, Roger Pau Monné wrote: > On Thu, Jan 30, 2020 at 11:47:52AM +, Wei Liu wrote: > > On Thu, Jan 30, 2020 at 12:39:47PM +0100, Roger Pau Monné wrote: > > > On Thu, Jan 30, 2020 at 11:18:21AM +, Wei Liu wrote: > > > > On Thu, Jan 30, 2020 at 11:41:43AM

Re: [Xen-devel] [PATCH v8 2/4] add a domain_tot_pages() helper function

2020-01-31 Thread Jan Beulich
On 30.01.2020 15:57, Paul Durrant wrote: > v8: > - New in v8 > --- > xen/arch/x86/domain.c | 2 +- > xen/arch/x86/mm.c | 6 +++--- > xen/arch/x86/mm/p2m-pod.c | 10 +- > xen/arch/x86/mm/shadow/common.c | 2 +- > xen/arch/x86/msi.c | 2 +- > x

[Xen-devel] [PATCH v7 11/11] xen: introduce ERRP_AUTO_PROPAGATE

2020-01-31 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &error_fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want

[Xen-devel] [PATCH v7 03/11] scripts: add coccinelle script to use auto propagated errp

2020-01-31 Thread Vladimir Sementsov-Ogievskiy
Script adds ERRP_AUTO_PROPAGATE macro invocation where appropriate and does corresponding changes in code (look for details in include/qapi/error.h) Usage example: spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \ --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \

[Xen-devel] [PATCH v7 00/11] error: auto propagated local_err part I

2020-01-31 Thread Vladimir Sementsov-Ogievskiy
Hi all! v7 is available at https://src.openvz.org/scm/~vsementsov/qemu.git #tag up-auto-local-err-partI-v7 Changes v6->v7: 01: - improve commit message - fix typo in comment [Eric] - add Eric's and Greg's r-b 02: - grammar/wording [Eric] - add Eric's and Greg's r-b 03: - improve com

[Xen-devel] [PATCH v7 02/11] error: auto propagated local_err

2020-01-31 Thread Vladimir Sementsov-Ogievskiy
Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of functions with an errp OUT parameter. It has three goals: 1. Fix issue with error_fatal and error_prepend/error_append_hint: user can't see this additional information, because exit() happens in error_setg earlier than informati

[Xen-devel] [PATCH v7 01/11] qapi/error: add (Error **errp) cleaning APIs

2020-01-31 Thread Vladimir Sementsov-Ogievskiy
Add functions to clean Error **errp: call corresponding Error *err cleaning function an set pointer to NULL. New functions: error_free_errp error_report_errp warn_report_errp Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Eric Blake --- CC: Eric Blake C

Re: [Xen-devel] Windows HVM no longer boots with AMD Ryzen 3700X

2020-01-31 Thread Andrew Cooper
On 31/01/2020 12:43, Joost Heijne wrote: > Hi, > > I ran into this list looking for a solution for the exact same problem > as described here. I'm trying to migrate an existing Windows > Server 2016 image to a Ryzen 3900x and encountered the same > difficulties. I disabled the processor's SMT featu

Re: [Xen-devel] [PATCH v7 00/11] error: auto propagated local_err part I

2020-01-31 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200131130118.1716-1-vsement...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Xen-devel] [PATCH v7 00/11] error: auto propagated local_err part I Message-id: 20200131130118.1716-

Re: [Xen-devel] [PATCH v5 05/12] x86: provide executable fixmap facility

2020-01-31 Thread Wei Liu
On Thu, Jan 30, 2020 at 12:30:47AM +, Wei Liu wrote: > On Wed, Jan 29, 2020 at 08:20:27PM +, Wei Liu wrote: > > > > +void __set_fixmap_x( > > +enum fixed_addresses_x idx, unsigned long mfn, unsigned long flags) > > +{ > > +BUG_ON(idx >= __end_of_fixed_addresses_x || idx <= FIX_X_R

Re: [Xen-devel] Windows HVM no longer boots with AMD Ryzen 3700X

2020-01-31 Thread Joost Heijne
Ah, I didn't check for that. I run Xen from the package distributed by Ubuntu, which is 4.9.2 currently. Joost -Original Message- From: Andrew Cooper [mailto:andrew.coop...@citrix.com] Sent: Friday, January 31, 2020 14:06 To: Joost Heijne; Andreas Kinzler; xen-devel@lists.xenproject.org

Re: [Xen-devel] [PATCH v5 05/12] x86: provide executable fixmap facility

2020-01-31 Thread Jan Beulich
On 31.01.2020 14:12, Wei Liu wrote: > On Thu, Jan 30, 2020 at 12:30:47AM +, Wei Liu wrote: >> On Wed, Jan 29, 2020 at 08:20:27PM +, Wei Liu wrote: >>> >>> +void __set_fixmap_x( >>> +enum fixed_addresses_x idx, unsigned long mfn, unsigned long flags) >>> +{ >>> +BUG_ON(idx >= __end

Re: [Xen-devel] [PATCH v5 05/12] x86: provide executable fixmap facility

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 02:19:16PM +0100, Jan Beulich wrote: > On 31.01.2020 14:12, Wei Liu wrote: > > On Thu, Jan 30, 2020 at 12:30:47AM +, Wei Liu wrote: > >> On Wed, Jan 29, 2020 at 08:20:27PM +, Wei Liu wrote: > >>> > >>> +void __set_fixmap_x( > >>> +enum fixed_addresses_x idx, un

Re: [Xen-devel] [PATCH v7 00/11] error: auto propagated local_err part I

2020-01-31 Thread Vladimir Sementsov-Ogievskiy
31.01.2020 16:12, no-re...@patchew.org wrote: Patchew URL: https://patchew.org/QEMU/20200131130118.1716-1-vsement...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Xen-devel] [PATCH v7 00/11] error: auto propagated l

Re: [Xen-devel] [PATCH v8 1/4] x86 / vmx: move teardown from domain_destroy()...

2020-01-31 Thread Jan Beulich
On 30.01.2020 15:57, Paul Durrant wrote: > ... to domain_relinquish_resources(). > > The teardown code frees the APICv page. This does not need to be done late > so do it in domain_relinquish_resources() rather than domain_destroy(). > > Signed-off-by: Paul Durrant Btw., this can have my Review

Re: [Xen-devel] [PATCH v8 1/4] x86 / vmx: move teardown from domain_destroy()...

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Jan Beulich > Sent: 31 January 2020 13:32 > To: Durrant, Paul > Cc: xen-devel@lists.xenproject.org; Jun Nakajima ; > Kevin Tian ; Andrew Cooper > ; Wei Liu ; Roger Pau Monné > ; George Dunlap > Subject: Re: [PATCH v8 1/4] x86 / vmx: move teardown from > domai

[Xen-devel] [xen-unstable test] 146611: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146611 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/146611/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-i386-prev 6 xen-buildfail REGR. vs. 146563 Tests which did no

Re: [Xen-devel] [PATCH v5 03/12] x86/smp: don't online cpu if hypervisor_ap_setup fails

2020-01-31 Thread Jan Beulich
On 29.01.2020 21:20, Wei Liu wrote: > Push hypervisor_ap_setup down to smp_callin. > > Take the chance to replace xen_guest with cpu_has_hypervisor. > > Signed-off-by: Wei Liu > --- > xen/arch/x86/smpboot.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/xen

Re: [Xen-devel] [PATCH v5 04/12] x86: make paddr_bits available earlier

2020-01-31 Thread Jan Beulich
On 30.01.2020 13:00, Wei Liu wrote: > On Thu, Jan 30, 2020 at 11:17:33AM +0100, Roger Pau Monné wrote: >>> >>> +/* This must come before e820 code becuause it sets paddr_bits. */ >> ^ because > > Fixed. Thanks. And then Acked-by: Jan Beulich Jan

Re: [Xen-devel] [PATCH v5 07/12] x86/hyperv: setup hypercall page

2020-01-31 Thread Jan Beulich
On 30.01.2020 12:47, Wei Liu wrote: > On Thu, Jan 30, 2020 at 12:39:47PM +0100, Roger Pau Monné wrote: >> I think what you need is a hook that modifies the memory map and adds >> a reserved region at ((1 << paddr_bits) - PAGE_SIZE) of size >> PAGE_SIZE. See where pv_shim_fixup_e820 is used, and I t

Re: [Xen-devel] [PATCH v5 03/12] x86/smp: don't online cpu if hypervisor_ap_setup fails

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 02:53:45PM +0100, Jan Beulich wrote: > On 29.01.2020 21:20, Wei Liu wrote: > > Push hypervisor_ap_setup down to smp_callin. > > > > Take the chance to replace xen_guest with cpu_has_hypervisor. > > > > Signed-off-by: Wei Liu > > --- > > xen/arch/x86/smpboot.c | 10 ++

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Jan Beulich
On 30.01.2020 13:28, Wei Liu wrote: > On Thu, Jan 30, 2020 at 01:08:07PM +0100, Roger Pau Monné wrote: >> >>> +} >>> + >>> /* >>> * Local variables: >>> * mode: C >>> diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S >>> index 97f9c07891..8e02b4c648 100644 >>> --- a/xen/arch/x86/xen

[Xen-devel] [linux-5.4 test] 146614: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146614 linux-5.4 real [real] http://logs.test-lab.xenproject.org/osstest/logs/146614/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-ovmf-amd64 10 debian-hvm-install fail REGR. vs. 146121 test-amd64-amd64-q

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 03:12:50PM +0100, Jan Beulich wrote: > On 30.01.2020 13:28, Wei Liu wrote: > > On Thu, Jan 30, 2020 at 01:08:07PM +0100, Roger Pau Monné wrote: > >> > >>> +} > >>> + > >>> /* > >>> * Local variables: > >>> * mode: C > >>> diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x

[Xen-devel] [qemu-mainline test] 146622: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146622 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/146622/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm 6 xen-buildfail REGR. vs. 144861 build-arm64

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Jan Beulich
On 29.01.2020 21:20, Wei Liu wrote: > I tried using the asm(".equ ..") trick but hit a problem with %c again. > > mm.c:5736:5: error: invalid 'asm': operand is not a condition code, invalid > operand code 'c' >asm ( ".equ HV_HCALL_PAGE, %c0; .global HV_HCALL_PAGE" Would you mind

[Xen-devel] [ovmf test] 146621: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146621 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/146621/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemuu-ovmf-amd64 10 debian-hvm-install fail REGR. vs. 145767 test-amd64-amd64-xl-qemuu

[Xen-devel] [PATCH] tools/xenstore: don't apply write limiting for privileged domain

2020-01-31 Thread Juergen Gross
Xenstore write limiting should not be applied to dom0. Unfortunately write limiting is disabled only for connections via sockets. When running in a stubdom Xenstore will apply write limiting to dom0, too. Change that by testing for the domain to be privileged as well. Signed-off-by: Juergen Gross

[Xen-devel] [PATCH] tools/xenstore: add newline for printing of stubdom console messages

2020-01-31 Thread Juergen Gross
There are several places in xenstore-stubdom where newlines at the end of messages on the console are missing. Add them. Signed-off-by: Juergen Gross --- tools/libs/evtchn/minios.c | 1 + tools/xenstore/xenstored_core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/t

Re: [Xen-devel] [PATCH] tools/xenstore: add newline for printing of stubdom console messages

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 03:25:09PM +0100, Juergen Gross wrote: > There are several places in xenstore-stubdom where newlines at the end > of messages on the console are missing. Add them. > > Signed-off-by: Juergen Gross Acked-by: Wei Liu ___ Xen-dev

Re: [Xen-devel] [PATCH v5 11/12] x86/hyperv: retrieve vp_index from Hyper-V

2020-01-31 Thread Jan Beulich
On 29.01.2020 21:20, Wei Liu wrote: > This will be useful when invoking hypercall that targets specific > vcpu(s). > > Signed-off-by: Wei Liu > Reviewed-by: Paul Durrant > Acked-by: Jan Beulich > --- > v5: > 1. Add Jan's Ack. And I now realize that it's actually irrelevant for this > xen/arc

Re: [Xen-devel] [PATCH v5 03/12] x86/smp: don't online cpu if hypervisor_ap_setup fails

2020-01-31 Thread Jan Beulich
On 31.01.2020 15:10, Wei Liu wrote: > On Fri, Jan 31, 2020 at 02:53:45PM +0100, Jan Beulich wrote: >> On 29.01.2020 21:20, Wei Liu wrote: >>> Push hypervisor_ap_setup down to smp_callin. >>> >>> Take the chance to replace xen_guest with cpu_has_hypervisor. >>> >>> Signed-off-by: Wei Liu >>> --- >>

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Jan Beulich
On 31.01.2020 15:20, Wei Liu wrote: > On Fri, Jan 31, 2020 at 03:12:50PM +0100, Jan Beulich wrote: >> On 30.01.2020 13:28, Wei Liu wrote: >>> On Thu, Jan 30, 2020 at 01:08:07PM +0100, Roger Pau Monné wrote: > +} > + > /* > * Local variables: > * mode: C > diff --gi

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 03:24:07PM +0100, Jan Beulich wrote: > On 29.01.2020 21:20, Wei Liu wrote: > > I tried using the asm(".equ ..") trick but hit a problem with %c again. > > > > mm.c:5736:5: error: invalid 'asm': operand is not a condition code, invalid > > operand code 'c' > >

Re: [Xen-devel] [PATCH] tools/xenstore: don't apply write limiting for privileged domain

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 03:25:57PM +0100, Juergen Gross wrote: > Xenstore write limiting should not be applied to dom0. Unfortunately > write limiting is disabled only for connections via sockets. When > running in a stubdom Xenstore will apply write limiting to dom0, too. > Change that by testing

Re: [Xen-devel] [PATCH] tools/xenstore: don't apply write limiting for privileged domain

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 02:55:44PM +, Wei Liu wrote: > On Fri, Jan 31, 2020 at 03:25:57PM +0100, Juergen Gross wrote: > > Xenstore write limiting should not be applied to dom0. Unfortunately > > write limiting is disabled only for connections via sockets. When > > running in a stubdom Xenstore

[Xen-devel] [PATCH v5 0/7] xl/libxl: domid allocation/preservation changes

2020-01-31 Thread Paul Durrant
Paul Durrant (7): libxl: add definition of INVALID_DOMID to the API libxl_create: make 'soft reset' explicit libxl: generalise libxl__domain_userdata_lock() libxl: add infrastructure to track and query 'recent' domids libxl: allow creation of domains with a specified or random domid xl.

[Xen-devel] [PATCH v5 2/7] libxl_create: make 'soft reset' explicit

2020-01-31 Thread Paul Durrant
The 'soft reset' code path in libxl__domain_make() is currently taken if a valid domid is passed into the function. A subsequent patch will enable higher levels of the toolstack to determine the domid of newly created or restored domains and therefore this criteria for choosing 'soft reset' will no

[Xen-devel] [PATCH v5 7/7] xl: allow domid to be preserved on save/restore or migrate

2020-01-31 Thread Paul Durrant
This patch adds a '-D' command line option to save and migrate to allow the domain id to be incorporated into the saved domain configuration and hence be preserved. NOTE: Logically it may seem as though preservation of domid should be dealt with by libxl, but the libxl migration stream has n

[Xen-devel] [PATCH v5 6/7] xl.conf: introduce 'domid_policy'

2020-01-31 Thread Paul Durrant
This patch adds a new global 'domid_policy' configuration option to decide how domain id values are allocated for new domains. It may be set to one of two values: "xen", the default value, will cause an invalid domid value to be passed to do_domain_create() preserving the existing behaviour of hav

[Xen-devel] [PATCH v5 4/7] libxl: add infrastructure to track and query 'recent' domids

2020-01-31 Thread Paul Durrant
A domid is considered recent if the domain it represents was destroyed less than a specified number of seconds ago. For debugging and/or testing purposes the number can be set using the environment variable LIBXL_DOMID_REUSE_TIMEOUT. If the variable does not exist then a default value of 60s is use

[Xen-devel] [PATCH v5 3/7] libxl: generalise libxl__domain_userdata_lock()

2020-01-31 Thread Paul Durrant
This function implements a file-based lock with a file name generated from a domid. This patch splits it into two, generalising the core of the locking code into a new libxl__lock_file() function which operates on a specified file, leaving just the file name generation in libxl__domain_userdata_lo

[Xen-devel] [PATCH v5 1/7] libxl: add definition of INVALID_DOMID to the API

2020-01-31 Thread Paul Durrant
Currently both xl and libxl have internal definitions of INVALID_DOMID which happen to be identical. However, for the purposes of describing the behaviour of libxl_domain_create_new/restore() it is useful to have a specified invalid value for a domain id. This patch therefore moves the libxl defin

[Xen-devel] [PATCH v5 5/7] libxl: allow creation of domains with a specified or random domid

2020-01-31 Thread Paul Durrant
This patch adds a 'domid' field to libxl_domain_create_info and then modifies libxl__domain_make() to have Xen use that value if it is valid. If the domid value is invalid then Xen will choose the domid, as before, unless the value is the new special RANDOM_DOMID value added to the API. This value

Re: [Xen-devel] [PATCH v2] x86/HVM: relinquish resources also from hvm_domain_destroy()

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Xen-devel On Behalf Of Jan > Beulich > Sent: 29 January 2020 13:00 > To: xen-devel@lists.xenproject.org > Cc: Andrew Cooper ; Paul Durrant > ; Wei Liu ; Roger Pau Monné > > Subject: [Xen-devel] [PATCH v2] x86/HVM: relinquish resources also from > hvm_domain_de

Re: [Xen-devel] [PATCH] tools/xenstore: don't apply write limiting for privileged domain

2020-01-31 Thread Jürgen Groß
On 31.01.20 15:58, Wei Liu wrote: On Fri, Jan 31, 2020 at 02:55:44PM +, Wei Liu wrote: On Fri, Jan 31, 2020 at 03:25:57PM +0100, Juergen Gross wrote: Xenstore write limiting should not be applied to dom0. Unfortunately write limiting is disabled only for connections via sockets. When runnin

Re: [Xen-devel] [PATCH v8 2/4] add a domain_tot_pages() helper function

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Jan Beulich > Sent: 31 January 2020 12:53 > To: Durrant, Paul > Cc: xen-devel@lists.xenproject.org; Andrew Cooper > ; Wei Liu ; Roger Pau Monné > ; George Dunlap ; Ian > Jackson ; Julien Grall ; Konrad > Rzeszutek Wilk ; Stefano Stabellini > ; Tim Deegan > Su

Re: [Xen-devel] [PATCH V3 2/2] Xen/PCIback: Implement PCI flr/slot/bus reset with 'reset' SysFS attribute

2020-01-31 Thread Wei Liu
On Fri, Jan 17, 2020 at 02:13:04PM -0500, Rich Persaud wrote: > On Aug 26, 2019, at 17:08, Pasi Kärkkäinen wrote: > > Hi, > > > >> On Mon, Oct 08, 2018 at 10:32:45AM -0400, Boris Ostrovsky wrote: > >>> On 10/3/18 11:51 AM, Pasi Kärkkäinen wrote: > >>> On Wed, Sep 19, 2018 at 11:05:26AM +0200, Ro

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Jan Beulich
On 31.01.2020 15:37, Wei Liu wrote: > On Fri, Jan 31, 2020 at 03:24:07PM +0100, Jan Beulich wrote: >> On 29.01.2020 21:20, Wei Liu wrote: >>> I tried using the asm(".equ ..") trick but hit a problem with %c again. >>> >>> mm.c:5736:5: error: invalid 'asm': operand is not a condition code, invalid

Re: [Xen-devel] [PATCH v8 2/4] add a domain_tot_pages() helper function

2020-01-31 Thread Durrant, Paul
> -Original Message- > From: Xen-devel On Behalf Of > Durrant, Paul > Sent: 31 January 2020 15:19 > To: Jan Beulich ; Julien Grall > Cc: Stefano Stabellini ; Wei Liu ; > Konrad Rzeszutek Wilk ; George Dunlap > ; Andrew Cooper ; > Ian Jackson ; Tim Deegan ; xen- > de...@lists.xenproject.or

Re: [Xen-devel] [PATCH v3 4/9] xen: add basic hypervisor filesystem support

2020-01-31 Thread Wei Liu
On Tue, Jan 21, 2020 at 09:43:25AM +0100, Juergen Gross wrote: [...] > diff --git a/xen/common/hypfs.c b/xen/common/hypfs.c > new file mode 100644 > index 00..6762d20dfd > --- /dev/null > +++ b/xen/common/hypfs.c > @@ -0,0 +1,365 @@ > +/**

Re: [Xen-devel] [PATCH v3 5/9] libs: add libxenhypfs

2020-01-31 Thread Wei Liu
On Tue, Jan 21, 2020 at 09:43:26AM +0100, Juergen Gross wrote: > Add the new library libxenhypfs for access to the hypervisor filesystem. > > Signed-off-by: Juergen Gross I've only skimmed read it. The code looks sensible. One minor comment. > diff --git a/tools/libs/hypfs/xenhypfs.pc.in b/too

Re: [Xen-devel] [PATCH v3 6/9] tools: add xenfs tool

2020-01-31 Thread Wei Liu
On Tue, Jan 21, 2020 at 09:43:27AM +0100, Juergen Gross wrote: > Add the xenfs tool for accessing the hypervisor filesystem. > > Signed-off-by: Juergen Gross Acked-by: Wei Liu ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xe

Re: [Xen-devel] [PATCH v4 7/7] xl: allow domid to be preserved on save/restore or migrate

2020-01-31 Thread Wei Liu
On Thu, Jan 30, 2020 at 06:20:08PM +, Andrew Cooper wrote: > On 30/01/2020 17:42, Durrant, Paul wrote: > >> -Original Message- > >> From: Ian Jackson > >> Sent: 30 January 2020 17:29 > >> To: Durrant, Paul > >> Cc: xen-devel@lists.xenproject.org; Wei Liu ; Anthony Perard > >> > >> Su

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 04:35:23PM +0100, Jan Beulich wrote: > On 31.01.2020 15:37, Wei Liu wrote: > > On Fri, Jan 31, 2020 at 03:24:07PM +0100, Jan Beulich wrote: > >> On 29.01.2020 21:20, Wei Liu wrote: > >>> I tried using the asm(".equ ..") trick but hit a problem with %c again. > >>> > >>> mm.c

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Jan Beulich
On 31.01.2020 17:15, Wei Liu wrote: > On Fri, Jan 31, 2020 at 04:35:23PM +0100, Jan Beulich wrote: >> On 31.01.2020 15:37, Wei Liu wrote: >>> On Fri, Jan 31, 2020 at 03:24:07PM +0100, Jan Beulich wrote: On 29.01.2020 21:20, Wei Liu wrote: > I tried using the asm(".equ ..") trick but hit a

[Xen-devel] [PATCH v4 0/7] x86/HVM: implement memory read caching

2020-01-31 Thread Jan Beulich
Emulation requiring device model assistance uses a form of instruction re-execution, assuming that the second (and any further) pass takes exactly the same path. This is a valid assumption as far as use of CPU registers goes (as those can't change without any other instruction executing in between)

[Xen-devel] [PATCH v4 1/7] SVM: drop asm/hvm/emulate.h inclusion from vmcb.h

2020-01-31 Thread Jan Beulich
It's not needed there and introduces a needless, almost global dependency. Include the file (or in some cases just xen/err.h) where actually needed, or - in one case - simply forward-declare a struct. In microcode*.c take the opportunity and also re-order a few other #include-s. Signed-off-by: Jan

[Xen-devel] [PATCH v4 2/7] x86/HVM: rename a variable in __hvm_copy()

2020-01-31 Thread Jan Beulich
This is to reflect its actual purpose. Also use in a 2nd place. Signed-off-by: Jan Beulich --- v4: New. --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3255,9 +3255,9 @@ static enum hvm_translation_result __hvm while ( todo > 0 ) { enum hvm_translation_result res

[Xen-devel] [PATCH v4 3/7] x86/HVM: introduce "curr" into hvmemul_rep_{mov, sto}s()

2020-01-31 Thread Jan Beulich
There are a number of uses of "current" already, and more may appear down the road. Latch into a local variable. At this occasion also drop stray casts from code getting touched anyway. Signed-off-by: Jan Beulich --- v4: New. --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@

[Xen-devel] [PATCH v4 4/7] x86/HVM: implement memory read caching for insn emulation

2020-01-31 Thread Jan Beulich
Emulation requiring device model assistance uses a form of instruction re-execution, assuming that the second (and any further) pass takes exactly the same path. This is a valid assumption as far as use of CPU registers goes (as those can't change without any other instruction executing in between)

[Xen-devel] [PATCH v4 5/7] x86/mm: use cache in guest_walk_tables()

2020-01-31 Thread Jan Beulich
Emulation requiring device model assistance uses a form of instruction re-execution, assuming that the second (and any further) pass takes exactly the same path. This is a valid assumption as far as use of CPU registers goes (as those can't change without any other instruction executing in between)

[Xen-devel] [PATCH v4 7/7] x86/HVM: reduce scope of pfec in hvm_emulate_init_per_insn()

2020-01-31 Thread Jan Beulich
It needs calculating only in one out of three cases. Re-structure the code a little such that the variable truly gets calculated only when we don't get any insn bytes from elsewhere, and hence need to (try to) fetch them. Also OR in PFEC_insn_fetch right in the initializer. While in this mood, res

[Xen-devel] [PATCH v4 6/7] x86/mm: drop p2mt parameter from map_domain_gfn()

2020-01-31 Thread Jan Beulich
No caller actually consumes it. Signed-off-by: Jan Beulich --- v4: New. --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -278,7 +278,6 @@ static int __init pvh_add_mem_range(stru static int __init pvh_setup_vmx_realmode_helpers(struct domain *d) { -p2m_type_t p2

Re: [Xen-devel] [PATCH v4 1/7] SVM: drop asm/hvm/emulate.h inclusion from vmcb.h

2020-01-31 Thread Andrew Cooper
On 31/01/2020 16:42, Jan Beulich wrote: > It's not needed there and introduces a needless, almost global > dependency. Include the file (or in some cases just xen/err.h) where > actually needed, or - in one case - simply forward-declare a struct. In > microcode*.c take the opportunity and also re-o

Re: [Xen-devel] [PATCH v5 08/12] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Wei Liu
On Fri, Jan 31, 2020 at 05:18:14PM +0100, Jan Beulich wrote: > On 31.01.2020 17:15, Wei Liu wrote: > > On Fri, Jan 31, 2020 at 04:35:23PM +0100, Jan Beulich wrote: > >> On 31.01.2020 15:37, Wei Liu wrote: > >>> On Fri, Jan 31, 2020 at 03:24:07PM +0100, Jan Beulich wrote: > On 29.01.2020 21:20,

[Xen-devel] [xen-unstable-smoke test] 146624: tolerable all pass - PUSHED

2020-01-31 Thread osstest service owner
flight 146624 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/146624/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 13 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

[Xen-devel] [RFC PATCH v3 23/22] x86/smp: reset x2apic_enabled in smp_send_stop()

2020-01-31 Thread David Woodhouse
From: David Woodhouse Just before smp_send_stop() re-enables interrupts when shutting down for reboot or kexec, it calls __stop_this_cpu() which in turn calls disable_local_APIC(), which puts the APIC back in to the mode Xen found it in at boot. If that means turning x2APIC off and going back in

Re: [Xen-devel] [PATCH v5 5/7] libxl: allow creation of domains with a specified or random domid

2020-01-31 Thread Jason Andryuk
On Fri, Jan 31, 2020 at 10:02 AM Paul Durrant wrote: > > This patch adds a 'domid' field to libxl_domain_create_info and then > modifies libxl__domain_make() to have Xen use that value if it is valid. > If the domid value is invalid then Xen will choose the domid, as before, > unless the value is

[Xen-devel] [qemu-mainline test] 146627: regressions - FAIL

2020-01-31 Thread osstest service owner
flight 146627 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/146627/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-xsm 6 xen-buildfail REGR. vs. 144861 build-arm64

[Xen-devel] [PATCH v6 03/11] x86: provide executable fixmap facility

2020-01-31 Thread Wei Liu
This allows us to set aside some address space for executable mapping. This fixed map range starts from XEN_VIRT_END so that it is within reach of the .text section. Shift the percpu stub range and shrink livepatch range accordingly. Signed-off-by: Wei Liu --- v6: 1. Move symbol generation snipp

[Xen-devel] [PATCH v6 06/11] x86/hyperv: provide Hyper-V hypercall functions

2020-01-31 Thread Wei Liu
These functions will be used later to make hypercalls to Hyper-V. Signed-off-by: Wei Liu Reviewed-by: Paul Durrant --- v6: 1. Use asm(...) to generate symbol 2. Add a comment regarding volatile registers v5: 1. Switch back to direct call 2. Fix some issues pointed out by Jan --- MAINTAINERS

[Xen-devel] [PATCH v6 07/11] DO NOT APPLY: x86/hyperv: issue an hypercall

2020-01-31 Thread Wei Liu
Test if the infrastructure works. Signed-off-by: Wei Liu --- xen/arch/x86/guest/hyperv/hyperv.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c index 7c2a96d70e..052b053160 100644 --- a/xen/arch/x86/gues

[Xen-devel] [PATCH v6 04/11] x86/hypervisor: provide hypervisor_fixup_e820

2020-01-31 Thread Wei Liu
And implement the hook for Xen guest. Signed-off-by: Wei Liu --- xen/arch/x86/e820.c| 4 ++-- xen/arch/x86/guest/hypervisor.c| 6 ++ xen/arch/x86/guest/xen/xen.c | 7 +++ xen/include/asm-x86/guest/hypervisor.h | 6 ++ 4 files changed, 21 insertio

[Xen-devel] [PATCH v6 00/11] More Hyper-V infrastructures

2020-01-31 Thread Wei Liu
This patch sereis implements several important functionalities to run Xen on top of Hyper-V. See individual patches for more details. I've checked the assembly code as well as putting in a test patch to make sure the hypercall interface is implemented correctly. Wei. Cc: Jan Beulich Cc: Andrew

[Xen-devel] [PATCH v6 01/11] x86/hypervisor: make hypervisor_ap_setup return an error code

2020-01-31 Thread Wei Liu
We want to be able to handle AP setup error in the upper layer. Signed-off-by: Wei Liu --- v6: 1. Change map_vcpuinfo as well 2. Make code shorter --- xen/arch/x86/guest/hypervisor.c| 6 -- xen/arch/x86/guest/xen/xen.c | 24 +++- xen/include/asm-x86/gue

[Xen-devel] [PATCH v6 02/11] x86/smp: don't online cpu if hypervisor_ap_setup fails

2020-01-31 Thread Wei Liu
Push hypervisor_ap_setup down to smp_callin. Take the chance to replace xen_guest with cpu_has_hypervisor. Signed-off-by: Wei Liu Reviewed-by: Roger Pau Monné Reviewed-by: Jan Beulich --- xen/arch/x86/smpboot.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen

[Xen-devel] [PATCH v6 10/11] x86: move viridian_page_msr to hyperv-tlfs.h

2020-01-31 Thread Wei Liu
And rename it to hv_vp_assist_page_msr. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/hvm/viridian/viridian.c| 2 +- xen/include/asm-x86/guest/hyperv-tlfs.h | 11 +++ xen/include/asm-x86/hvm/viridian.h | 15 ++- 3 files changed, 14 insertions(+), 14

[Xen-devel] [PATCH v6 09/11] x86/hyperv: retrieve vp_index from Hyper-V

2020-01-31 Thread Wei Liu
This will be useful when invoking hypercall that targets specific vcpu(s). Signed-off-by: Wei Liu Reviewed-by: Paul Durrant Acked-by: Jan Beulich --- v5: 1. Add Jan's Ack. v4: 1. Use private.h 2. Add Paul's review tag v2: 1. Fold into setup_pcpu_arg function --- xen/arch/x86/guest/hyperv/hyp

[Xen-devel] [PATCH v6 05/11] x86/hyperv: setup hypercall page

2020-01-31 Thread Wei Liu
Hyper-V uses a technique called overlay page for its hypercall page. It will insert a backing page to the guest when the hypercall functionality is enabled. That means we can use a page that is not backed by real memory for hypercall page. Use the top-most addressable page for that purpose. Adjust

[Xen-devel] [PATCH v6 08/11] x86/hyperv: provide percpu hypercall input page

2020-01-31 Thread Wei Liu
Hyper-V's input / output argument must be 8 bytes aligned an not cross page boundary. One way to satisfy those requirements is to use percpu page. For the foreseeable future we only need to provide input for TLB and APIC hypercalls, so skip setting up an output page. We will also need to provide

[Xen-devel] [PATCH v6 11/11] x86/hyperv: setup VP assist page

2020-01-31 Thread Wei Liu
VP assist page is rather important as we need to toggle some bits in it for efficient nested virtualisation. Signed-off-by: Wei Liu --- v6: 1. Use hv_vp_assist_page_msr 2. Make code shorter 3. Preserve rsvdP fields v5: 1. Deal with error properly instead of always panicking 2. Swap percpu variab

Re: [Xen-devel] [PATCH v6 05/11] x86/hyperv: setup hypercall page

2020-01-31 Thread Wei Liu
(Note to self) On Fri, Jan 31, 2020 at 05:49:24PM +, Wei Liu wrote: [...] > +static uint64_t generate_guest_id(void) > +{ > +union hv_guest_os_id id; > + id.raw = 0; > +id.vendor = HV_XEN_VENDOR_ID; > +id.major = xen_major_version(); > +id.minor = xen_minor_version();

Re: [Xen-devel] [PATCH] xen/arm: Implement GICD_IGRPMODR as RAZ/WI for VGICv3

2020-01-31 Thread Jeff Kubascik
Hello Julien, On 1/29/2020 4:27 PM, Julien Grall wrote: > Hi Jeff, > > On 21/01/2020 14:39, Jeff Kubascik wrote: >> The VGICv3 module does not implement security extensions for guests. >> Furthermore, per the ARM Generic Interrupt Controller Architecture >> Specification (ARM IHI 0069E), section

  1   2   >