Re: [Qemu-devel] [RFC] virtio-mem: paravirtualized memory

2017-06-16 Thread David Hildenbrand
On 16.06.2017 17:04, Michael S. Tsirkin wrote: > On Fri, Jun 16, 2017 at 04:20:02PM +0200, David Hildenbrand wrote: >> Hi, >> >> this is an idea that is based on Andrea Arcangeli's original idea to >> host enforce guest access to memory given up using virtio-b

Re: [Qemu-devel] [PATCH] target/s390x: Implement CSST

2017-06-19 Thread David Hildenbrand
On 15.06.2017 22:37, Richard Henderson wrote: > There are no uses in a Linux system with which to test, > but it Looks Right by my reading of the PoO. I am using next.git/master with this patch applied:

Re: [Qemu-devel] [RFC] virtio-mem: paravirtualized memory

2017-06-19 Thread David Hildenbrand
On 19.06.2017 12:08, Stefan Hajnoczi wrote: > On Fri, Jun 16, 2017 at 04:20:02PM +0200, David Hildenbrand wrote: >> Important restrictions of this concept: >> - Guests without a virtio-mem guest driver can't see that memory. >> - We will always require some boot memory that

Re: [Qemu-devel] [PATCH] hmp, qmp: introduce "info memory" and "query-memory" commands

2017-06-19 Thread David Hildenbrand
On 13.06.2017 14:55, Vadim Galitsyn wrote: > Commands above provide the following memory information in bytes: Is the idea to have something like hmp_info_numa() ("info NUMA"), just for qmp? And so it also works without NUMA? I think, for this command to be helpful, you should include a per-NUMA

Re: [Qemu-devel] [PATCH v2] target/s390x: Enforce instruction features

2017-06-19 Thread David Hildenbrand
On 16.06.2017 07:15, Richard Henderson wrote: > Introduce a synthetic feature (type MISC) to handle disabling of > the enforcing of features at translation time. > > Signed-off-by: Richard Henderson > --- > target/s390x/cpu_features.c | 4 +++- >

Re: [Qemu-devel] [PATCH] target/s390x: Implement CSST

2017-06-19 Thread David Hildenbrand
On 19.06.2017 12:03, David Hildenbrand wrote: > On 15.06.2017 22:37, Richard Henderson wrote: >> There are no uses in a Linux system with which to test, >> but it Looks Right by my reading of the PoO. > > I am using next.git/master with this patch applied: > https://git.

Re: [Qemu-devel] [PATCH] target/s390x: Implement CSST

2017-06-19 Thread David Hildenbrand
On 19.06.2017 14:33, Christian Borntraeger wrote: > On 06/19/2017 02:05 PM, David Hildenbrand wrote: >> On 19.06.2017 12:03, David Hildenbrand wrote: >>> On 15.06.2017 22:37, Richard Henderson wrote: >>>> There are no uses in a Linux system with which to test, >>

Re: [Qemu-devel] [PATCH] target/s390x: Implement CSST

2017-06-19 Thread David Hildenbrand
On 19.06.2017 14:47, Christian Borntraeger wrote: > On 06/19/2017 02:41 PM, David Hildenbrand wrote: >> On 19.06.2017 14:33, Christian Borntraeger wrote: >>> On 06/19/2017 02:05 PM, David Hildenbrand wrote: >>>> On 19.06.2017 12:03, David Hildenbrand wrote: >

Re: [Qemu-devel] [RFC PATCH] target-s390x: Implement mvcos instruction

2017-06-13 Thread David Hildenbrand
On 13.06.2017 10:18, Miroslav Benes wrote: > On Mon, 12 Jun 2017, David Hildenbrand wrote: > >> On 12.06.2017 18:44, Thomas Huth wrote: >>> On 01.03.2017 13:19, Miroslav Benes wrote: >>>> On Wed, 1 Mar 2017, Thomas Huth wrote: >>>> >>>>>

Re: [Qemu-devel] [RFC] virtio-mem: paravirtualized memory

2017-06-18 Thread David Hildenbrand
>> A Linux guest will deflate the balloon (all or some pages) in the >> following scenarios: >> a) page migration > > It inflates it first, doesn't it? Yes, that that is true. I was just listing all scenarios. > >> b) unload virtio-balloon kernel module >> c) hibernate/suspension >> d)

Re: [Qemu-devel] [PATCH v2] target/s390x: Add support for the TEST BLOCK instruction

2017-05-18 Thread David Hildenbrand
> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c > index f6e5bce..de0ecd4 100644 > --- a/target/s390x/mem_helper.c > +++ b/target/s390x/mem_helper.c > @@ -20,6 +20,7 @@ > > #include "qemu/osdep.h" > #include "cpu.h" > +#include "exec/address-spaces.h" > #include

Re: [Qemu-devel] [PATCH RFC 1/1] s390x/ccw: create s390 phb for compat reasons as well

2017-09-15 Thread David Hildenbrand
On 15.09.2017 15:07, Cornelia Huck wrote: > On Fri, 15 Sep 2017 13:57:40 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> As an alternative, simply >> >> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c >> index 0f28ebd162..

