* Re: [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY
2025-05-14 16:35 [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY Lorenzo Stoakes
@ 2025-05-14 17:28 ` David Hildenbrand
2025-05-14 17:46 ` Yang Shi
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2025-05-14 17:28 UTC (permalink / raw)
To: Lorenzo Stoakes, Andrew Morton
Cc: Christian Borntraeger, Ignacio Moreno Gonzalez, linux-mm,
Yang Shi, Janosch Frank, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, kvm, linux-s390, linux-kernel,
pbonzini
On 14.05.25 18:35, Lorenzo Stoakes wrote:
> The enum type prot_type declared in arch/s390/kvm/gaccess.c declares an
> unfortunate identifier within it - PROT_NONE.
>
> This clashes with the protection bit define from the uapi for mmap()
> declared in include/uapi/asm-generic/mman-common.h, which is indeed what
> those casually reading this code would assume this to refer to.
>
> This means that any changes which subsequently alter headers in any way
> which results in the uapi header being imported here will cause build
> errors.
>
> Resolve the issue by renaming PROT_NONE to PROT_TYPE_DUMMY.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Suggested-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
> Fixes: b3cefd6bf16e ("KVM: s390: Pass initialized arg even if unused")
> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505140943.IgHDa9s7-lkp@intel.com/
> ---
>
> Andrew - sorry to be a pain - this needs to land before
> https://lore.kernel.org/all/20250508-madvise-nohugepage-noop-without-thp-v1-1-e7ceffb197f3@kuka.com/
>
> I can resend this as a series with it if that makes it easier for you? Let
> me know if there's anything I can do to make it easier to get the ordering right here.
>
> Thanks!
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY
2025-05-14 16:35 [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY Lorenzo Stoakes
2025-05-14 17:28 ` David Hildenbrand
@ 2025-05-14 17:46 ` Yang Shi
2025-05-15 7:15 ` Ignacio Moreno Gonzalez
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yang Shi @ 2025-05-14 17:46 UTC (permalink / raw)
To: Lorenzo Stoakes, Andrew Morton
Cc: Christian Borntraeger, Ignacio Moreno Gonzalez, linux-mm,
Janosch Frank, David Hildenbrand, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, kvm, linux-s390, linux-kernel,
pbonzini
On 5/14/25 9:35 AM, Lorenzo Stoakes wrote:
> The enum type prot_type declared in arch/s390/kvm/gaccess.c declares an
> unfortunate identifier within it - PROT_NONE.
>
> This clashes with the protection bit define from the uapi for mmap()
> declared in include/uapi/asm-generic/mman-common.h, which is indeed what
> those casually reading this code would assume this to refer to.
>
> This means that any changes which subsequently alter headers in any way
> which results in the uapi header being imported here will cause build
> errors.
>
> Resolve the issue by renaming PROT_NONE to PROT_TYPE_DUMMY.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Suggested-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
> Fixes: b3cefd6bf16e ("KVM: s390: Pass initialized arg even if unused")
> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505140943.IgHDa9s7-lkp@intel.com/
> ---
>
> Andrew - sorry to be a pain - this needs to land before
> https://lore.kernel.org/all/20250508-madvise-nohugepage-noop-without-thp-v1-1-e7ceffb197f3@kuka.com/
>
> I can resend this as a series with it if that makes it easier for you? Let
> me know if there's anything I can do to make it easier to get the ordering right here.
>
> Thanks!
>
> arch/s390/kvm/gaccess.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Acked-by: Yang Shi <yang@os.amperecomputing.com>
>
> diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
> index f6fded15633a..4e5654ad1604 100644
> --- a/arch/s390/kvm/gaccess.c
> +++ b/arch/s390/kvm/gaccess.c
> @@ -318,7 +318,7 @@ enum prot_type {
> PROT_TYPE_DAT = 3,
> PROT_TYPE_IEP = 4,
> /* Dummy value for passing an initialized value when code != PGM_PROTECTION */
> - PROT_NONE,
> + PROT_TYPE_DUMMY,
> };
>
> static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva, u8 ar,
> @@ -334,7 +334,7 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
> switch (code) {
> case PGM_PROTECTION:
> switch (prot) {
> - case PROT_NONE:
> + case PROT_TYPE_DUMMY:
> /* We should never get here, acts like termination */
> WARN_ON_ONCE(1);
> break;
> @@ -804,7 +804,7 @@ static int guest_range_to_gpas(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
> gpa = kvm_s390_real_to_abs(vcpu, ga);
> if (!kvm_is_gpa_in_memslot(vcpu->kvm, gpa)) {
> rc = PGM_ADDRESSING;
> - prot = PROT_NONE;
> + prot = PROT_TYPE_DUMMY;
> }
> }
> if (rc)
> @@ -962,7 +962,7 @@ int access_guest_with_key(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
> if (rc == PGM_PROTECTION)
> prot = PROT_TYPE_KEYC;
> else
> - prot = PROT_NONE;
> + prot = PROT_TYPE_DUMMY;
> rc = trans_exc_ending(vcpu, rc, ga, ar, mode, prot, terminate);
> }
> out_unlock:
> --
> 2.49.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY
2025-05-14 16:35 [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY Lorenzo Stoakes
2025-05-14 17:28 ` David Hildenbrand
2025-05-14 17:46 ` Yang Shi
@ 2025-05-15 7:15 ` Ignacio Moreno Gonzalez
2025-05-15 9:24 ` Christian Borntraeger
2025-05-15 20:17 ` Lorenzo Stoakes
4 siblings, 0 replies; 6+ messages in thread
From: Ignacio Moreno Gonzalez @ 2025-05-15 7:15 UTC (permalink / raw)
To: Lorenzo Stoakes, Andrew Morton
Cc: Christian Borntraeger, linux-mm, Yang Shi, Janosch Frank,
David Hildenbrand, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, kvm, linux-s390, linux-kernel,
pbonzini
On 5/14/2025 6:35 PM, Lorenzo Stoakes wrote:
> Caution! This message was sent from outside of KUKA. Please do not click links or open attachments unless you are certain of their authenticity.
>
> The enum type prot_type declared in arch/s390/kvm/gaccess.c declares an
> unfortunate identifier within it - PROT_NONE.
>
> This clashes with the protection bit define from the uapi for mmap()
> declared in include/uapi/asm-generic/mman-common.h, which is indeed what
> those casually reading this code would assume this to refer to.
>
> This means that any changes which subsequently alter headers in any way
> which results in the uapi header being imported here will cause build
> errors.
>
> Resolve the issue by renaming PROT_NONE to PROT_TYPE_DUMMY.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Suggested-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
> Fixes: b3cefd6bf16e ("KVM: s390: Pass initialized arg even if unused")
> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505140943.IgHDa9s7-lkp@intel.com/
> ---
>
> Andrew - sorry to be a pain - this needs to land before
> https://lore.kernel.org/all/20250508-madvise-nohugepage-noop-without-thp-v1-1-e7ceffb197f3@kuka.com/
>
> I can resend this as a series with it if that makes it easier for you? Let
> me know if there's anything I can do to make it easier to get the ordering right here.
>
> Thanks!
Acked-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY
2025-05-14 16:35 [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY Lorenzo Stoakes
` (2 preceding siblings ...)
2025-05-15 7:15 ` Ignacio Moreno Gonzalez
@ 2025-05-15 9:24 ` Christian Borntraeger
2025-05-15 20:17 ` Lorenzo Stoakes
4 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2025-05-15 9:24 UTC (permalink / raw)
To: Lorenzo Stoakes, Andrew Morton
Cc: Ignacio Moreno Gonzalez, linux-mm, Yang Shi, Janosch Frank,
David Hildenbrand, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, kvm, linux-s390, linux-kernel,
pbonzini
Am 14.05.25 um 18:35 schrieb Lorenzo Stoakes:
> The enum type prot_type declared in arch/s390/kvm/gaccess.c declares an
> unfortunate identifier within it - PROT_NONE.
>
> This clashes with the protection bit define from the uapi for mmap()
> declared in include/uapi/asm-generic/mman-common.h, which is indeed what
> those casually reading this code would assume this to refer to.
>
> This means that any changes which subsequently alter headers in any way
> which results in the uapi header being imported here will cause build
> errors.
>
> Resolve the issue by renaming PROT_NONE to PROT_TYPE_DUMMY.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Suggested-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
> Fixes: b3cefd6bf16e ("KVM: s390: Pass initialized arg even if unused")
> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505140943.IgHDa9s7-lkp@intel.com/
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
I think its fine to go via mm tree.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY
2025-05-14 16:35 [PATCH] KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY Lorenzo Stoakes
` (3 preceding siblings ...)
2025-05-15 9:24 ` Christian Borntraeger
@ 2025-05-15 20:17 ` Lorenzo Stoakes
4 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Stoakes @ 2025-05-15 20:17 UTC (permalink / raw)
To: Andrew Morton
Cc: Christian Borntraeger, Ignacio Moreno Gonzalez, linux-mm,
Yang Shi, Janosch Frank, David Hildenbrand, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Sven Schnelle, kvm, linux-s390,
linux-kernel, pbonzini
Andrew -
Please disregard this patch, I have now re-sent it as part of a series in
[0] in order to enforce ordering.
Thanks!
[0]: https://lore.kernel.org/linux-mm/cover.1747338438.git.lorenzo.stoakes@oracle.com/
On Wed, May 14, 2025 at 05:35:30PM +0100, Lorenzo Stoakes wrote:
> The enum type prot_type declared in arch/s390/kvm/gaccess.c declares an
> unfortunate identifier within it - PROT_NONE.
>
> This clashes with the protection bit define from the uapi for mmap()
> declared in include/uapi/asm-generic/mman-common.h, which is indeed what
> those casually reading this code would assume this to refer to.
>
> This means that any changes which subsequently alter headers in any way
> which results in the uapi header being imported here will cause build
> errors.
>
> Resolve the issue by renaming PROT_NONE to PROT_TYPE_DUMMY.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Suggested-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com>
> Fixes: b3cefd6bf16e ("KVM: s390: Pass initialized arg even if unused")
> Cc: stable@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505140943.IgHDa9s7-lkp@intel.com/
> ---
>
> Andrew - sorry to be a pain - this needs to land before
> https://lore.kernel.org/all/20250508-madvise-nohugepage-noop-without-thp-v1-1-e7ceffb197f3@kuka.com/
>
> I can resend this as a series with it if that makes it easier for you? Let
> me know if there's anything I can do to make it easier to get the ordering right here.
>
> Thanks!
>
> arch/s390/kvm/gaccess.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
> index f6fded15633a..4e5654ad1604 100644
> --- a/arch/s390/kvm/gaccess.c
> +++ b/arch/s390/kvm/gaccess.c
> @@ -318,7 +318,7 @@ enum prot_type {
> PROT_TYPE_DAT = 3,
> PROT_TYPE_IEP = 4,
> /* Dummy value for passing an initialized value when code != PGM_PROTECTION */
> - PROT_NONE,
> + PROT_TYPE_DUMMY,
> };
>
> static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva, u8 ar,
> @@ -334,7 +334,7 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
> switch (code) {
> case PGM_PROTECTION:
> switch (prot) {
> - case PROT_NONE:
> + case PROT_TYPE_DUMMY:
> /* We should never get here, acts like termination */
> WARN_ON_ONCE(1);
> break;
> @@ -804,7 +804,7 @@ static int guest_range_to_gpas(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
> gpa = kvm_s390_real_to_abs(vcpu, ga);
> if (!kvm_is_gpa_in_memslot(vcpu->kvm, gpa)) {
> rc = PGM_ADDRESSING;
> - prot = PROT_NONE;
> + prot = PROT_TYPE_DUMMY;
> }
> }
> if (rc)
> @@ -962,7 +962,7 @@ int access_guest_with_key(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
> if (rc == PGM_PROTECTION)
> prot = PROT_TYPE_KEYC;
> else
> - prot = PROT_NONE;
> + prot = PROT_TYPE_DUMMY;
> rc = trans_exc_ending(vcpu, rc, ga, ar, mode, prot, terminate);
> }
> out_unlock:
> --
> 2.49.0
^ permalink raw reply [flat|nested] 6+ messages in thread