From c647103f61b872ce768988aef61749d0e853a831 Mon Sep 17 00:00:00 2001 From: palle Date: Sat, 11 Feb 2017 23:41:36 +0000 Subject: [PATCH] sun4v: Fix calculation of mmu data fault address (pointer arithmetic) --- sys/arch/sparc64/sparc64/trap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 31f8b5486e35..1bb82c755045 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.186 2017/02/11 21:04:29 christos Exp $ */ +/* $NetBSD: trap.c,v 1.187 2017/02/11 23:41:36 palle Exp $ */ /* * Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.186 2017/02/11 21:04:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.187 2017/02/11 23:41:36 palle Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -738,8 +738,8 @@ badtrap: if (dsfsr & SFSR_FV) dsfar = ldxa(SFAR, ASI_DMMU); } else { - paddr_t mmu_fsa_dfa = cpus->ci_mmufsa - + offsetof(struct mmufsa, dfa); + paddr_t mmu_fsa_dfa = cpus->ci_mmufsa + + (offsetof(struct mmufsa, dfa) / sizeof(paddr_t)); dsfar = ldxa(mmu_fsa_dfa, ASI_PHYS_CACHED); } #ifdef DEBUG