[Qemu-devel] [PATCH RFC 4/5] target/s390x: remove all CONFIG_KVM from cpu.h

2017-08-11 Thread David Hildenbrand
Let's move everything into internal.h Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 62 - target/s390x/internal.h | 52 + 2 files changed, 52 insertions(+), 62 del

[Qemu-devel] [PATCH RFC 1/5] target/s390x: introduce internal.h

2017-08-11 Thread David Hildenbrand
drop extra paremthesis around (1 << 6) Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/arch_dump.c | 1 + target/s390x/cc_helper.c | 1 + target/s390x/cpu.c | 1 + target/s390x/cpu.h | 492 +-- target

Re: [Qemu-devel] [PATCH RFC 1/5] target/s390x: introduce internal.h

2017-08-11 Thread David Hildenbrand
On 11.08.2017 15:15, Richard Henderson wrote: > On 08/11/2017 12:46 AM, David Hildenbrand wrote: >> + >> +static const char *cc_names[] = { >> +[CC_OP_CONST0]= "CC_OP_CONST0", > > This should get moved out of the header to the c file that uses it. >

Re: [Qemu-devel] [PATCH RFC 1/5] target/s390x: introduce internal.h

2017-08-11 Thread David Hildenbrand
> By the way, all the other targets that have KVM have a separate header > for things like this: kvm_arm.h, kvm_ppc.h, kvm_mips.h, kvm_i386.h > ... maybe it's time for kvm_s390x.h now? Definitely! > > Thomas > -- Thanks, David

Re: [Qemu-devel] [PATCH RFC 1/5] target/s390x: introduce internal.h

2017-08-11 Thread David Hildenbrand
On 11.08.2017 16:00, Thomas Huth wrote: > On 11.08.2017 09:46, David Hildenbrand wrote: >> cpu.h should only contain what really has to be accessed outside of >> target/s390x/. Add internal.h which can only be used inside target/s390x/. >> >> Move everything that is

Re: [Qemu-devel] [PATCH RFC 1/5] target/s390x: introduce internal.h

2017-08-11 Thread David Hildenbrand
On 11.08.2017 16:39, Thomas Huth wrote: > On 11.08.2017 16:21, David Hildenbrand wrote: >> On 11.08.2017 16:00, Thomas Huth wrote: >>> On 11.08.2017 09:46, David Hildenbrand wrote: >>>> cpu.h should only contain what really has to be accessed outside of >>>&g

Re: [Qemu-devel] [PATCH RFC 0/5] target/s390x: introduce internal.h and cleanup cpu.h

2017-08-11 Thread David Hildenbrand
On 11.08.2017 17:15, Cornelia Huck wrote: > On Fri, 11 Aug 2017 09:46:47 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> cpu.h is accessed outside of target/s390x. It should only contain >> what is expected to be accessed outside of this folder. Therefore, cr

[Qemu-devel] [PATCH v1 for-2.11 01/10] target/s390x: move cc_name() to cc_helper.c

2017-08-17 Thread David Hildenbrand
While at it, move the translations into the function. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cc_helper.c | 48 target/s390x/cpu.h | 48 +--- 2 files chang

[Qemu-devel] [PATCH v1 for-2.11 05/10] target/s390x: move get_per_in_range() to misc_helper.c

2017-08-17 Thread David Hildenbrand
Only used in that file. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 11 --- target/s390x/misc_helper.c | 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index d

[Qemu-devel] [PATCH v1 for-2.11 03/10] target/s390x: move psw_key_valid() to mem_helper.c

2017-08-17 Thread David Hildenbrand
Only used in that file. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h| 11 --- target/s390x/mem_helper.c | 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 6567cfa..4

[Qemu-devel] [PATCH v1 for-2.11 00/10] target/s390x: cleanup cpu.h

2017-08-17 Thread David Hildenbrand
this version. RFC -> v1: - (hopefully) fixed a compile error - move some functions from cpu.h to the only c file they are used in - move kvm function and stubs to kvm_s390x.h and kvm-stub.c - smaller requested style fixes David Hildenbrand (10): target/s390x: move cc_name() to cc_helper.c tar

[Qemu-devel] [PATCH v1 for-2.11 08/10] s390x: avoid calling kvm_ functions outside of target/s390x/

2017-08-17 Thread David Hildenbrand
Let's just introduce an helper. Reviewed-by: Richard Henderson <richard.hender...@linaro.org> Reviewed-by: Thomas Huth <th...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- hw/s390x/s390-virtio-ccw.c | 4 +--- target/s390x/cpu.c | 7 +++

Re: [Qemu-devel] [PATCH 1/6] tests: Run filter-redirector and -mirror test only on POSIX systems

2017-08-17 Thread David Hildenbrand
On 17.08.2017 08:25, Thomas Huth wrote: > This way we can get rid of the ugly #ifdefs in the code which makes > it easier to extend later. > > Signed-off-by: Thomas Huth <th...@redhat.com> Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH 3/6] tests: Enable the drive_del test also on s390x

2017-08-17 Thread David Hildenbrand
On 17.08.2017 10:53, Cornelia Huck wrote: > On Thu, 17 Aug 2017 08:25:10 +0200 > Thomas Huth wrote: > >> By using the "virtio-xxx" device name aliases instead of the >> "virtio-xxx-pci" names, we can use this test on s390x, too, >> to check that adding and deleting also works

Re: [Qemu-devel] [PATCH] hw/s390x/ipl: The s390-ipl device is not hot-pluggable

2017-08-17 Thread David Hildenbrand
Loads the ROMs and thus can only be used one time - > internally */ > +dc->user_creatable = false; > } > > static const TypeInfo s390_ipl_info = { > Late but still Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

[Qemu-devel] [PATCH v1 for-2.11 02/10] target/s390x: move cpu_mmu_idx_to_asc() to excp_helper.c

2017-08-17 Thread David Hildenbrand
Only used in that file. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 14 -- target/s390x/excp_helper.c | 14 ++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 3

[Qemu-devel] [PATCH v1 for-2.11 06/10] target/s390x: introduce internal.h

2017-08-17 Thread David Hildenbrand
e cases by one char. - get_per_atmid(): drop extra paremthesis around (1 << 6) Change license of new file to GPL2+ and keep copyright notice. Reviewed-by: Richard Henderson <richard.hender...@linaro.org> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/arch_dump

[Qemu-devel] [PATCH v1 for-2.11 09/10] s390x/kvm: move KVM declarations and stubs to separate files

2017-08-17 Thread David Hildenbrand
;th...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/Makefile.objs | 1 + target/s390x/cpu.h | 121 + target/s390x/kvm-stub.c| 111 + target/s390x/kvm_s39

Re: [Qemu-devel] [PATCH 4/6] tests: Introduce generic device hot-plug/hot-unplug functions

2017-08-17 Thread David Hildenbrand
On 17.08.2017 08:25, Thomas Huth wrote: > A lot of tests provide code for adding and removing a device via the > device_add and device_del QMP commands. Maintaining this code in so > many places is cumbersome and error-prone (some of the code parts > check the responses in an incorrect way, for

[Qemu-devel] [PATCH v1 for-2.11 04/10] target/s390x: move s390_do_cpu_reset() to diag.c

2017-08-17 Thread David Hildenbrand
Only used in that file. Also drop the comment, not really needed. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 7 --- target/s390x/diag.c | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h

[Qemu-devel] [PATCH v1 for-2.11 07/10] target/s390x: move a couple of functions to cpu.c

2017-08-17 Thread David Hildenbrand
Prepare to move more stuff (especially KVM related) from cpu.h to internal.h. Reviewed-by: Richard Henderson <richard.hender...@linaro.org> Reviewed-by: Thomas Huth <th...@redhat.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- targe

[Qemu-devel] [PATCH v1 for-2.11 10/10] target/s390x: cleanup cpu.h

2017-08-17 Thread David Hildenbrand
Let's reshuffle the function prototypes so we get a cleaner outline of the files. Reviewed-by: Richard Henderson <richard.hender...@linaro.org> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 140 ++--- 1

Re: [Qemu-devel] [PATCH v1 for-2.11 09/10] s390x/kvm: move KVM declarations and stubs to separate files

2017-08-17 Thread David Hildenbrand
>> +#include "qemu/osdep.h" >> +#include "qemu-common.h" >> +#include "cpu.h" >> +#include "kvm_s390x.h" > > here goes the: > > struct kvm_s390_irq {}; As we don't have a stub using kvm_s390_irq, I guess I can just drop this for now. [...] > > change by > > typedef struct kvm_s390_irq

Re: [Qemu-devel] [PATCH 4/6] tests: Introduce generic device hot-plug/hot-unplug functions

2017-08-17 Thread David Hildenbrand
On 17.08.2017 12:57, Thomas Huth wrote: > On 17.08.2017 11:53, David Hildenbrand wrote: >> On 17.08.2017 08:25, Thomas Huth wrote: >>> A lot of tests provide code for adding and removing a device via the >>> device_add and device_del QMP commands. Maintaining this

Re: [Qemu-devel] [PATCH v1 for-2.11 09/10] s390x/kvm: move KVM declarations and stubs to separate files

2017-08-17 Thread David Hildenbrand
On 17.08.2017 14:48, Cornelia Huck wrote: > On Thu, 17 Aug 2017 14:35:53 +0200 > Thomas Huth <th...@redhat.com> wrote: > >> On 17.08.2017 13:40, Philippe Mathieu-Daudé wrote: >>> Hi David, >>> >>> On 08/17/2017 06:22 AM, David Hildenbra

Re: [Qemu-devel] [PATCH v1 for-2.11 09/10] s390x/kvm: move KVM declarations and stubs to separate files

2017-08-17 Thread David Hildenbrand
On 17.08.2017 14:35, Thomas Huth wrote: > On 17.08.2017 13:40, Philippe Mathieu-Daudé wrote: >> Hi David, >> >> On 08/17/2017 06:22 AM, David Hildenbrand wrote: >>> Let's do it just like the other architectures. Introduce kvm-stub.c >>> for stubs and kvm_s3

Re: [Qemu-devel] [PATCH for-2.11] s390x: introduce 2.11 compat machine

2017-08-10 Thread David Hildenbrand
e/hw/compat.h b/include/hw/compat.h > index 08f36004da..3e101f8f67 100644 > --- a/include/hw/compat.h > +++ b/include/hw/compat.h > @@ -1,6 +1,9 @@ > #ifndef HW_COMPAT_H > #define HW_COMPAT_H > > +#define HW_COMPAT_2_10 \ > +/* empty */ > + > #define HW_COMPAT_2_9 \ > {\ > .driver = "pci-bridge",\ > Looks just fine to me. Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PULL 37/40] s390x/kvm: Enable KSS facility for nested virtualization

2017-07-17 Thread David Hildenbrand
On 14.07.2017 12:41, Christian Borntraeger wrote: > From: Farhan Ali > > If the host supports keyless subset (KSS) then first level > guest (G2) should enable KSS facility as well. > > Signed-off-by: Farhan Ali > Reviewed-by: Eric Farman

Re: [Qemu-devel] [PULL 35/40] s390x/cpumodel: we are always in zarchitecture mode

2017-07-17 Thread David Hildenbrand
On 14.07.2017 12:41, Christian Borntraeger wrote: > From: "Jason J. Herne" > > In QEMU, a guest VCPU always started in and never was able to leave > z/Architecture mode. Now we have an architected way of showing this > condition. > > The SIGP SET ARCHITECTURE

Re: [Qemu-devel] [PULL 35/40] s390x/cpumodel: we are always in zarchitecture mode

2017-07-17 Thread David Hildenbrand
On 17.07.2017 19:33, David Hildenbrand wrote: > On 14.07.2017 12:41, Christian Borntraeger wrote: >> From: "Jason J. Herne" <jjhe...@linux.vnet.ibm.com> >> >> In QEMU, a guest VCPU always started in and never was able to leave >> z/Architecture mode

Re: [Qemu-devel] [PULL 34/40] s390x/cpumodel: wire up new hardware features

2017-07-17 Thread David Hildenbrand
On 14.07.2017 12:41, Christian Borntraeger wrote: > From: "Jason J. Herne" > > Some new guest features have been introduced recently. Let's wire > them up in the CPU model. > > Signed-off-by: Jason J. Herne > Acked-by: Christian

Re: [Qemu-devel] [PULL 32/40] s390x/cpumodel: add zpci, aen and ais facilities

2017-07-17 Thread David Hildenbrand
> +/* Try to enable AIS facility */ > +kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0); > + > qemu_mutex_init(_sigp_mutex); > > return 0; > @@ -2635,6 +2638,10 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model, > Error **errp) > set_bit(S390_FEAT_CMM,

Re: [Qemu-devel] [PATCH v3 02/10] pc-bios/s390-ccw: Move ebc2asc to sclp.c

2017-07-11 Thread David Hildenbrand
re.is.real.space */ > +"-/.,%_>?.`:#@'=\""/* 7F */ > +".abcdefghi...jklmnopqr.." /* 9F */ > + "..stuvwxyz.." /* BF */ > +".ABCDEFGHI...JKLMNOPQR.." /* DF */ > +"..STUVWXYZ..0123456789..";/* FF */ > + > /* Perform service call. Return 0 on success, non-zero otherwise. */ > static int sclp_service_call(unsigned int command, void *sccb) > { > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v3 03/10] pc-bios/s390-ccw: Move virtio-block related functions into a separate file

2017-07-11 Thread David Hildenbrand
; +#include "s390-ccw.h" > +#include "virtio.h" > +#include "virtio-scsi.h" > + > +static int virtio_blk_read_many(VDev *vdev, > +ulong sector, void *load_addr, int sec_num) > +{ I would change this on the fly into something nicer. But I assume you really just want a straight copy in this patch. Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v3 04/10] pc-bios/s390-ccw: Add a write() function for stdio

2017-07-11 Thread David Hildenbrand
th = sizeof(EventBufferHeader) + len; > @@ -84,6 +89,13 @@ void sclp_print(const char *str) > memcpy(sccb->data, str, len); > > sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb); > + > +return len; > +} > + > +void sclp_print(const char *str) > +{ > +write(1, str, _strlen(str)); > } > > void sclp_get_loadparm_ascii(char *loadparm) > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PULL 32/40] s390x/cpumodel: add zpci, aen and ais facilities

