qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 485dd6: s390x/css: copy CCW format bit from O


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 485dd6: s390x/css: copy CCW format bit from ORB to SCSW
Date: Wed, 20 Jul 2016 14:00:04 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 485dd69088b6ff6cf1c1b6b2c8157c1c9846992a
      
https://github.com/qemu/qemu/commit/485dd69088b6ff6cf1c1b6b2c8157c1c9846992a
  Author: Sascha Silbe <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/s390x/css.c

  Log Message:
  -----------
  s390x/css: copy CCW format bit from ORB to SCSW

The CCW Format (F) flag of the Subchannel-Status Word (SCSW) indicates
the format of the CCWs "associated with an I/O operation", i.e. the
value of CCW-Format Control (F) bit of the Operation-Request Block
(ORB).

Copy the CCW format bit from the ORB to the SCSW so we correctly
indicate the format of the CCWs to the guest.

Signed-off-by: Sascha Silbe <address@hidden>
Reviewed-by: Halil Pasic <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 727a0424dd77a2c9176d63e7b92d017ee3e8b761
      
https://github.com/qemu/qemu/commit/727a0424dd77a2c9176d63e7b92d017ee3e8b761
  Author: Sascha Silbe <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/s390x/css.c

  Log Message:
  -----------
  s390x/css: sch_handle_start_func() handles resume, too

It's not obvious from the code flow that sch_handle_start_func() gets
called for rsch. Add some comments explaining this.

Signed-off-by: Sascha Silbe <address@hidden>
Reviewed-by: Halil Pasic <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 2a79eb1a616a07b0e8c41430f03af254fefe219d
      
https://github.com/qemu/qemu/commit/2a79eb1a616a07b0e8c41430f03af254fefe219d
  Author: Cornelia Huck <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/s390x/css-bridge.c
    M hw/s390x/s390-virtio-ccw.c
    M include/hw/s390x/css-bridge.h

  Log Message:
  -----------
  s390x/css: provide a dev_path for css devices

We need to implement the get_dev_path method for the css bus, or
else we might end up with two different devices having the same
qdev_path.

This was noticed when adding two scsi_hd controllers: The SCSIBus
code will produce a non-unique dev_path for vmstate usage if the
parent bus does not provide the get_dev_path method.

We simply use the device's bus id, as this is unique and we won't
have any deeper hierarchy from a channel subsystem perspective
anyway.

Note that we need to disable this for older machine versions,
as this changes the migration format.

Reported-by: Marc Hartmayer <address@hidden>
Reviewed-by: Halil Pasic <address@hidden>
Reviewed-by: Sascha Silbe <address@hidden>
Tested-by: Marc Hartmayer <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 709787ee997f0a0ccab78e0edaf10d48929151ee
      
https://github.com/qemu/qemu/commit/709787ee997f0a0ccab78e0edaf10d48929151ee
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Provide TCG_PHYS_ADDR_BITS

Provide a constant for the number of address bits supported under TCG.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Suggested-by: Eduardo Habkost <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: af45907a132857cfd47acc998bf5f7c26cd13071
      
https://github.com/qemu/qemu/commit/af45907a132857cfd47acc998bf5f7c26cd13071
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Allow physical address bits to be set

Currently QEMU sets the x86 number of physical address bits to the
magic number 40.  This is only correct on some small AMD systems;
Intel systems tend to have 36, 39, 46 bits, and large AMD systems
tend to have 48.

Having the value different from your actual hardware is detectable
by the guest and in principal can cause problems;
The current limit of 40 stops TB VMs being created by those lucky
enough to have that much.

This patch lets you set the physical bits by a cpu property but
defaults to the same 40bits which matches TCGs setup.

I've removed the ancient warning about the 42 bit limit in exec.c;
I can't find that limit in there and no one else seems to know where
it is.

We use a magic value of 0 as the property default so that we can
later distinguish between the default and a user set value.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 112dad69d723a68205f255dd46d78871b5c5a8ca
      
https://github.com/qemu/qemu/commit/112dad69d723a68205f255dd46d78871b5c5a8ca
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386: Mask mtrr mask based on CPU physical address limits

