FAILED: patch "[PATCH] KVM: s390: split kvm_s390_logical_to_effective" failed to apply to 4.9-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f85f1baaa18932a041fd2b1c2ca6cfd9898c7d2b Mon Sep 17 00:00:00 2001
From: Claudio Imbrenda <[email protected]>
Date: Tue, 2 Mar 2021 13:36:44 +0100
Subject: [PATCH] KVM: s390: split kvm_s390_logical_to_effective
Split kvm_s390_logical_to_effective to a generic function called _kvm_s390_logical_to_effective. The new function takes a PSW and an address and returns the address with the appropriate bits masked off. The old function now calls the new function with the appropriate PSW from the vCPU.
This is needed to avoid code duplication for vSIE.
arch/s390/kvm/gaccess.h +24 -7
@@ -36,6 +36,29 @@ static inline unsigned long kvm_s390_real_to_abs(struct kvm_vcpu *vcpu,return gra; } +/** +* _kvm_s390_logical_to_effective - convert guest logical to effective address +* @psw: psw of the guest +* @ga: guest logical address +* +* Convert a guest logical address to an effective address by applying the +* rules of the addressing mode defined by bits 31 and 32 of the given PSW +* (extendended/basic addressing mode). +* +* Depending on the addressing mode, the upper 40 bits (24 bit addressing +* mode), 33 bits (31 bit addressing mode) or no bits (64 bit addressing +* mode) of @ga will be zeroed and the remaining bits will be returned. +*/ +static inline unsigned long _kvm_s390_logical_to_effective (psw_t *psw, +unsigned long ga) +{ +if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_64BIT ) +return ga; +if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_31BIT ) +return ga & ((1UL <<31 ) -1 ); +return ga & ((1UL <<24 ) -1 ); +} +/** * kvm_s390_logical_to_effective - convert guest logical to effective address * @vcpu: guest virtual cpu
@@ -52,13 +75,7 @@ static inline unsigned long kvm_s390_real_to_abs(struct kvm_vcpu *vcpu,static inline unsigned long kvm_s390_logical_to_effective (struct kvm_vcpu *vcpu,unsigned long ga) { -psw_t *psw = &vcpu->arch.sie_block->gpsw; - -if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_64BIT ) -return ga; -if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_31BIT ) -return ga & ((1UL <<31 ) -1 ); -return ga & ((1UL <<24 ) -1 ); +return _kvm_s390_logical_to_effective (&vcpu->arch.sie_block->gpsw, ga); }/*
Quoted 6 lines · On 12.05.21 12:21, [email protected] wrote:
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Please drop the other 3 kvm: s390: patches then for 4.9, as the kernel will not compile without this until we have a backport for this.
Quoted 74 lines
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
f85f1baaa18932a041fd2b1c2ca6cfd9898c7d2bMon Sep 17 00:00:00 2001
From: Claudio Imbrenda <[email protected]>
Date: Tue, 2 Mar 2021 13:36:44 +0100
Subject: [PATCH] KVM: s390: splitkvm_s390_logical_to_effectiveSplit
kvm_s390_logical_to_effectiveto a generic function called_kvm_s390_logical_to_effective. The new function takes a PSW and an address and returns the address with the appropriate bits masked off. The old function now calls the new function with the appropriate PSW from the vCPU.This is needed to avoid code duplication for vSIE.
Signed-off-by Claudio Imbrenda <[email protected]>Reviewed-by Christian Borntraeger <[email protected]>Cc [email protected] # for VSIE: correctly handle MVPG when in VSIESigned-off-by Christian Borntraeger <[email protected]>arch/s390/kvm/gaccess.h +24
-7@@ -36,6 +36,29 @@ static inline unsigned long kvm_s390_real_to_abs(struct kvm_vcpu *vcpu,return gra; } +/** +* _kvm_s390_logical_to_effective - convert guest logical to effective address +* @psw: psw of the guest +* @ga: guest logical address +* +* Convert a guest logical address to an effective address by applying the +* rules of the addressing mode defined by bits 31 and 32 of the given PSW +* (extendended/basic addressing mode). +* +* Depending on the addressing mode, the upper 40 bits (24 bit addressing +* mode), 33 bits (31 bit addressing mode) or no bits (64 bit addressing +* mode) of @ga will be zeroed and the remaining bits will be returned. +*/ +static inline unsigned long _kvm_s390_logical_to_effective (psw_t *psw, +unsigned long ga) +{ +if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_64BIT ) +return ga; +if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_31BIT ) +return ga & ((1UL <<31 ) -1 ); +return ga & ((1UL <<24 ) -1 ); +} +/** * kvm_s390_logical_to_effective - convert guest logical to effective address * @vcpu: guest virtual cpu @@ -52,13 +75,7 @@ static inline unsigned long kvm_s390_real_to_abs(struct kvm_vcpu *vcpu,static inline unsigned long kvm_s390_logical_to_effective (struct kvm_vcpu *vcpu,unsigned long ga) { -psw_t *psw = &vcpu->arch.sie_block->gpsw; - -if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_64BIT ) -return ga; -if (psw_bits (*psw).eaba ==PSW_BITS_AMODE_31BIT ) -return ga & ((1UL <<31 ) -1 ); -return ga & ((1UL <<24 ) -1 ); +return _kvm_s390_logical_to_effective (&vcpu->arch.sie_block->gpsw, ga); }/*
Greg KH
maintainerQuoted 10 lines · Christian Borntraeger
Quoted 6 lines · On 12.05.21 12:21, [email protected] wrote:
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.Please drop the other 3 kvm: s390: patches then for 4.9, as the kernel will not compile without this until we have a backport for this.
Ok, will do.