]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: disable dax page range checking on RA
authorRob Gardner <rob.gardner@oracle.com>
Wed, 5 Apr 2017 18:33:01 +0000 (12:33 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 24 Apr 2017 04:43:26 +0000 (21:43 -0700)
Orabug: 25820812

This fix is to address a hypervisor f/w change which affects
T7 machines with 3.0 cpu and T8 machines. Newer HV f/w
pays attention to the page size field in real addresses.
This is not a bug; I asked them to implement this long ago.
A value of zero here means 8k, so RA buffers are restricted
to one page when running on newer firmware. The PRM defines a page
size of 0xF to mean "disable page range checking". We set this
value for all real addresses. Old f/w will overwrite this field
anyway, so it's safe for us to always set it.

Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
Reviewed-by: Jonathan Helman <jonathan.helman@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/dax/dax_impl.h
arch/sparc/dax/dax_mm.c

index f277c4e890efc866aed186f22d83e87f319986fc..db974d6f184c5212f28d7f630ff8a3996925c48f 100644 (file)
@@ -131,6 +131,8 @@ extern const struct vm_operations_struct dax_vm_ops;
 
 #define        CCB_HDR(ccb)            ((struct ccb_hdr *)(ccb))
 #define        IS_LONG_CCB(ccb)        ((CCB_HDR(ccb))->sync_flags & CCB_SYNC_LONGCCB)
+/* VM spec 36.2.1.1.8 & 36.2.1.2 / PRM 23.7.1 */
+#define NO_PAGE_RANGE_CHECK (0xfLL << 56)
 
 #define        DAX_CCB_WAIT_USEC               100
 #define        DAX_CCB_WAIT_RETRIES_MAX        10000
index 32ccc141e7261d312d57306d90088a11eede76e3..181cf57c64e0cf6417895f8951e05aed8ba8d623 100644 (file)
@@ -196,8 +196,8 @@ int dax_map_segment_common(unsigned long size,
                            ccbp->dwords[addr_sel]);
        } else {
                *ccb_addr_type = CCB_AT_RA;
-               ccbp->dwords[addr_sel] = dv->pa +
-                       (virtp - vma->vm_start);
+               ccbp->dwords[addr_sel] = NO_PAGE_RANGE_CHECK |
+                       (dv->pa + (virtp - vma->vm_start));
                dax_map_dbg("changed %s to RA 0x%llx", name,
                            ccbp->dwords[addr_sel]);
        }