The CPU GPs if we try and set a bit in a variable MTRR mask above
the limit of physical address bits on the host.  We hit this
when loading a migration from a host with a larger physical
address limit than our destination (e.g. a Xeon->i7 of same
generation) but previously used to get away with it
until 48e1a45 started checking that msr writes actually worked.

It seems in our case the GP probably comes from KVM emulating
that GP.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: fcc35e7ccaed771790940524f3b0eef7aebfc9b1
      
https://github.com/qemu/qemu/commit/fcc35e7ccaed771790940524f3b0eef7aebfc9b1
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M include/hw/i386/pc.h
    M target-i386/cpu.c
    M target-i386/cpu.h
    M target-i386/kvm.c

  Log Message:
  -----------
  target-i386: Fill high bits of mtrr mask

Fill the bits between 51..number-of-physical-address-bits in the
MTRR_PHYSMASKn variable range mtrr masks so that they're consistent
in the migration stream irrespective of the physical address space
of the source VM in a migration.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Suggested-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: d9c84f196970f78d4b55ab87e03cbcad7c65f86f
      
https://github.com/qemu/qemu/commit/d9c84f196970f78d4b55ab87e03cbcad7c65f86f
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Use uint32_t for X86CPU.apic_id

Redo 9886e834 (target-i386: Require APIC ID to be explicitly set before
CPU realize) in another way that doesn't use int64_t to detect
if apic-id property has been set.

Use the fact that 0xFFFFFFFF is the broadcast
value that a CPU can't have and set default
uint32_t apic_id to it instead of using int64_t.

Later uint32_t apic_id will be used to drop custom
property setter/getter in favor of static property.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 9f3aab58539b4cc716e42e772be8116dc2e7d159
      
https://github.com/qemu/qemu/commit/9f3aab58539b4cc716e42e772be8116dc2e7d159
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M include/hw/i386/topology.h

  Log Message:
  -----------
  pc: Add x86_topo_ids_from_apicid()

It's reverse of apicid_from_topo_ids() and will be used in follow up
patches to fill in data structures for query-hotpluggable-cpus and
for user friendly error reporting.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 11f6fee576680a2d482123535da920f8ceb33eb5
      
https://github.com/qemu/qemu/commit/11f6fee576680a2d482123535da920f8ceb33eb5
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Set physical address bits based on host

Add the host-phys-bits boolean property, if true, take phys-bits
from the hosts physical bits value, overriding either the default
or the user specified value.

We can also use the value we read from the host to check the users
explicitly set value and warn them if it doesn't match.

Note:
   a) We only read the hosts value in KVM mode (because on non-x86
      we get an abort if we try)
   b) We don't warn about trying to use host-phys-bits in TCG mode,
      we just fall back to the TCG default.  This allows the machine
      type to set the host-phys-bits flag if it wants and then to
      work in both TCG and KVM.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 7baef5cfea3d2271442fee602eb0b0c872b54b8e
      
https://github.com/qemu/qemu/commit/7baef5cfea3d2271442fee602eb0b0c872b54b8e
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Extract CPU lookup into a separate function

It will be reused in the next patch at pre_plug time

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4ec60c76d5ab513e375f17b043d2b9cb849adf6c
      
https://github.com/qemu/qemu/commit/4ec60c76d5ab513e375f17b043d2b9cb849adf6c
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c
    M target-i386/cpu.c

  Log Message:
  -----------
  pc: cpu: Consolidate apic-id validity checks in pc_cpu_pre_plug()

Machine code knows about all possible APIC IDs so use that
instead of hack which does O(n^2) complexity duplicate
checks, interating over global CPUs list.
As result duplicate check is done only once with O(log n) complexity.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 2da00e3176abac34ca7a6aab1f5bbb94a0d03fc5
      
https://github.com/qemu/qemu/commit/2da00e3176abac34ca7a6aab1f5bbb94a0d03fc5
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Replace custom apic-id setter/getter with static property

Custom apic-id setter/getter doesn't do any property specific
checks anymore, so clean it up and use more compact static
property DEFINE_PROP_UINT32 instead.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: d89c2b8b98e097b9cad5104b0f178bde1cfa011b
      
https://github.com/qemu/qemu/commit/d89c2b8b98e097b9cad5104b0f178bde1cfa011b
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Add socket/core/thread properties to X86CPU