2017-07-18 Thread David Hildenbrand
On 17.07.2017 20:12, Christian Borntraeger wrote: > On 07/17/2017 07:23 PM, David Hildenbrand wrote: >> >>> +/* Try to enable AIS facility */ >>> +kvm_vm_enable_cap(s, KVM_CAP_S390_AIS, 0); >>> + >>> qemu_mutex_init(_sigp_mutex); >

Re: [Qemu-devel] [PULL 34/40] s390x/cpumodel: wire up new hardware features

2017-07-18 Thread David Hildenbrand
On 17.07.2017 20:14, Christian Borntraeger wrote: > On 07/17/2017 07:30 PM, David Hildenbrand wrote: >> On 14.07.2017 12:41, Christian Borntraeger wrote: >>> From: "Jason J. Herne" <jjhe...@linux.vnet.ibm.com> >>> >>> Some new guest features h

[Qemu-devel] [PATCH v2 4/5] s390x/kvm: better comment regarding zPCI feature availability

2017-07-20 Thread David Hildenbrand
Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 9bec481..84416c0 100644 --- a/target

[Qemu-devel] [PATCH v2 3/5] target/s390x: introduce (test|set)_be_bit

2017-07-20 Thread David Hildenbrand
. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.c | 8 target/s390x/cpu_features.h | 8 target/s390x/kvm.c | 14 ++ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/target/s390x/cpu_features.c b/target

