Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: 4ebc33f3f3b6
Choose a base ref
...
head repository: qemu/qemu
compare: 5fcde5f92323
Choose a head ref
  • 11 commits
  • 18 files changed
  • 3 contributors

Commits on May 3, 2023

  1. hw/i386/xen/: move xen-mapcache.c to hw/xen/

    xen-mapcache.c contains common functions which can be used for enabling Xen on
    aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it
    accessible for both aarch64 and x86.
    
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Vikram Garhwal authored and Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    9f268f5 View commit details
    Browse the repository at this point in the history
  2. hw/i386/xen: rearrange xen_hvm_init_pc

    In preparation to moving most of xen-hvm code to an arch-neutral location,
    move non IOREQ references to:
    - xen_get_vmport_regs_pfn
    - xen_suspend_notifier
    - xen_wakeup_notifier
    - xen_ram_init
    
    towards the end of the xen_hvm_init_pc() function.
    
    This is done to keep the common ioreq functions in one place which will be
    moved to new function in next patch in order to make it common to both x86 and
    aarch64 machines.
    
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Vikram Garhwal authored and Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    b5e35f8 View commit details
    Browse the repository at this point in the history
  3. hw/i386/xen/xen-hvm: move x86-specific fields out of XenIOState

    In preparation to moving most of xen-hvm code to an arch-neutral location, move:
    - shared_vmport_page
    - log_for_dirtybit
    - dirty_bitmap
    - suspend
    - wakeup
    
    out of XenIOState struct as these are only used on x86, especially the ones
    related to dirty logging.
    Updated XenIOState can be used for both aarch64 and x86.
    
    Also, remove free_phys_offset as it was unused.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    33f0333 View commit details
    Browse the repository at this point in the history
  4. xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common

    This patch does following:
    1. creates arch_handle_ioreq() and arch_xen_set_memory(). This is done in
        preparation for moving most of xen-hvm code to an arch-neutral location,
        move the x86-specific portion of xen_set_memory to arch_xen_set_memory.
        Also, move handle_vmport_ioreq to arch_handle_ioreq.
    
    2. Pure code movement: move common functions to hw/xen/xen-hvm-common.c
        Extract common functionalities from hw/i386/xen/xen-hvm.c and move them to
        hw/xen/xen-hvm-common.c. These common functions are useful for creating
        an IOREQ server.
    
        xen_hvm_init_pc() contains the architecture independent code for creating
        and mapping a IOREQ server, connecting memory and IO listeners, initializing
        a xen bus and registering backends. Moved this common xen code to a new
        function xen_register_ioreq() which can be used by both x86 and ARM machines.
    
        Following functions are moved to hw/xen/xen-hvm-common.c:
            xen_vcpu_eport(), xen_vcpu_ioreq(), xen_ram_alloc(), xen_set_memory(),
            xen_region_add(), xen_region_del(), xen_io_add(), xen_io_del(),
            xen_device_realize(), xen_device_unrealize(),
            cpu_get_ioreq_from_shared_memory(), cpu_get_ioreq(), do_inp(),
            do_outp(), rw_phys_req_item(), read_phys_req_item(),
            write_phys_req_item(), cpu_ioreq_pio(), cpu_ioreq_move(),
            cpu_ioreq_config(), handle_ioreq(), handle_buffered_iopage(),
            handle_buffered_io(), cpu_handle_ioreq(), xen_main_loop_prepare(),
            xen_hvm_change_state_handler(), xen_exit_notifier(),
            xen_map_ioreq_server(), destroy_hvm_domain() and
            xen_shutdown_fatal_error()
    
    3. Removed static type from below functions:
        1. xen_region_add()
        2. xen_region_del()
        3. xen_io_add()
        4. xen_io_del()
        5. xen_device_realize()
        6. xen_device_unrealize()
        7. xen_hvm_change_state_handler()
        8. cpu_ioreq_pio()
        9. xen_exit_notifier()
    
    4. Replace TARGET_PAGE_SIZE with XC_PAGE_SIZE to match the page side with Xen.
    
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    6c32395 View commit details
    Browse the repository at this point in the history
  5. include/hw/xen/xen_common: return error from xen_create_ioreq_server

    This is done to prepare for enabling xenpv support for ARM architecture.
    On ARM it is possible to have a functioning xenpv machine with only the
    PV backends and no IOREQ server. If the IOREQ server creation fails,
    continue to the PV backends initialization.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    57fb6e1 View commit details
    Browse the repository at this point in the history
  6. hw/xen/xen-hvm-common: skip ioreq creation on ioreq registration failure

    On ARM it is possible to have a functioning xenpv machine with only the
    PV backends and no IOREQ server. If the IOREQ server creation fails continue
    to the PV backends initialization.
    
    Also, moved the IOREQ registration and mapping subroutine to new function
    xen_do_ioreq_register().
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    a16ed49 View commit details
    Browse the repository at this point in the history
  7. hw/xen/xen-hvm-common: Use g_new and error_report

    Replace g_malloc with g_new and perror with error_report.
    
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Vikram Garhwal authored and Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    0dc73ab View commit details
    Browse the repository at this point in the history
  8. meson.build: do not set have_xen_pci_passthrough for aarch64 targets

    have_xen_pci_passthrough is only used for Xen x86 VMs.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    91dbf7a View commit details
    Browse the repository at this point in the history
  9. hw/arm: introduce xenpvh machine

    Add a new machine xenpvh which creates a IOREQ server to register/connect with
    Xen Hypervisor.
    
    Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a
    TPM emulator and connects to swtpm running on host machine via chardev socket
    and support TPM functionalities for a guest domain.
    
    Extra command line for aarch64 xenpvh QEMU to connect to swtpm:
        -chardev socket,id=chrtpm,path=/tmp/myvtpm2/swtpm-sock \
        -tpmdev emulator,id=tpm0,chardev=chrtpm \
        -machine tpm-base-addr=0x0c000000 \
    
    swtpm implements a TPM software emulator(TPM 1.2 & TPM 2) built on libtpms and
    provides access to TPM functionality over socket, chardev and CUSE interface.
    Github repo: https://github.com/stefanberger/swtpm
    Example for starting swtpm on host machine:
        mkdir /tmp/vtpm2
        swtpm socket --tpmstate dir=/tmp/vtpm2 \
        --ctrl type=unixio,path=/tmp/vtpm2/swtpm-sock &
    
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Vikram Garhwal authored and Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    1820d83 View commit details
    Browse the repository at this point in the history
  10. meson.build: enable xenpv machine build for ARM

    Add CONFIG_XEN for aarch64 device to support build for ARM targets.
    
    Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Vikram Garhwal authored and Stefano Stabellini committed May 3, 2023
    Copy the full SHA
    bc618c5 View commit details
    Browse the repository at this point in the history
  11. Merge tag 'xenpvh3-tag' of https://gitlab.com/sstabellini/qemu into s…

    …taging
    
    xenpvh3-tag
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQIzBAABCgAdFiEE0E4zq6UfZ7oH0wrqiU+PSHDhrpAFAmRRpX8ACgkQiU+PSHDh
    # rpDONBAAlE+B1tVuDlVja5Q11Vw6iTnb+T65uTXPdRY4ucUVw3K4gF05JO3SanA7
    # eHRT0/1FqCW5iOA1zNKKfvTzjETvYahOmVnTPVQxo8bbpcuB7rDPy/3swhZY6s9P
    # P07Zdj6a7zLdsBsbax2c6Xwh++aprX94IfLtHTLa/v8S0/IXE3+CABIMsUruY2hE
    # EOFHM5w9FYoXCfvPnwQFDEWzgAYut0sFtdXcfH6/ATY7QliHecu7Nn4pND6dQvbr
    # gxYi229yS52fmW4uH+LiFLjhs90tt5hX0+xcskzVkwgZKjs7Ylu1j68OSSU5JexW
    # 21was3cPe16D5LXmS66Q6JeA3dZfDQX0rX1RLOihvo3PrHL7OFU19OkBIUXg/9AD
    # WB1bpkMoJgFMC7TZqfkYx22y9YeLN5oxBHWolfxnT7T9eHP5E3E242p/HQRT/cGx
    # I03iG9Ze3j9IJ5oB/j+9hoHZD4CEStxQl9arzKbvnao3+xR9YiHkn+zO+0Z6Jddb
    # i3o8Wa/Y/rDilU7IwQ/b++HsqMzFKdD/u+uEA4cOFUCL/SCNFgPhfzJj/30BRHmR
    # bKSZnuhOV57aDPak8R8QOT9+ZmGpzgT1i/UByyRwxAUzHHL/aru8Pxa0rBuFVXVx
    # n0qxkfGrK9O+azBQzMjJXhDSYmYuxTz2Q1tQuAnu4vSgJk3zYUM=
    # =AQVI
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Wed 03 May 2023 01:06:23 AM BST
    # gpg:                using RSA key D04E33ABA51F67BA07D30AEA894F8F4870E1AE90
    # gpg: Good signature from "Stefano Stabellini <sstabellini@kernel.org>" [unknown]
    # gpg:                 aka "Stefano Stabellini <stefano.stabellini@eu.citrix.com>" [undefined]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: D04E 33AB A51F 67BA 07D3  0AEA 894F 8F48 70E1 AE90
    
    * tag 'xenpvh3-tag' of https://gitlab.com/sstabellini/qemu:
      meson.build: enable xenpv machine build for ARM
      hw/arm: introduce xenpvh machine
      meson.build: do not set have_xen_pci_passthrough for aarch64 targets
      hw/xen/xen-hvm-common: Use g_new and error_report
      hw/xen/xen-hvm-common: skip ioreq creation on ioreq registration failure
      include/hw/xen/xen_common: return error from xen_create_ioreq_server
      xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common
      hw/i386/xen/xen-hvm: move x86-specific fields out of XenIOState
      hw/i386/xen: rearrange xen_hvm_init_pc
      hw/i386/xen/: move xen-mapcache.c to hw/xen/
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed May 3, 2023
    Copy the full SHA
    5fcde5f View commit details
    Browse the repository at this point in the history