[PATCH/RFC] vl/s390: fixup ram sizes for compat machines

2020-03-31 Thread Christian Borntraeger
David Alan Gilbert Signed-off-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- hw/s390x/s390-virtio-ccw.c | 12 hw/s390x/sclp.c| 10 -- include/hw/boards.h| 1 + softmmu/vl.c | 3 +++ 4 files changed, 16 insertions(+), 10 deletion

Re: [PATCH v1] s390x: Reject unaligned RAM sizes

2020-03-31 Thread Christian Borntraeger
On 27.03.20 23:13, Igor Mammedov wrote: > On Fri, 27 Mar 2020 17:53:39 +0100 > David Hildenbrand wrote: > >> On 27.03.20 17:46, Igor Mammedov wrote: >>> On Fri, 27 Mar 2020 17:05:34 +0100 >>> Christian Borntraeger wrote: >>> >&

Re: [PATCH v1] s390x: Reject unaligned RAM sizes

2020-03-27 Thread Christian Borntraeger
On 27.03.20 17:01, David Hildenbrand wrote: > On 27.03.20 16:34, Christian Borntraeger wrote: >> >> >> On 27.03.20 16:29, David Hildenbrand wrote: >>> Historically, we fixed up the RAM size (rounded it down), to fit into >>> storage increments. Since com

Re: [PATCH v1] s390x: Reject unaligned RAM sizes

2020-03-27 Thread Christian Borntraeger
On 27.03.20 16:29, David Hildenbrand wrote: > Historically, we fixed up the RAM size (rounded it down), to fit into > storage increments. Since commit 3a12fc61af5c ("390x/s390-virtio-ccw: use > memdev for RAM"), we no longer consider the fixed-up size when > allcoating the RAM block - which

[PATCH v2] s390x/pv: Retry ioctls on -EINTR

2020-03-27 Thread Christian Borntraeger
;) Reported-by: Marc Hartmayer Acked-by: Janosch Frank Tested-by: Marc Hartmayer Signed-off-by: Christian Borntraeger --- hw/s390x/pv.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c index 8cf5cd2c9b..dd6e13 100644 --- a/hw/s390x/pv.c +++ b/hw

Re: [PATCH] s390x/pv: Retry ioctls on -EINTR