Re: [Qemu-devel] [PATCH RFC 1/1] s390x/ccw: create s390 phb for compat reasons as well

2017-09-15 Thread David Hildenbrand
On 15.09.2017 12:14, Cornelia Huck wrote: > d32bd032d8 ("s390x/ccw: create s390 phb conditionally") made > registering the s390 pci host bridge conditional on presense > of the zpci facility bit. Sadly, that breaks migration from > some old machines. > > Create the s390 phb if we need it for

Re: [Qemu-devel] [PATCH v5 08/22] s390x: move sclp_service_call() to sclp.h

2017-09-13 Thread David Hildenbrand
On 13.09.2017 17:21, Cornelia Huck wrote: > On Wed, 13 Sep 2017 16:29:23 +0200 > Thomas Huth <th...@redhat.com> wrote: > >> On 13.09.2017 15:24, David Hildenbrand wrote: >>> Implemented in sclp.c, so let's move it to the right include file. >>> Fix u

Re: [Qemu-devel] [PATCH v5 11/22] s390x: allow only 1 CPU with TCG

2017-09-13 Thread David Hildenbrand
On 13.09.2017 18:13, Alex Bennée wrote: > > David Hildenbrand <da...@redhat.com> writes: > >> Specifying more than 1 CPU (e.g. -smp 5) leads to SIGP errors (the >> guest tries to bring these CPUs up but fails), because we don't support >> multiple CPUs on s390

Re: [Qemu-devel] [PATCH v5 03/22] s390x: get rid of s390-virtio.c

2017-09-13 Thread David Hildenbrand
On 13.09.2017 15:23, David Hildenbrand wrote: > It is a leftover from the days where we had still the !ccw virtio > machine. As this one is long gone, let's move everything to> > s390-virtio-ccw.c. Whoops, another thing to fix up: hw/s390x/s390-virtio.c is not compi

Re: [Qemu-devel] [PATCH v5 18/22] s390x: implement query-hotpluggable-cpus

2017-09-13 Thread David Hildenbrand
On 13.09.2017 17:49, Cornelia Huck wrote: > On Wed, 13 Sep 2017 15:24:13 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> CPU hotplug is only possible on a per core basis on s390x. So let's >> add possible_cpus and properly wire everything up. > > s

Re: [Qemu-devel] [PATCH RFC 1/1] s390x/ccw: create s390 phb for compat reasons as well

2017-09-15 Thread David Hildenbrand
On 15.09.2017 15:22, Cornelia Huck wrote: > On Fri, 15 Sep 2017 15:09:02 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> On 15.09.2017 15:07, Cornelia Huck wrote: >>> On Fri, 15 Sep 2017 13:57:40 +0200 >>> David Hildenbrand <da...@redhat.com>

Re: [Qemu-devel] [PATCH v5 11/22] s390x: allow only 1 CPU with TCG

2017-09-15 Thread David Hildenbrand
On 15.09.2017 15:17, Alex Bennée wrote: > > David Hildenbrand <da...@redhat.com> writes: > >> On 13.09.2017 18:13, Alex Bennée wrote: >>> >>> David Hildenbrand <da...@redhat.com> writes: >>> >>>> Specifying more than 1 CPU

Re: [Qemu-devel] [PATCH v3] s390x/ccw: create s390 phb for compat reasons as well

2017-09-18 Thread David Hildenbrand
On 18.09.2017 10:55, Cornelia Huck wrote: > d32bd032d8 ("s390x/ccw: create s390 phb conditionally") made > registering the s390 pci host bridge conditional on presense > of the zpci facility bit. Sadly, that breaks migration from > machines that did not use the cpu model (2.7 and previous). > >

[Qemu-devel] [PATCH v1 04/27] s390x: introduce and use S390_MAX_CPUS

2017-09-18 Thread David Hildenbrand
Will be handy in the next patches. Signed-off-by: David Hildenbrand <da...@redhat.com> --- hw/s390x/s390-virtio-ccw.c | 2 +- target/s390x/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index d5a1

[Qemu-devel] [PATCH v1 14/27] s390x/kvm: factor out storing of adtl CPU status

2017-09-18 Thread David Hildenbrand
Called from SIGP code to be factored out, so let's move it. Add a FIXME for TCG code in the future. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/helper.c | 29 + target/s390x/internal.h | 1 + target/s390x/kvm.c

[Qemu-devel] [PATCH v1 27/27] s390x/tcg: refactor stfl(e) to use s390_get_feat_block()

2017-09-18 Thread David Hildenbrand
will now also indicate the "Configuration-z-architectural-mode", which is with new SIGP code the right thing to do. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/helper.h | 2 +- target/s390x/misc_helper.c | 72 ++--

[Qemu-devel] [PATCH v1 26/27] s390x/tcg: unlock NMI