[Qemu-devel] [PATCH v2 5/5] target/s390x: improve baselining if certain base features are missing

2017-07-20 Thread David Hildenbrand
-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_models.c | 33 + 1 file changed, 33 insertions(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index f4e5bb6..92120f4 100644 --- a/target/s390x/cpu_models.c +++ b/target

[Qemu-devel] [PATCH v2 2/5] target/s390x: indicate query subfunction in s390_fill_feat_block

2017-07-20 Thread David Hildenbrand
We'll have to do the same for TCG, so let's just move it in there. Reviewed-by: Christian Borntraeger <borntrae...@de.ibm.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.c | 31 ++- target/s390x/kvm.c

[Qemu-devel] [PATCH v2 0/5] target/s390x: cpu model cleanups + improvements

2017-07-20 Thread David Hildenbrand
subfunctions part of a base model is missing. v1 -> v2: - try to make the compiler not spit out warnings David Hildenbrand (5): target/s390x: drop BE_BIT() target/s390x: indicate query subfunction in s390_fill_feat_block target/s390x: introduce (test|set)_be_bit s390x/kvm: better comm

[Qemu-devel] [PATCH v2 1/5] target/s390x: drop BE_BIT()

2017-07-20 Thread David Hildenbrand
Unused and broken, let's just get rid of it. Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target/s390x/cpu_features.h b/target/s390x/cp

Re: [Qemu-devel] [PATCH 1/1] s390/cpumodel: remove KSS from the default model of z14

2017-07-20 Thread David Hildenbrand
the SIE_KSS feature in the default model. > Let's also create a dependency check. Makes sense. Acked-by: David Hildenbrand <da...@redhat.com> > > Signed-off-by: Christian Borntraeger <borntrae...@de.ibm.com> > Reviewed-by: Jason J. Herne <jjhe...@linux.vnet.ibm.

[Qemu-devel] [PATCH v1 0/6] target/s390x: tcg improvments + MSA functions

2017-07-21 Thread David Hildenbrand
h an upstream kernel compiled for z10: ... -cpu qemu,mvcos=on,stfle=on,ldisp=on,ldisphp=on,\ eimm=on,stckf=on,csst=on,csst2=on,ginste=on,\ exrl=on,msa-base=on,msa3-base=on,msa4-base=on,msa5-base=on ... David Hildenbrand (6): target/s390x: fix pgm irq ilen for stsi

[Qemu-devel] [PATCH v1 2/6] target/s390x: fix pgm irq ilen in translate_pages()

2017-07-21 Thread David Hildenbrand
0 is certainly wrong. Let's use ILEN_AUTO. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index a873dc4..1ad0158 100644 --- a/target

[Qemu-devel] [PATCH v1 5/6] target/s390x: add basic MSA features

2017-07-21 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 3/6] target/s390x: implement spm (SET PROGRAM MASK)

