From owner-svn-src-head@FreeBSD.ORG Thu Oct 16 13:49:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DD3AC5B; Thu, 16 Oct 2014 13:49:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19BD4875; Thu, 16 Oct 2014 13:49:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9GDns4u039594; Thu, 16 Oct 2014 13:49:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9GDnsiv039593; Thu, 16 Oct 2014 13:49:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201410161349.s9GDnsiv039593@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 16 Oct 2014 13:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273166 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 13:49:55 -0000 Author: andrew Date: Thu Oct 16 13:49:54 2014 New Revision: 273166 URL: https://svnweb.freebsd.org/changeset/base/273166 Log: Fix the type of pte_pa as when it is passed into _kvm_pa2off it is either a uint64_t or a pointer to an off_t. With it being a u_long can result in incorrect values being returned. Modified: head/lib/libkvm/kvm_arm.c Modified: head/lib/libkvm/kvm_arm.c ============================================================================== --- head/lib/libkvm/kvm_arm.c Thu Oct 16 12:41:14 2014 (r273165) +++ head/lib/libkvm/kvm_arm.c Thu Oct 16 13:49:54 2014 (r273166) @@ -212,7 +212,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t struct vmstate *vm = kd->vmst; pd_entry_t pd; pt_entry_t pte; - u_long pte_pa; + off_t pte_pa; if (kd->vmst->minidump) return (_kvm_minidump_kvatop(kd, va, pa)); @@ -228,7 +228,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t return (_kvm_pa2off(kd, *pa, pa, L1_S_SIZE)); } pte_pa = (pd & L1_ADDR_MASK) + l2pte_index(va) * sizeof(pte); - _kvm_pa2off(kd, pte_pa, (off_t *)&pte_pa, L1_S_SIZE); + _kvm_pa2off(kd, pte_pa, &pte_pa, L1_S_SIZE); if (lseek(kd->pmfd, pte_pa, 0) == -1) { _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek"); goto invalid;