2017-09-18 Thread David Hildenbrand
Nothing hindering us anymore from unlocking the restart code (used for NMI). Signed-off-by: David Hildenbrand <da...@redhat.com> --- hw/s390x/s390-virtio-ccw.c | 4 +--- target/s390x/sigp.c| 5 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/s390x/s390-virtio

[Qemu-devel] [PATCH v1 01/27] s390x: raise CPU hotplug irq after really hotplugged

2017-09-18 Thread David Hildenbrand
Let's move it into the machine, so we trigger the IRQ after setting ms->possible_cpus (which SCLP uses to construct the list of online CPUs). Signed-off-by: David Hildenbrand <da...@redhat.com> --- hw/s390x/s390-virtio-ccw.c | 4 target/s390x/cpu.c | 8 2 files c

[Qemu-devel] [PATCH v1 16/27] s390x/kvm: factor out SIGP code into sigp.c

2017-09-18 Thread David Hildenbrand
We want to use the same code base for TCG, so let's cleanly factor it out. The sigp mutex is currently not really needed, as everything is protected by the iothread mutex. But this could change later, so leave it in place and initialize it properly from common code. Signed-off-by: David

[Qemu-devel] [PATCH v1 08/27] s390x/tcg: a CPU cannot switch state due to an interrupt

2017-09-18 Thread David Hildenbrand
Going to OPERATING here looks wrong. A CPU should even never be !OPERATING at this point. Unhalting will already be done in cpu_handle_halt() if there is work, so we can drop this statement completely. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/excp_helper.c |

[Qemu-devel] [PATCH v1 17/27] s390x/kvm: factor out actual handling of STOP interrupts

2017-09-18 Thread David Hildenbrand
For KVM, the KVM module decides when a STOP can be performed (when the STOP interrupt can be processed). Factor it out so we can use it later for TCG. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/internal.h | 1 + target/s390x/kvm.c | 8 +--- target

[Qemu-devel] [PATCH v1 23/27] s390x/tcg: implement STOP and RESET interrupts for TCG

2017-09-18 Thread David Hildenbrand
nning" scenario. STOP is defined to be delivered after all other interrupts have been delivered. Therefore it has the actual lowest priority. As both can wake up a CPU if sleeping, indicate them correctly to external code (e.g. cpu_has_work()). Signed-off-by: David Hildenbrand <da...@redhat.com

[Qemu-devel] [PATCH v1 05/27] s390/tcg: turn INTERRUPT_EXT into a mask

2017-09-18 Thread David Hildenbrand
comparator interrupts. And we really only store the parameters as defined by the PoP. We'll introduce external calls and emergency signals in the following patches. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 13 ++ target/s390x/excp_helper.

[Qemu-devel] [PATCH v1 02/27] s390x/cpumodel: fix max STFL(E) bit number

2017-09-18 Thread David Hildenbrand
Not that it would matter in the near future, but it is actually 2048 bytes, therefore 16384 possible bits. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/cpu_features.c b/

[Qemu-devel] [PATCH v1 13/27] target/s390x: proper cpu->be convertion in s390_store_status()

2017-09-18 Thread David Hildenbrand
Necessary so TCG can also use it. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/helper.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 09468f85fa..e44d54b932

[Qemu-devel] [PATCH v1 11/27] s390x/kvm: generalize SIGP stop and restart interrupt injection

2017-09-18 Thread David Hildenbrand
Preparation for factoring it out into !kvm code. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/internal.h | 2 ++ target/s390x/interrupt.c | 20 target/s390x/kvm-stub.c | 8 target/s390x/kvm.c

[Qemu-devel] [PATCH v1 10/27] s390x/kvm: pass ipb directly into handle_sigp()

2017-09-18 Thread David Hildenbrand
No need to pass kvm_run. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 14f864697d..da3f7e9895 100644 --- a/target/s390x/kvm.c +++ b/target

[Qemu-devel] [PATCH v1 18/27] s390x/tcg: implement SIGP SENSE RUNNING STATUS

2017-09-18 Thread David Hildenbrand
Preparation for TCG, for KVM is this is completely handled in the kernel. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 2 ++ target/s390x/sigp.c | 25 + 2 files changed, 27 insertions(+) diff --git a/target/s390x/cpu.h b/target

[Qemu-devel] [PATCH v1 20/27] s390x/tcg: implement SIGP EXTERNAL CALL

2017-09-18 Thread David Hildenbrand
As preparation for TCG. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/sigp.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 063a34ccc7..080bce3fba 100644 --- a/target

[Qemu-devel] [PATCH v1 25/27] s390x/tcg: switch to new SIGP handling code

2017-09-18 Thread David Hildenbrand
This effectively enables experimental SMP support. Floating interrupts are still a mess, so allow it but print a big warning. There also seems to be a problem with CPU hotplug (after the main loop started). Signed-off-by: David Hildenbrand <da...@redhat.com> --- hw/s390x/s390-virtio-ccw.

[Qemu-devel] [PATCH v1 24/27] s390x/tcg: flush the tlb on SIGP SET PREFIX

