From a083c2c57ca342f18ea051c307bf711c1ba2abb2 Mon Sep 17 00:00:00 2001 From: Rob Gardner Date: Wed, 5 Apr 2017 12:33:01 -0600 Subject: [PATCH] sparc64: disable dax page range checking on RA 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 Reviewed-by: Jonathan Helman Signed-off-by: Allen Pais --- arch/sparc/dax/dax_impl.h | 2 ++ arch/sparc/dax/dax_mm.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/sparc/dax/dax_impl.h b/arch/sparc/dax/dax_impl.h index f277c4e890ef..db974d6f184c 100644 --- a/arch/sparc/dax/dax_impl.h +++ b/arch/sparc/dax/dax_impl.h @@ -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 diff --git a/arch/sparc/dax/dax_mm.c b/arch/sparc/dax/dax_mm.c index 32ccc141e726..181cf57c64e0 100644 --- a/arch/sparc/dax/dax_mm.c +++ b/arch/sparc/dax/dax_mm.c @@ -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]); } -- 2.50.1