2017-07-21 Thread David Hildenbrand
Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate.c | 16 3 files changed, 20 insertions(+) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 7732d01..4f7c6b7

[Qemu-devel] [PATCH v1 6/6] target/s390x: various alignment check

2017-07-21 Thread David Hildenbrand
Let's add proper alignment checks for a handful of instructions that require a SPECIFICATION exception in case alignment is violated. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/insn-data.def | 14 +++--- target/s390x/mem_helper.c

[Qemu-devel] [PATCH v1 1/6] target/s390x: fix pgm irq ilen for stsi

2017-07-21 Thread David Hildenbrand
The instruction is 4 bytes long. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/misc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index b508101..2ec49c9 100644 --- a/target

[Qemu-devel] [PATCH v1 4/6] target/s390x: move wrap_address to cpu.h

2017-07-21 Thread David Hildenbrand
Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu.h| 14 ++ target/s390x/mem_helper.c | 14 -- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 4f7c6b7..13df41c 100644 --- a/

Re: [Qemu-devel] [PATCH v1 0/6] target/s390x: tcg improvments + MSA functions

2017-07-25 Thread David Hildenbrand
On 25.07.2017 13:55, Cornelia Huck wrote: > On Fri, 21 Jul 2017 14:56:03 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> Based on series: >> "[PATCH v2 0/5] target/s390x: cpu model cleanups + improvements" > > I'm trying to decide wh

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