2017-09-18 Thread David Hildenbrand
Thanks to Aurelien Jarno for doing this in his prototype. We can flush the whole TLB as this should happen really rarely. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/sigp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/sigp.c b/target/s390x/

[Qemu-devel] [PATCH v1 07/27] s390x/tcg: STOPPED cpus can never wake up

2017-09-18 Thread David Hildenbrand
Interrupts can't wake such CPUs up. SIGP from other CPUs has to be used to toggle the state. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index f42e28ea25..64db

[Qemu-devel] [PATCH v1 21/27] s390x/tcg: implement SIGP EMERGENCY SIGNAL

2017-09-18 Thread David Hildenbrand
As preparation for TCG. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/sigp.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 080bce3fba..d492885787 100644 --- a/target/s390x/sigp.c +++ b/target

[Qemu-devel] [PATCH v1 09/27] target/s390x: factor out handling of WAIT PSW into handle_wait()

2017-09-18 Thread David Hildenbrand
This will now also detect crashes under TCG. We can directly use cpu->env.psw.addr instead of kvm_run, as we do a cpu_synchronize_state(). Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/helper.c | 28 ++-- target/s390x/internal.h | 1

[Qemu-devel] [PATCH v1 22/27] s390x/tcg: implement SIGP CONDITIONAL EMERGENCY SIGNAL

2017-09-18 Thread David Hildenbrand
Mostly analogous to the kernel/KVM version (so I assume the checks are correct :) ). As a preparation for TCG. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 1 + target/s390x/sigp.c | 37 + 2 files changed, 38 inse

[Qemu-devel] [PATCH v1 15/27] s390x/kvm: drop two debug prints

2017-09-18 Thread David Hildenbrand
Preparation for moving it out of kvm.c. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/kvm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 01c4125d21..d759edf1c8 100644 --- a/target/s390x/kvm.c +++ b/target/s390x

[Qemu-devel] [PATCH v1 00/27] s390x: SMP for TCG (+ cleanups)

2017-09-18 Thread David Hildenbrand
, hotplugged CPUs will never get set "cpu->created = true". But doesn't seem to be related to this) Based on: https://github.com/cohuck/qemu.git s390-next Available on: g...@github.com:davidhildenbrand/qemu.git s390x-queue David Hildenbrand (27): s390x: raise CPU hotplug

[Qemu-devel] [PATCH v1 03/27] target/s390x: get rid of next_core_id

2017-09-18 Thread David Hildenbrand
from kernel space. Suggested-by: Igor Mammedov <imamm...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu-qom.h| 2 -- target/s390x/cpu.c| 14 +++--- target/s390x/cpu.h| 2 ++ target/s390x/cpu_models.c | 2 ++ 4 files

[Qemu-devel] [PATCH v1 19/27] s390x/tcg: implement SIGP SENSE

2017-09-18 Thread David Hildenbrand
Add it as preparation for TCG. Sensing coul later be done completely lockless. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/sigp.c | 29 + 1 file changed, 29 insertions(+) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index c573

[Qemu-devel] [PATCH v1 12/27] s390x/kvm: factor out storing of CPU status

2017-09-18 Thread David Hildenbrand
Factor it out into s390_store_status(), to be used also by TCG later on. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/helper.c | 38 ++ target/s390x/internal.h | 2 ++ target/s390x/kvm.c

[Qemu-devel] [PATCH v1 06/27] s390x/tcg: injection of emergency signals and extarnal calls

2017-09-18 Thread David Hildenbrand
Preparation for new TCG SIGP code. Especially also prepare for indicating that another external call is already pending. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 8 +++- target/s390x/excp_helper.c | 14 ++ target/s390x/inte

Re: [Qemu-devel] [PATCH] s390x/cpu: expose the guest crash information

2017-09-18 Thread David Hildenbrand
> # An enumeration of the guest panic information types > # > +# @kvm-s390: s390 guest panic information type (Since: 2.11) > +# > # Since: 2.9 > ## > { 'enum': 'GuestPanicInformationType', > - 'data': [ 'hyper-v'] } > + 'data': [ 'hyper-v', 'kvm-s390' ] } > > ## > #

Re: [Qemu-devel] [PATCH v3] s390x/ccw: create s390 phb for compat reasons as well

2017-09-18 Thread David Hildenbrand
On 18.09.2017 14:11, Cornelia Huck wrote: > On Mon, 18 Sep 2017 14:03:20 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> On 18.09.2017 10:55, Cornelia Huck wrote: >>> d32bd032d8 ("s390x/ccw: create s390 phb conditionally") made >>>

Re: [Qemu-devel] [PATCH v1 16/27] s390x/kvm: factor out SIGP code into sigp.c

2017-09-18 Thread David Hildenbrand
On 18.09.2017 19:25, Christian Borntraeger wrote: > > > On 09/18/2017 06:00 PM, David Hildenbrand wrote: >> We want to use the same code base for TCG, so let's cleanly factor it >> out. >> >> The sigp mutex is currently not really needed, as everything is &

Re: [Qemu-devel] [PATCH v1 00/27] s390x: SMP for TCG (+ cleanups)

