]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: s390: Add P bit in table entry bitfields, move union vaddress
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Wed, 4 Feb 2026 15:02:31 +0000 (16:02 +0100)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Wed, 4 Feb 2026 16:00:08 +0000 (17:00 +0100)
Add P bit in hardware definition of region 3 and segment table entries.

Move union vaddress from kvm/gaccess.c to asm/dat_bits.h

Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
arch/s390/include/asm/dat-bits.h
arch/s390/kvm/gaccess.c

index 8d65eec2f124900fe22c24ae80816cb9549a6f0b..c40874e0e42695e8114f78c547c74f38b3f81144 100644 (file)
@@ -9,6 +9,32 @@
 #ifndef _S390_DAT_BITS_H
 #define _S390_DAT_BITS_H
 
+/*
+ * vaddress union in order to easily decode a virtual address into its
+ * region first index, region second index etc. parts.
+ */
+union vaddress {
+       unsigned long addr;
+       struct {
+               unsigned long rfx : 11;
+               unsigned long rsx : 11;
+               unsigned long rtx : 11;
+               unsigned long sx  : 11;
+               unsigned long px  : 8;
+               unsigned long bx  : 12;
+       };
+       struct {
+               unsigned long rfx01 : 2;
+               unsigned long       : 9;
+               unsigned long rsx01 : 2;
+               unsigned long       : 9;
+               unsigned long rtx01 : 2;
+               unsigned long       : 9;
+               unsigned long sx01  : 2;
+               unsigned long       : 29;
+       };
+};
+
 union asce {
        unsigned long val;
        struct {
@@ -98,7 +124,8 @@ union region3_table_entry {
        struct {
                unsigned long   : 53;
                unsigned long fc: 1; /* Format-Control */
-               unsigned long   : 4;
+               unsigned long p : 1; /* DAT-Protection Bit */
+               unsigned long   : 3;
                unsigned long i : 1; /* Region-Invalid Bit */
                unsigned long cr: 1; /* Common-Region Bit */
                unsigned long tt: 2; /* Table-Type Bits */
@@ -140,7 +167,8 @@ union segment_table_entry {
        struct {
                unsigned long   : 53;
                unsigned long fc: 1; /* Format-Control */
-               unsigned long   : 4;
+               unsigned long p : 1; /* DAT-Protection Bit */
+               unsigned long   : 3;
                unsigned long i : 1; /* Segment-Invalid Bit */
                unsigned long cs: 1; /* Common-Segment Bit */
                unsigned long tt: 2; /* Table-Type Bits */
index 41ca6b0ee7a928ed16f4c8c88f35ccf60a6f37a7..d8347f7cbe513e34ce667d5aa6fd3852c953431c 100644 (file)
 
 #define GMAP_SHADOW_FAKE_TABLE 1ULL
 
-/*
- * vaddress union in order to easily decode a virtual address into its
- * region first index, region second index etc. parts.
- */
-union vaddress {
-       unsigned long addr;
-       struct {
-               unsigned long rfx : 11;
-               unsigned long rsx : 11;
-               unsigned long rtx : 11;
-               unsigned long sx  : 11;
-               unsigned long px  : 8;
-               unsigned long bx  : 12;
-       };
-       struct {
-               unsigned long rfx01 : 2;
-               unsigned long       : 9;
-               unsigned long rsx01 : 2;
-               unsigned long       : 9;
-               unsigned long rtx01 : 2;
-               unsigned long       : 9;
-               unsigned long sx01  : 2;
-               unsigned long       : 29;
-       };
-};
-
 /*
  * raddress union which will contain the result (real or absolute address)
  * after a page table walk. The rfaa, sfaa and pfra members are used to