2017-07-25 Thread David Hildenbrand
(ping) Hi, this has been on these lists for quite some time now. I want to start preparing a virtio spec for virtio-mem soon. So if you have any more comments/ideas/objections/questions, now is the right time to post them :) Thanks! On 16.06.2017 16:20, David Hildenbrand wrote: >

Re: [Qemu-devel] [PATCH v1 3/6] target/s390x: implement spm (SET PROGRAM MASK)

2017-07-24 Thread David Hildenbrand
On 24.07.2017 06:39, Richard Henderson wrote: > On 07/21/2017 05:56 AM, David Hildenbrand wrote: >> +tcg_gen_extrl_i64_i32(cc, o->in1); >> +tcg_gen_shri_i32(cc, cc, 28); >> +tcg_gen_andi_i32(cc, cc, 0x3ul); >> +tcg_gen_mov_i32(cc_op, cc)

Re: [Qemu-devel] [PATCH v1 0/6] target/s390x: tcg improvments + MSA functions

2017-07-24 Thread David Hildenbrand
On 24.07.2017 05:16, Richard Henderson wrote: > On 07/21/2017 05:56 AM, David Hildenbrand wrote: >> 1. smaller pgm irq instruction length fixes > > I think maybe we should add insn length data to the unwind data, so that we > can > have env->int_pgm_ilen set to

Re: [Qemu-devel] [PATCH v3 3/5] target/s390x: Rework program_interrupt() and related functions

2017-07-24 Thread David Hildenbrand
On 24.07.2017 10:52, Thomas Huth wrote: > misc_helper.c won't be compiled with --disable-tcg anymore, but we > still need the program_interrupt() function in that case. Move it > to interrupt.c instead, and refactor it to re-use the code from > trigger_pgm_exception() (for TCG) and

Re: [Qemu-devel] [PATCH v1 4/6] target/s390x: move wrap_address to cpu.h

2017-07-24 Thread David Hildenbrand
On 24.07.2017 20:00, Richard Henderson wrote: > On 07/24/2017 10:38 AM, David Hildenbrand wrote: >> On 24.07.2017 06:40, Richard Henderson wrote: >>> On 07/21/2017 05:56 AM, David Hildenbrand wrote: >>>> Signed-off-by: David Hildenbrand<da...@redhat.com>

Re: [Qemu-devel] [PATCH v1 4/6] target/s390x: move wrap_address to cpu.h

2017-07-24 Thread David Hildenbrand
On 24.07.2017 06:40, Richard Henderson wrote: > On 07/21/2017 05:56 AM, David Hildenbrand wrote: >> Signed-off-by: David Hildenbrand<da...@redhat.com> >> --- >> target/s390x/cpu.h| 14 ++ >> target/s390x/mem_helper.c | 14 -- &g

Re: [Qemu-devel] [PATCH v3 8/9] s390x/kvm: msi route fixup for non-pci

2017-07-26 Thread David Hildenbrand
On 26.07.2017 10:25, Thomas Huth wrote: > On 26.07.2017 10:20, Cornelia Huck wrote: >> On Wed, 26 Jul 2017 09:09:06 +0200 >> Thomas Huth wrote: >> >>> On 25.07.2017 17:33, Cornelia Huck wrote: If we don't provide pci, we cannot have a pci device for which we have to

Re: [Qemu-devel] [PATCH v3 4/9] s390x/pci: do not advertise pci on non-pci builds

2017-07-26 Thread David Hildenbrand
On 25.07.2017 17:33, Cornelia Huck wrote: > Only set the zpci feature bit on builds that actually support pci. > > Signed-off-by: Cornelia Huck > --- > hw/s390x/s390-pci-bus.c | 5 + > hw/s390x/s390-pci-bus.h | 1 + > hw/s390x/s390-pci-stub.c | 4 >

Re: [Qemu-devel] [PATCH 1/4] target/s390x: Add ilen to unwind data

2017-07-25 Thread David Hildenbrand
if ((cc_op != CC_OP_DYNAMIC) && (cc_op != CC_OP_STATIC)) { > env->cc_op = cc_op; > } > +env->int_pgm_ilen = data[2]; > } > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH 2/4] target/s390x: Use ILEN_UNWIND in trivial cases

2017-07-25 Thread David Hildenbrand
ter to drop setting int_pgm_ilen here completely. > > /* Use the (ultimate) callers address to find the insn that trapped. */ > cpu_restore_state(cs, retaddr); > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH 3/4] target/s390x: Use unwind info in STSI