2017-09-18 Thread David Hildenbrand
s expected to return always "false" for kvm. This behavior should still be that way. Thanks! > > On 09/18/2017 05:59 PM, David Hildenbrand wrote: >> This series contains: >> - properly implement local external interrupts for TCG >> - factor out KVM SIGP han

Re: [Qemu-devel] [PATCH v2 3/3] s390x/tcg: add basic MSA features

2017-09-19 Thread David Hildenbrand
On 19.09.2017 19:47, Richard Henderson wrote: > On 09/19/2017 09:26 AM, David Hildenbrand wrote: >> +const uint8_t fc = env->regs[0] & 0x7fULL; > > Don't mask here... Bit 56 is the mod bit (see variable "mod") and is checked inside the switch(). The funct

Re: [Qemu-devel] [PATCH] target/s390x/kvm: Fix problem when running with SELinux under z/VM

2017-09-19 Thread David Hildenbrand
On 18.09.2017 09:43, Christian Borntraeger wrote: > > > On 09/15/2017 04:36 PM, Thomas Huth wrote: >> On 29.03.2017 16:25, Christian Borntraeger wrote: >>> On 03/29/2017 04:21 PM, Thomas Huth wrote: On 24.03.2017 10:39, Christian Borntraeger wrote: > On 03/24/2017 10:26 AM, Thomas Huth

[Qemu-devel] [PATCH v2 1/3] s390x/tcg: implement spm (SET PROGRAM MASK)

2017-09-19 Thread David Hildenbrand
Missing and is used inside Linux in the context of CPACF. Reviewed-by: Richard Henderson <r...@twiddle.net> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate.c | 11 +++ 3 f

[Qemu-devel] [PATCH v2 0/3] Implement basic MSA functions

2017-09-19 Thread David Hildenbrand
ot;s390x/tcg: move wrap_address() to internal.h" -- internal.h instead of cpu.h - "s390x/tcg: add basic MSA features" -- minor style fixes David Hildenbrand (3): s390x/tcg: implement spm (SET PROGRAM MASK) s390x/tcg: move wrap_address() to internal.h s390x/tcg: add basic MS

Re: [Qemu-devel] [PATCH] target/s390x/kvm: Fix problem when running with SELinux under z/VM

2017-09-19 Thread David Hildenbrand
>> It's the last remaining alloc hack we have in QEMU :) That's why I am >> asking the question. > > Hmm, maybe we could remove it for QEMU v3.0 ? ;-) > > Thomas > > Chasing unicorns on rainbows? ;) -- Thanks, David

Re: [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information

2017-09-19 Thread David Hildenbrand
> CPUState *cs = CPU(obj); > @@ -291,6 +345,8 @@ static void s390_cpu_initfn(Object *obj) > cs->exception_index = EXCP_HLT; > object_property_add(OBJECT(cpu), "id", "int64_t", s390x_cpu_get_id, > s390x_cpu_set_id, NULL, NULL, NULL); > +

Re: [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information

2017-09-19 Thread David Hildenbrand
> +## > +# @GuestPanicInformationS390: > +# > +# S390 specific guest panic information (PSW) > +# > +# Since: 2.11 > +## > +{'struct': 'GuestPanicInformationS390', > + 'data': { 'psw-mask': 'uint64', > + 'psw-addr': 'uint64', > + 'reason': 'str' } } Wonder if we should rather

Re: [Qemu-devel] [PATCH] target/s390x/kvm: Fix problem when running with SELinux under z/VM

2017-09-19 Thread David Hildenbrand
On 19.09.2017 14:48, Thomas Huth wrote: > On 19.09.2017 14:38, David Hildenbrand wrote: >> On 18.09.2017 09:43, Christian Borntraeger wrote: >>> >>> >>> On 09/15/2017 04:36 PM, Thomas Huth wrote: >>>> On 29.03.2017 16:25, Christian Borntraeger wrote:

[Qemu-devel] [PATCH v2 3/3] s390x/tcg: add basic MSA features

2017-09-19 Thread David Hildenbrand
this facility when compiled for a z9 model. Allow to enable the facilities for the qemu cpu model. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/Makefile.objs | 2 +- target/s390x/cpu_models.c| 4 +++ target/s390x/crypto_helper.

[Qemu-devel] [PATCH v1] s390x/kvm: fix and cleanup storing CPU status

2017-09-21 Thread David Hildenbrand
ed-off-by: David Hildenbrand <da...@redhat.com> --- Found with my fancy SIGP kvm-unit-tests I am currently working on. And looks like there is even more ... stay tuned :) target/s390x/kvm.c | 63 +- 1 file changed, 43 insertions(+), 20 deleti

Re: [Qemu-devel] kvm_set_phys_mem: assertion failed

2017-09-20 Thread David Hildenbrand
md_mode) > > bisect blames: > > commit f357f564be0bd45245b3ccfbbe20ace08fe83ca8 > Author: David Hildenbrand <da...@redhat.com> > Date:   Mon Sep 11 19:49:31 2017 +0200 > > kvm: we never have overlapping slots in kvm_set_phys_mem() > > libvirt config attached. > > cheers, >

