Skip to content

Commit e52e022

Browse files
committed
KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY
JIRA: https://issues.redhat.com/browse/RHEL-113452 commit 15ac613 Author: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Date: Mon May 19 15:56:57 2025 +0100 KVM: s390: rename PROT_NONE to PROT_TYPE_DUMMY 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. Link: https://lkml.kernel.org/r/20250519145657.178365-1-lorenzo.stoakes@oracle.com Fixes: b3cefd6 ("KVM: s390: Pass initialized arg even if unused") Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Suggested-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com> 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> Acked-by: Ignacio Moreno Gonzalez <Ignacio.MorenoGonzalez@kuka.com> Acked-by: Yang Shi <yang@os.amperecomputing.com> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com> Reviewed-by: Oscar Salvador <osalvador@suse.de> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Cc: <stable@vger.kernel.org> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: James Houghton <jthoughton@google.com> Cc: Janosch Frank <frankja@linux.ibm.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent 1bae070 commit e52e022

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/s390/kvm/gaccess.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ enum prot_type {
317317
PROT_TYPE_DAT = 3,
318318
PROT_TYPE_IEP = 4,
319319
/* Dummy value for passing an initialized value when code != PGM_PROTECTION */
320-
PROT_NONE,
320+
PROT_TYPE_DUMMY,
321321
};
322322

323323
static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva, u8 ar,
@@ -333,7 +333,7 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
333333
switch (code) {
334334
case PGM_PROTECTION:
335335
switch (prot) {
336-
case PROT_NONE:
336+
case PROT_TYPE_DUMMY:
337337
/* We should never get here, acts like termination */
338338
WARN_ON_ONCE(1);
339339
break;
@@ -803,7 +803,7 @@ static int guest_range_to_gpas(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
803803
gpa = kvm_s390_real_to_abs(vcpu, ga);
804804
if (!kvm_is_gpa_in_memslot(vcpu->kvm, gpa)) {
805805
rc = PGM_ADDRESSING;
806-
prot = PROT_NONE;
806+
prot = PROT_TYPE_DUMMY;
807807
}
808808
}
809809
if (rc)
@@ -961,7 +961,7 @@ int access_guest_with_key(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
961961
if (rc == PGM_PROTECTION)
962962
prot = PROT_TYPE_KEYC;
963963
else
964-
prot = PROT_NONE;
964+
prot = PROT_TYPE_DUMMY;
965965
rc = trans_exc_ending(vcpu, rc, ga, ar, mode, prot, terminate);
966966
}
967967
out_unlock:

0 commit comments

Comments
 (0)