1. 10 9月, 2014 5 次提交
  2. 09 9月, 2014 1 次提交
  3. 08 9月, 2014 30 次提交
    • A
      hypervisor property clashes with hypervisor node · 85423d90
      Anton Blanchard 提交于
      dtc fails on a recent QEMU snapshot:
      
      ERROR (name_properties): "name" property in /hypervisor#1 is incorrect ("hypervisor" instead of base node name)
      
      Looking at the device tree we have a hypervisor property:
      
      # lsprop hypervisor
      hypervisor       "kvm"
      
      But we also have a hypervisor node, with a name that doesn't match:
      
      # lsprop hypervisor#1/
      name             "hypervisor"
      compatible       "linux,kvm"
      linux,phandle    7e5eb5d8 (2120136152)
      
      Commit c08ce91d309c (spapr: add uuid/host details to device tree)
      looks to have collided with an earlier patch. Remove the hypervisor
      property.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      85423d90
    • G
      spapr_pci: map the MSI window in each PHB · 8c46f7ec
      Greg Kurz 提交于
      On sPAPR, virtio devices are connected to the PCI bus and use MSI-X.
      Commit cc943c36 has modified MSI-X
      so that writes are made using the bus master address space and follow
      the IOMMU path.
      
      Unfortunately, the IOMMU address space address space does not have an
      MSI window: the notification is silently dropped in unassigned_mem_write
      instead of reaching the guest... The most visible effect is that all
      virtio devices are non-functional on sPAPR since then. :(
      
      This patch does the following:
      1) map the MSI window into the IOMMU address space for each PHB
         - since each PHB instantiates its own IOMMU address space, we
           can safely map the window at a fixed address (SPAPR_PCI_MSI_WINDOW)
         - no real need to keep the MSI window setup in a separate function,
           the spapr_pci_msi_init() code moves to spapr_phb_realize().
      
      2) kill the global MSI window as it is not needed in the end
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      8c46f7ec
    • A
      spapr-vlan: Don't touch last entry in buffer list · 439ce140
      Anton Blanchard 提交于
      The last 8 bytes of the buffer list is defined to contain the number
      of dropped frames. At the moment we use it to store rx entries,
      which trips up ethtool -S:
      
      rx_no_buffer: 9223380832981355136
      
      Fix this by skipping the last buffer list entry.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      439ce140
    • A
      spapr_pci: Fix config space corruption · 32420522
      Alexey Kardashevskiy 提交于
      When disabling MSI/MSIX via "ibm,change-msi" RTAS call, no check was made
      if MSI or MSIX is actually supported and the MSI message was reset
      unconditionally. If this happened on a device which does not support MSI
      (but does support MSIX, otherwise "ibm,change-msi" would not be called),
      this device would have PCIDevice::msi_cap field (MSI capability offset)
      set to zero and writing a vector would actually clear PCI status.
      
      This clears MSI message only if MSI or MSIX is present on a device.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      32420522
    • A
      PPC: Cuda: Use cuda timer to expose tbfreq to guest · b981289c
      Alexander Graf 提交于
      Mac OS X calibrates a number of frequencies on bootup based on reading
      tb values on bootup and comparing them to via cuda timer values.
      
      The only variable we can really steer well (thanks to KVM) is the cuda
      frequency. So let's use that one to fake Mac OS X into believing the
      bus frequency is tbfreq * 4. That way Mac OS X will automatically
      calculate the correct timebase frequency.
      
      With this patch and the patch set I posted earlier I can successfully
      run Mac OS X 10.2, 10.3 and 10.4 guests with -M mac99 on TCG and KVM.
      Suggested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b981289c
    • A
      PPC: Mac: Move tbfreq into local variable · caae6c96
      Alexander Graf 提交于
      We already expose the real CPU's tb frequency to the guest via fw_cfg. Soon
      we will need to also expose it to the MacIO, so let's move it to a variable
      that we can leverage every time we need the frequency.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      caae6c96
    • A
      PPC: mac_nvram: Split NVRAM into OF and OSX parts · 2d9907a3
      Alexander Graf 提交于
      Mac OS X (at least with -M mac99) searches for a valid NVRAM partition
      of a special Apple type. If it can't find that partition in the first
      half of NVRAM, it will look at the second half.
      
      There are a few implications from this. The first is that we need to
      split NVRAM into 2 halves - one for Open Firmware use, the other one for
      Mac OS X. Without this split Mac OS X will just loop endlessly over the
      second half trying to find a partition.
      
      The other implication is that we should provide a specially crafted Mac
      OS X compatible NVRAM partition on the second half that Mac OS X can
      happily use as it sees fit.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      2d9907a3
    • A
      PPC: mac_nvram: Allow 2 and 4 byte accesses · b19eae18
      Alexander Graf 提交于
      The NVRAM in our Core99 machine really supports 2byte and 4byte accesses
      just as well as 1byte accesses. In fact, Mac OS X uses those.
      
      Add support for higher register size granularities.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b19eae18
    • A
      PPC: mac_nvram: Remove unused functions · a8b05037
      Alexander Graf 提交于
      The macio_nvram_read and macio_nvram_write functions are never called,
      just remove them.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a8b05037
    • A
      PPC: mac99: Fix core99 timer frequency · d696760b
      Alexander Graf 提交于
      There is a special timer in the mac99 machine that we recently started
      to emulate. Unfortunately we emulated it in the wrong frequency.
      
      This patch adapts the frequency Mac OS X uses to evaluate results from
      this timer, making calculations it bases off of it work.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d696760b
    • N
      ppc/spapr: Fix MAX_CPUS to 255 · 9674a356
      Nikunj A Dadhania 提交于
      MAX_CPUS 256 is inconsistent with qemu supporting upto 255 cpus. This
      MAX_CPUS number was percolated back to "virsh capabilities" with wrong
      max_cpus.
      Signed-off-by: NNikunj A Dadhania <nikunj@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      9674a356
    • B
      spapr: Locate RTAS and device-tree based on real RMA · b7d1f77a
      Benjamin Herrenschmidt 提交于
      We currently calculate the final RTAS and FDT location based on
      the early estimate of the RMA size, cropped to 256M on KVM since
      we only know the real RMA size at reset time which happens much
      later in the boot process.
      
      This means the FDT and RTAS end up right below 256M while they
      could be much higher, using precious RMA space and limiting
      what the OS bootloader can put there which has proved to be
      a problem with some OSes (such as when using very large initrd's)
      
      Fortunately, we do the actual copy of the device-tree into guest
      memory much later, during reset, late enough to be able to do it
      using the final RMA value, we just need to move the calculation
      to the right place.
      
      However, RTAS is still loaded too early, so we change the code to
      load the tiny blob into qemu memory early on, and then copy it into
      guest memory at reset time. It's small enough that the memory usage
      doesn't matter.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [aik: fixed errors from checkpatch.pl, defined RTAS_MAX_ADDR]
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [agraf: fix compilation on 32bit hosts]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b7d1f77a
    • B
      loader: Add load_image_size() to replace load_image() · ea87616d
      Benjamin Herrenschmidt 提交于
      A subsequent patch to ppc/spapr needs to load the RTAS blob into
      qemu memory rather than target memory (so it can later be copied
      into the right spot at machine reset time).
      
      I would use load_image() but it is marked deprecated because it
      doesn't take a buffer size as argument, so let's add load_image_size()
      that does.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [aik: fixed errors from checkpatch.pl]
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      ea87616d
    • A
      spapr: Fix ibm, associativity for memory nodes · c3b4f589
      Alexey Kardashevskiy 提交于
      We want the associtivity lists of memory and CPU nodes to match but
      memory nodes have incorrect domain#3 which is zero for CPU so they won't
      match.
      
      This clears domain#3 in the list to match CPUs associtivity lists.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c3b4f589
    • A
      spapr: Add a helper for node0_size calculation · b082d65a
      Alexey Kardashevskiy 提交于
      In multiple places there is a node0_size variable calculation
      which assumes that NUMA node #0 and memory node #0 are the same
      things which they are not. Since we are going to change it and
      do not want to change it in multiple places, let's make a helper.
      
      This adds a spapr_node0_size() helper and makes use of it.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b082d65a
    • A
      spapr: Split memory nodes to power-of-two blocks · 6010818c
      Alexey Kardashevskiy 提交于
      Linux kernel expects nodes to have power-of-two size and
      does WARN_ON if this is not the case:
      [    0.041456] WARNING: at drivers/base/memory.c:115
      which is:
      
      ===
      	/* Validate blk_sz is a power of 2 and not less than section size */
      	if ((block_sz & (block_sz - 1)) || (block_sz < MIN_MEMORY_BLOCK_SIZE)) {
              	WARN_ON(1);
      	        block_sz = MIN_MEMORY_BLOCK_SIZE;
      	}
      ===
      
      This splits memory nodes into set of smaller blocks with
      a size which is a power of two. This makes sure the start
      address of every node is aligned to the node size.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      [agraf: squash windows compile fix in]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      6010818c
    • A
      spapr: Refactor spapr_populate_memory() to allow memoryless nodes · 7db8a127
      Alexey Kardashevskiy 提交于
      Current QEMU does not support memoryless NUMA nodes, however
      actual hardware may have them so it makes sense to have a way
      to emulate them in QEMU. This prepares SPAPR for that.
      
      This moves 2 calls of spapr_populate_memory_node() into
      the existing loop over numa nodes so first several nodes may
      have no memory and this still will work.
      
      If there is no numa configuration, the code assumes there is just
      a single node at 0 and it has all the guest memory.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      7db8a127
    • A
      spapr: Use DT memory node rendering helper for other nodes · 81014ac2
      Alexey Kardashevskiy 提交于
      This finishes refactoring by using the spapr_populate_memory_node helper
      for all nodes and removing leftovers from spapr_populate_memory().
      
      This is not a part of the previous patch because the patches look
      nicer apart.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      81014ac2
    • A
      spapr: Move DT memory node rendering to a helper · 26a8c353
      Alexey Kardashevskiy 提交于
      This moves recurring bits of code related to memory@xxx nodes
      creation to a helper.
      
      This makes use of the new helper for node@0.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      26a8c353
    • G
      spapr: fix possible memory leak · a21a7a70
      Gonglei 提交于
      get_boot_devices_list() will malloc memory, spapr_finalize_fdt
      doesn't free it.
      Signed-off-by: NChenliang <chenliang88@huawei.com>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a21a7a70
    • A
      PPC: mac99: Move NVRAM to page boundary when necessary · 261265cc
      Alexander Graf 提交于
      When running KVM we have to adhere to host page boundaries for memory slots.
      Unfortunately the NVRAM on mac99 is a 4k RAM hole inside of an MMIO flash
      area.
      
      So if our host is configured with 64k page size, we can't use the mac99 target
      with KVM. This is a real shame, as this limitation is not really an issue - we
      can easily map NVRAM somewhere else and at least Linux and Mac OS X use it
      at their new location.
      
      So in that emergency case when it's about failing to run at all and moving NVRAM
      to a place it shouldn't be at, choose the latter.
      
      This patch enables -M mac99 with KVM on 64k page size hosts.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      261265cc
    • N
      spapr: add uuid/host details to device tree · ef951443
      Nikunj A Dadhania 提交于
      Useful for identifying the guest/host uniquely within the
      guest. Adding following properties to the guest root node.
      
      vm,uuid - uuid of the guest
      host-model - Host model number
      host-serial - Host machine serial number
      hypervisor type - Tells its "kvm"
      Signed-off-by: NNikunj A Dadhania <nikunj@linux.vnet.ibm.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      ef951443
    • P
      hw/ppc/spapr_hcall.c: Fix typo in function names · 7d0cd464
      Peter Maydell 提交于
      Fix a typo in the names of a couple of functions
      (s/resouce/resource/).
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      7d0cd464
    • N
      ppc: spapr-rtas - implement os-term rtas call · 2e14072f
      Nikunj A Dadhania 提交于
      PAPR compliant guest calls this in absence of kdump. This finally
      reaches the guest and can be handled according to the policies set by
      higher level tools(like taking dump) for further analysis by tools like
      crash.
      
      Linux kernel calls ibm,os-term when extended property of os-term is set.
      This makes sure that a return to the linux kernel is gauranteed.
      Signed-off-by: NNikunj A Dadhania <nikunj@linux.vnet.ibm.com>
      [agraf: reduce RTAS_TOKEN_MAX]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      2e14072f
    • A
      PPC: KVM: Fix g3beige and mac99 when HV is loaded · 277c7a4d
      Alexander Graf 提交于
      On PPC we have 2 different styles of KVM: PR and HV. HV can only virtualize
      sPAPR guests while PR can virtualize everything that's reasonably close to
      the host hardware platform.
      
      As long as only one kernel module (PR or HV) is loaded, the "default" kvm type
      is the module that's loaded. So if your hardware only supports PR mode you can
      easily spawn a Mac VM.
      
      However, if both HV and PR are loaded we default to HV mode. And in that case
      the Mac machines have to explicitly ask for PR mode to get a working VM.
      
      Fix this up by explicitly having the Mac machines ask for PR style KVM. This
      fixes bootup of Mac VMs on systems where bot HV and PR kvm modules are loaded
      for me.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      277c7a4d
    • J
      ide: Add resize callback to ide/core · 01ce352e
      John Snow 提交于
      Currently, if the block device backing the IDE drive is resized,
      the information about the device as cached inside of the IDEState
      structure is not updated, thus when a guest OS re-queries the drive,
      it is unable to see the expanded size.
      
      This patch adds a resize callback that updates the IDENTIFY data
      buffer in order to correct this.
      
      Lastly, a Linux guest as-is cannot resize a libata drive while in-use,
      but it can see the expanded size as part of a bus rescan event.
      This patch also allows guests such as Linux to see the new drive size
      after a soft reboot event, without having to exit the QEMU process.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      01ce352e
    • J
      IDE: Fill the IDENTIFY request consistently · 4bf6637d
      John Snow 提交于
      IDE-HD, IDE-ATAPI and IDE-CFATA all fill the
      identify buffer in slightly different ways,
      this is a relatively minor patch to make them
      uniform, to emphasize that:
      
      (1) We build the s->identify_data cache first, then
      (2) We copy it to s->io_buffer to fulfill the request.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4bf6637d
    • J
      ide: Add wwn support to IDE-ATAPI drive · c5fe97e3
      John Snow 提交于
      Although it is possible to specify the wwn
      property for cdrom devices on the command line,
      the underlying driver fails to relay this information
      to the guest operating system via IDENTIFY.
      
      This is a simple patch to correct that.
      
      See ATA8-ACS, Table 22 parts 5, 6, and 9.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c5fe97e3
    • L
      pflash_cfi01: write flash contents to bdrv on incoming migration · 4c0cfc72
      Laszlo Ersek 提交于
      A drive that backs a pflash device is special:
      - it is very small,
      - its entire contents are kept in a RAMBlock at all times, covering the
        guest-phys address range that provides the guest's view of the emulated
        flash chip.
      
      The pflash device model keeps the drive (the host-side file) and the
      guest-visible flash contents in sync. When migrating the guest, the
      guest-visible flash contents (the RAMBlock) is migrated by default, but on
      the target host, the drive (the host-side file) remains in full sync with
      the RAMBlock only if:
      - the source and target hosts share the storage underlying the pflash
        drive,
      - or the migration requests full or incremental block migration too, which
        then covers all drives.
      
      Due to the special nature of pflash drives, the following scenario makes
      sense as well:
      - no full nor incremental block migration, covering all drives, alongside
        the base migration (justified eg. by shared storage for "normal" (big)
        drives),
      - non-shared storage for pflash drives.
      
      In this case, currently only those portions of the flash drive are updated
      on the target disk that the guest reprograms while running on the target
      host.
      
      In order to restore accord, dump the entire flash contents to the bdrv in
      a post_load() callback.
      
      - The read-only check follows the other call-sites of pflash_update();
      - both "pfl->ro" and pflash_update() reflect / consider the case when
        "pfl->bs" is NULL;
      - the total size of the flash device is calculated as in
        pflash_cfi01_realize().
      
      When using shared storage, or requesting full or incremental block
      migration along with the normal migration, the patch should incur a
      harmless rewrite from the target side.
      
      It is assumed that, on the target host, RAM is loaded ahead of the call to
      pflash_post_load().
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4c0cfc72
    • L
      pflash_cfi01: fixup stale DPRINTF() calls · afeb25f9
      Laszlo Ersek 提交于
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      afeb25f9
  4. 05 9月, 2014 4 次提交