2017-07-25 Thread David Hildenbrand
++ b/target/s390x/translate.c > @@ -3988,7 +3988,6 @@ static ExitStatus op_stpt(DisasContext *s, DisasOps *o) > static ExitStatus op_stsi(DisasContext *s, DisasOps *o) > { > check_privileged(s); > -potential_page_fault(s); > gen_helper_stsi(cc_op, cpu_env, o-&g

[Qemu-devel] [PATCH v1 4/5] s390x/kvm: better comment regarding zPCI feature availability

2017-07-19 Thread David Hildenbrand
Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index fe02315..3d0b7b3 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2661,7 +2661,7 @

[Qemu-devel] [PATCH v1 0/5] target/s390x: cpu model cleanups + improvements

2017-07-19 Thread David Hildenbrand
subfunctions part of a base model is missing. David Hildenbrand (5): target/s390x: drop BE_BIT() target/s390x: indicate query subfunction in s390_fill_feat_block target/s390x: introduce (test|set)_be_bit s390x/kvm: better comment regarding zPCI feature availability target/s390x: improve

[Qemu-devel] [PATCH v1 3/5] target/s390x: introduce (test|set)_be_bit

2017-07-19 Thread David Hildenbrand
. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.c | 8 target/s390x/cpu_features.h | 8 target/s390x/kvm.c | 14 ++ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/target/s390x/cpu_features.c b/target

[Qemu-devel] [PATCH v1 2/5] target/s390x: indicate query subfunction in s390_fill_feat_block

2017-07-19 Thread David Hildenbrand
We'll have to do the same for TCG, so let's just move it in there. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.c | 31 ++- target/s390x/kvm.c | 13 - 2 files changed, 26 insertions(+), 18 deletions(-)

[Qemu-devel] [PATCH v1 1/5] target/s390x: drop BE_BIT()

2017-07-19 Thread David Hildenbrand
Unused and broken, let's just get rid of it. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_features.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h index 14bc311..770435e 100644 --- a/target

[Qemu-devel] [PATCH v1 5/5] target/s390x: improve baselining if certain base features are missing

2017-07-19 Thread David Hildenbrand
-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_models.c | 33 + 1 file changed, 33 insertions(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index f4e5bb6..92120f4 100644 --- a/target/s390x/cpu_models.c +++ b/target

Re: [Qemu-devel] [PATCH] s390: return unavailable features via query-cpu-definitions

2017-06-30 Thread David Hildenbrand
On 30.06.2017 15:25, Viktor Mihajlovski wrote: > The response for query-cpu-definitions didn't include the > unavailable-features field, which is used by libvirt to figure > out whether a certain cpu model is usable on the host. > > The unavailable features are now computed by obtaining the host

Re: [Qemu-devel] [PATCH v3] s390: return unavailable features via query-cpu-definitions

2017-07-04 Thread David Hildenbrand
model under TCG, as sc->model will be NULL). > +if (sc->model) { > +info->has_unavailable_features = true; > +check_unavailable_features(cpu_list_data->model, sc->model, > + >unavailable_features); > + }

Re: [Qemu-devel] [PATCH v1] target-s390x: fix risbg handling

2017-07-03 Thread David Hildenbrand
On 01.07.2017 22:27, Richard Henderson wrote: > On 06/25/2017 03:19 PM, Aurelien Jarno wrote: >> On 2017-06-23 01:12, David Hildenbrand wrote: >>> If we have for example: r3 contains 0x >>> ec 33 3f bf 61 55 risbg %r3,%r3,63,191,97 &

Re: [Qemu-devel] [PATCH v2] s390: return unavailable features via query-cpu-definitions

2017-07-03 Thread David Hildenbrand
> > +static S390CPUModel *get_max_cpu_model(Error **errp); > + > #ifndef CONFIG_USER_ONLY > +static void list_add_feat(const char *name, void *opaque); Wonder if we should declare all these prototypes at the beginning of the file. > + > +static void check_unavailable_features(const

Re: [Qemu-devel] [PATCH v2] s390: return unavailable features via query-cpu-definitions

2017-07-03 Thread David Hildenbrand
>> Wonder if we should declare all these prototypes at the beginning of the >> file. >> > Don't know either. Looking around in QEMU, forward declarations for > static functions seem to be used sparsely (only when needed). I could > have reordered the functions to get around without forward decls

Re: [Qemu-devel] [PATCH v1] s390x/cpumodel: allow to enable "idtes" feature for TCG

2017-07-03 Thread David Hildenbrand
On 03.07.2017 13:07, Thomas Huth wrote: > On 30.06.2017 21:22, Richard Henderson wrote: >> On 06/29/2017 12:05 AM, Thomas Huth wrote: >>> However, I'm not sure whether you can simply ignore the clearing-by-ASCE >>> stuff in this case. For example, according to the PoP: >>> >>> "When the

Re: [Qemu-devel] [PATCH v3 00/18] target/s390x improvements

2017-06-27 Thread David Hildenbrand
On 23.06.2017 18:05, Aurelien Jarno wrote: > On 2017-06-19 17:03, Richard Henderson wrote: >> Changes since v2: >> * Dropped the enforcement of PGM_OPERATION for insns for >> which the feature bit is set. There's no agreement on >> exactly how to do this yet. >> * Add implementations

[Qemu-devel] [PATCH v1] s390x/cpumodel: allow to enable "idtes" feature for TCG

2017-06-27 Thread David Hildenbrand
Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/cpu_models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 63903c2..f056357 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -676,6 +676,

Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS

2017-06-27 Thread David Hildenbrand
On 27.06.2017 13:48, Thomas Huth wrote: > It's already possible to do a network boot of an s390x guest with an > external netboot image (based on a Linux installation), but it would > be much more convenient if the s390-ccw firmware supported network > booting right out of the box, without the

Re: [Qemu-devel] [RFC PATCH 01/14] pc-bios/s390-ccw: Add the libc from the SLOF firmware

2017-06-27 Thread David Hildenbrand
On 27.06.2017 13:48, Thomas Huth wrote: > To be able to use some more advanced libc functions in the s390-ccw > firmware, like printf() and malloc(), we need a better libc here. > This patch adds the C library from the SLOF firmware (taken from > the SLOF commit ID

Re: [Qemu-devel] [PATCH v1] s390x/cpumodel: allow to enable "idtes" feature for TCG

2017-06-28 Thread David Hildenbrand
On 28.06.2017 16:21, Thomas Huth wrote: > On 27.06.2017 18:10, David Hildenbrand wrote: >> STFL bit 4 and 5 are just indications to the guest, which TLB entries an >> IDTE call will clear. These are performance indicators for the guest. >> >> STFL bit 4: >>

[Qemu-devel] [PATCH RFC 3/6] kvm: use start + size for memory ranges

2017-08-09 Thread David Hildenbrand
Convert kvm_lookup_matching_slot(). Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f6ceeba..bec157e 100644 --- a/accel/kvm/kvm-all.c +++ b

Re: [Qemu-devel] [PATCH v1 5/6] target/s390x: add basic MSA features

2017-08-09 Thread David Hildenbrand
>> @@ -792,6 +792,7 @@ static void add_qemu_cpu_model_features(S390FeatBitmap >> fbm) >> S390_FEAT_STFLE, >> S390_FEAT_EXTENDED_IMMEDIATE, >> S390_FEAT_EXTENDED_TRANSLATION_2, >> +S390_FEAT_MSA, >> S390_FEAT_EXTENDED_TRANSLATION_3, >>

[Qemu-devel] [PATCH RFC 2/6] kvm: factor out alignment of memory section

2017-08-09 Thread David Hildenbrand
Factor it out, so we can reuse it later. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 59 +++-- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e

[Qemu-devel] [PATCH RFC 6/6] kvm: kvm_log_sync() is only called with known memory sections

2017-08-09 Thread David Hildenbrand
. This heavily simplifies this function. We can now get rid of kvm_lookup_overlapping_slot(). Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 101 +--- 1 file changed, 33 insertions(+), 68 deletions(-) diff --git a/accel/k

[Qemu-devel] [PATCH RFC 1/6] kvm: require JOIN_MEMORY_REGIONS_WORKS

2017-08-09 Thread David Hildenbrand
of this special handling. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 42 +- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 46ce479..eae61bb 100644 --- a/accel/k

[Qemu-devel] [PATCH RFC 0/6] QEMU: kvm: cleanup kvm_slot handling

2017-08-09 Thread David Hildenbrand
, we can directly always map one memory section to one kvm slot (if the fixed up size is > 0). Only very briefly tested. Will do some more testing if we agree that this is the right thing to do. David Hildenbrand (6): kvm: require JOIN_MEMORY_REGIONS_WORKS kvm: factor out alignment of mem

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

2017-08-09 Thread David Hildenbrand
Let's properly align the sections first and bail out if we would ever be called with a memory region we don't know yet. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/acc

[Qemu-devel] [PATCH RFC 4/6] kvm: we never have overlapping slots in kvm_set_phys_mem()

2017-08-09 Thread David Hildenbrand
slots. Signed-off-by: David Hildenbrand <da...@redhat.com> --- accel/kvm/kvm-all.c | 69 + 1 file changed, 11 insertions(+), 58 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index bec157e..7b45506 100644 --- a/accel/k

Re: [Qemu-devel] [PATCH v4 5/9] s390x/ccw: create s390 phb conditionally

2017-08-07 Thread David Hildenbrand
On 07.08.2017 12:00, Cornelia Huck wrote: > On Fri, 4 Aug 2017 15:20:26 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> On 04.08.2017 13:29, Cornelia Huck wrote: >>> Don't create the s390 pci host bridge if we do not provide the zpci >>> facilit

Re: [Qemu-devel] [PATCH v2 3/4] i386/kvm: introduce tsc_is_stable_and_known()

2017-08-07 Thread David Hildenbrand
t; -&& ((env->features[FEAT_8000_0007_EDX] & CPUID_APM_INVTSC) > -|| env->user_tsc_khz != 0) > -&& env->tsc_khz != 0) { > +&& tsc_is_stable_and_known(env)) { > > c = _data.entries[cpuid_i++]; > c->function = KVM_CPUID_SIGNATURE | 0x10; > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v2 4/4] i386/kvm: advertise Hyper-V frequency MSRs

2017-08-07 Thread David Hildenbrand
has_msr_hv_stimer = true; > break; > + case HV_X64_MSR_TSC_FREQUENCY: > +has_msr_hv_frequencies = true; > +break; > } > } > } > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v4 7/9] s390x/pci: fence off instructions for non-pci

