Re: [PATCH v1 3/4] KVM: s390: vsie: Accommodate ESA prefix pages

Janosch Frank
2026-04-01T11:45:50Z

On 4/1/26 04:09, Eric Farman wrote:
> The prefix page address occupies a different number
> of bits for z/Architecture versus ESA mode. Adjust the
> definition to cover both, and permit an ESA mode
> address within the nested codepath.
>
> Signed-off-by: Eric Farman <farman@linux.ibm.com>
> ---
> arch/s390/include/asm/kvm_host_types.h | 3 +--
> arch/s390/kvm/kvm-s390.h | 5 ++++-
> arch/s390/kvm/vsie.c | 7 ++++++-
> 3 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/include/asm/kvm_host_types.h b/arch/s390/include/asm/kvm_host_types.h
> index 1394d3fb648f..3f50942bdfe6 100644
> --- a/arch/s390/include/asm/kvm_host_types.h
> +++ b/arch/s390/include/asm/kvm_host_types.h
> @@ -137,8 +137,7 @@ struct mcck_volatile_info {
> struct kvm_s390_sie_block {
> atomic_t cpuflags; /* 0x0000 */
> __u32 : 1; /* 0x0004 */
> - __u32 prefix : 18;
> - __u32 : 1;
> + __u32 prefix : 19;
> __u32 ibc : 12;
> __u8 reserved08[4]; /* 0x0008 */
> #define PROG_IN_SIE (1<<0)
> diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
> index bf1d7798c1af..c0ad8effe3d0 100644
> --- a/arch/s390/kvm/kvm-s390.h
> +++ b/arch/s390/kvm/kvm-s390.h
> @@ -122,7 +122,9 @@ static inline int kvm_is_ucontrol(struct kvm *kvm)
> #endif
> }
>
> -#define GUEST_PREFIX_SHIFT 13
> +#define GUEST_PREFIX_SHIFT 12
> +#define GUEST_PREFIX_ZARCH 0x7fffe
> +#define GUEST_PREFIX_ESA 0x7ffff

Those should be GUEST_PREFIX_MASK_XXX.

GUEST_PREFIX_MASK_ZARCH can be used for set prefix and sigp set prefix
emulation at a later time. Those functions currently use numeric constants.

The rest looks fine.