Re: [Qemu-devel] [PATCH v2 3/3] s390x/tcg: add basic MSA features

2017-09-20 Thread David Hildenbrand
On 20.09.2017 15:23, Richard Henderson wrote: > On 09/19/2017 02:36 PM, David Hildenbrand wrote: >> On 19.09.2017 19:47, Richard Henderson wrote: >>> On 09/19/2017 09:26 AM, David Hildenbrand wrote: >>>> +const uint8_t fc = env->regs[0] & 0x7fULL; &g

Re: [Qemu-devel] kvm_set_phys_mem: assertion failed

2017-09-20 Thread David Hildenbrand
md_mode) > > bisect blames: > > commit f357f564be0bd45245b3ccfbbe20ace08fe83ca8 > Author: David Hildenbrand <da...@redhat.com> > Date:   Mon Sep 11 19:49:31 2017 +0200 > > kvm: we never have overlapping slots in kvm_set_phys_mem() > > libvirt config attached. > > cheers, >

Re: [Qemu-devel] [RFC PATCH] qdev: Mark devices as non-hotpluggable by default

2017-09-20 Thread David Hildenbrand
On 20.09.2017 18:10, Thomas Huth wrote: > On 20.09.2017 13:17, Thomas Huth wrote: >> On 20.09.2017 12:57, Marcel Apfelbaum wrote: >>> On 20/09/2017 13:07, Peter Maydell wrote: > [...] Is it possible to hack together some kind of test code that can give us a list of the devices compiled

[Qemu-devel] [PATCH v3 3/3] s390x/tcg: add basic MSA features

2017-09-20 Thread David Hildenbrand
this facility when compiled for a z9 model. Allow to enable the facilities for the qemu cpu model. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/Makefile.objs | 2 +- target/s390x/cpu_models.c| 4 +++ target/s390x/crypto_helper.

Re: [Qemu-devel] kvm_set_phys_mem: assertion failed

2017-09-20 Thread David Hildenbrand
On 20.09.2017 16:31, Gerd Hoffmann wrote: > Hi, > >> Dropping from os section: >> >> > type="pflash">/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure- >> efi.fd >> > template="/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure- >> efi.fd">/var/lib/libvirt/qemu/nvram/fedora-org-drm-qxl- >> base_VARS.fd > >

[Qemu-devel] [PATCH v3 1/3] s390x/tcg: implement spm (SET PROGRAM MASK)

2017-09-20 Thread David Hildenbrand
Missing and is used inside Linux in the context of CPACF. Reviewed-by: Richard Henderson <r...@twiddle.net> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate.c | 11 +++ 3 f

[Qemu-devel] [PATCH v1] kvm: drop wrong assertion creating problems with pflash

2017-09-20 Thread David Hildenbrand
y no slot to remove and the asser is wrong. So let's just drop the assert. Reported-by: Gerd Hoffmann <kra...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 1 - 1 file changed, 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-a

[Qemu-devel] [PATCH v3 0/3] Implement basic MSA functions

2017-09-20 Thread David Hildenbrand
ement spm (SET PROGRAM MASK)" -- use tcg_gen_extrl_i64_i32 + tcg_gen_extract_i32 - "s390x/tcg: move wrap_address() to internal.h" -- internal.h instead of cpu.h - "s390x/tcg: add basic MSA features" -- minor style fixes David Hildenbrand (3): s390x/tcg: implement spm (SET PROGRA

[Qemu-devel] [PATCH v3 2/3] s390x/tcg: move wrap_address() to internal.h

2017-09-20 Thread David Hildenbrand
We want to use it in another file. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Reviewed-by: Richard Henderson <richard.hender...@linaro.org> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/internal.h | 14 ++ target/s390x

Re: [Qemu-devel] [PATCH 1/1] s390x/ais: for 2.10 stable: disable ais facility

2017-09-21 Thread David Hildenbrand
the 2.10 > + * machine. > + */ > +/* kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0); */ > > qemu_mutex_init(_sigp_mutex); > > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH] s390x: use generic cpu_model parsing

2017-09-21 Thread David Hildenbrand
u_models.c b/target/s390x/cpu_models.c > index 5169379..0bf7e14 100644 > --- a/target/s390x/cpu_models.c > +++ b/target/s390x/cpu_models.c > @@ -1207,9 +1207,6 @@ static void s390_qemu_cpu_model_class_init(ObjectClass > *oc, void *data) > qemu_hw_version()); > } Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v3 0/3] Implement basic MSA functions

2017-09-21 Thread David Hildenbrand
On 21.09.2017 10:23, Cornelia Huck wrote: > On Wed, 20 Sep 2017 17:30:13 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> Some leftover from "target/s390x: tcg improvments + MSA functions". >> >> Implement all basic MSA (cpacf/crypto) ins

Re: [Qemu-devel] [PATCH v1 00/27] s390x: SMP for TCG (+ cleanups)

