Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Steffen Eiden <seiden@linux.ibm.com>,
	Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andreas Grapentin <gra@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Friedrich Welter <fritz@linux.ibm.com>,
	Gautam Gala <ggala@linux.ibm.com>,
	Hariharan Mari <hari55@linux.ibm.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Nico Boehr <nrb@linux.ibm.com>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	linux-s390@vger.kernel.org,
	Nina Schoetterl-Glausch <nsg@linux.ibm.com>,
	Jens Remus <jremus@linux.ibm.com>
Subject: Re: [PATCH v4 00/25] KVM: s390: arm64: System Registers
Date: Fri, 4 Dec 2026 14:43:15 +0100	[thread overview]
Message-ID: <af65e242-baf4-4a1c-96ff-e76a85a4898c@linux.ibm.com> (raw)
In-Reply-To: <20261127-sysreg-v4-0-a6318d18aab5@linux.ibm.com>

Am 27.11.26 um 15:22 schrieb Steffen Eiden:
> Add system register handling for KVM/arm64 on s390. Share KVM/arm64
> code, introduce ARM guest management functions for s390 hosts, and
> implement host system register & exception handling.
> 
> This is the second series on the way to arm64 guests on s390. The first
> series laid the KVM foundation (basic module, vCPU run, simple page
> faults) and is included in v7.4. This series builds the system register
> layer on top and closes the biggest of the remaining gaps towards a
> functional guest support.
> 
> On top of master this series requires one patch[1] not yet merged in
> order to build clean.
> 
> The series applies without those patches on master but the build will
> fail or trigger warnings w/o those patches.
> 
> Regarding merging:
> 
> Patches 1-10 can/should go via the KVM/arm64 tree. Note that PATCH 8 is
> an s390 patch but is is required so be at this position. Otherwise, s390
> will not compile when patch 10 is applied until patch 18. And I cannot
> palce it before as the patch needs some stuff from the just shared
> headers in PATCH 07.
> 
> Patches 11-25 can then be picked by KVM/s390. Those require the
> perquisite patch [1] mentioned above.
> 
> A branch  with the prerequisite and this series is available at
> kernel.org [2]. Another series may be added on top to that branch soon.
> 
> Changes in detail:
> 
> arm64:
> 
> Refactor the id register fields in arch_vcpu into a dedicated structure
> such that it can be reused by s390. Refactor detection of the number of
> sysregs. Mark sysreg related code as shared.
> 
> A few code pieces are moved inside arm headers/code to reduce the amount
> of shared sections. This adds a bit of churn in the diff but reduces the
> shared marker __churn__ at the end.
> 
> The shared regions deliberately contain more code and more headers than
> s390 currently needs. Larger contiguous regions mean less churn whenever
> the surrounding arm64 code changes. Some of this code will be used by
> later series anyways. Some of the shared code will probably never be
> reused by s390 at all. I trust the compiler to remove it. The reduced
> churn outweighs this drawback. Since unused function checking is
> disabled for shared code [3], sharing more than required does not
> introduce warnings once everything is merged.
> 
> s390:
> 
> Add s390 instruction support for ARM guest management: easr/sasr for
> system register access, QAAF for feature queries, and ptff extensions
> for guest time handling.
> 
> Implement complete sysreg handling for s390 including feature
> sanitisation, register enumeration and access, exception injection, and
> finalized page fault handling. For now s390 maintains its own sysreg
> table but I intend to share the table with arm as soon as possible.
> 
> Emulation:
> 
> Guest accesses to ID registers are trapped and served from a sanitized
> copy of the QAAF query results, using the ID register sanitisation and
> finalisation infrastructure shared with arm64. Userspace sees and
> controls guest ID registers with the usual semantics. After the first
> vCPU run the values are final. All other system registers live in the
> SAE save area and are accessed by the host via EASR/SASR, either on
> guest traps or through the one-reg/two-reg UAPI. The save area itself is
> initialized from the QAAF-provided initial save area.
> 
> Exception handling:
> 
> Unsupported or invalid guest actions now raise proper arm64 exceptions
> instead of failing exits. Page faults beyond the guest's address limits
> are injected as address size faults or synchronous external aborts,
> mirroring arm64's kvm_handle_guest_abort() injected faults re-enter the
> guest with the pending exception instead of exiting to userspace.
> 
> Features and userspace:
> 
> SVE is offered to guests at 128-bit vector length, backed by s390's
> Vector Extension. Pointer authentication is passed through where
> hardware support exists. The AEF capabilities are reported under
> /sys/firmware/aef/, including the raw QAAF query results.
> 
> 	Steffen
> 
> [1] https://lore.kernel.org/all/20261105-insn-v2-1-ff27987aa212@linux.ibm.com
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git/log/?h=sae
> 
> ---
> Changes in v4:
> arm64:
> - split up id register refactroing into two: defineing helpers, then
>    creating the new struct (marc)
> - New patch "arm64: vdso: Define ARM64_S390_COMMON=1 for all vdso builds"
>    to fix the arm64 (compat) vDSO build, which dies on -Wundef/-Werror
>    when the sharing marker is unset.
> - OSLSR conversion: also update the tools copy of sysreg.h
> 
> s390:
> - The guest PT offset (EPD) is now tracked per-VM instead of per-vcpu.
> - vcpu_reset_hcrx() is now non-static, runs after the feature set has
>    been restricted (vcpu run pid change), and sets HCRX_EL2_MSCEn
>    unconditionally, depending on MOPS
> - Feature sanitisation: ARM64_HAS_HCR_NV1 no longer probes
>    ID_AA64MMFR4_EL1.E2H0 and reports false, matching the other
>    non-emulatable capabilities.
> - AEF sysfs: dropped the redundant sae_avail/ptff_avail/edat2_avail
>    attributes
> - Authorship fixes: range-check asm macro patch is solely authored by
>    Jens Remus. SVE patch authorship now credits Friedrich Welter.
> - more smaller issues resolved
> 
> - Collected Reviewed-by tags from Joey Goulyand rebased onto master
> - Link to v3: https://lore.kernel.org/r/20261106-sysreg-v3-0-75e95980fb10@linux.ibm.com
> 
> Changes in v3:
> - rebase into 7.4-rc2 (including the first batch of arm on s390 patches)
> - guard style changed from `#ifdef ARM64_S390_COMMON` to `#if ARM64_S390_COMMON == 1`
> - Improve and clarify commit messages
>   arm64:
> - generate OSLSR definitions
> - consolidate more shared sections by:
>    - moving some code in beforehand
>    - deliberately adding more code/header than required.
>      due to [3] there will not be any unused warnings when merged.
> - reduce sharing churn
> 
> s390
> - streamline sasr/easr instruction generation and use
> - aef_info() aggregate removed; new minimal aef_usable()/aef_gisrsa() API
> - qaaf enum numbering reorganized, on reserved field was incorrectly
>    identified as a register.
> - aef.c no longer aggregates or gates on CONFIG_KVM_S390_ARM64.
> - spectre.c stubs replaced with real queries of sanitized ID regs.
> - Many new sys_reg_descs entries
> - QAAF init save area: save area now memcpy'd from cached aef_gisrsa()
>    instead of kvm_vcpu_init_save_area()
> - improved pagefault handling
> - reworked SVE helpers
> - fixed various smaller bugs
> - Link to v2: https://lore.kernel.org/all/20260831145536.913567-1-seiden@linux.ibm.com/
> 
> Changes in v2:
> - rework the entire sharing code concept to use marker instead of moving
>    code.
> 
> ---
> Friedrich Welter (1):
>        KVM: s390: arm64: Implement SVE for arm guests
> 
> Jens Remus (1):
>        s390: Add range check asm macro
> 
> Steffen Eiden (23):
>        KVM: arm64: Route VM ID register accesses through helpers
>        KVM: arm64: Refactor idreg caching into dedicated structure
>        KVM: arm64: Extract number of sys_reg_desc into a constant
>        arm64: sysreg: Convert OSLSR to automatic register generation
>        arm64: vdso: Define ARM64_S390_COMMON=1 for all vdso builds
>        arm64: Prepare headers for sysreg sharing with s390
>        arm64: Share system register related headers and functions with s390
>        KVM: s390: arm64: Prepare for sharing arm64 SVE and ftr-reg code
>        KVM: arm64: Prepare sys_regs.c for sharing with s390
>        KVM: arm64: Share system register code with s390
>        s390: tools: Share arm64/kvm headers
>        s390: Read/write ARM system registers
>        s390: Query arm guest time
>        KVM: s390: arm64: Query Available Arm features
>        KVM: s390: arm64: Verify machine feature set before loading
>        KVM: s390: arm64: Implement feature sanitisation
>        KVM: s390: arm64: Implement arm system register managing infrastructure
>        KVM: s390: arm64: Integrate system registers into the host
>        KVM: s390: arm64: Use QAAF init save area
>        KVM: s390: arm64: Implement exception injection
>        KVM: s390: arm64: Finalize page fault handling
>        KVM: s390: arm64: Promote PTRAUTH capability
>        s390: Report AEF features to sysfs
> 
>   Documentation/ABI/testing/sysfs-firmware-aef |  51 ++
>   arch/arm64/include/asm/cache.h               |   3 +
>   arch/arm64/include/asm/cputype.h             |   3 +
>   arch/arm64/include/asm/kvm_emulate.h         |   5 +-
>   arch/arm64/include/asm/kvm_host.h            | 101 +++-
>   arch/arm64/include/asm/spectre.h             |  13 +-
>   arch/arm64/include/asm/sysreg.h              |  12 +-
>   arch/arm64/kernel/vdso32/Makefile            |   2 +
>   arch/arm64/kvm/arm.c                         |   3 +
>   arch/arm64/kvm/config.c                      |  12 +-
>   arch/arm64/kvm/guest.c                       |  11 +-
>   arch/arm64/kvm/hyp/nvhe/pkvm.c               |  10 +-
>   arch/arm64/kvm/hyp/nvhe/sys_regs.c           |   5 +-
>   arch/arm64/kvm/sys_regs.c                    | 113 ++--
>   arch/arm64/kvm/sys_regs.h                    |   1 +
>   arch/arm64/tools/sysreg                      |  14 +
>   arch/s390/include/arm64/kvm_emulate.h        |   2 +
>   arch/s390/include/arm64/kvm_hyp.h            |  18 +
>   arch/s390/include/arm64/kvm_nested.h         |   5 +
>   arch/s390/include/arm64/sys_regs.h           |   9 +
>   arch/s390/include/asm/aef.h                  |  12 +
>   arch/s390/include/asm/insn-common-asm.h      |  28 +
>   arch/s390/include/asm/kvm_host_arm64.h       | 238 +++++++-
>   arch/s390/include/asm/kvm_host_arm64_types.h | 115 ++++
>   arch/s390/include/asm/sae-asm.h              |  45 ++
>   arch/s390/include/asm/sae.h                  |  93 +++
>   arch/s390/include/asm/timex.h                |  53 ++
>   arch/s390/kernel/Makefile                    |   2 +-
>   arch/s390/kernel/aef.c                       | 192 +++++++
>   arch/s390/kernel/dis.c                       |   1 +
>   arch/s390/kvm/arm64/Makefile                 |   7 +-
>   arch/s390/kvm/arm64/Makefile.gen             |   3 +-
>   arch/s390/kvm/arm64/arm.c                    | 107 +++-
>   arch/s390/kvm/arm64/exception.c              | 109 ++++
>   arch/s390/kvm/arm64/feature.c                | 178 ++++++
>   arch/s390/kvm/arm64/feature.h                |  97 ++++
>   arch/s390/kvm/arm64/guest.c                  | 268 ++++++++-
>   arch/s390/kvm/arm64/handle_exit.c            |   1 +
>   arch/s390/kvm/arm64/inject_fault.c           |  65 ++-
>   arch/s390/kvm/arm64/mmu.c                    |  74 ++-
>   arch/s390/kvm/arm64/qaaf.c                   |  85 +++
>   arch/s390/kvm/arm64/qaaf.h                   |  12 +
>   arch/s390/kvm/arm64/reset.c                  |  72 +++
>   arch/s390/kvm/arm64/spectre.c                |  51 ++
>   arch/s390/kvm/arm64/sys_regs.c               | 831 +++++++++++++++++++++++++++
>   arch/s390/kvm/arm64/trace.h                  |  50 ++
>   arch/s390/tools/Makefile.arm64h              |  11 +-
>   arch/s390/tools/opcodes.txt                  |   3 +
>   include/kvm/arm_arch_timer.h                 |   3 +
>   tools/arch/arm64/include/asm/sysreg.h        |  12 +-
>   50 files changed, 3052 insertions(+), 159 deletions(-)
> 
> base-commit: 9437ee8b6cf607e883b36e44bd755968daaebd48
> change-id: 20261106-sysreg-d6adf0cd34d4
> prerequisite-message-id: 20261105-insn-v2-1-ff27987aa212@linux.ibm.com
> prerequisite-patch-id: ed28ef94c9056cb81bb738f1b54745d012cb613f