2020-03-27 Thread Christian Borntraeger
>> I fail to see where that is triggered in the kernel. >> >> t480s: ~/git/linux/arch/s390/kvm (HEAD losgelöst bei next/master) $ git >> grep "EINTR" >> kvm-s390.c: if (exit_reason == -EINTR) { >> kvm-s390.c: return -EINTR; >> kvm-s390.c: rc = -EINTR; >> vsie.c: if (rc

Re: [PATCH] s390x/pv: Retry ioctls on -EINTR

2020-03-27 Thread Christian Borntraeger
On 27.03.20 10:49, David Hildenbrand wrote: > On 27.03.20 10:43, Christian Borntraeger wrote: >> PV_ENABLE (and maybe others) might return -EINTR when a signal is >> pending. Let us retry the ioctl in that case. >> >> Fixes: 4d226deafc44 ("s390x: protvirt: Suppo

[PATCH] s390x/pv: Retry ioctls on -EINTR

2020-03-27 Thread Christian Borntraeger
PV_ENABLE (and maybe others) might return -EINTR when a signal is pending. Let us retry the ioctl in that case. Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility") Reported-by: Marc Hartmayer Tested-by: Marc Hartmayer Signed-off-by: Christian Borntraeger --- hw/s390

Re: [PATCH v11 03/16] s390x: protvirt: Support unpack facility

2020-03-23 Thread Christian Borntraeger
On 23.03.20 08:15, Christian Borntraeger wrote: > [...] > >>> +int s390_ipl_prepare_pv_header(void) >>> +{ >>> +IplParameterBlock *ipib = s390_ipl_get_iplb_pv(); >>> +IPLBlockPV *ipib_pv = >pv; >>> +void *h

Re: [PATCH v11 03/16] s390x: protvirt: Support unpack facility

2020-03-23 Thread Christian Borntraeger
[...] >> +int s390_ipl_prepare_pv_header(void) >> +{ >> +IplParameterBlock *ipib = s390_ipl_get_iplb_pv(); >> +IPLBlockPV *ipib_pv = >pv; >> +void *hdr = g_malloc(ipib_pv->pv_header_len); >> +int rc; >> + >> +cpu_physical_memory_read(ipib_pv->pv_header_addr, hdr, >> +

Re: [PULL 3/4] s390/ipl: sync back loadparm

2020-03-20 Thread Christian Borntraeger
On 19.03.20 21:31, Peter Maydell wrote: > On Tue, 10 Mar 2020 at 15:09, Christian Borntraeger > wrote: >> >> From: Halil Pasic >> >> We expose loadparm as a r/w machine property, but if loadparm is set by >> the guest via DIAG 308, we don't update the prop

Re: [PATCH v11 09/16] s390x: protvirt: SCLP interpretation

2020-03-19 Thread Christian Borntraeger
he SCCB address, > since the function that injects the sclp external interrupt would > reject a zero sccb address. > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand > Reviewed-by: Claudio Imbrenda > Reviewed-by: Cornelia Huck Reviewed-by: Christian B

Re: [PATCH v10 03/16] s390x: protvirt: Support unpack facility

2020-03-19 Thread Christian Borntraeger
ific IPLB which is retained separately from >>> those set via code 5. >>> >>> Code 10 is used to unpack the VM into protected memory, verify its >>> integrity and start it. >>> >>> Signed-off-by: Janosch Frank >>> Co-developed-by

Re: [PATCH v10 01/16] s390x: Move diagnose 308 subcodes and rcs into ipl.h

2020-03-18 Thread Christian Borntraeger
On 18.03.20 15:30, Janosch Frank wrote: > They are part of the IPL process, so let's put them into the ipl > header. > > Signed-off-by: Janosch Frank Reviewed-by: Christian Borntraeger > --- > hw/s390x/ipl.h | 11 +++ > target/s390x/diag.c | 11 -

Re: [PATCH v10 15/16] docs: system: Add protvirt docs

2020-03-18 Thread Christian Borntraeger
On 18.03.20 15:30, Janosch Frank wrote: > Let's add some documentation for the Protected VM functionality. > > Signed-off-by: Janosch Frank > Acked-by: David Hildenbrand > Reviewed-by: Claudio Imbrenda Acked-by: Christian Borntraeger > --- > docs/system/s3

Re: [PATCH] Documentation: create/move s390x documentation

2020-03-18 Thread Christian Borntraeger
off-by: Cornelia Huck > --- > > Mostly an initial version so that Janosch can base his protected virt > documentation on something; there's room for more here :) > > If this looks good, I'll queue it on my s390-next branch for 5.1. Acked-by: Christian Borntraeger > > --- > MAINTA

Re: [PATCH v9] fixup! Fix subcode/pbt

2020-03-16 Thread Christian Borntraeger
On 16.03.20 18:57, Cornelia Huck wrote: > On Mon, 16 Mar 2020 16:04:00 +0100 > Christian Borntraeger wrote: > >> On 16.03.20 15:54, Cornelia Huck wrote: >>> On Mon, 16 Mar 2020 15:47:41 +0100 >>> Janosch Frank wrote: >>> >>>> On 3/16/2

Re: [PATCH v9] s390x: protvirt: Fence huge pages

2020-03-16 Thread Christian Borntraeger
On 16.03.20 11:06, Janosch Frank wrote: > On 3/13/20 9:21 AM, Christian Borntraeger wrote: >> >> >> On 12.03.20 17:25, Janosch Frank wrote: >>> Let's bail out of the protected transition if we detect that huge >>> pages might be in use. >>> >&

Re: [PATCH v9] fixup! Fix subcode/pbt

2020-03-16 Thread Christian Borntraeger
On 16.03.20 15:54, Cornelia Huck wrote: > On Mon, 16 Mar 2020 15:47:41 +0100 > Janosch Frank wrote: > >> On 3/16/20 3:27 PM, Cornelia Huck wrote: >>> On Fri, 13 Mar 2020 05:52:32 -0400 >>> Janosch Frank wrote: >>> Signed-off-by: Janosch Frank --- hw/s390x/ipl.h | 11

Re: [PATCH v9] fixup! Fix subcode/pbt

2020-03-13 Thread Christian Borntraeger
On 13.03.20 10:52, Janosch Frank wrote: > Signed-off-by: Janosch Frank looks sane. You will merge this? > --- > hw/s390x/ipl.h | 11 +++ > target/s390x/diag.c | 2 +- > 2 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h > index

Re: [PATCH v9 09/15] s390x: protvirt: Set guest IPL PSW

2020-03-13 Thread Christian Borntraeger
On 13.03.20 15:21, Janosch Frank wrote: [..] >>> +} else { >>> +s390_cpu_set_state(S390_CPU_STATE_LOAD, cpu); >>> +} >>> s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); >>> } >>> #endif >> >> I don't understand why you set the state to S390_CPU_STATE_LOAD and >> then

Re: [PATCH v9 08/15] s390x: protvirt: SCLP interpretation

2020-03-13 Thread Christian Borntraeger
t this is the case? Or maybe even really do the same as sclp_service_call and return 0x1f0 for unknown commands? Anyway, whatever you decide. Reviewed-by: Christian Borntraeger > +s390_cpu_pv_mem_read(env_archcpu(env), 0, _sccb, sccb_len); > +sclp_c->execute(sclp, _sccb, code); &g

Re: [PATCH RFCv2 2/4] intc/s390_flic_kvm.c: Use kvm_device_ioctl() instead of ioctl()

2020-03-13 Thread Christian Borntraeger
On 12.03.20 17:12, David Hildenbrand wrote: > Let's use the official variant, which will e.g., trace the call. > kvm_device_ioctl() will do the rc -> -errno conversion automatically, so > we can drop that code. > > Cc: Cornelia Huck > Cc: Halil Pasic > Cc: Christian

Re: [PATCH v9] s390x: protvirt: Fence huge pages

2020-03-13 Thread Christian Borntraeger
On 12.03.20 17:25, Janosch Frank wrote: > Let's bail out of the protected transition if we detect that huge > pages might be in use. > > Signed-off-by: Janosch Frank > --- > > I'd like to squash this into the unpack patch to give a proper error > message if we try to transition into the

Re: [PATCH v9 13/15] s390x: protvirt: Handle SIGP store status correctly

2020-03-13 Thread Christian Borntraeger
On 12.03.20 17:13, Janosch Frank wrote: > On 3/12/20 4:51 PM, Christian Borntraeger wrote: >> On 11.03.20 14:21, Janosch Frank wrote: >>> For protected VMs status storing is not done by QEMU anymore. >>> >>> Signed-off-by: Janosch Frank >>> Rev

Re: [PATCH v9 13/15] s390x: protvirt: Handle SIGP store status correctly

2020-03-13 Thread Christian Borntraeger
On 12.03.20 17:13, Janosch Frank wrote: > On 3/12/20 4:51 PM, Christian Borntraeger wrote: >> On 11.03.20 14:21, Janosch Frank wrote: >>> For protected VMs status storing is not done by QEMU anymore. >>> >>> Signed-off-by: Janosch Frank >>> Rev

Re: [PATCH v9 11/15] s390x: protvirt: Disable address checks for PV guest IO emulation

2020-03-13 Thread Christian Borntraeger
On 12.03.20 17:17, Janosch Frank wrote: > On 3/12/20 5:10 PM, Christian Borntraeger wrote: >> >> >> On 12.03.20 17:07, Janosch Frank wrote: >>> On 3/12/20 4:41 PM, Christian Borntraeger wrote: >>>> On 11.03.20 14:21, Janosch Frank wrote: >>

Re: [PATCH v9 10/15] s390x: protvirt: Move diag 308 data over SIDA

2020-03-12 Thread Christian Borntraeger
On 12.03.20 17:05, Janosch Frank wrote: > On 3/12/20 4:17 PM, Christian Borntraeger wrote: >> >> >> On 11.03.20 14:21, Janosch Frank wrote: >>> For protected guests the IPIB is written/read to/from the SIDA, so we >> >> I think we need t

Re: [PATCH v9 11/15] s390x: protvirt: Disable address checks for PV guest IO emulation

2020-03-12 Thread Christian Borntraeger
On 12.03.20 17:07, Janosch Frank wrote: > On 3/12/20 4:41 PM, Christian Borntraeger wrote: >> On 11.03.20 14:21, Janosch Frank wrote: >>> IO instruction data is routed through SIDAD for protected guests, so >>> adresses do not need to be checked, as this is kern

Re: [PATCH v9 13/15] s390x: protvirt: Handle SIGP store status correctly

2020-03-12 Thread Christian Borntraeger
; store_arch) > hwaddr len = sizeof(*sa); > int i; > > + /* Storing will occur on next SIE entry for protected VMs */ Maybe ... next SIE entry of the sending CPU ? Reviewed-by: Christian Borntraeger > +if (s390_is_pv()) { > +return 0; > +} > + > sa = cpu_physical_memory_map(addr, , true); > if (!sa) { > return -EFAULT; >

Re: [PATCH v9 11/15] s390x: protvirt: Disable address checks for PV guest IO emulation

2020-03-12 Thread Christian Borntraeger
; Signed-off-by: Janosch Frank > Reviewed-by: Thomas Huth > Reviewed-by: David Hildenbrand Reviewed-by: Christian Borntraeger > --- > target/s390x/ioinst.c | 33 ++--- > 1 file changed, 26 insertions(+), 7 deletions(-) > > diff --git a/tar

Re: [PATCH v9 10/15] s390x: protvirt: Move diag 308 data over SIDA

2020-03-12 Thread Christian Borntraeger
On 11.03.20 14:21, Janosch Frank wrote: > For protected guests the IPIB is written/read to/from the SIDA, so we I think we need to make up our mind regarding IPLB vs. IPIB Otherwise Reviewed-by: Christian Borntraeger > need those accesses to go t

Re: [PATCH v9 09/15] s390x: protvirt: Set guest IPL PSW

2020-03-12 Thread Christian Borntraeger
by: David Hildenbrand Reviewed-by: Christian Borntraeger > --- > target/s390x/cpu.c | 22 +- > 1 file changed, 13 insertions(+), 9 deletions(-) > > diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c > index 84029f14814b4980..a48d39f139cdc1c4 100644 > --- a/tar

Re: [PATCH v9 07/15] s390x: protvirt: Move STSI data over SIDAD

2020-03-12 Thread Christian Borntraeger
On 11.03.20 14:21, Janosch Frank wrote: > For protected guests, we need to put the STSI emulation results into > the SIDA, so SIE will write them into the guest at the next entry. > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand > --- > target/s390x/kvm.c | 11 +-- >

Re: [PATCH v9 06/15] s390x: Add SIDA memory ops

2020-03-12 Thread Christian Borntraeger
S390_PROTECTED, so > let's check for that. > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand Reviewed-by: Christian Borntraeger > --- > target/s390x/cpu.h| 7 ++- > target/s390x/kvm.c| 25 + > target/s390x/kvm_s39

Re: [PATCH v9 03/15] s390x: protvirt: Add migration blocker

2020-03-12 Thread Christian Borntraeger
> +error_setg(_mig_blocker, > + "protected VMs are currently not migrateable."); > + rc = migrate_add_blocker(pv_mig_blocker, _err); > +if (local_err) { Shall we rather use rc here? local_err should also work I guess. Anyway Reviewed-by: Christian Borntraeger >

Re: [PATCH v9 02/15] s390x: protvirt: Support unpack facility

2020-03-12 Thread Christian Borntraeger
On 11.03.20 14:21, Janosch Frank wrote: [...] > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c > index b81942e1e6f9002e..98df89e62c25f583 100644 > --- a/hw/s390x/ipl.c > +++ b/hw/s390x/ipl.c > @@ -27,6 +27,7 @@ > #include "hw/s390x/vfio-ccw.h" > #include "hw/s390x/css.h" > #include

Re: [PATCH] oslib-posix: initialize mutex and condition variable

2020-03-10 Thread Christian Borntraeger
On 10.03.20 18:59, Paolo Bonzini wrote: > The mutex and condition variable were never initialized, causing > -mem-prealloc to abort with an assertion failure. > > Fixes: 037fb5eb3941c80a2b7c36a843e47207ddb004d4 > Reported-by: Christian Borntraeger You might want to replace th

Re: [PATCH v8 02/15] s390x: protvirt: Support unpack facility

2020-03-10 Thread Christian Borntraeger
gned-off-by: Janosch Frank > Co-developed-by: Christian Borntraeger [Changes > to machine] > --- > hw/s390x/Makefile.objs | 1 + > hw/s390x/ipl.c | 56 - > hw/s390x/ipl.h | 79 +++ > hw/s390x/pv.c

Re: [PATCH v8 05/15] s390x: protvirt: KVM intercept changes

2020-03-10 Thread Christian Borntraeger
nging sigps and diag308 will reach QEMU. QEMU will do its parts of the job, while the ultravisor has done the instruction part of the job. With that Reviewed-by: Christian Borntraeger > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand > --- > target/s390x/k

[PULL 2/4] s390x/bios: rebuild s390-ccw.img

2020-03-10 Thread Christian Borntraeger
contains 98df96d4edae ("pc-bios: s390x: Save iplb location in lowcore") Signed-off-by: Christian Borntraeger --- pc-bios/s390-ccw.img | Bin 42608 -> 42608 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-

[PULL 4/4] s390x: ipl: Consolidate iplb validity check into one function

2020-03-10 Thread Christian Borntraeger
From: Janosch Frank It's nicer to just call one function than calling a function for each possible iplb type. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Message-Id: <20200310090950.61172-1-fran...@linux.ibm.com> Reviewed-by: Christian Borntraeger Signed-off-by: Chr

[PULL 0/4] s390x/ipl: Fixes for ipl and bios

2020-03-10 Thread Christian Borntraeger
not throw away guest changes of the IPL parameter during reset - refactor IPLB checks Christian Borntraeger (1): s390x/bios: rebuild s390-ccw.img Halil Pasic (1): s390/ipl: sync back loadparm Janosch Frank (2): pc

[PULL 1/4] pc-bios: s390x: Save iplb location in lowcore

2020-03-10 Thread Christian Borntraeger
-by: Marc Hartmayer Message-Id: <20200304114231.23493-19-fran...@linux.ibm.com> Reviewed-by: Christian Borntraeger Reviewed-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- pc-bios/s390-ccw/jump2ipl.c | 1 + pc-bios/s390-ccw/main.c | 8 +++- pc-bios/s390-ccw/net

[PULL 3/4] s390/ipl: sync back loadparm

2020-03-10 Thread Christian Borntraeger
adparm property for the machine") Reported-by: Marc Hartmayer Reviewed-by: Janosch Frank Reviewed-by: Viktor Mihajlovski Tested-by: Marc Hartmayer Reviewed-by: David Hildenbrand Message-Id: <20200309133223.100491-1-pa...@linux.ibm.com> [borntrae...@de.ibm.com: use reverse xmas tree] Signed-off

Re: [PATCH v7 02/15] s390x: protvirt: Support unpack facility

2020-03-10 Thread Christian Borntraeger
On 09.03.20 15:40, Christian Borntraeger wrote: > something like the following? > > > diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c > index c513f8efe0..cd12c29b9a 100644 > --- a/target/s390x/cpu.c > +++ b/target/s390x/cpu.c > @@ -185,13 +185,18 @@ static void

Re: [PATCH v8 2/2] s390x: protvirt: Support unpack facility

2020-03-10 Thread Christian Borntraeger
On 10.03.20 10:00, David Hildenbrand wrote: > > Now that we talked about cached values, what about > > #if !defined(CONFIG_USER_ONLY) > static bool s390_is_pv(void) > { > static S390CcwMachineState *ccw; > Object *obj; > > if (ccw) { > return ccw->pv; > } > > /*

Re: [PATCH v8] s390x: ipl: Consolidate iplb validity check into one function

2020-03-10 Thread Christian Borntraeger
On 10.03.20 10:09, Janosch Frank wrote: > It's nicer to just call one function than calling a function for each > possible iplb type. > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand thanks applied.

Re: [PATCH v8] s390x: ipl: Consolidate iplb validity check into one function

2020-03-10 Thread Christian Borntraeger
On 10.03.20 10:09, Janosch Frank wrote: > It's nicer to just call one function than calling a function for each > possible iplb type. > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand David, still ok? If yes I will pick this one. Reviewed-by: Christ

Re: [PATCH v8 1/2] s390x: ipl: Consolidate iplb validity check into one function

2020-03-10 Thread Christian Borntraeger
On 10.03.20 09:32, Janosch Frank wrote: > It's nicer to just call one function than calling a function for each > possible iplb type. > > Signed-off-by: Janosch Frank > --- > hw/s390x/ipl.h | 20 +++- > target/s390x/diag.c | 2 +- > 2 files changed, 12 insertions(+), 10

Re: [PATCH v2 1/1] s390/ipl: sync back loadparm

2020-03-10 Thread Christian Borntraeger
On 09.03.20 14:32, Halil Pasic wrote: > We expose loadparm as a r/w machine property, but if loadparm is set by > the guest via DIAG 308, we don't update the property. Having a > disconnect between the guest view and the QEMU property is not nice in > itself, but things get even worse for SCSI,

Re: [PATCH v7 02/15] s390x: protvirt: Support unpack facility

2020-03-09 Thread Christian Borntraeger
On 09.03.20 14:37, David Hildenbrand wrote: >> >> +#if !defined(CONFIG_USER_ONLY) >> +static bool machine_is_pv(MachineState *ms) >> +{ >> +Object *obj; >> + >> +/* we have to bail out for the "none" machine */ >> +obj = object_dynamic_cast(OBJECT(ms), TYPE_S390_CCW_MACHINE); >>

Re: [PATCH] cpu: Use DeviceClass reset instead of a special CPUClass reset

2020-03-09 Thread Christian Borntraeger
On 03.03.20 11:05, Peter Maydell wrote: > The CPUClass has a 'reset' method. This is a legacy from when > TYPE_CPU used not to inherit from TYPE_DEVICE. We don't need it any > more, as we can simply use the TYPE_DEVICE reset. The 'cpu_reset()' > function is kept as the API which most places

Re: [PATCH] mem-prealloc: initialize cond and mutex

2020-03-09 Thread Christian Borntraeger
On 09.03.20 11:05, Paolo Bonzini wrote: > On 09/03/20 11:03, Igor Mammedov wrote: >>> +qemu_cond_init(_cond); >>> +qemu_mutex_init(_mutex); >> Is it possible for touch_all_pages to be called several times? >> If it's then it probably needs a guard against that to make >> sure it won't

Re: 回复: [PATCH] mem-prealloc: initialize cond and mutex(Internet mail)

2020-03-09 Thread Christian Borntraeger
Can you test and review my fixup? That will help Paolo to take my fix. > 发件人: Christian Borntraeger > 发送时间: 2020-03-06 16:50 > 收件人: qemu-devel > 抄送: qemu-s390x; Christian Borntraeger; bauerchen(陈蒙蒙); Paolo Bonzini; Marc > Hartmayer > 主题: [PATCH] mem-prealloc: initialize cond

Re: [PATCH v6 03/18] s390x: protvirt: Support unpack facility

2020-03-06 Thread Christian Borntraeger
On 04.03.20 12:42, Janosch Frank wrote: [...] > diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c > index 3dd396e870..69b1cc5dfc 100644 > --- a/target/s390x/cpu.c > +++ b/target/s390x/cpu.c > @@ -37,6 +37,8 @@ > #include "sysemu/hw_accel.h" > #include "hw/qdev-properties.h" > #ifndef

[PATCH] mem-prealloc: initialize cond and mutex

2020-03-06 Thread Christian Borntraeger
ond->initialized' failed. Let us initialize cond and mutex. Cc: bauerchen Cc: Paolo Bonzini Reported-by: Marc Hartmayer Fixes: 037fb5eb3941 ("mem-prealloc: optimize large guest startup") Signed-off-by: Christian Borntraeger --- util/oslib-posix.c | 2 ++ 1 file changed, 2 insertions(+) d

Re: [PULL 000/136] Misc patches for 2020-02-25 (refactoring and Coccinelle edition)

2020-03-06 Thread Christian Borntraeger
zed' failed. On 06.03.20 09:34, Christian Borntraeger wrote: > > > On 06.03.20 09:02, Christian Borntraeger wrote: >> >> On 25.02.20 12:48, Paolo Bonzini wrote: >>> The following changes since commit c1e667d2598b9b3ce62b8e89ed22dd38dfe9f57f: >>> >>>

Re: [PULL 000/136] Misc patches for 2020-02-25 (refactoring and Coccinelle edition)

2020-03-06 Thread Christian Borntraeger
On 06.03.20 09:02, Christian Borntraeger wrote: > > On 25.02.20 12:48, Paolo Bonzini wrote: >> The following changes since commit c1e667d2598b9b3ce62b8e89ed22dd38dfe9f57f: >> >> Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' >> int

Re: [PULL 000/136] Misc patches for 2020-02-25 (refactoring and Coccinelle edition)

2020-03-06 Thread Christian Borntraeger
On 25.02.20 12:48, Paolo Bonzini wrote: > The following changes since commit c1e667d2598b9b3ce62b8e89ed22dd38dfe9f57f: > > Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' > into staging (2020-02-24 11:38:54 +) > > are available in the git repository at: > > >

Re: [PATCH v6 18/18] pc-bios: s390x: Save iplb location in lowcore

2020-03-05 Thread Christian Borntraeger
ncountered the ZIPL panic > quite often. > > Signed-off-by: Janosch Frank > Tested-by: Marc Hartmayer Reviewed-by: Christian Borntraeger Thanks applied. > --- > pc-bios/s390-ccw/jump2ipl.c | 1 + > pc-bios/s390-ccw/main.c | 8 +++- > pc-bios/s390-cc

Re: [PATCH 1/1] s390/ipl: sync back loadparm

2020-03-05 Thread Christian Borntraeger
On 05.03.20 15:25, Christian Borntraeger wrote: > > > On 05.03.20 15:11, Halil Pasic wrote: >> On Thu, 5 Mar 2020 13:44:31 +0100 >> Christian Borntraeger wrote: >> >>> >>> >>> On 25.02.20 15:35, Viktor Mihajlovski wrote: >>>>

Re: [PATCH 1/1] s390/ipl: sync back loadparm

2020-03-05 Thread Christian Borntraeger
On 05.03.20 15:11, Halil Pasic wrote: > On Thu, 5 Mar 2020 13:44:31 +0100 > Christian Borntraeger wrote: > >> >> >> On 25.02.20 15:35, Viktor Mihajlovski wrote: >>> >>> >>> On 2/25/20 12:56 PM, Halil Pasic wrote: >>>>

Re: [PATCH 1/1] s390/ipl: sync back loadparm

2020-03-05 Thread Christian Borntraeger
On 25.02.20 15:35, Viktor Mihajlovski wrote: > > > On 2/25/20 12:56 PM, Halil Pasic wrote: >> On Tue, 25 Feb 2020 10:39:40 +0100 >> David Hildenbrand wrote: >> >>> On 24.02.20 16:02, Halil Pasic wrote: We expose loadparm as a r/w machine property, but if loadparm is set by the

Re: [PATCH v6 06/18] s390x: protvirt: Inhibit balloon when switching to protected mode

2020-03-05 Thread Christian Borntraeger
then do the right thing (make shared). With an updated patch description: Reviewed-by: Christian Borntraeger > > Signed-off-by: Janosch Frank > Reviewed-by: David Hildenbrand > --- > hw/s390x/s390-virtio-ccw.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --

Re: [PATCH v6 02/18] s390x: protvirt: Add diag308 subcodes 8 - 10

2020-03-04 Thread Christian Borntraeger
On 04.03.20 12:42, Janosch Frank wrote: > For diag308 subcodes 8 - 10 we have a new ipib of type 5. The ipib > holds the address and length of the secure execution header, as well > as a list of guest components. > > Each component is a block of memory, for example kernel or initrd, > which

Re: [PATCH v6 00/18] s390x: Protected Virtualization support

2020-03-04 Thread Christian Borntraeger
On 04.03.20 18:15, David Hildenbrand wrote: > On 04.03.20 12:42, Janosch Frank wrote: >> Most of the QEMU changes for PV are related to the new IPL type with >> subcodes 8 - 10 and the execution of the necessary Ultravisor calls to >> IPL secure guests. Note that we can only boot into secure

Re: [PATCH v6 18/18] pc-bios: s390x: Save iplb location in lowcore

2020-03-04 Thread Christian Borntraeger
On 04.03.20 12:42, Janosch Frank wrote: > The POP states that for a list directed IPL the IPLB is stored into > memory by the machine loader and its address is stored at offset 0x14 > of the lowcore. > > ZIPL currently uses the address in offset 0x14 to access the IPLB and > acquire flags about

Re: [PATCH RFC 2/4] intc/s390_flic_kvm.c: Use kvm_device_ioctl() instead of ioctl()

2020-03-04 Thread Christian Borntraeger
On 03.03.20 15:19, David Hildenbrand wrote: > Let's use the official variant, which will e.g., trace the call. > > Cc: Cornelia Huck > Cc: Halil Pasic > Cc: Christian Borntraeger > Cc: qemu-s3...@nongnu.org > Signed-off-by: David Hildenbrand > --- > h

Re: [PATCH v5 07/18] s390x: protvirt: Inhibit balloon when switching to protected mode

2020-03-03 Thread Christian Borntraeger
On 26.02.20 19:24, Cornelia Huck wrote: > On Wed, 26 Feb 2020 16:30:32 +0100 > Janosch Frank wrote: > >> On 2/26/20 4:16 PM, David Hildenbrand wrote: >>> On 26.02.20 16:06, Christian Borntraeger wrote: >>>> >>>> >>>> On 26.02.

Re: [PATCH v5 07/18] s390x: protvirt: Inhibit balloon when switching to protected mode

2020-02-26 Thread Christian Borntraeger
On 26.02.20 16:11, Janosch Frank wrote: > On 2/26/20 3:59 PM, David Hildenbrand wrote: >> On 26.02.20 13:20, Janosch Frank wrote: >>> Ballooning in protected VMs can only be done when the guest shares the >>> pages it gives to the host. Hence, until we have a solution for this >>> in the guest

Re: [PATCH v5 07/18] s390x: protvirt: Inhibit balloon when switching to protected mode

2020-02-26 Thread Christian Borntraeger
On 26.02.20 15:59, David Hildenbrand wrote: > On 26.02.20 13:20, Janosch Frank wrote: >> Ballooning in protected VMs can only be done when the guest shares the >> pages it gives to the host. Hence, until we have a solution for this >> in the guest kernel, we inhibit ballooning when switching

Re: [PATCH v5 06/18] s390x: protvirt: Handle diag 308 subcodes 0,1,3,4

2020-02-26 Thread Christian Borntraeger
On 26.02.20 13:20, Janosch Frank wrote: > As we now have access to the protection state of the cpus, we can > implement special handling of diag 308 subcodes for cpus in the > protected state. > > For subcodes 0 and 1 we need to unshare all pages before continuing, > so the guest doesn't

Re: [PATCH v5 05/18] s390x: protvirt: Add migration blocker

2020-02-26 Thread Christian Borntraeger
On 26.02.20 13:20, Janosch Frank wrote: > Migration is not yet supported. > > Signed-off-by: Janosch Frank > --- > hw/s390x/s390-virtio-ccw.c | 28 ++-- > 1 file changed, 22 insertions(+), 6 deletions(-) > > diff --git a/hw/s390x/s390-virtio-ccw.c

Re: [PATCH v5 01/18] s390x: Use constant for ESA PSW address

2020-02-26 Thread Christian Borntraeger
ASK_ESA_ADDR as an alternative. Either way, this makes sense. Reviewed-by: Christian Borntraeger > --- > hw/s390x/ipl.c | 2 +- > target/s390x/cpu.c | 4 ++-- > target/s390x/cpu.h | 1 + > 3 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/hw/s39

Re: [PATCH] pc-bios/s390x: Pack ResetInfo struct

2020-02-25 Thread Christian Borntraeger
On 25.02.20 16:00, Christian Borntraeger wrote: > > > On 25.02.20 13:58, Jason J. Herne wrote: >> On 2/25/20 6:13 AM, Christian Borntraeger wrote: >>> >>> >>> On 25.02.20 11:23, Jason J. Herne wrote: >>>> On 2/13/20 1:24 PM, Christian Bo

Re: [PATCH] pc-bios/s390x: Pack ResetInfo struct

2020-02-25 Thread Christian Borntraeger
On 25.02.20 13:58, Jason J. Herne wrote: > On 2/25/20 6:13 AM, Christian Borntraeger wrote: >> >> >> On 25.02.20 11:23, Jason J. Herne wrote: >>> On 2/13/20 1:24 PM, Christian Borntraeger wrote: >>> ... >>>>>> diff --git a/pc-bios/s390-

Re: [PATCH] pc-bios/s390x: Pack ResetInfo struct

2020-02-25 Thread Christian Borntraeger
On 25.02.20 11:23, Jason J. Herne wrote: > On 2/13/20 1:24 PM, Christian Borntraeger wrote: > ... >>>> diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c >>>> index da13c43cc0..8839226803 100644 >>>> --- a/pc-bios/s390-ccw/jump2ip

Re: [PATCH v4 03/16] s390x: protvirt: Support unpack facility

2020-02-24 Thread Christian Borntraeger
d VM information) > 4. Protect image pages from the host and decrypt them > 5. Verify the image integrity > > Only after step 5 a protected VM is allowed to run. > > Signed-off-by: Janosch Frank > Signed-off-by: Christian Borntraeger [Changes > to machine] [...] > d

Re: [PATCH] MAINTAINERS: Reactivate MIPS KVM CPUs

2020-02-24 Thread Christian Borntraeger
d Fixes"), with hope that > this component will be fully maintained at some further, but not > distant point in future. > > CC: James Hogan > CC: Christian Borntraeger > CC: Paolo Bonzini > Signed-off-by: Aleksandar Markovic I talked with Aleksandar several times about maintainership a

Re: [PATCH] s390/sclp: improve special wait psw logic

2020-02-20 Thread Christian Borntraeger
On 20.02.20 14:26, David Hildenbrand wrote: > On 20.02.20 14:16, Christian Borntraeger wrote: >> There is a special quiesce PSW that we check for "shutdown". Otherwise >> disabled >> wait is detected as "crashed". Architecturally we must only check PSW

[PATCH] s390/sclp: improve special wait psw logic

2020-02-20 Thread Christian Borntraeger
There is a special quiesce PSW that we check for "shutdown". Otherwise disabled wait is detected as "crashed". Architecturally we must only check PSW bits 116-127. Fix this. Cc: qemu-sta...@nongnu.org Signed-off-by: Christian Borntraeger --- target/s390x/helper.c | 2 +

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Christian Borntraeger
lle script > scripts/coccinelle/as-rw-const.patch. > > Two lines in hw/net/dp8393x.c that Coccinelle produced that > were over 80 characters were re-wrapped by hand. > > Signed-off-by: Peter Maydell s390 part Acked-by: Christian Borntraeger > --- > I could break this d

Re: [PATCH] pc-bios/s390x: Pack ResetInfo struct

2020-02-13 Thread Christian Borntraeger
On 13.02.20 19:02, Jason J. Herne wrote: > On 2/6/20 5:09 AM, Christian Borntraeger wrote: >> >> >> On 05.02.20 19:21, Jason J. Herne wrote: >>> This fixes vfio-ccw when booting non-Linux operating systems. Without this >>> struct being packed, a

[PATCH] uapi: fix userspace breakage, use __BITS_PER_LONG for swap

2020-02-13 Thread Christian Borntraeger
es: d5767057c9a ("uapi: rename ext2_swab() to swab() and share globally in swab.h") Cc: Yury Norov Cc: Allison Randal Cc: Joe Perches Cc: Thomas Gleixner Cc: William Breathitt Gray Signed-off-by: Christian Borntraeger --- include/uapi/linux/swab.h | 4 ++-- 1 file changed, 2 insertions(

Re: [PATCH] pc-bios/s390x: Pack ResetInfo struct

2020-02-07 Thread Christian Borntraeger
Jason, can you run objdump -Sdr on jump2ipl.o on a broken variant? On 06.02.20 12:00, Thomas Huth wrote: > On 06/02/2020 11.09, Christian Borntraeger wrote: >> >> >> On 05.02.20 19:21, Jason J. Herne wrote: >>> This fixes vfio-ccw when booting non-Li

Re: [PATCH] travis.yml: Test the s390-ccw build, too

2020-02-07 Thread Christian Borntraeger
On 07.02.20 10:56, Thomas Huth wrote: > On 07/02/2020 10.47, Cornelia Huck wrote: >> On Thu, 6 Feb 2020 21:25:43 +0100 >> Thomas Huth wrote: >> >>> Since we can now use a s390x host on Travis, we can also build and >>> test the s390-ccw bios images there. For this we have to make sure >>>

Re: [PATCH] pc-bios/s390x: Pack ResetInfo struct

2020-02-06 Thread Christian Borntraeger
On 05.02.20 19:21, Jason J. Herne wrote: > This fixes vfio-ccw when booting non-Linux operating systems. Without this > struct being packed, a few extra bytes of low core memory get overwritten when > we assign a value to memory address 0 in jump_to_IPL_2. This is enough to > cause some

Re: VW ELF loader

2020-02-04 Thread Christian Borntraeger
On 01.02.20 20:04, Paolo Bonzini wrote: > On 01/02/20 14:39, Alexey Kardashevskiy wrote: >> QEMU needs to load GRUB from the disk. The current workaround is to read >> it from qcow2, save in a file and then call load_elf(). Not nice. >> >> 2 problems with that. >> >> 1. when load_elf calls

Re: [PATCH] s390x/event-facility: fix error propagation

2020-01-21 Thread Christian Borntraeger
not realized. > > Fix this by (correctly) checking the local Error err. > > Reported-by: Christian Borntraeger > Fixes: 3d508334dd2c ("s390x/event-facility: Fix realize() error API > violations") > Signed-off-by: Cornelia Huck Tested-by: Christian Borntraeg

Re: [PATCH v2] s390x: adapter routes error handling

2020-01-17 Thread Christian Borntraeger
On 17.01.20 12:33, Cornelia Huck wrote: > On Fri, 17 Jan 2020 12:22:45 +0100 > Christian Borntraeger wrote: > >> On 17.01.20 12:11, Cornelia Huck wrote: >>> If the kernel irqchip has been disabled, we don't want the >>> {add,release}_adapter_routes

Re: [PATCH v2] s390x: adapter routes error handling

2020-01-17 Thread Christian Borntraeger
On 17.01.20 12:11, Cornelia Huck wrote: > If the kernel irqchip has been disabled, we don't want the > {add,release}_adapter_routes routines to call any kvm_irqchip_* > interfaces, as they may rely on an irqchip actually having been > created. Just take a quick exit in that case instead. > >

Re: [PATCH] target/s390x/kvm: Enable adapter interruption suppression again

2020-01-17 Thread Christian Borntraeger
On 17.01.20 11:38, Thomas Huth wrote: > On 16/01/2020 21.26, Cornelia Huck wrote: >> On Thu, 16 Jan 2020 15:19:13 -0500 >> Matthew Rosato wrote: >> >>> On 1/16/20 7:20 AM, Thomas Huth wrote: The AIS feature has been disabled late in the v2.10 development cycle since there were some

Re: [PATCH] target/s390x/kvm: Enable adapter interruption suppression again

2020-01-16 Thread Christian Borntraeger
On 16.01.20 13:55, Thomas Huth wrote: > On 16/01/2020 13.50, Cornelia Huck wrote: >> On Thu, 16 Jan 2020 13:20:26 +0100 >> Thomas Huth wrote: >> >>> The AIS feature has been disabled late in the v2.10 development >>> cycle since there were some issues with migration (see commit >>>

Re: [PATCH] tests/boot-sector: Fix the bad s390x assembler code

2019-12-18 Thread Christian Borntraeger
that we always zero out the upper bits > of the register. > > Signed-off-by: Thomas Huth Reviewed-by: Christian Borntraeger > --- > tests/boot-sector.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tests/boot-sector.c b/tests/boot-sector.c &g

Re: [RFC QEMU PATCH] pc-bios/s390-ccw: Add zipl-like "BOOT_IMAGE=x" to the kernel parameters

2019-12-16 Thread Christian Borntraeger
On 16.12.19 13:09, Cornelia Huck wrote: > On Mon, 16 Dec 2019 12:29:24 +0100 > Christian Borntraeger wrote: > >> On 16.12.19 12:24, Thomas Huth wrote: >>> Note: I've marked the patch as RFC since I'm not quite sure whether >>> this is really the righ

Re: [RFC QEMU PATCH] pc-bios/s390-ccw: Add zipl-like "BOOT_IMAGE=x" to the kernel parameters

2019-12-16 Thread Christian Borntraeger
On 16.12.19 12:24, Thomas Huth wrote: > Note: I've marked the patch as RFC since I'm not quite sure whether > this is really the right way to address this issue: It's unfortunate > that we have to mess with different location in ZIPL which might also > change again in the future. As

Re: [PATCH v3 4/4] pc-bios/s390x: Fix reset psw mask

2019-12-03 Thread Christian Borntraeger
On 03.12.19 14:28, Janosch Frank wrote: > We need to set the short psw indication bit in the reset psw, as it is > a short psw. > > fixes: 9629823290 ("pc-bios/s390-ccw: do a subsystem reset before running the > guest") > Signed-off-by: Janosch Frank Ack

Re: [PATCH v3 4/4] pc-bios/s390x: Fix reset psw mask

2019-12-03 Thread Christian Borntraeger
On 03.12.19 14:28, Janosch Frank wrote: > We need to set the short psw indication bit in the reset psw, as it is > a short psw. > > fixes: 9629823290 ("pc-bios/s390-ccw: do a subsystem reset before running the > guest") > Signed-off-by: Janosch Frank We should also add commit

Re: [PATCH v2 3/3] s390x: Fix cpu normal reset ri clearing

2019-12-03 Thread Christian Borntraeger
- offsetof(CPUS390XState, end_reset_fields) - + offsetof(CPUS390XState, start_normal_reset_fields) - offsetof(CPUS390XState, start_initial_reset_fields)); /* architectured initial value for Breaking-Event-Address register */ to avoid double memse

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