These properties will be used by as address where to plug
CPU with help -device/device_add commands.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: c2f193b538032accb9db504998bf2ea7c0ef65af
      
https://github.com/qemu/qemu/commit/c2f193b538032accb9db504998bf2ea7c0ef65af
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c
    M target-i386/cpu.h

  Log Message:
  -----------
  target-i386: Add support for UMIP and RDPID CPUID bits

These are both stored in CPUID[EAX=7,EBX=0].ECX.  KVM is going to
be able to emulate both (albeit with a performance loss in the case
of RDPID, which therefore will be in KVM_GET_EMULATED_CPUID rather
than KVM_GET_SUPPORTED_CPUID).

It's also possible to implement both in TCG, but this is for 2.8.

Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 6816b1b3811e839540df22855d975b6d76ae438b
      
https://github.com/qemu/qemu/commit/6816b1b3811e839540df22855d975b6d76ae438b
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: cpu: Do not ignore error and fix apic parent

object_property_add_child() silently fails with error that it can't
create duplicate propery 'apic' as we already have 'apic' property
registered for 'apic' feature. As result generic device_realize puts
apic into unattached container.

As it's programming error, abort if name collision happens in future
and fix property name for apic_state to 'lapic', this way apic is
a child of cpu instance.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 67e55caa6dcb91c80428cee6fe463f8dd8a755ab
      
https://github.com/qemu/qemu/commit/67e55caa6dcb91c80428cee6fe463f8dd8a755ab
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Fix apic object leak when CPU is deleted

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e8f7b83e886361e4b16d46936f72d46bcf8fcb5b
      
https://github.com/qemu/qemu/commit/e8f7b83e886361e4b16d46936f72d46bcf8fcb5b
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Set APIC ID based on socket/core/thread ids if it's not been set yet

CPU added with device_add help won't have APIC ID set,
so set it according to socket/core/thread ids provided
with device_add command.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: ba157b696c4a82234ef1b43e98a7c74455538263
      
https://github.com/qemu/qemu/commit/ba157b696c4a82234ef1b43e98a7c74455538263
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Delay setting number of boot CPUs to machine_done time

Currently present CPUs counter in CMOS only contains
smp_cpus (i.e. initial CPUs specified with -smp X) and
doesn't account for CPUs created with -device.
If VM is started with additional CPUs added with
 -device, it will hang in BIOS waiting for condition
   smp_cpus == counted_cpus
forever as counted_cpus will include -device CPUs as well
and be more than smp_cpus.

Make present CPUs counter in CMOS to count all CPUs
(initial and coldplugged with -device) by delaying
it to machine done time when it possible to count
CPUs added with -device.

Signed-off-by: Igor Mammedov <address@hidden>


  Commit: a44a49dbf2eb8b9b430711b152663678c15f689c
      
https://github.com/qemu/qemu/commit/a44a49dbf2eb8b9b430711b152663678c15f689c
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Register created initial and hotpluged CPUs in one place pc_cpu_plug()

Consolidate possible_cpus array management in pc_cpu_plug() for
smp_cpus, coldplugged with -device and hotplugged with
device_add.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 73360e27850b213327011f7e22e03865b8c0dd5b
      
https://github.com/qemu/qemu/commit/73360e27850b213327011f7e22e03865b8c0dd5b
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Forbid BSP removal

Boot CPU is assumed to always present in QEMU code, so
untile that assumptions are gone, deny removal request,
In another words QEMU won't support BSP hot-unplug.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4da7faaeb0c7dd3f7f233165d336c878f78fd1eb
      
https://github.com/qemu/qemu/commit/4da7faaeb0c7dd3f7f233165d336c878f78fd1eb
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Enforce adding CPUs contiguously and removing them in opposite order

It will still allow us to use cpu_index as migration instance_id
since when CPUs are added contiguously (from the first to the last)
and removed in opposite order, cpu_index stays stable and it's
reproducible on destination side.

While there is work in progress to support migration when there
are holes in cpu_index range resulting from out-of-order plug or
unplug, this patch is intended as an interim solution until
cpu_index usage is cleaned up.

As result of this patch it would be possible to plug/unplug CPUs,
but in limited order that doesn't break migration.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: edd1211194cd71afd78daf148c46801937ec11f5
      