So I queued 11-25 (with 18 and 19 as v5) plus the kerneldoc fixup from Heiko
to kvms390/next.

      parent reply	other threads:[~2026-12-04 13:43 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 14:22 [PATCH v4 00/25] KVM: s390: arm64: System Registers Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 01/25] KVM: arm64: Route VM ID register accesses through helpers Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 02/25] KVM: arm64: Refactor idreg caching into dedicated structure Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 03/25] KVM: arm64: Extract number of sys_reg_desc into a constant Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 04/25] arm64: sysreg: Convert OSLSR to automatic register generation Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 05/25] arm64: vdso: Define ARM64_S390_COMMON=1 for all vdso builds Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 06/25] arm64: Prepare headers for sysreg sharing with s390 Steffen Eiden
2026-12-04  9:01   ` Marc Zyngier
2026-12-04 12:59   ` [PATCH] arm64: Remove unused gicv5 include Steffen Eiden
2026-12-04 19:53     ` Oliver Upton
2026-11-27 14:22 ` [PATCH v4 07/25] arm64: Share system register related headers and functions with s390 Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 08/25] KVM: s390: arm64: Prepare for sharing arm64 SVE and ftr-reg code Steffen Eiden
2026-12-03 12:33   ` Christian Borntraeger
2026-11-27 14:22 ` [PATCH v4 09/25] KVM: arm64: Prepare sys_regs.c for sharing with s390 Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 10/25] KVM: arm64: Share system register code " Steffen Eiden
2026-11-27 14:36   ` sashiko-bot
2026-12-03 13:06     ` Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 11/25] s390: tools: Share arm64/kvm headers Steffen Eiden
2026-12-04 12:02   ` Heiko Carstens
2026-11-27 14:22 ` [PATCH v4 12/25] s390: Add range check asm macro Steffen Eiden
2026-12-04 12:02   ` Heiko Carstens
2026-11-27 14:22 ` [PATCH v4 13/25] s390: Read/write ARM system registers Steffen Eiden
2026-12-04 12:07   ` Heiko Carstens
2026-11-27 14:22 ` [PATCH v4 14/25] s390: Query arm guest time Steffen Eiden
2026-12-04 12:11   ` Heiko Carstens
2026-11-27 14:22 ` [PATCH v4 15/25] KVM: s390: arm64: Query Available Arm features Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 16/25] KVM: s390: arm64: Verify machine feature set before loading Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 17/25] KVM: s390: arm64: Implement feature sanitisation Steffen Eiden
2026-11-27 14:44   ` sashiko-bot
2026-11-27 14:22 ` [PATCH v4 18/25] KVM: s390: arm64: Implement arm system register managing infrastructure Steffen Eiden
2026-11-27 15:04   ` sashiko-bot
2026-12-04 12:39   ` [PATCH v5] " Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 19/25] KVM: s390: arm64: Integrate system registers into the host Steffen Eiden
2026-12-04 12:42   ` [PATCH v5] " Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 20/25] KVM: s390: arm64: Use QAAF init save area Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 21/25] KVM: s390: arm64: Implement exception injection Steffen Eiden
2026-11-27 14:48   ` sashiko-bot
2026-11-27 14:22 ` [PATCH v4 22/25] KVM: s390: arm64: Finalize page fault handling Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 23/25] KVM: s390: arm64: Implement SVE for arm guests Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 24/25] KVM: s390: arm64: Promote PTRAUTH capability Steffen Eiden
2026-11-27 14:22 ` [PATCH v4 25/25] s390: Report AEF features to sysfs Steffen Eiden
2026-12-03 23:05 ` (subset) [PATCH v4 00/25] KVM: s390: arm64: System Registers Oliver Upton
2026-12-04  6:23   ` Steffen Eiden
2026-12-04 11:20   ` Christian Borntraeger
2026-12-04 19:56     ` Oliver Upton
2026-12-04 13:43 ` Christian Borntraeger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af65e242-baf4-4a1c-96ff-e76a85a4898c@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=brueckner@linux.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=fritz@linux.ibm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=ggala@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=gra@linux.ibm.com \
    --cc=hari55@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=joey.gouly@arm.com \
    --cc=jremus@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=nsg@linux.ibm.com \
    --cc=oupton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=svens@linux.ibm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox