Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: Add some useful mask macros

Add _{SEGMENT,REGION3}_FR_MASK, similar to _{SEGMENT,REGION3}_MASK, but
working on gfn/pfn instead of addresses. Use them in gaccess.c instead
of using the normal masks plus gpa_to_gfn().

Also add _PAGES_PER_{SEGMENT,REGION3} to make future code more readable.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

+6 -1
+5
arch/s390/kvm/dat.h
··· 104 104 } tok; 105 105 }; 106 106 107 + #define _SEGMENT_FR_MASK (_SEGMENT_MASK >> PAGE_SHIFT) 108 + #define _REGION3_FR_MASK (_REGION3_MASK >> PAGE_SHIFT) 109 + #define _PAGES_PER_SEGMENT _PAGE_ENTRIES 110 + #define _PAGES_PER_REGION3 (_PAGES_PER_SEGMENT * _CRST_ENTRIES) 111 + 107 112 /* Soft dirty, needed as macro for atomic operations on ptes */ 108 113 #define _PAGE_SD 0x002 109 114
+1 -1
arch/s390/kvm/gaccess.c
··· 1461 1461 lockdep_assert_held(&sg->kvm->mmu_lock); 1462 1462 lockdep_assert_held(&sg->parent->children_lock); 1463 1463 1464 - gfn = f->gfn & gpa_to_gfn(is_pmd(*table) ? _SEGMENT_MASK : _REGION3_MASK); 1464 + gfn = f->gfn & (is_pmd(*table) ? _SEGMENT_FR_MASK : _REGION3_FR_MASK); 1465 1465 scoped_guard(spinlock, &sg->host_to_rmap_lock) 1466 1466 rc = gmap_insert_rmap(sg, gfn, gpa_to_gfn(raddr), host->h.tt); 1467 1467 if (rc)