qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 5a7bd0: hw/i386/xen/: move xen-mapcache.c to


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 5a7bd0: hw/i386/xen/: move xen-mapcache.c to hw/xen/
Date: Wed, 15 Feb 2023 06:11:24 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 5a7bd067c5bdc4fc137eab08473fd7c97541cb0b
      
https://github.com/qemu/qemu/commit/5a7bd067c5bdc4fc137eab08473fd7c97541cb0b
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M hw/i386/meson.build
    M hw/i386/xen/meson.build
    M hw/i386/xen/trace-events
    R hw/i386/xen/xen-mapcache.c
    M hw/xen/meson.build
    M hw/xen/trace-events
    A hw/xen/xen-mapcache.c

  Log Message:
  -----------
  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>


  Commit: a5ad1d599a7660a3a467204bc9800f7e598ddcbf
      
https://github.com/qemu/qemu/commit/a5ad1d599a7660a3a467204bc9800f7e598ddcbf
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M hw/i386/xen/xen-hvm.c

  Log Message:
  -----------
  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>


  Commit: 3c905dcb2a79509f325516e070f2377f381203ff
      
https://github.com/qemu/qemu/commit/3c905dcb2a79509f325516e070f2377f381203ff
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M hw/i386/xen/xen-hvm.c

  Log Message:
  -----------
  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>


  Commit: edb2d4ae6e8827c75500d09c0b38bf8f2110f4c3
      
https://github.com/qemu/qemu/commit/edb2d4ae6e8827c75500d09c0b38bf8f2110f4c3
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M hw/i386/xen/trace-events
    M hw/i386/xen/xen-hvm.c
    M hw/xen/meson.build
    M hw/xen/trace-events
    A hw/xen/xen-hvm-common.c
    A include/hw/i386/xen_arch_hvm.h
    A include/hw/xen/arch_hvm.h
    A include/hw/xen/xen-hvm-common.h

  Log Message:
  -----------
  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>


  Commit: c497850dd61ee1043249ab263a92d49f26ef175a
      
https://github.com/qemu/qemu/commit/c497850dd61ee1043249ab263a92d49f26ef175a
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M include/hw/xen/xen_common.h

  Log Message:
  -----------
  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>


  Commit: dd7aa6f5dc164601e6e1aa9af9536fe4af96a72b
      
https://github.com/qemu/qemu/commit/dd7aa6f5dc164601e6e1aa9af9536fe4af96a72b
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M hw/xen/xen-hvm-common.c

  Log Message:
  -----------
  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>


  Commit: a9706153b4b16e740cf268f7d6939d97b274da7b
      
https://github.com/qemu/qemu/commit/a9706153b4b16e740cf268f7d6939d97b274da7b
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M hw/xen/xen-hvm-common.c

  Log Message:
  -----------
  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>


  Commit: abd70cc92fad809056f27298d11c479fa12ad4e9
      
https://github.com/qemu/qemu/commit/abd70cc92fad809056f27298d11c479fa12ad4e9
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M meson.build

  Log Message:
  -----------
  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>


  Commit: db7ffa23169ec356479f50cbf8d52dd289388b96
      
https://github.com/qemu/qemu/commit/db7ffa23169ec356479f50cbf8d52dd289388b96
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    A docs/system/arm/xenpvh.rst
    M docs/system/target-arm.rst
    M hw/arm/meson.build
    A hw/arm/xen_arm.c
    A include/hw/arm/xen_arch_hvm.h
    M include/hw/xen/arch_hvm.h

  Log Message:
  -----------
  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>


  Commit: 86b01d58ca2840bea6e4e7260aad450a660fbd46
      
https://github.com/qemu/qemu/commit/86b01d58ca2840bea6e4e7260aad450a660fbd46
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M meson.build

  Log Message:
  -----------
  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>


  Commit: befb645941a68fa551d8a43835e454a7e8aedf6e
      
https://github.com/qemu/qemu/commit/befb645941a68fa551d8a43835e454a7e8aedf6e
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    A docs/system/arm/xenpvh.rst
    M docs/system/target-arm.rst
    M hw/arm/meson.build
    A hw/arm/xen_arm.c
    M hw/i386/meson.build
    M hw/i386/xen/meson.build
    M hw/i386/xen/trace-events
    M hw/i386/xen/xen-hvm.c
    R hw/i386/xen/xen-mapcache.c
    M hw/xen/meson.build
    M hw/xen/trace-events
    A hw/xen/xen-hvm-common.c
    A hw/xen/xen-mapcache.c
    A include/hw/arm/xen_arch_hvm.h
    A include/hw/i386/xen_arch_hvm.h
    A include/hw/xen/arch_hvm.h
    A include/hw/xen/xen-hvm-common.h
    M include/hw/xen/xen_common.h
    M meson.build

  Log Message:
  -----------
  Merge tag 'xenpvh2' of https://gitlab.com/sstabellini/qemu into staging

tag xenpvh2

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEE0E4zq6UfZ7oH0wrqiU+PSHDhrpAFAmPsG84ACgkQiU+PSHDh
# rpAN9g/8DzXnYz7dpoS7ooh8X4RW6LRCxD6I7sFwFyu6ViMBsWFEHe+/q46haZ+n
# H6OqwpvSZ2hKTc4FN3ZQ5klC9Ho3DU6PI01atIQM9FnMVCkn/+y6XFj+A6e/hlEG
# PEAB+TwZkXhMtKMBQsWBx+4Uy5akpG/yVCz88ekodKebP/0Mj0YNYRWizQaXVjKG
# lntP/+6fdQ+jxISFHJ7lMZs4WgjfQ+17t9dY66MTG1N1dFhw6Eo21CmRdpeDvH1h
# y1Hv6eFkMwQ/uCbdWLWuRsHM6QmLycB0uucqMGB5pVnoIzPV/3ZaW6Lfb4LG2aPj
# ef8HCgwpKSnsiuOFwDnPdrj/28yPY+ldEydbhn30Aub3qyQG1sYpWTnJ9DhERbeP
# zR9KOWG/1XWZalQIpYzYYburJOX1CfcpnBdhceeqDHrydSs89WXTlHv7hV8XSCyA
# ++BOi5T+kgYP66uTUR8iDgHsN+nLmbcY9FB41yMhu8gHU6YHINJ0a8gyNDzaxKJa
# 7ymyYlofK5O8kRC+0ww6mx7iY4yqjRBOzOTzTtkLk2+yU5DjIKp7W6750xcz40Hd
# FpgzDIfVOXYE4Zu9JL6fyCQvI8y3tZEn/7I1UoyJBAUcCEv8TdWwQe6DdYzKXJNQ
# klDj9pkH6xnbGI+uk3xPk3EgeDG/NbYepaWN5bLtRem6TNho8tw=
# =w7C0
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 14 Feb 2023 23:39:58 GMT
# gpg:                using RSA key D04E33ABA51F67BA07D30AEA894F8F4870E1AE90
# gpg: Good signature from "Stefano Stabellini <sstabellini@kernel.org>" 
[unknown]
# gpg:                 aka "Stefano Stabellini 
<stefano.stabellini@eu.citrix.com>" [full]
# Primary key fingerprint: D04E 33AB A51F 67BA 07D3  0AEA 894F 8F48 70E1 AE90

* tag 'xenpvh2' 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: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/6a50f64ca01d...befb645941a6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]