https://github.com/qemu/qemu/commit/edd1211194cd71afd78daf148c46801937ec11f5
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  pc: cpu: Allow device_add to be used with x86 cpu

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4d952914a03548b863c3c0af191d7e2af482f09e
      
https://github.com/qemu/qemu/commit/4d952914a03548b863c3c0af191d7e2af482f09e
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c
    M qmp-commands.hx

  Log Message:
  -----------
  pc: Implement query-hotpluggable-cpus callback

it returns a list of present/possible to hotplug CPU
objects with a list of properties to use with
device_add.

in PC case returned list would looks like:
-> { "execute": "query-hotpluggable-cpus" }
<- {"return": [
     {
  "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
  "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
     },
     {
  "qom-path": "/machine/unattached/device[0]",
  "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
  "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
     }
   ]}

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 889211b18b8d0acc814fbbe01b986f07b229a8c9
      
https://github.com/qemu/qemu/commit/889211b18b8d0acc814fbbe01b986f07b229a8c9
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/intc/apic.c
    M hw/intc/apic_common.c
    M include/hw/i386/apic_internal.h

  Log Message:
  -----------
  apic: move MAX_APICS check to 'apic' class

MAX_APICS is only used by child 'apic' class and not
by its parent TYPE_APIC_COMMON or any other derived
class.

Move check into end user 'apic' class so it won't
get in the way of other APIC implementations
if they support more then MAX_APICS.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Radim Krčmář <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 1dfe3282cf851dce186ab15b07225e5d8588b63f
      
https://github.com/qemu/qemu/commit/1dfe3282cf851dce186ab15b07225e5d8588b63f
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/intc/apic.c
    M include/hw/i386/apic_internal.h

  Log Message:
  -----------
  apic: Drop APICCommonState.idx and use APIC ID as index in local_apics[]

local_apics[] is sized to contain all APIC ID supported in xAPIC mode,
so use APIC ID as index in it instead of constantly increasing counter idx.

Fixes error "apic initialization failed" when a CPU hotplugged and
unplugged more times than there are free slots in local_apics[].

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Radim Krčmář <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 365aa1131fa61815eb1d672df6ba451bfe7f2cea
      
https://github.com/qemu/qemu/commit/365aa1131fa61815eb1d672df6ba451bfe7f2cea
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/kvm/apic.c

  Log Message:
  -----------
  apic: kvm-apic: Fix crash due to access to freed memory region

kvm-apic.io_memory memory region had its parent set to NULL at
memory_region_init_io() time, so it ended up as a child in
 /unattached contaner.
As result when kvm-apic instance was deleted, the child property
 /unattached/kvm-apic-msi[XXX] contained a reference to
kvm-apic.io_memory address which was freed as part of kvm-apic.

Do the same as 'apic' and make kvm-apic instance the owner
of the memory region so that it won't end up in /unattached
and gets cleanly released along with related kvm-apic instance.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 9c156f9de52b75510d3951dfede2cf96773b6626
      
https://github.com/qemu/qemu/commit/9c156f9de52b75510d3951dfede2cf96773b6626
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/kvm/apic.c
    M hw/intc/apic.c
    M hw/intc/apic_common.c
    M include/hw/i386/apic_internal.h

  Log Message:
  -----------
  (kvm)apic: Add unrealize callbacks

Callbacks will do necessary cleanups before APIC device is deleted

Signed-off-by: Chen Fan <address@hidden>
Signed-off-by: Gu Zheng <address@hidden>
Signed-off-by: Zhu Guihua <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: f6e984443f1634eee8d6876a7cce039b976c95e0
      
https://github.com/qemu/qemu/commit/f6e984443f1634eee8d6876a7cce039b976c95e0
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/intc/apic_common.c
    M include/hw/i386/apic_internal.h
    M include/hw/i386/pc.h

  Log Message:
  -----------
  apic: Use apic_id as apic's migration instance_id

instance_id is generated by last_used_id + 1 for a given device type
so for QEMU with 3 CPUs instance_id for APICs is a seti of [0, 1, 2]
When CPU in the middle is hot-removed and migration started
APICs with instance_ids 0 and 2 are transferred in migration stream.
However target starts with 2 CPUs and APICs' instance_ids are
generated from scratch [0, 1] hence migration fails with error
  Unknown savevm section or instance 'apic' 2

