[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/46] s390x/migration: use zero flag parameter
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 01/46] s390x/migration: use zero flag parameter |
Date: |
Thu, 14 Dec 2017 18:09:19 +0100 |
From: Christian Borntraeger <address@hidden>
valgrind pointed out that we call KVM_S390_GET_IRQ_STATE with an
undefined value for flags. Kernels prior to 4.15 did not use that
field, and later kernels ignore it for compatibility reasons, but we
better play safe.
The same is true for SET_IRQ_STATE. We should make sure to not use the
flag field, either.
Signed-off-by: Christian Borntraeger <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/kvm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index b03f583032..f205e0a2ca 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -1979,7 +1979,10 @@ int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t
cpu_state)
void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
{
- struct kvm_s390_irq_state irq_state;
+ struct kvm_s390_irq_state irq_state = {
+ .buf = (uint64_t) cpu->irqstate,
+ .len = VCPU_IRQ_BUF_SIZE,
+ };
CPUState *cs = CPU(cpu);
int32_t bytes;
@@ -1987,9 +1990,6 @@ void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
return;
}
- irq_state.buf = (uint64_t) cpu->irqstate;
- irq_state.len = VCPU_IRQ_BUF_SIZE;
-
bytes = kvm_vcpu_ioctl(cs, KVM_S390_GET_IRQ_STATE, &irq_state);
if (bytes < 0) {
cpu->irqstate_saved_size = 0;
@@ -2003,7 +2003,10 @@ void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
{
CPUState *cs = CPU(cpu);
- struct kvm_s390_irq_state irq_state;
+ struct kvm_s390_irq_state irq_state = {
+ .buf = (uint64_t) cpu->irqstate,
+ .len = cpu->irqstate_saved_size,
+ };
int r;
if (cpu->irqstate_saved_size == 0) {
@@ -2014,9 +2017,6 @@ int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
return -ENOSYS;
}
- irq_state.buf = (uint64_t) cpu->irqstate;
- irq_state.len = cpu->irqstate_saved_size;
-
r = kvm_vcpu_ioctl(cs, KVM_S390_SET_IRQ_STATE, &irq_state);
if (r) {
error_report("Setting interrupt state failed %d", r);
--
2.13.6
- [Qemu-devel] [PULL 00/46] First batch of s390x patches for 2.12, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 02/46] pc-bios/s390-ccw: zero out bss section, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 01/46] s390x/migration: use zero flag parameter,
Cornelia Huck <=
- [Qemu-devel] [PULL 03/46] pc-bios/s390-ccw.img: update image, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 04/46] s390x: introduce 2.12 compat machine, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 05/46] target/s390x: nuke DPRINTF in helper.c, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 06/46] s390x/tcg: introduce and use s390_program_interrupt(), Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 07/46] s390x/tcg: get rid of runtime_exception(), Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 08/46] s390x/tcg: rip out dead tpi code, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 10/46] s390x/pci: pass the retaddr to all PCI instructions, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 09/46] s390x/ioinst: pass the retaddr to all IO instructions, Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 11/46] s390x/diag: pass the retaddr into handle_diag_308(), Cornelia Huck, 2017/12/14
- [Qemu-devel] [PULL 12/46] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG), Cornelia Huck, 2017/12/14