Skip to content

Commit 15ac613

Browse files
lorenzo-stoakesakpm00
authored andcommitted
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/[email protected] Fixes: b3cefd6 ("KVM: s390: Pass initialized arg even if unused") Signed-off-by: Lorenzo Stoakes <[email protected]> Suggested-by: Ignacio Moreno Gonzalez <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Acked-by: Christian Borntraeger <[email protected]> Acked-by: Ignacio Moreno Gonzalez <[email protected]> Acked-by: Yang Shi <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Acked-by: Liam R. Howlett <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Cc: <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: James Houghton <[email protected]> Cc: Janosch Frank <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Vasily Gorbik <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 546b1c9 commit 15ac613

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
@@ -319,7 +319,7 @@ enum prot_type {
319319
PROT_TYPE_DAT = 3,
320320
PROT_TYPE_IEP = 4,
321321
/* Dummy value for passing an initialized value when code != PGM_PROTECTION */
322-
PROT_NONE,
322+
PROT_TYPE_DUMMY,
323323
};
324324

325325
static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva, u8 ar,
@@ -335,7 +335,7 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
335335
switch (code) {
336336
case PGM_PROTECTION:
337337
switch (prot) {
338-
case PROT_NONE:
338+
case PROT_TYPE_DUMMY:
339339
/* We should never get here, acts like termination */
340340
WARN_ON_ONCE(1);
341341
break;
@@ -805,7 +805,7 @@ static int guest_range_to_gpas(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
805805
gpa = kvm_s390_real_to_abs(vcpu, ga);
806806
if (!kvm_is_gpa_in_memslot(vcpu->kvm, gpa)) {
807807
rc = PGM_ADDRESSING;
808-
prot = PROT_NONE;
808+
prot = PROT_TYPE_DUMMY;
809809
}
810810
}
811811
if (rc)
@@ -963,7 +963,7 @@ int access_guest_with_key(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
963963
if (rc == PGM_PROTECTION)
964964
prot = PROT_TYPE_KEYC;
965965
else
966-
prot = PROT_NONE;
966+
prot = PROT_TYPE_DUMMY;
967967
rc = trans_exc_ending(vcpu, rc, ga, ar, mode, prot, terminate);
968968
}
969969
out_unlock:

0 commit comments

Comments
 (0)