2017-08-07 Thread David Hildenbrand
On 07.08.2017 11:52, Cornelia Huck wrote: > On Fri, 4 Aug 2017 15:17:25 +0200 > David Hildenbrand <da...@redhat.com> wrote: > >> On 04.08.2017 13:29, Cornelia Huck wrote: >>> If a guest running on a machine without zpci issues a pci instruction, >>> th

Re: [Qemu-devel] [PATCH v2 1/4] i386/kvm: use a switch statement for MSR detection

2017-08-07 Thread David Hildenbrand
On 07.08.2017 10:57, Ladi Prosek wrote: > Switch is easier on the eye and might lead to better codegen. > > Signed-off-by: Ladi Prosek > --- > target/i386/kvm.c | 75 > +++ > 1 file changed, 31 insertions(+), 44

Re: [Qemu-devel] [PATCH v4 5/9] s390x/ccw: create s390 phb conditionally

2017-08-04 Thread David Hildenbrand
On 04.08.2017 13:29, Cornelia Huck wrote: > Don't create the s390 pci host bridge if we do not provide the zpci > facility. > > Reviewed-by: Thomas Huth > Acked-by: Christian Borntraeger > Signed-off-by: Cornelia Huck This works,

Re: [Qemu-devel] [PATCH v4 7/9] s390x/pci: fence off instructions for non-pci

