1. 09 2月, 2018 1 次提交
  2. 27 10月, 2017 1 次提交
  3. 19 7月, 2017 2 次提交
  4. 15 7月, 2017 2 次提交
  5. 20 6月, 2017 1 次提交
  6. 02 6月, 2017 1 次提交
  7. 23 5月, 2017 2 次提交
    • E
      shutdown: Add source information to SHUTDOWN and RESET · cf83f140
      Eric Blake 提交于
      Time to wire up all the call sites that request a shutdown or
      reset to use the enum added in the previous patch.
      
      It would have been less churn to keep the common case with no
      arguments as meaning guest-triggered, and only modified the
      host-triggered code paths, via a wrapper function, but then we'd
      still have to audit that I didn't miss any host-triggered spots;
      changing the signature forces us to double-check that I correctly
      categorized all callers.
      
      Since command line options can change whether a guest reset request
      causes an actual reset vs. a shutdown, it's easy to also add the
      information to reset requests.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts]
      Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part]
      Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x parts]
      Message-Id: <20170515214114.15442-5-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      cf83f140
    • E
      shutdown: Prepare for use of an enum in reset/shutdown_request · aedbe192
      Eric Blake 提交于
      We want to track why a guest was shutdown; in particular, being able
      to tell the difference between a guest request (such as ACPI request)
      and host request (such as SIGINT) will prove useful to libvirt.
      Since all requests eventually end up changing shutdown_requested in
      vl.c, the logical change is to make that value track the reason,
      rather than its current 0/1 contents.
      
      Since command-line options control whether a reset request is turned
      into a shutdown request instead, the same treatment is given to
      reset_requested.
      
      This patch adds an internal enum ShutdownCause that describes reasons
      that a shutdown can be requested, and changes qemu_system_reset() to
      pass the reason through, although for now nothing is actually changed
      with regards to what gets reported.  The enum could be exported via
      QAPI at a later date, if deemed necessary, but for now, there has not
      been a request to expose that much detail to end clients.
      
      For the most part, we turn 0 into SHUTDOWN_CAUSE_NONE, and 1 into
      SHUTDOWN_CAUSE_HOST_ERROR; the only specific case where we have enough
      information right now to use a different value is when we are reacting
      to a host signal.  It will take a further patch to edit all call-sites
      that can trigger a reset or shutdown request to properly pass in any
      other reasons; this patch includes TODOs to point such places out.
      
      qemu_system_reset() trades its 'bool report' parameter for a
      'ShutdownCause reason', with all non-zero values having the same
      effect; this lets us get rid of the weird #defines for VMRESET_*
      as synonyms for bools.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20170515214114.15442-3-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      aedbe192
  8. 26 4月, 2017 1 次提交
  9. 22 4月, 2017 1 次提交
    • P
      xen: use libxendevice model to restrict operations · 1c599472
      Paul Durrant 提交于
      This patch adds a command-line option (-xen-domid-restrict) which will
      use the new libxendevicemodel API to restrict devicemodel [1] operations
      to the specified domid. (Such operations are not applicable to the xenpv
      machine type).
      
      This patch also adds a tracepoint to allow successful enabling of the
      restriction to be monitored.
      
      [1] I.e. operations issued by libxendevicemodel. Operation issued by other
          xen libraries (e.g. libxenforeignmemory) are currently still unrestricted
          but this will be rectified by subsequent patches.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
      1c599472
  10. 23 3月, 2017 3 次提交
  11. 01 2月, 2017 1 次提交
  12. 29 11月, 2016 3 次提交
  13. 23 11月, 2016 1 次提交
  14. 09 11月, 2016 1 次提交
  15. 13 8月, 2016 1 次提交
  16. 03 8月, 2016 1 次提交
  17. 04 7月, 2016 1 次提交
  18. 17 6月, 2016 1 次提交
  19. 07 6月, 2016 1 次提交
  20. 29 5月, 2016 1 次提交
  21. 19 5月, 2016 2 次提交
    • P
      hw: remove pio_addr_t · 89a80e74
      Paolo Bonzini 提交于
      pio_addr_t is almost unused, because these days I/O ports are simply
      accessed through the address space.  cpu_{in,out}[bwl] themselves are
      almost unused; monitor.c and xen-hvm.c could use address_space_read/write
      directly, since they have an integer size at hand.  This leaves qtest as
      the only user of those functions.
      
      On the other hand even portio_* functions use this type; the only
      interesting use of pio_addr_t thus is include/hw/sysbus.h.  I guess I
      could move it there, but I don't see much benefit in that either.  Using
      uint32_t is enough and avoids the need to include ioport.h everywhere.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      89a80e74
    • P
      33c11879
  22. 10 2月, 2016 4 次提交
  23. 07 2月, 2016 1 次提交
    • S
      fix MSI injection on Xen · 428c3ece
      Stefano Stabellini 提交于
      On Xen MSIs can be remapped into pirqs, which are a type of event
      channels. It's mostly for the benefit of PCI passthrough devices, to
      avoid the overhead of interacting with the emulated lapic.
      
      However remapping interrupts and MSIs is also supported for emulated
      devices, such as the e1000 and virtio-net.
      
      When an interrupt or an MSI is remapped into a pirq, masking and
      unmasking is done by masking and unmasking the event channel. The
      masking bit on the PCI config space or MSI-X table should be ignored,
      but it isn't at the moment.
      
      As a consequence emulated devices which use MSI or MSI-X, such as
      virtio-net, don't work properly (the guest doesn't receive any
      notifications). The mechanism was working properly when xen_apic was
      introduced, but I haven't narrowed down which commit in particular is
      causing the regression.
      
      Fix the issue by ignoring the masking bit for MSI and MSI-X which have
      been remapped into pirqs.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      428c3ece
  24. 29 1月, 2016 1 次提交
    • P
      xen: Clean up includes · 21cbfe5f
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-14-git-send-email-peter.maydell@linaro.org
      21cbfe5f
  25. 27 1月, 2016 3 次提交
    • I
      xen: Switch uses of xc_map_foreign_{pages,bulk} to use libxenforeignmemory API. · e0cb42ae
      Ian Campbell 提交于
      In Xen 4.7 we are refactoring parts libxenctrl into a number of
      separate libraries which will provide backward and forward API and ABI
      compatiblity.
      
      One such library will be libxenforeignmemory which provides access to
      privileged foreign mappings and which will provide an interface
      equivalent to xc_map_foreign_{pages,bulk}.
      
      The new xenforeignmemory_map() function behaves like
      xc_map_foreign_pages() when the err argument is NULL and like
      xc_map_foreign_bulk() when err is non-NULL, which maps into the shim
      here onto checking err == NULL and calling the appropriate old
      function.
      
      Note that xenforeignmemory_map() takes the number of pages before the
      arrays themselves, in order to support potentially future use of
      variable-length-arrays in the prototype (in the future, when Xen's
      baseline toolchain requirements are new enough to ensure VLAs are
      supported).
      
      In preparation for adding support for libxenforeignmemory add support
      to the <=4.0 and <=4.6 compat code in xen_common.h to allow us to
      switch to using the new API. These shims will disappear for versions
      of Xen which include libxenforeignmemory.
      
      Since libxenforeignmemory will have its own handle type but for <= 4.6
      the functionality is provided by using a libxenctrl handle we
      introduce a new global xen_fmem alongside the existing xen_xc. In fact
      we make xen_fmem a pointer to the existing xen_xc, which then works
      correctly with both <=4.0 (xc handle is an int) and <=4.6 (xc handle
      is a pointer). In the latter case xen_fmem is actually a double
      indirect pointer, but it all falls out in the wash.
      
      Unlike libxenctrl libxenforeignmemory has an explicit unmap function,
      rather than just specifying that munmap should be used, so the unmap
      paths are updated to use xenforeignmemory_unmap, which is a shim for
      munmap on these versions of xen. The mappings in xen-hvm.c do not
      appear to be unmapped (which makes sense for a qemu-dm process)
      
      In fb_disconnect this results in a change from simply mmap over the
      existing mapping (with an implicit munmap) to expliclty unmapping with
      xenforeignmemory_unmap and then mapping the required anonymous memory
      in the same hole. I don't think this is a problem since any other
      thread which was racily touching this region would already be running
      the risk of hitting the mapping halfway through the call. If this is
      thought to be a problem then we could consider adding an extra API to
      the libxenforeignmemory interface to replace a foreign mapping with
      anonymous shared memory, but I'd prefer not to.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      e0cb42ae
    • I
      xen: Switch uses of xc_map_foreign_range into xc_map_foreign_pages · 9ed257d1
      Ian Campbell 提交于
      In Xen 4.7 we are refactoring parts libxenctrl into a number of
      separate libraries which will provide backward and forward API and ABI
      compatiblity.
      
      One such library will be libxenforeignmemory which provides access to
      privileged foreign mappings and which will provide an interface
      equivalent to xc_map_foreign_{pages,bulk}.
      
      In preparation for this switch all uses of xc_map_foreign_range to
      xc_map_foreign_pages. This is trivial because size was always
      XC_PAGE_SIZE so the necessary adjustments are trivial:
      
        * Pass &mfn (an array of length 1) instead of mfn. The function
          takes a pointer to const, so there is no possibily of mfn changing
          due to this change.
        * Pass nr_pages=1 instead of size=XC_PAGE_SIZE
      
      There is one wrinkle in xen_console.c:con_initialise() where
      con->ring_ref is an int but can in some code paths (when !xendev->dev)
      be treated as an mfn. I think this is an existing latent truncation
      hazard on platforms where xen_pfn_t is 64-bit and int is 32-bit (e.g.
      amd64, both arm* variants). I'm unsure under what circumstances
      xendev->dev can be NULL or if anything elsewhere ensures the value
      fits into an int. For now I just use a temporary xen_pfn_t to in
      effect upcast the pointer from int* to xen_pfn_t*.
      
      In xenfb.c:common_bind we now explicitly launder the mfn into a
      xen_pfn_t, so it has the correct type to be passed to
      xc_map_foreign_pages and doesn't provoke warnings on 32-bit x86.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      9ed257d1
    • I
      xen: Switch to libxenevtchn interface for compat shims. · a2db2a1e
      Ian Campbell 提交于
      In Xen 4.7 we are refactoring parts libxenctrl into a number of
      separate libraries which will provide backward and forward API and ABI
      compatiblity.
      
      One such library will be libxenevtchn which provides access to event
      channels.
      
      In preparation for this switch the compatibility layer in xen_common.h
      (which support building with older versions of Xen) to use what will
      be the new library API. This means that the evtchn shim will disappear
      for versions of Xen which include libxenevtchn.
      
      To simplify things for the <= 4.0.0 support we wrap the int fd in a
      malloc(sizeof int) such that the handle is always a pointer. This
      leads to less typedef headaches and the need for
      XC_HANDLER_INITIAL_VALUE etc for these interfaces.
      
      Note that this patch does not add any support for actually using
      libxenevtchn, it just adjusts the existing shims.
      
      Note that xc_evtchn_alloc_unbound functionality remains in libxenctrl,
      since that functionality is not exposed by /dev/xen/evtchn.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      a2db2a1e
  26. 15 1月, 2016 2 次提交