2017-09-21 Thread David Hildenbrand
> David Hildenbrand (27): > s390x: raise CPU hotplug irq after really hotplugged > s390x/cpumodel: fix max STFL(E) bit number > target/s390x: get rid of next_core_id > s390x: introduce and use S390_MAX_CPUS It probably makes sense to apply 1-3/4 before the SMP support.

Re: [Qemu-devel] [PATCH v2 11/19] s390x: allow only 1 CPU with TCG

2017-09-14 Thread David Hildenbrand
On 06.09.2017 23:20, Richard Henderson wrote: > On 09/06/2017 11:16 AM, Matthew Rosato wrote: >> On 09/04/2017 11:43 AM, David Hildenbrand wrote: >>> Specifying more than 1 CPU (e.g. -smp 5) leads to SIGP errors (the >>> guest tries to bring these CPUs up but fails

Re: [Qemu-devel] [PATCH v1] s390x/kvm: fix and cleanup storing CPU status

2017-09-22 Thread David Hildenbrand
On 22.09.2017 15:12, Richard Henderson wrote: > On 09/21/2017 04:30 PM, David Hildenbrand wrote: >> +struct sigp_save_area { >> +uint64_tfprs[16]; /* 0x */ >> +uint64_tgrs[16];/* 0x0080 */ &g

[Qemu-devel] [PATCH v2] s390x/kvm: fix and cleanup storing CPU status

2017-09-22 Thread David Hildenbrand
ed-off-by: David Hildenbrand <da...@redhat.com> --- v1 -> v2: - dropped QEMU_PACKED - Moved QEMU_BUILD_BUG_ON() - Retested if it works now target/s390x/kvm.c | 62 -- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/targe

[Qemu-devel] [PATCH v2 2/3] s390x/tcg: move wrap_address() to internal.h

2017-09-19 Thread David Hildenbrand
We want to use it in another file. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/internal.h | 14 ++ target/s390x/mem_helper.c | 14 -- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/target/s390x/internal.h b/target

Re: [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information

2017-09-19 Thread David Hildenbrand
On 19.09.2017 15:56, Christian Borntraeger wrote: > > > On 09/19/2017 03:14 PM, David Hildenbrand wrote: >> >>> CPUState *cs = CPU(obj); >>> @@ -291,6 +345,8 @@ static void s390_cpu_initfn(Object *obj) >>> cs->exception_index = EXCP_HLT;

Re: [Qemu-devel] [PATCH v1 23/27] s390x/tcg: implement STOP and RESET interrupts for TCG

2017-09-18 Thread David Hildenbrand
> static void cpu_inject_io(S390CPU *cpu, uint16_t subchannel_id, > diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c > index ce8fda9d01..521dcc75f3 100644 > --- a/target/s390x/sigp.c > +++ b/target/s390x/sigp.c > @@ -498,6 +498,7 @@ void do_stop_interrupt(CPUS390XState *env) >

Re: [Qemu-devel] [PATCH v1 23/27] s390x/tcg: implement STOP and RESET interrupts for TCG

2017-09-18 Thread David Hildenbrand
On 18.09.2017 22:00, David Hildenbrand wrote: > >> static void cpu_inject_io(S390CPU *cpu, uint16_t subchannel_id, >> diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c >> index ce8fda9d01..521dcc75f3 100644 >> --- a/target/s390x/sigp.c >> +++ b/target

Re: [Qemu-devel] [PATCH v2 0/3] Implement basic MSA functions

2017-09-20 Thread David Hildenbrand
On 20.09.2017 17:14, Cornelia Huck wrote: > On Tue, 19 Sep 2017 16:26:51 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> Some leftover from "target/s390x: tcg improvments + MSA functions". >> >> Implement all basic MSA (cpacf/crypto) ins

Re: [Qemu-devel] [PATCH RFC 2/3] s390x/tcg: low-address protection support

2017-10-16 Thread David Hildenbrand
On 12.10.2017 10:41, Thomas Huth wrote: > On 29.09.2017 13:27, Cornelia Huck wrote: >> On Thu, 28 Sep 2017 15:08:11 +0200 >> David Hildenbrand <da...@redhat.com> wrote: >> >>> On 28.09.2017 06:50, Thomas Huth wrote: >>>> On 27.09.2017 19:00, Dav

Re: [Qemu-devel] [PATCH v1 5/6] kvm: kvm_log_start/stop are only called with known sections

2017-10-16 Thread David Hildenbrand
On 10.10.2017 15:29, Paolo Bonzini wrote: > On 10/10/2017 11:06, Thomas Huth wrote: >> On 11.09.2017 19:49, David Hildenbrand wrote: >>> Let's properly align the sections first and bail out if we would ever >>> get called with a memory section we don't know yet. &

Re: [Qemu-devel] [PATCH v2 00/30] s390x: SMP for TCG

2017-10-16 Thread David Hildenbrand
On 11.10.2017 14:07, Cornelia Huck wrote: > On Thu, 28 Sep 2017 22:36:38 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> This series is based on a couple of other patches floating around on >> the mailing list (e.g. cleanups and LAP). The fist patc

Re: [Qemu-devel] [PATCH RFC 1/3] accel/tcg: allow to invalidate a write TLB entry immediately

2017-10-16 Thread David Hildenbrand
On 27.09.2017 19:48, Richard Henderson wrote: > On 09/27/2017 10:00 AM, David Hildenbrand wrote: >> Background: s390x implements Low-Address Protection (LAP). If LAP is >> enabled, writing to effective addresses (before any transaltion) >> 0-511 and 4096-4607 triggers a

Re: [Qemu-devel] [PATCH v1] memory: call log_start after region_add

2017-10-16 Thread David Hildenbrand
On 16.10.2017 11:18, David Hildenbrand wrote: > It might be confusing for some listener implementations that implement > both, region_add and log_start (e.g. KVM) if we call log_start before an > actual region was added using region_add. > > This makes current KVM code trigg

Re: [Qemu-devel] [PATCH v1] kvm: tolerate non-existing slot for log_start and log_stop

2017-10-16 Thread David Hildenbrand
On 16.10.2017 11:41, David Hildenbrand wrote: > log_start might be called by memory.c just before registering the > section. So we can actually get a log_start without a region_add, which > we can silently ignore. > > This makes current KVM code trigger an assertion > ("k

[Qemu-devel] [PATCH v1] memory: call log_start after region_add

2017-10-16 Thread David Hildenbrand
. So let's just reverse the order instead of tolerating log_start on yet unknown regions. Reported-by: Thomas Huth <th...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memory.c b/mem

Re: [Qemu-devel] [PATCH v1 5/6] kvm: kvm_log_start/stop are only called with known sections

2017-10-16 Thread David Hildenbrand
On 16.10.2017 10:52, Thomas Huth wrote: > On 16.10.2017 09:16, David Hildenbrand wrote: >> On 10.10.2017 15:29, Paolo Bonzini wrote: >>> On 10/10/2017 11:06, Thomas Huth wrote: >>>> On 11.09.2017 19:49, David Hildenbrand wrote: >>>>> Let's properly alig

[Qemu-devel] [PATCH v1] kvm: tolerate non-existing slot for log_start and log_stop

2017-10-16 Thread David Hildenbrand
trap every access to a section, we might not have a slot. So let's just tolerate if we don't have a slot. Fixes: 343562e8fa22 ("kvm: kvm_log_start/stop are only called with known sections") Reported-by: Thomas Huth <th...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.

Re: [Qemu-devel] kvm_set_phys_mem: assertion failed

2017-10-16 Thread David Hildenbrand
On 04.10.2017 17:48, Laszlo Ersek wrote: > Hi, > > On 09/21/17 16:28, Auger Eric wrote: >> Hi David, >> On 20/09/2017 16:34, David Hildenbrand wrote: >>> On 20.09.2017 16:31, Gerd Hoffmann wrote: >>>> Hi, >>>> >>>>> Droppin

Re: [Qemu-devel] [PATCH v1] memory: call log_start after region_add

2017-10-16 Thread David Hildenbrand
On 16.10.2017 14:19, Paolo Bonzini wrote: > On 16/10/2017 11:36, David Hildenbrand wrote: >>> -if (fr->dirty_log_mask && listener->log_start) { >>> -listener->log_start(listener, , 0, fr->dirty_log_mask); >>>

[Qemu-devel] [PATCH v1 4/7] kvm: fix error message when failing to unregister slot

2017-10-16 Thread David Hildenbrand
"overlapping" is a leftover, let's drop it. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f5fa3e24bd..559c544501 100644 --- a/acc

[Qemu-devel] [PATCH v1 6/7] kvm: simplify kvm_align_section()

2017-10-16 Thread David Hildenbrand
Use ROUND_UP and simplify the code a bit. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 2835bb3801..f290f487a5 100644 --- a

[Qemu-devel] [PATCH v1 7/7] memory: reuse section_from_flat_range()

2017-10-16 Thread David Hildenbrand
We can use section_from_flat_range() instead of manually initializing. Signed-off-by: David Hildenbrand <da...@redhat.com> --- memory.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/memory.c b/memory.c index f39b8592bf..7c8e5878d6 100644 --- a/memory.c

[Qemu-devel] [PATCH v1 5/7] kvm: region_add and region_del is not called on updates

2017-10-16 Thread David Hildenbrand
Attributes are not updated via region_add()/region_del(). Attribute changes lead to a delete first, followed by a new add. If this would ever not be the case, we would get an error when trying to register the new slot. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm

[Qemu-devel] [PATCH v1 0/7] kvm: slot handling fixes (and small cleanups)

2017-10-16 Thread David Hildenbrand
/log_stop/log_sync when we actually haven't registered a slot (due to trapping). 4. Some further cleanups Available on: https://github.com/davidhildenbrand/qemu/commits/kvm_slot @Joe, if you could retest, this would be great! I updated the branch. David Hildenbrand (7): memory: call log_start

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