2017-08-04 Thread David Hildenbrand
On 04.08.2017 13:29, Cornelia Huck wrote: > If a guest running on a machine without zpci issues a pci instruction, > throw them an exception. > > Reviewed-by: Thomas Huth > Signed-off-by: Cornelia Huck > --- > target/s390x/kvm.c | 54 >

Re: [Qemu-devel] [PATCH 1/3] i386/kvm: use a switch statement for MSR detection

2017-08-04 Thread David Hildenbrand
On 04.08.2017 11:14, Ladi Prosek wrote: > Switch is easier on the eye and might lead to better codegen. > > Signed-off-by: Ladi Prosek <lpro...@redhat.com> Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v4 8/9] s390x/kvm: msi route fixup for non-pci

2017-08-04 Thread David Hildenbrand
On 04.08.2017 13:29, Cornelia Huck wrote: > If we don't provide pci, we cannot have a pci device for which we > have to translate to adapter routes: just return -ENODEV. > > Signed-off-by: Cornelia Huck > --- > target/s390x/kvm.c | 6 ++ > 1 file changed, 6 insertions(+)

Re: [Qemu-devel] [PATCH v4 9/9] s390x: refine pci dependencies

2017-08-04 Thread David Hildenbrand
onfigs/s390x-softmmu.mak > +++ b/default-configs/s390x-softmmu.mak > @@ -1,5 +1,5 @@ > CONFIG_PCI=y > -CONFIG_VIRTIO_PCI=y > +CONFIG_VIRTIO_PCI=$(CONFIG_PCI) > CONFIG_VHOST_USER_SCSI=$(CONFIG_LINUX) > CONFIG_VIRTIO=y > CONFIG_SCLPCONSOLE=y > Reviewed-by: David Hildenbrand <da...@redhat.com> -- Thanks, David

Re: [Qemu-devel] [PATCH v4 4/9] s390x/pci: do not advertise pci on non-pci builds

2017-08-04 Thread David Hildenbrand
a zPCI bus and AEN, therefore we don't need HW support */ > -set_bit(S390_FEAT_ZPCI, model->features); > +if (pci_available) { > +set_bit(S390_FEAT_ZPCI, model->features); > +} > set_bit(S390_FEAT_ADAPTER_EVENT_NOTIFICATION, model->features); > >

Re: [Qemu-devel] [PATCH 3/3] i386/kvm: advertise Hyper-V frequency MSRs

2017-08-04 Thread David Hildenbrand
On 04.08.2017 11:14, Ladi Prosek wrote: > As of kernel commit eb82feea59d6 ("KVM: hyperv: support > HV_X64_MSR_TSC_FREQUENCY > and HV_X64_MSR_APIC_FREQUENCY"), KVM supports two new MSRs which are required > for nested Hyper-V to read timestamps with RDTSC + TSC page. > > This commit makes QEMU

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