qemu-commits
[Top][All Lists]
Advanced

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

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


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 52e410: hw/i386/xen/: move xen-mapcache.c to hw/xen/
Date: Fri, 09 Jun 2023 11:24:40 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 52e4108784ad8a4697f074e89f80820fad71d14b
      
https://github.com/qemu/qemu/commit/52e4108784ad8a4697f074e89f80820fad71d14b
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: 2846cba9a807f6155623035cf475ceab8d835857
      
https://github.com/qemu/qemu/commit/2846cba9a807f6155623035cf475ceab8d835857
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: 44500ad31678e8636669143eefbd7188f9b8c633
      
https://github.com/qemu/qemu/commit/44500ad31678e8636669143eefbd7188f9b8c633
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: a9966c2c0c4b24dade08c37e5f36a521f17f06a0
      
https://github.com/qemu/qemu/commit/a9966c2c0c4b24dade08c37e5f36a521f17f06a0
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>


  Commit: b5efbe68370f189967ce19a9db7219f307e03b26
      
https://github.com/qemu/qemu/commit/b5efbe68370f189967ce19a9db7219f307e03b26
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 2023)

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

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


  Commit: f7487962feb3ec580fa8eb687eda9af2bc2eaf34
      
https://github.com/qemu/qemu/commit/f7487962feb3ec580fa8eb687eda9af2bc2eaf34
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: ec3b024893d4b79ed691972c275acc4cb81a4ee9
      
https://github.com/qemu/qemu/commit/ec3b024893d4b79ed691972c275acc4cb81a4ee9
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: 0d3c550a9d10747399112eb58beca6fcad38a965
      
https://github.com/qemu/qemu/commit/0d3c550a9d10747399112eb58beca6fcad38a965
  Author: Stefano Stabellini <stefano.stabellini@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: c96a60d845d89a72470c99be5b91963bfc755e75
      
https://github.com/qemu/qemu/commit/c96a60d845d89a72470c99be5b91963bfc755e75
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: 236c27fd61dd0961631076a56286dd108fe5ef1f
      
https://github.com/qemu/qemu/commit/236c27fd61dd0961631076a56286dd108fe5ef1f
  Author: Vikram Garhwal <vikram.garhwal@amd.com>
  Date:   2023-06-08 (Thu, 08 Jun 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: 2c256e77595c10df083950879064154d693ce98b
      
https://github.com/qemu/qemu/commit/2c256e77595c10df083950879064154d693ce98b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-06-09 (Fri, 09 Jun 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_native.h
    M meson.build

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

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>


Compare: https://github.com/qemu/qemu/compare/3673ad389622...2c256e77595c



reply via email to

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