Re: [Xen-devel] [PATCH v2 10/16] x86/PV: split out dealing with CRn from privileged instruction handling

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 22:01, wrote: > On 28/09/16 09:14, Jan Beulich wrote: >> +static int priv_op_read_cr(unsigned int reg, unsigned long *val, >> + struct x86_emulate_ctxt *ctxt) >> +{ >> +const struct vcpu *curr = current; >> + >> +switch ( reg ) >> +{ >> +

Re: [Xen-devel] [PATCH v2 11/16] x86/PV: split out dealing with DRn from privileged instruction handling

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 22:13, wrote: > On 28/09/16 09:15, Jan Beulich wrote: >> This is in preparation for using the generic emulator here. >> >> Some care is needed temporarily to not unduly alter guest register >> state: The local variable "res" can only go away once this code got >> fully switched

Re: [Xen-devel] [PATCH v2 09/16] x86/32on64: use generic instruction decoding for call gate emulation

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 21:47, wrote: > On 28/09/16 09:13, Jan Beulich wrote: >> @@ -3204,179 +3285,59 @@ static void emulate_gate_op(struct cpu_u >> return; >> } >> >> -op_bytes = op_default = ar & _SEGMENT_DB ? 4 : 2; >> -ad_default = ad_bytes = op_default; >> -opnd_sel =

[Xen-devel] [qemu-mainline test] 101216: tolerable FAIL - PUSHED

2016-09-30 Thread osstest service owner
flight 101216 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/101216/ Failures :-/ but no regressions. Regressions which are regarded as allowable (not blocking): test-amd64-i386-xl-qemuu-win7-amd64 16 guest-stop fail like 101213 test-amd64-amd64-xl-rtds

Re: [Xen-devel] [PATCH v2 13/16] x86emul: support XSETBV

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 22:45, wrote: > On 28/09/16 09:17, Jan Beulich wrote: >> This is a prereq for switching PV privileged op emulation to the >> generic instruction emulator. Since handle_xsetbv() is already capable >> of dealing with all guest kinds, avoid introducing another hook here. >> >> Sign

Re: [Xen-devel] [PATCH v2 16/16] x86emul: don't assume a memory operand

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 23:12, wrote: > On 28/09/16 09:19, Jan Beulich wrote: >> @@ -2216,7 +2217,7 @@ x86_decode( >> } >> } >> >> -if ( override_seg != -1 && ea.type == OP_MEM ) >> +if ( override_seg != x86_seg_none ) > > I don't see why the "ea.type == OP_MEM" should be dropp

Re: [Xen-devel] [PATCH v2 05/30] xen/x86: assert that local_events_need_delivery is not called by the idle domain

2016-09-30 Thread Roger Pau Monne
On Thu, Sep 29, 2016 at 04:45:57AM -0600, Jan Beulich wrote: > >>> On 27.09.16 at 17:57, wrote: > > It doesn't make sense since the idle domain doesn't receive any events. > > The change itself is fine, but I think it would help if the commit > message made explicit why this is becoming relevant.

Re: [Xen-devel] [PATCH v2 08/16] SVM: use generic instruction decoding

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 21:24, wrote: > On 28/09/16 09:13, Jan Beulich wrote: >> ... instead of custom handling. To facilitate this break out init code >> from _hvm_emulate_one() into the new hvm_emulate_init(), and make >> hvmemul_insn_fetch( globally available. > > ) > >> int __get_instruction_len

Re: [Xen-devel] [PATCH v2 15/16] x86/PV: use generic emulator for privileged instruction handling

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 23:06, wrote: > On 28/09/16 09:18, Jan Beulich wrote: >> There's a new emulator return code being added to allow bypassing >> certain operations (see the code comment). Its handling in the epilogue >> code involves moving the raising of the single step trap until after >> regist

Re: [Xen-devel] [PATCH v2 05/30] xen/x86: assert that local_events_need_delivery is not called by the idle domain

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 10:32, wrote: > On Thu, Sep 29, 2016 at 04:45:57AM -0600, Jan Beulich wrote: >> >>> On 27.09.16 at 17:57, wrote: >> > It doesn't make sense since the idle domain doesn't receive any events. >> >> The change itself is fine, but I think it would help if the commit >> message mad

Re: [Xen-devel] [PATCH] pub-headers: reduce C99 dependencies

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 21:22, wrote: > > On 29/09/2016 12:11, Julien Grall wrote: >> Hi Jan, >> >> On 28/09/2016 23:04, Jan Beulich wrote: >> On 28.09.16 at 21:42, wrote: Hi Jan, On 28/09/2016 05:00, Jan Beulich wrote: > For consumers not using (fully) C99-aware compilers, li

Re: [Xen-devel] [PATCH] pub-headers: reduce C99 dependencies

2016-09-30 Thread Wei Liu
On Fri, Sep 30, 2016 at 03:05:18AM -0600, Jan Beulich wrote: > >>> On 29.09.16 at 21:22, wrote: > > > > > On 29/09/2016 12:11, Julien Grall wrote: > >> Hi Jan, > >> > >> On 28/09/2016 23:04, Jan Beulich wrote: > >> On 28.09.16 at 21:42, wrote: > Hi Jan, > > On 28/09/2016 05:0

[Xen-devel] [libvirt test] 101218: regressions - FAIL

2016-09-30 Thread osstest service owner
flight 101218 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/101218/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-libvirt-qcow2 9 debian-di-install fail REGR. vs. 101200 Tests which did not suc

[Xen-devel] [PATCH v3] SVM: use generic instruction decoding

2016-09-30 Thread Jan Beulich
... instead of custom handling. To facilitate this break out init code from _hvm_emulate_one() into the new hvm_emulate_init(), and make hvmemul_insn_fetch( globally available. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- v3: Add comment explaining debug/non-debug build differences.

[Xen-devel] [PATCH] x86emul: defer injection of #DB

2016-09-30 Thread Jan Beulich
Move the raising of the single step trap until after registers were updated. This should probably have been that way from the beginning, to allow the inject_hw_exception() hook to see updated register state (in case it cares) - it's a trap, after all. Signed-off-by: Jan Beulich --- a/xen/arch/x8

[Xen-devel] [PATCH v3] x86emul: support XSETBV

2016-09-30 Thread Jan Beulich
This is a prereq for switching PV privileged op emulation to the generic instruction emulator. Since handle_xsetbv() is already capable of dealing with all guest kinds, avoid introducing another hook here. Signed-off-by: Jan Beulich --- v3: Include asm/xstate.h, requiring adjustments to EFER_* de

Re: [Xen-devel] [PATCH v9 04/13] x86: properly calculate xen ELF end of image address

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 23:42, wrote: > This patch is prereq for "efi: build xen.gz with EFI code" patch which adds, > among others, xen/arch/x86/efi/relocs-dummy.S to xen.gz output. Below there > is a description why it is needed. > > Currently xen ELF end of image address is calculated using first l

Re: [Xen-devel] [PATCH v9 06/13] efi: create new early memory allocator

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 23:42, wrote: > +#else > +static void __init free_ebmalloc_unused_mem(void) > +{ > +} > +#endif Did you build test this for ARM? The function ought to be unused, as ... > @@ -1251,6 +1301,8 @@ void __init efi_init_memory(void) > } *extra, *extra_head = NULL; > #endif >

[Xen-devel] [PATCH 1/2] tools/libxc: Don't leak foreign mappings when loading modules

2016-09-30 Thread Andrew Cooper
Spotted by Coverity Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu CC: Boris Ostrovsky --- tools/libxc/xc_dom_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c index 5326d36..e177667 100644 --- a/tools/libxc/xc_dom_c

[Xen-devel] [PATCH 2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode()

2016-09-30 Thread Andrew Cooper
Coverity doesn't appear to be able to spot that this is a terminal error path, but leave a comment to "fix" MISSING_BREAK. Signed-off-by: Andrew Cooper --- CC: Jan Beulich This issue is newly exposed since splitting x86_decode() away from x86_emulate(). I seem to recall that Coverity has an up

[Xen-devel] [ovmf test] 101220: all pass - PUSHED

2016-09-30 Thread osstest service owner
flight 101220 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/101220/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf ed72804638c9b240477c5235d72c3823483813b2 baseline version: ovmf dab62c5ec8a88def3ee99

Re: [Xen-devel] [PATCH v9 09/13] x86: change default load address from 1 MiB to 2 MiB

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 23:42, wrote: > Subsequent patches introducing relocatable early boot code play with > page tables using 2 MiB huge pages. If load address is not aligned at > 2 MiB then code touching such page tables must have special cases for > start and end of Xen image memory region. So, le

Re: [Xen-devel] [PATCH v9 13/13] x86: add multiboot2 protocol support for relocatable images

2016-09-30 Thread Jan Beulich
>>> On 29.09.16 at 23:42, wrote: > Add multiboot2 protocol support for relocatable images. Only GRUB2 with > "multiboot2: Add support for relocatable images" patch understands > that feature. Older multiboot protocol (regardless of version) > compatible loaders ignore it and everything works as us

Re: [Xen-devel] [PATCH 2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode()

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 12:01, wrote: > Coverity doesn't appear to be able to spot that this is a terminal error path, > but leave a comment to "fix" MISSING_BREAK. > > Signed-off-by: Andrew Cooper Acked-by: Jan Beulich ___ Xen-devel mailing list Xen-de

Re: [Xen-devel] [PATCH] x86emul: defer injection of #DB

2016-09-30 Thread Andrew Cooper
On 30/09/16 10:39, Jan Beulich wrote: > Move the raising of the single step trap until after registers were > updated. This should probably have been that way from the beginning, > to allow the inject_hw_exception() hook to see updated register state > (in case it cares) - it's a trap, after all. >

Re: [Xen-devel] [PATCH v3] x86emul: support XSETBV

2016-09-30 Thread Andrew Cooper
On 30/09/16 10:39, Jan Beulich wrote: > This is a prereq for switching PV privileged op emulation to the > generic instruction emulator. Since handle_xsetbv() is already capable > of dealing with all guest kinds, avoid introducing another hook here. > > Signed-off-by: Jan Beulich Reviewed-by: And

Re: [Xen-devel] [PATCH 1/2] tools/libxc: Don't leak foreign mappings when loading modules

2016-09-30 Thread Wei Liu
On Fri, Sep 30, 2016 at 11:01:03AM +0100, Andrew Cooper wrote: > Spotted by Coverity > > Signed-off-by: Andrew Cooper Acked-by: Wei Liu > --- > CC: Ian Jackson > CC: Wei Liu > CC: Boris Ostrovsky > --- > tools/libxc/xc_dom_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/to

Re: [Xen-devel] [PATCH v2 07/10] tools: tracing: handle more scheduling related events.

2016-09-30 Thread Ian Jackson
Dario Faggioli writes ("[PATCH v2 07/10] tools: tracing: handle more scheduling related events."): > There are some scheduling related trace records that > are not being taken care of (and hence only dumped as > raw records). > > Some of them are being introduced in this series, while > other wer

Re: [Xen-devel] [PATCH v2 08/10] libxl: fix coding style of credit1 parameters related functions

2016-09-30 Thread Ian Jackson
Dario Faggioli writes ("[PATCH v2 08/10] libxl: fix coding style of credit1 parameters related functions"): > More specifically, the the error handling path is > made compliant with libxl's codying style. ... > int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid, >

Re: [Xen-devel] [PATCH v2 09/10] libxl: allow to set the ratelimit value online for Credit2

2016-09-30 Thread Ian Jackson
Dario Faggioli writes ("[PATCH v2 09/10] libxl: allow to set the ratelimit value online for Credit2"): > This is the remaining part of the plumbing (the libxl > one) necessary to be able to change the value of the > ratelimit_us parameter online, for Credit2 (like it is > already for Credit1). Th

Re: [Xen-devel] [PATCH 1/5] x86emul: support UMIP

2016-09-30 Thread Andrew Cooper
On 08/09/16 14:42, Jan Beulich wrote: > To make this complete, also add support for SLDT and STR. Note that by > just looking at the guest CR4 bit, this is independent of actually > making available the UMIP feature to guests. > > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/x86_emulate/x86_e

Re: [Xen-devel] [PATCH v2 09/10] libxl: allow to set the ratelimit value online for Credit2

2016-09-30 Thread George Dunlap
On 30/09/16 11:30, Ian Jackson wrote: > Dario Faggioli writes ("[PATCH v2 09/10] libxl: allow to set the ratelimit > value online for Credit2"): >> This is the remaining part of the plumbing (the libxl >> one) necessary to be able to change the value of the >> ratelimit_us parameter online, for Cr

Re: [Xen-devel] [PATCH v2 10/10] xl: allow to set the ratelimit value online for Credit2

2016-09-30 Thread Ian Jackson
Dario Faggioli writes ("[PATCH v2 10/10] xl: allow to set the ratelimit value online for Credit2"): > Last part of the wiring necessary for allowing to > change the value of the ratelimit_us parameter online, > for Credit2 (like it is already for Credit1). > > Signed-off-by: Dario Faggioli > Rev

Re: [Xen-devel] [PATCH v2 09/10] libxl: allow to set the ratelimit value online for Credit2

2016-09-30 Thread Ian Jackson
George Dunlap writes ("Re: [PATCH v2 09/10] libxl: allow to set the ratelimit value online for Credit2"): > On 30/09/16 11:30, Ian Jackson wrote: > >> + out: > >> +GC_FREE; > >> +return rc; > > > > This should have an explicit assignment rc=0 before the out label. As > > it is, it will h

Re: [Xen-devel] [PATCH 2/5] x86emul: consolidate segment register handling

2016-09-30 Thread Andrew Cooper
On 08/09/16 14:43, Jan Beulich wrote: > @@ -2861,21 +2860,20 @@ x86_emulate( > dst.val = src.val; > break; > > -case 0x8c: /* mov Sreg,r/m */ { > -struct segment_register reg; > -enum x86_segment seg = decode_segment(modrm_reg); > +case 0x8c: /* mov Sreg,

Re: [Xen-devel] [PATCH 4/5] x86/emulate: add support for {, v}movq xmm, xmm/m64

2016-09-30 Thread Andrew Cooper
On 08/09/16 14:45, Jan Beulich wrote: > From: Mihai Donțu > > Signed-off-by: Mihai Donțu > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v9 06/13] efi: create new early memory allocator

2016-09-30 Thread Daniel Kiper
On Fri, Sep 30, 2016 at 03:46:54AM -0600, Jan Beulich wrote: > >>> On 29.09.16 at 23:42, wrote: > > +#else > > +static void __init free_ebmalloc_unused_mem(void) > > +{ > > +} > > +#endif > > Did you build test this for ARM? The function ought to be unused, > as ... Nope. > > @@ -1251,6 +1301,8

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

2016-09-30 Thread osstest service owner
flight 101221 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/101221/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-xl 1

Re: [Xen-devel] [PATCH v8 03/16] libxl/arm: Generate static ACPI DSDT table

2016-09-30 Thread Wei Liu
On Wed, Sep 28, 2016 at 06:18:49PM -0700, Shannon Zhao wrote: > It uses static DSDT table like the way x86 uses. Currently the DSDT > table only contains processor device objects and it generates the > maximal objects which so far is 128. > > While the GUEST_MAX_VCPUS is defined under __XEN__ or _

Re: [Xen-devel] [PATCH v8 00/16] Xen ARM DomU ACPI support

2016-09-30 Thread Wei Liu
This series is now pushed. Thanks for all your work to make this happen. Please keep an eye on related bug reports and patches. Wei. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 0/2] Clarify License information : stubdom, tools/blktap2

2016-09-30 Thread Wei Liu
On Mon, Sep 26, 2016 at 02:30:00PM +0100, Wei Liu wrote: > On Mon, Sep 26, 2016 at 01:16:32PM +0100, Lars Kurth wrote: > > This series contains some of the easier license clean-up cases, which can > > be fixed > > by adding COPYING files or README.source files. The series specially > > contains:

Re: [Xen-devel] [PATCH v2 01/10] xen: credit1: return the 'time remaining to the limit' as next timeslice.

2016-09-30 Thread George Dunlap
On 30/09/16 03:53, Dario Faggioli wrote: > If vcpu x has run for 200us, and sched_ratelimit_us is > 1000us, continue running x _but_ return 1000us-200us as > the next time slice. This way, next scheduling point will > happen in 800us, i.e., exactly at the point when x crosses > the threshold, and c

Re: [Xen-devel] [PATCH v2 02/10] xen: credit1: don't rate limit context switches in case of yields

2016-09-30 Thread George Dunlap
On 30/09/16 03:53, Dario Faggioli wrote: > Rate limiting has been primarily introduced to avoid too > heavy context switch rate due to interrupts, and, in > general, asynchronous events. > > If a vcpu "voluntarily" yields, we really should let it > give up the cpu for a while. > > In fact, it may

Re: [Xen-devel] [PATCH 2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode()

2016-09-30 Thread Wei Liu
On Fri, Sep 30, 2016 at 04:06:57AM -0600, Jan Beulich wrote: > >>> On 30.09.16 at 12:01, wrote: > > Coverity doesn't appear to be able to spot that this is a terminal error > > path, > > but leave a comment to "fix" MISSING_BREAK. > > > > Signed-off-by: Andrew Cooper > > Acked-by: Jan Beulich

Re: [Xen-devel] [PATCH v2] Added COPYING and README.patch files to xen/common and xen/tools

2016-09-30 Thread Wei Liu
On Tue, Sep 27, 2016 at 10:53:07AM +0100, Wei Liu wrote: > On Mon, Sep 26, 2016 at 05:06:49PM +0100, Lars Kurth wrote: > > This patch adds information related to non-GPL licenses and code > > imports from 3rd party projects. The aim of this patch, is to > > make it easier for future contributors, t

Re: [Xen-devel] [PATCH v2 03/10] xen: credit2: make tickling more deterministic

2016-09-30 Thread George Dunlap
On 30/09/16 03:53, Dario Faggioli wrote: > Right now, the following scenario can occurr: > - upon vcpu v wakeup, v itself is put in the runqueue, >and pcpu X is tickled; > - pcpu Y schedules (for whatever reason), sees v in >the runqueue and picks it up. > > This may seem ok (or even a g

Re: [Xen-devel] [PATCH v2 09/30] x86/vtd: fix and simplify mapping RMRR regions

2016-09-30 Thread Roger Pau Monne
On Thu, Sep 29, 2016 at 08:18:36AM -0600, Jan Beulich wrote: > >>> On 27.09.16 at 17:57, wrote: > > The current code used by Intel VTd will only map RMRR regions for the > > hardware domain, but will fail to map RMRR regions for unprivileged domains > > unless the page tables are shared between EP

Re: [Xen-devel] [PATCH v2 04/10] xen: credit2: only reset credit on reset condition

2016-09-30 Thread George Dunlap
On 30/09/16 03:53, Dario Faggioli wrote: > The condition for a Credit2 scheduling epoch coming to an > end is that the vcpu at the front of the runqueue has negative > credits. However, it is possible, that runq_candidate() does > not actually return to the scheduler the first vcpu in the > runqueu

Re: [Xen-devel] Adding new custom devices to Xen via QEMU

2016-09-30 Thread Wei Liu
Hello On Thu, Sep 29, 2016 at 09:35:21AM -0400, Jason Dickens wrote: > Hello, > > My name is Jason Dickens and I'm a Research Scientist here at GrammaTech. > Some of our research involves securing hypervisors and we have needed to add > to and/or modify Xen. I have been successful in modifying th

Re: [Xen-devel] [PATCH 5/5] x86/emulate: add support for {, v}movd {, x}mm, r/m32 and {, v}movq {, x}mm, r/m64

2016-09-30 Thread Andrew Cooper
On 08/09/16 14:46, Jan Beulich wrote: > --- a/xen/arch/x86/x86_emulate/x86_emulate.c > +++ b/xen/arch/x86/x86_emulate/x86_emulate.c > @@ -223,7 +223,7 @@ static const opcode_desc_t twobyte_table > /* 0x70 - 0x7F */ > SrcImmByte|ModRM, SrcImmByte|ModRM, SrcImmByte|ModRM, SrcImmByte|ModRM,

[Xen-devel] [xen-unstable test] 101219: tolerable FAIL

2016-09-30 Thread osstest service owner
flight 101219 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/101219/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-armhf-libvirt-xsm 7 host-ping-check-xenfail pass in 101215 test-amd64-amd64-xl-rtds 6

Re: [Xen-devel] [PATCH v2 08/10] libxl: fix coding style of credit1 parameters related functions

2016-09-30 Thread Dario Faggioli
On Fri, 2016-09-30 at 11:24 +0100, Ian Jackson wrote: > Dario Faggioli writes ("[PATCH v2 08/10] libxl: fix coding style of > credit1 parameters related functions"): > >  int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid, > >    libxl_sched_credit_par

Re: [Xen-devel] [PATCH 5/5] x86/emulate: add support for {, v}movd {, x}mm, r/m32 and {, v}movq {, x}mm, r/m64

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 13:59, wrote: > On 08/09/16 14:46, Jan Beulich wrote: >> --- a/xen/arch/x86/x86_emulate/x86_emulate.c >> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c >> @@ -223,7 +223,7 @@ static const opcode_desc_t twobyte_table >> /* 0x70 - 0x7F */ >> SrcImmByte|ModRM, SrcImmByte|Mo

Re: [Xen-devel] [PATCH 5/5] x86/emulate: add support for {, v}movd {, x}mm, r/m32 and {, v}movq {, x}mm, r/m64

2016-09-30 Thread Andrew Cooper
On 30/09/16 13:11, Jan Beulich wrote: On 30.09.16 at 13:59, wrote: >> On 08/09/16 14:46, Jan Beulich wrote: >>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c >>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c >>> @@ -223,7 +223,7 @@ static const opcode_desc_t twobyte_table >>> /* 0x70 - 0x7

Re: [Xen-devel] [PATCH 2/5] x86emul: consolidate segment register handling

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 12:39, wrote: > On 08/09/16 14:43, Jan Beulich wrote: >> @@ -2861,21 +2860,20 @@ x86_emulate( >> dst.val = src.val; >> break; >> >> -case 0x8c: /* mov Sreg,r/m */ { >> -struct segment_register reg; >> -enum x86_segment seg = decode_segment

Re: [Xen-devel] [PATCH 2/5] x86emul: consolidate segment register handling

2016-09-30 Thread Andrew Cooper
On 30/09/16 13:15, Jan Beulich wrote: On 30.09.16 at 12:39, wrote: >> On 08/09/16 14:43, Jan Beulich wrote: >>> @@ -2861,21 +2860,20 @@ x86_emulate( >>> dst.val = src.val; >>> break; >>> >>> -case 0x8c: /* mov Sreg,r/m */ { >>> -struct segment_register reg; >>>

Re: [Xen-devel] [PATCH 1/5] x86emul: support UMIP

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 12:32, wrote: > On 08/09/16 14:42, Jan Beulich wrote: >> @@ -1484,6 +1485,17 @@ static bool is_aligned(enum x86_segment >> return !((reg.base + offs) & (size - 1)); >> } >> >> +static bool is_umip(struct x86_emulate_ctxt *ctxt, >> +const struct x86_em

Re: [Xen-devel] [PATCH v2 04/10] xen: credit2: only reset credit on reset condition

2016-09-30 Thread anshul makkar
On 30/09/16 03:53, Dario Faggioli wrote: The condition for a Credit2 scheduling epoch coming to an end is that the vcpu at the front of the runqueue has negative credits. However, it is possible, that runq_candidate() does not actually return to the scheduler the first vcpu in the runqueue (e.g.,

Re: [Xen-devel] [PATCH 1/5] x86emul: support UMIP

2016-09-30 Thread Andrew Cooper
On 30/09/16 13:23, Jan Beulich wrote: On 30.09.16 at 12:32, wrote: >> On 08/09/16 14:42, Jan Beulich wrote: >>> @@ -1484,6 +1485,17 @@ static bool is_aligned(enum x86_segment >>> return !((reg.base + offs) & (size - 1)); >>> } >>> >>> +static bool is_umip(struct x86_emulate_ctxt *ctxt

Re: [Xen-devel] [PATCH v2 09/10] libxl: allow to set the ratelimit value online for Credit2

2016-09-30 Thread Dario Faggioli
On Fri, 2016-09-30 at 11:33 +0100, George Dunlap wrote: > On 30/09/16 11:30, Ian Jackson wrote: > > > > Dario Faggioli writes ("[PATCH v2 09/10] libxl: allow to set the > > ratelimit value online for Credit2"): > > > > > > This is the remaining part of the plumbing (the libxl > > > one) necessary

Re: [Xen-devel] [PATCH 3/5] x86emul: support RTM instructions

2016-09-30 Thread Andrew Cooper
On 08/09/16 14:44, Jan Beulich wrote: > Minimal emulation: XBEGIN aborts right away, hence > - XABORT is just a no-op, > - XEND always raises #GP, > - XTEST always signals neither RTM nor HLE are active. > > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/x86_emulate/x86_emulate.c > +++ b/xen/ar

Re: [Xen-devel] [PATCH 1/5] x86emul: support UMIP

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 14:27, wrote: > On 30/09/16 13:23, Jan Beulich wrote: > On 30.09.16 at 12:32, wrote: >>> On 08/09/16 14:42, Jan Beulich wrote: @@ -1484,6 +1485,17 @@ static bool is_aligned(enum x86_segment return !((reg.base + offs) & (size - 1)); } +static

Re: [Xen-devel] [PATCH 3/5] x86emul: support RTM instructions

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 14:37, wrote: > On 08/09/16 14:44, Jan Beulich wrote: >> @@ -2852,7 +2854,18 @@ x86_emulate( >> lock_prefix = 1; >> break; >> >> -case 0xc6 ... 0xc7: /* mov (sole member of Grp11) */ >> +case 0xc6: /* Grp11: mov / xabort */ >> +case 0xc7: /* Grp11

Re: [Xen-devel] [PATCH v2 05/10] xen: credit2: implement yield()

2016-09-30 Thread George Dunlap
On 30/09/16 03:53, Dario Faggioli wrote: > When a vcpu explicitly yields it is usually giving > us an advice of "let someone else run and come back > to me in a bit." > > Credit2 isn't, so far, doing anything when a vcpu > yields, which means an yield is basically a NOP (well, > actually, it's pur

Re: [Xen-devel] [PATCH v2 04/10] xen: credit2: only reset credit on reset condition

2016-09-30 Thread Dario Faggioli
On Fri, 2016-09-30 at 13:25 +0100, anshul makkar wrote: > On 30/09/16 03:53, Dario Faggioli wrote: > > @@ -2336,6 +2345,7 @@ csched2_schedule( > >  struct csched2_runqueue_data *rqd; > >  struct csched2_vcpu * const scurr = CSCHED2_VCPU(current); > >  struct csched2_vcpu *snext = NULL;

[Xen-devel] [PATCH v2 0/4] x86: further insn emulator improvements

2016-09-30 Thread Jan Beulich
1: support UMIP 2: consolidate segment register handling 3: support RTM instructions 4: conditionally clear BNDn for branches Signed-off-by: Jan Beulich ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH v2 1/4] x86emul: support UMIP

2016-09-30 Thread Jan Beulich
To make this complete, also add support for SLDT and STR. Note that by just looking at the guest CR4 bit, this is independent of actually making available the UMIP feature to guests. Signed-off-by: Jan Beulich --- v2: s/is_umip/umip_active/g. Fix a coding style issue. --- a/xen/arch/x86/x86_emul

[Xen-devel] [PATCH v2 2/4] x86emul: consolidate segment register handling

2016-09-30 Thread Jan Beulich
Use a single set of variables throughout the huge switch() statement, allowing to funnel SLDT/STR into the mov-from-sreg code path. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- v2: s/store_seg/store_selector/g. Re-base. --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x8

Re: [Xen-devel] [PATCH v2 06/10] xen: tracing: add trace records for schedule and rate-limiting.

2016-09-30 Thread George Dunlap
On 30/09/16 03:54, Dario Faggioli wrote: > As far as {csched, csched2, rt}_schedule() are concerned, > an "empty" event, would already make it easier to read and > understand a trace. > > But while there, add a few useful information, like > if the cpu that is going through the scheduler has > bee

[Xen-devel] [PATCH v2 3/4] x86emul: support RTM instructions

2016-09-30 Thread Jan Beulich
Minimal emulation: XBEGIN aborts right away, hence - XABORT is just a no-op, - XEND always raises #GP, - XTEST always signals neither RTM nor HLE are active. Signed-off-by: Jan Beulich --- v2: Explicitly generate #UD for xtest and xend. --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch

[Xen-devel] [PATCH v2 4/4] x86emul: conditionally clear BNDn for branches

2016-09-30 Thread Jan Beulich
Considering that we surface MPX to HVM guests, instructions we emulate should also correctly deal with MPX state. While for now BND* instructions don't get emulated, the effect of branches (which we do emulate) without BND prefix should be taken care of. No need to alter XABORT behavior: While not

Re: [Xen-devel] [PATCH v2 1/4] x86emul: support UMIP

2016-09-30 Thread Andrew Cooper
On 30/09/16 14:16, Jan Beulich wrote: > To make this complete, also add support for SLDT and STR. Note that by > just looking at the guest CR4 bit, this is independent of actually > making available the UMIP feature to guests. > > Signed-off-by: Jan Beulich Much clearer. Reviewed-by: Andrew Coop

Re: [Xen-devel] [PATCH v2 2/4] x86emul: consolidate segment register handling

2016-09-30 Thread Andrew Cooper
On 30/09/16 14:16, Jan Beulich wrote: > Use a single set of variables throughout the huge switch() statement, > allowing to funnel SLDT/STR into the mov-from-sreg code path. > > Signed-off-by: Jan Beulich > Reviewed-by: Andrew Cooper Also looking better. ~Andrew ___

Re: [Xen-devel] [PATCH v2 09/30] x86/vtd: fix and simplify mapping RMRR regions

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 13:27, wrote: > On Thu, Sep 29, 2016 at 08:18:36AM -0600, Jan Beulich wrote: >> >>> On 27.09.16 at 17:57, wrote: >> > +{ >> > +int rc; >> > + >> > +while ( nr_pages > 0 ) >> > +{ >> > +rc = (map ? map_mmio_regions : unmap_mmio_regions) >> > + (d,

Re: [Xen-devel] [PATCH v2 08/10] libxl: fix coding style of credit1 parameters related functions

2016-09-30 Thread George Dunlap
On 30/09/16 13:04, Dario Faggioli wrote: > On Fri, 2016-09-30 at 11:24 +0100, Ian Jackson wrote: >> Dario Faggioli writes ("[PATCH v2 08/10] libxl: fix coding style of >> credit1 parameters related functions"): >>> int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid, >>>

Re: [Xen-devel] Adding new custom devices to Xen via QEMU

2016-09-30 Thread Jason Dickens
Hi Wei, Thanks for the response. It make sense to me that if the device were on the PCI bus (or other such bus, e.g. USB) that it could be discovered, at least by an OS. Its something to consider. I should mention that our guest VM doesn't actually use an OS. However, the device is not imple

[Xen-devel] [PATCH v2] x86/32on64: don't modify guest descriptors without need

2016-09-30 Thread Jan Beulich
System gates with type 0 shouldn't have what might be their DPL altered - such descriptors can't be used anyway without incurring a #GP, and hence adjusting its DPL is only risking to confuse the guest. Also bail right away for non-present descriptors - no need to write back anything in that case.

Re: [Xen-devel] [PATCH v2 00/10] sched: Credit1 and Credit2 improvements... but *NO* soft-affinity for Credit2!

2016-09-30 Thread George Dunlap
On 30/09/16 03:53, Dario Faggioli wrote: > Hey, > > This is v2 of my Credit1 and Credit2 improvements series. First posting is > here: > > https://lists.xen.org/archives/html/xen-devel/2016-08/msg02183.html > > Now, couple of things: > - some of the patches have been applied already out of v1;

Re: [Xen-devel] Adding new custom devices to Xen via QEMU

2016-09-30 Thread David Vrabel
On 30/09/16 14:35, Jason Dickens wrote: > Hi Wei, > > Thanks for the response. It make sense to me that if the device were on > the PCI bus (or other such bus, e.g. USB) that it could be discovered, > at least by an OS. Its something to consider. I should mention that our > guest VM doesn't actual

Re: [Xen-devel] [PATCH v2 05/10] xen: credit2: implement yield()

2016-09-30 Thread Dario Faggioli
On Fri, 2016-09-30 at 13:52 +0100, George Dunlap wrote: > On 30/09/16 03:53, Dario Faggioli wrote: > > > > When a vcpu explicitly yields it is usually giving > > us an advice of "let someone else run and come back > > to me in a bit." > > > > Credit2 isn't, so far, doing anything when a vcpu > >

Re: [Xen-devel] [PATCH v1 02/12] tmem: Retire XEN_SYSCTL_TMEM_OP_[SET_CAP|SAVE_GET_CLIENT_CAP]

2016-09-30 Thread Konrad Rzeszutek Wilk
On Wed, Sep 28, 2016 at 06:10:58AM -0600, Jan Beulich wrote: > >>> On 28.09.16 at 11:42, wrote: > > It is not used by anything. > > But that shouldn't be the only aspect. Are they also not useful for > anything? As far as I can see it was meant to complement the 'weight'. But the code just hangs

Re: [Xen-devel] [PATCH v2 00/10] sched: Credit1 and Credit2 improvements... but *NO* soft-affinity for Credit2!

2016-09-30 Thread Dario Faggioli
On Fri, 2016-09-30 at 14:51 +0100, George Dunlap wrote: > On 30/09/16 03:53, Dario Faggioli wrote: > >  > > Dario Faggioli (10): > [snip] > > > >   xen: credit2: implement yield() > >   xen: tracing: add trace records for schedule and rate- > > limiting. > > I've pushed everything but the

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

2016-09-30 Thread osstest service owner
flight 101224 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/101224/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-armhf-armhf-xl 1

Re: [Xen-devel] [PATCH v2 3/4] x86emul: support RTM instructions

2016-09-30 Thread Andrew Cooper
On 30/09/16 14:17, Jan Beulich wrote: > Minimal emulation: XBEGIN aborts right away, hence > - XABORT is just a no-op, > - XEND always raises #GP, > - XTEST always signals neither RTM nor HLE are active. > > Signed-off-by: Jan Beulich > --- > v2: Explicitly generate #UD for xtest and xend. > > ---

Re: [Xen-devel] [PATCH v2 00/10] sched: Credit1 and Credit2 improvements... but *NO* soft-affinity for Credit2!

2016-09-30 Thread George Dunlap
On 30/09/16 15:06, Dario Faggioli wrote: > On Fri, 2016-09-30 at 14:51 +0100, George Dunlap wrote: >> On 30/09/16 03:53, Dario Faggioli wrote: >>> >>> Dario Faggioli (10): >> [snip] >>> >>> xen: credit2: implement yield() >>> xen: tracing: add trace records for schedule and rate- >>>

Re: [Xen-devel] [PATCH v2 00/10] sched: Credit1 and Credit2 improvements... but *NO* soft-affinity for Credit2!

2016-09-30 Thread Dario Faggioli
On Fri, 2016-09-30 at 15:10 +0100, George Dunlap wrote: > On 30/09/16 15:06, Dario Faggioli wrote: > > Mm... looks to me that > > > >  3/10 xen: credit2: make tickling more deterministic > > > > is also missing? Or should I re-`git pull' (I've just done that, > > though...)? > > I see it there i

Re: [Xen-devel] [PATCH v2] x86/32on64: don't modify guest descriptors without need

2016-09-30 Thread Andrew Cooper
On 30/09/16 14:36, Jan Beulich wrote: > System gates with type 0 shouldn't have what might be their DPL altered > - such descriptors can't be used anyway without incurring a #GP, and > hence adjusting its DPL is only risking to confuse the guest. > > Also bail right away for non-present descriptors

[Xen-devel] [PATCH v3 0/2] sched: Credit1 and Credit2 improvements... but *NO* soft-affinity for Credit2!

2016-09-30 Thread Dario Faggioli
And here they are, the last two remaining patches... Dario --- Dario Faggioli (2): xen: credit2: implement yield() xen: tracing: add trace records for schedule and rate-limiting. xen/common/sched_credit.c| 32 +++ xen/common/sched_credit2.c | 92

[Xen-devel] [PATCH v3 1/2] xen: credit2: implement yield()

2016-09-30 Thread Dario Faggioli
When a vcpu explicitly yields it is usually giving us an advice of "let someone else run and come back to me in a bit." Credit2 isn't, so far, doing anything when a vcpu yields, which means an yield is basically a NOP (well, actually, it's pure overhead, as it causes the scheduler kick in, but the

[Xen-devel] [PATCH v3 2/2] xen: tracing: add trace records for schedule and rate-limiting.

2016-09-30 Thread Dario Faggioli
As far as {csched, csched2, rt}_schedule() are concerned, an "empty" event, would already make it easier to read and understand a trace. But while there, add a few useful information, like if the cpu that is going through the scheduler has been tickled or not, if it is currently idle, etc (they va

Re: [Xen-devel] Adding new custom devices to Xen via QEMU

2016-09-30 Thread Jason Dickens
Thanks David, This could very well be the issue, but could you please elaborate? The questions that come up are the following: What is the physical address range given to RAM? What range of addresses would work for my device? And, if this is the case, how would I unpopulate the RAM? There are

Re: [Xen-devel] [PATCH v3] SVM: use generic instruction decoding

2016-09-30 Thread Boris Ostrovsky
On 09/30/2016 05:38 AM, Jan Beulich wrote: > +if ( opc_tab[instr].opcode == ctxt.ctxt.opcode ) > { > -if ( (inst_len + i) >= fetch_len ) > -{ > -if ( !fetch(vmcb, buf + fetch_len, fetch_addr + fetch_len, > -max_le

Re: [Xen-devel] [PATCH v1 08/12] tmem: Handle 'struct tmem_info' as a seperate field in the

2016-09-30 Thread Konrad Rzeszutek Wilk
On Wed, Sep 28, 2016 at 06:56:40AM -0600, Jan Beulich wrote: > >>> On 28.09.16 at 11:42, wrote: > > Note: We still have to do this awkward 'guest_handle_cast' > > otherwise it will not compile on ARM - which defines _two_ > > of these macros (__guest_handle_64_xen_sysctl_tmem_client_t > > and __gu

Re: [Xen-devel] [PATCH v3] SVM: use generic instruction decoding

2016-09-30 Thread Jan Beulich
>>> On 30.09.16 at 16:37, wrote: > On 09/30/2016 05:38 AM, Jan Beulich wrote: >> +if ( opc_tab[instr].opcode == ctxt.ctxt.opcode ) >> { >> -if ( (inst_len + i) >= fetch_len ) >> -{ >> -if ( !fetch(vmcb, buf + fetch_len, fetch_addr + fetch_l

Re: [Xen-devel] [PATCH] xen: Remove event channel notification through Xen PCI platform device

2016-09-30 Thread David Vrabel
On 26/08/16 22:55, KarimAllah Ahmed wrote: > Ever since commit 254d1a3f02eb ("xen/pv-on-hvm kexec: shutdown watches > from old kernel") using the INTx interrupt from Xen PCI platform device for > event channel notification would just lockup the guest during bootup. > postcore_initcall now calls xs_

Re: [Xen-devel] [PATCH] trace: Fix incorrect number of pages used for trace metadata

2016-09-30 Thread George Dunlap
On 29/09/16 14:53, Igor Druzhinin wrote: > As long as t_info_first_offset is calculated in uint32_t offsets we need to > multiply it by sizeof(uint32_t) in order to get the right number of pages > for trace metadata. Not doing that makes it impossible to read the trace > buffer correctly from users

Re: [Xen-devel] [PATCH v3 0/3] xen/pciback: support driver_override

2016-09-30 Thread David Vrabel
On 22/09/16 09:45, Juergen Gross wrote: > Support the driver_override scheme introduced with commit 782a985d7af2 > ("PCI: Introduce new device binding path using pci_dev.driver_override") Applied to for-linus-4.9, thanks. David ___ Xen-devel mailing li

Re: [Xen-devel] [PATCH v2 0/2] Convert to new CPU hotplug framework

2016-09-30 Thread David Vrabel
On 07/09/16 18:18, Boris Ostrovsky wrote: > New CPU hotplug framework was introduced recently. These patches convert Xen > CPU hotplug code to this infrastructure. Applied to for-linus-4.9, thanks. David ___ Xen-devel mailing list Xen-devel@lists.xen.o

Re: [Xen-devel] [PATCH v3] SVM: use generic instruction decoding

2016-09-30 Thread Andrew Cooper
On 30/09/16 15:44, Jan Beulich wrote: >>> +int >>> +x86_insn_modrm(const struct x86_emulate_state *state, >>> + unsigned int *rm, unsigned int *reg) >>> +{ >>> +check_state(state); >>> + >>> +if ( !(state->desc & ModRM) ) >>> +return -EINVAL; >>> + >>> +if ( rm ) >

Re: [Xen-devel] [PATCH] trace: Fix incorrect number of pages used for trace metadata

2016-09-30 Thread George Dunlap
On 30/09/16 15:46, George Dunlap wrote: > On 29/09/16 14:53, Igor Druzhinin wrote: >> As long as t_info_first_offset is calculated in uint32_t offsets we need to >> multiply it by sizeof(uint32_t) in order to get the right number of pages >> for trace metadata. Not doing that makes it impossible to

  1   2   >