Fix issue by manually registering APIC's vmsd with apic_id as
instance_id, in this case instance_id on target will always
match instance_id on source as apic_id is the same for a given
cpu instance.

Reported-by: Bharata B Rao <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: c884776e9dc947105827bd6c22192863f97267d2
      
https://github.com/qemu/qemu/commit/c884776e9dc947105827bd6c22192863f97267d2
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M target-i386/cpu.c

  Log Message:
  -----------
  target-i386: Add x86_cpu_unrealizefn()

First remove VCPU from exec loop and only then remove lapic.

Signed-off-by: Chen Fan <address@hidden>
Signed-off-by: Gu Zheng <address@hidden>
Signed-off-by: Zhu Guihua <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 8fe6374e8e0c8dacb85e9e97897291541dd61be6
      
https://github.com/qemu/qemu/commit/8fe6374e8e0c8dacb85e9e97897291541dd61be6
  Author: Igor Mammedov <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Make device_del CPU work for x86 CPUs

ACPI subsystem already has all logic in place the only
thing left to eject CPU is destroy it and ammend
present CPUs counter in CMOS, do so.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 3b55fbdcb048bf82e82c29b555d0918b83fc40a5
      
https://github.com/qemu/qemu/commit/3b55fbdcb048bf82e82c29b555d0918b83fc40a5
  Author: Peter Maydell <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/s390x/css-bridge.c
    M hw/s390x/css.c
    M hw/s390x/s390-virtio-ccw.c
    M include/hw/s390x/css-bridge.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160720' into staging

Fixes for s390x in the css area.

# gpg: Signature made Wed 20 Jul 2016 15:12:43 BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <address@hidden>"
# gpg:                 aka "Cornelia Huck <address@hidden>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20160720:
  s390x/css: provide a dev_path for css devices
  s390x/css: sch_handle_start_func() handles resume, too
  s390x/css: copy CCW format bit from ORB to SCSW

Signed-off-by: Peter Maydell <address@hidden>


  Commit: e66b05e9ca471715388182613217503160ed7a4d
      
https://github.com/qemu/qemu/commit/e66b05e9ca471715388182613217503160ed7a4d
  Author: Peter Maydell <address@hidden>
  Date:   2016-07-20 (Wed, 20 Jul 2016)

  Changed paths:
    M hw/i386/kvm/apic.c
    M hw/i386/pc.c
    M hw/intc/apic.c
    M hw/intc/apic_common.c
    M include/hw/i386/apic_internal.h
    M include/hw/i386/pc.h
    M include/hw/i386/topology.h
    M qmp-commands.hx
    M target-i386/cpu.c
    M target-i386/cpu.h
    M target-i386/kvm.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into 
staging

x86 queue, 2016-07-20

# gpg: Signature made Wed 20 Jul 2016 16:07:38 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-pull-request: (28 commits)
  pc: Make device_del CPU work for x86 CPUs
  target-i386: Add x86_cpu_unrealizefn()
  apic: Use apic_id as apic's migration instance_id
  (kvm)apic: Add unrealize callbacks
  apic: kvm-apic: Fix crash due to access to freed memory region
  apic: Drop APICCommonState.idx and use APIC ID as index in local_apics[]
  apic: move MAX_APICS check to 'apic' class
  pc: Implement query-hotpluggable-cpus callback
  pc: cpu: Allow device_add to be used with x86 cpu
  pc: Enforce adding CPUs contiguously and removing them in opposite order
  pc: Forbid BSP removal
  pc: Register created initial and hotpluged CPUs in one place pc_cpu_plug()
  pc: Delay setting number of boot CPUs to machine_done time
  pc: Set APIC ID based on socket/core/thread ids if it's not been set yet
  target-i386: Fix apic object leak when CPU is deleted
  target-i386: cpu: Do not ignore error and fix apic parent
  target-i386: Add support for UMIP and RDPID CPUID bits
  target-i386: Add socket/core/thread properties to X86CPU
  target-i386: Replace custom apic-id setter/getter with static property
  pc: cpu: Consolidate apic-id validity checks in pc_cpu_pre_plug()
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/6a426eb27ec1...e66b05e9ca47

reply via email to

[Prev in Thread] Current Thread [Next in Thread]