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: 3673ad389622
Choose a base ref
...
head repository: qemu/qemu
compare: 2c256e77595c
Choose a head ref
  • 11 commits
  • 18 files changed
  • 3 contributors

Commits on Jun 8, 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 Jun 8, 2023
    Copy the full SHA
    52e4108 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 Jun 8, 2023
    Copy the full SHA
    2846cba 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 Jun 8, 2023
    Copy the full SHA
    44500ad 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>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Stefano Stabellini committed Jun 8, 2023
    Copy the full SHA
    a9966c2 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

    From: Stefano Stabellini <stefano.stabellini@amd.com>
    
    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 Jun 8, 2023
    Copy the full SHA
    b5efbe6 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 Jun 8, 2023
    Copy the full SHA
    f748796 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 Jun 8, 2023
    Copy the full SHA
    ec3b024 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 Jun 8, 2023
    Copy the full SHA
    0d3c550 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 Jun 8, 2023
    Copy the full SHA
    c96a60d 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 Jun 8, 2023
    Copy the full SHA
    236c27f View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2023

  1. Merge tag 'xenpvh4-tag' of https://gitlab.com/sstabellini/qemu into s…

    …taging
    
    xenpvh4-tag
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQIzBAABCgAdFiEE0E4zq6UfZ7oH0wrqiU+PSHDhrpAFAmSCccAACgkQiU+PSHDh
    # rpDozw//c9OS7740if5p3UAeQ4SAa/2K0iE+Fg4NleMrfKps7deIeZRQUFuVvgh6
    # IiYBomftohBe4lzd/17UIW9nVOVGNu4Vf1RlKgHVG+cZBk+hpEDvDTr2nsvZDB4A
    # O1TxeMi4bvOQwfPUGvX2ngZRqZxXw8eiRNekQtaVJ0FySAwQ7ffQS+S53WhgWqnD
    # riBI4oKM42mGwDU8jkgKcKvdKF4QrLOnoQaW7/tFLy3vR452gCvHWctLXySRL9iL
    # dGnldYS3HnhCEiPAlMM5QELHk01k+xKF9L3zKFvvn4COa0u377LQw/Pv3uteWhoq
    # 2QDTaPhudJnxbpckhmtlcx3t1HLU4VLSUhwFFmdDIS7N6Xo8HQuu3Dl5WuMQ8iAv
    # 51DlFSeXIabIKyLWykXyawv8uMd8voq9e24oB56r/UzzT5vWKncEelGkIgeblk8N
    # CHMkuIAbR1ipJlD/kitFvYVoIpSNjK52A34UIad7jM05A8VRVe/E4Jw8NbHc181r
    # eS1Qxpb0eg8TXKCJWc48/oRos5fqsZGRpWcMy/Fp5gK1kPsaOE/VG2c/EfEE45jr
    # v60+3zX1BIpCHbiGKatlWJy2b4TjYE7IZSngaBp/WwPisKJGyAM6yYzRHMN9MSef
    # +i1bB4ljBkJFXpbVsMunxZnGhYQn8ctb+kGjclVOA8zyv9u1G5M=
    # =Lmlf
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Thu 08 Jun 2023 05:26:40 PM PDT
    # gpg:                using RSA key D04E33ABA51F67BA07D30AEA894F8F4870E1AE90
    # gpg: Good signature from "Stefano Stabellini <sstabellini@kernel.org>" [unknown]
    # gpg:                 aka "Stefano Stabellini <stefano.stabellini@eu.citrix.com>" [unknown]
    # 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 'xenpvh4-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 Jun 9, 2023
    Copy the full SHA
    2c256e7 View commit details
    Browse the repository at this point in the history