1. 16 Jan, 2013 2 commits
  2. 15 Jan, 2013 2 commits
  3. 19 Dec, 2012 6 commits
  4. 17 Dec, 2012 1 commit
  5. 14 Dec, 2012 2 commits
  6. 11 Dec, 2012 1 commit
    • Christian Borntraeger's avatar
      Support default block interfaces per QEMUMachine · 2d0d2837
      Christian Borntraeger authored
      
      
      There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a
      default/standard interface to their block devices / drives. Therefore,
      this patch introduces a new field default_block_type per QEMUMachine
      struct. The prior use_scsi field becomes thereby obsolete and is
      replaced through .default_block_type = IF_SCSI.
      
      This patch also changes the default for s390x to IF_VIRTIO and
      removes an early hack that converts IF_IDE drives.
      Other parties have already claimed interest (e.g. IF_SD for exynos)
      
      To create a sane default, for machines that dont specify a
      default_block_type, this patch makes IF_IDE = 0 and IF_NONE = 1.
      I checked all users of IF_NONE (blockdev.c and ww/device-hotplug.c)
      as well as IF_IDE and it seems that it is ok to change the defines -
      in other words, I found no obvious (to me) assumption in the code
      regarding IF_NONE==0. IF_NONE is only set if there is an
      explicit if=none. Without if=* the interface becomes IF_DEFAULT.
      
      I would suggest to have some additional care, e.g. by letting
      this patch sit some days in the block tree.
      
      Based on an initial patch from Einar Lueck <elelueck@de.ibm.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      CC: Igor Mitsyanko <i.mitsyanko@samsung.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
      Acked-by: default avatarIgor Mitsyanko <i.mitsyanko@samsung.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      2d0d2837
  7. 31 Oct, 2012 2 commits
  8. 29 Oct, 2012 2 commits
    • David Gibson's avatar
      pseries: Implement qemu initiated shutdowns using EPOW events · 74d042e5
      David Gibson authored
      
      
      At present, using 'system_powerdown' from the monitor or otherwise
      instructing qemu to (cleanly) shut down a pseries guest will not work,
      because we did not have a method of signalling the shutdown request to the
      guest.
      
      PAPR does include a usable mechanism for this, though it is rather more
      involved than the equivalent on x86.  This involves sending an EPOW
      (Environmental and POwer Warning) event through the PAPR event and error
      logging mechanism, which also has a number of other functions.
      
      This patch implements just enough of the event/error logging functionality
      to be able to send a shutdown event to the guest.  At least with modern
      guest kernels and a userspace that is up and running, this means that
      system_powerdown from the qemu monitor should now work correctly on pseries
      guests.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      74d042e5
    • zhlcindy@gmail.com's avatar
      Add USB option in machine options · 094b287f
      zhlcindy@gmail.com authored
      
      
      When -usb option is used, global varible usb_enabled is set.
      And all the plaform will create one USB controller according
      to this variable. In fact, global varibles make code hard
      to read.
      
      So this patch is to remove global variable usb_enabled and
      add USB option in machine options. All the plaforms will get
      USB option value from machine options.
      
      USB option of machine options will be set either by:
        * -usb
        * -machine type=pseries,usb=on
      
      Both these ways can work now. They both set USB option in
      machine options. In the future, the first way will be removed.
      Signed-off-by: default avatarLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Acked-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      094b287f
  9. 23 Oct, 2012 1 commit
    • Avi Kivity's avatar
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity authored
      
      
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  10. 20 Oct, 2012 1 commit
    • Eduardo Habkost's avatar
      create struct for machine initialization arguments · 5f072e1f
      Eduardo Habkost authored
      
      
      This should help us to:
      - More easily add or remove machine initialization arguments without
        having to change every single machine init function;
      - More easily make mechanical changes involving the machine init
        functions in the future;
      - Let machine initialization forward the init arguments to other
        functions more easily.
      
      This change was half-mechanical process: first the struct was added with
      the local ram_size, boot_device, kernel_*, initrd_*, and cpu_model local
      variable initialization to all functions. Then the compiler helped me
      locate the local variables that are unused, so they could be removed.
      Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
      5f072e1f
  11. 06 Oct, 2012 2 commits
  12. 05 Oct, 2012 1 commit
    • David Gibson's avatar
      pseries: Don't test for MSR_PR for hypercalls under KVM · efcb9383
      David Gibson authored
      
      
      PAPR hypercalls should only be invoked from the guest kernel, not guest
      user programs, that is, with MSR[PR]=0.  Currently we check this in
      spapr_hypercall, returning H_PRIVILEGE if MSR[PR]=1.
      
      However, under KVM the state of MSR[PR] is already checked by the host
      kernel before passing the hypercall to qemu, making this check redundant.
      Worse, however, we don't generally synchronize KVM and qemu state on the
      hypercall path, meaning that qemu could incorrectly reject a hypercall
      because it has a stale MSR value.
      
      This patch fixes the problem by moving the privilege test exclusively to
      the TCG hypercall path.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      CC: qemu-stable@nongnu.org
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      efcb9383
  13. 04 Oct, 2012 5 commits
    • David Gibson's avatar
      pseries: Set hash table size based on RAM size · 382be75d
      David Gibson authored
      
      
      Currently the pseries machine code always attempts to set the size of the
      guests's hash page table to 16MB.  However, because of the way the POWER
      MMU works, a suitable hash page table size should really depend on memory
      size.  16MB will be excessive for guests with <1GB and RAM, and may not be
      enough for guests with >2GB of RAM (depending on guest page size and
      other factors).
      
      The usual given rule of thumb is that the hash table should be 1/64 of
      the size of memory, but in fact the Linux guests we are aiming at don't
      really need that much.  This patch, therefore, changes the hash table
      allocation code to aim for 1/128 of the size of RAM (rounding up).  When
      using KVM, this size may still be adjusted by the host kernel if it is
      unable to allocate a suitable (contiguous) table.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      382be75d
    • David Gibson's avatar
      pseries: Remove XICS irq type enum type · ff9d2afa
      David Gibson authored
      
      
      Currently the XICS interrupt controller emulation uses a custom enum to
      specify whether a given interrupt is level-sensitive or message-triggered.
      This enum makes life awkward for saving the state, and isn't particularly
      useful since there are only two possibilities.  This patch replaces the
      enum with a simple bool.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      ff9d2afa
    • David Gibson's avatar
      pseries: Add support for new KVM hash table control call · 7f763a5d
      David Gibson authored
      
      
      This adds support for then new "reset htab" ioctl which allows qemu
      to properly cleanup the MMU hash table when the guest is reset. With
      the corresponding kernel support, reset of a guest now works properly.
      
      This also paves the way for indicating a different size hash table
      to the kernel and for the kernel to be able to impose limits on
      the requested size.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      7f763a5d
    • David Gibson's avatar
      pseries: Use new method to correct reset sequence · c8787ad4
      David Gibson authored
      
      
      A number of things need to occur during reset of the PAPR
      paravirtualized platform in a specific order.  For example, the hash
      table needs to be cleared before the CPUs are reset, so that they
      initialize their register state correctly, and the CPUs need to have
      their main reset called before we set up the entry point state on the
      boot cpu.  We also need to have the main qdev reset happen before the
      creation and installation of the device tree for the new boot, because
      we need the state of the devices settled to correctly construct the
      device tree.
      
      We currently do the pseries once-per-reset initializations done from a
      reset handler.  However we can't adequately control when this handler
      is called during the reset - in particular we can't guarantee it
      happens after all the qdev resets (since qdevs might be registered
      after the machine init function has executed).
      
      This patch uses the new QEMUMachine reset method to to fix this
      problem, ensuring the various order dependent reset steps happen in
      the correct order.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarAndreas Färber <afaerber@suse.de>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      c8787ad4
    • David Gibson's avatar
      pseries: Fix and cleanup CPU initialization and reset · 048706d9
      David Gibson authored
      
      
      The current pseries machine init function iterates over the CPUs at several
      points, doing various bits of initialization.  This is messy; these can
      and should be merged into a single iteration doing all the necessary per
      cpu initialization.  Worse, some of these initializations were setting up
      state which should be set on every reset, not just at machine init time.
      A few of the initializations simply weren't necessary at all.
      
      This patch, therefore, moves those things that need to be to the
      per-cpu reset handler, and combines the remainder into two loops over
      the cpus (which also creates them).  The second loop is for setting up
      hash table information, and will be removed in a subsequent patch also
      making other fixes to the hash table setup.
      
      This exposes a bug in our start-cpu RTAS routine (called by the guest to
      start up CPUs other than CPU0) under kvm.  Previously, this function did
      not make a call to ensure that it's changes to the new cpu's state were
      pushed into KVM in-kernel state.  We sort-of got away with this because
      some of the initializations had already placed the secondary CPUs into the
      right starting state for the sorts of Linux guests we've been running.
      
      Nonetheless the start-cpu RTAS call's behaviour was not correct and could
      easily have been broken by guest changes.  This patch also fixes it.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarAndreas Färber <afaerber@suse.de>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      048706d9
  14. 22 Aug, 2012 2 commits
  15. 16 Aug, 2012 1 commit
    • David Gibson's avatar
      pseries: Instantiate USB interface when required · 35139a59
      David Gibson authored
      
      
      The pseries machine already supports the -vga std option, creating a
      graphics adapter.  However, this is not very useful without being able to
      add a keyboard and mouse as well.  This patch addresses this by adding
      a USB interface when requested, and automatically adding a USB keyboard
      and mouse when VGA is enabled.
      
      This is a stop gap measure to get usable graphics mode on pseries while
      waiting for Li Zhang's rework of USB options to go in after 1.2.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      35139a59
  16. 15 Aug, 2012 9 commits