From patchwork Fri Sep 21 07:18:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 972875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GlMX5cr5z9s55 for ; Fri, 21 Sep 2018 17:19:04 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="V0qrlYgF"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42GlMX1LlmzF3QB for ; Fri, 21 Sep 2018 17:19:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="V0qrlYgF"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42GlMR3lYbzF3Px for ; Fri, 21 Sep 2018 17:18:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="V0qrlYgF"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42GlMR1btWz9s55; Fri, 21 Sep 2018 17:18:59 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1537514339; bh=K1f68KtHmH8snI2EYj293GBZHbc1lvKQx9PVauWXVWM=; h=From:To:Cc:Subject:Date:From; b=V0qrlYgF37n2edAFfsDmQr4g6HA9Uv/mikjWp1LpvU0/k4PIs/zXEgYxgRH6byXyl zF9sXbcmSdXPDemR0FRhJ86vEzXsErrf3TsOC9zK8Y+3g3GQ9mfSeWhZF3iBhY3yZv AZL409WdJU0oxEVDATrHMlt9mEpHOWeVXrcul6W41nidgM6jyRumj0gNit0y3TKuEA GTJcrNC+F4462FKSzLNVkPb0AA2bwpqNXnaCU2FPo+ph46Nuxam/0eNHtgR97HPYXV K61fyI14BARjCJyQKkz10i2B/MQT5bChZLZq6W8hIlrwlrSHQDhY02hql7vxF3EoUj SqP6WGCAkFNOg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 21 Sep 2018 17:18:43 +1000 Message-Id: <20180921071843.3044578-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 Subject: [Pdbg] [PATCH] adu: Avoid address truncation from 64-bit to 32-bit X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libpdbg/adu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpdbg/adu.c b/libpdbg/adu.c index 27049b7..e956b71 100644 --- a/libpdbg/adu.c +++ b/libpdbg/adu.c @@ -368,7 +368,7 @@ retry: CHECK_ERR(adu_reset(adu)); /* Set the address */ - ctrl_reg = SETFIELD(P9_FBC_ALTD_ADDRESS, 0, addr); + ctrl_reg = SETFIELD(P9_FBC_ALTD_ADDRESS, 0ULL, addr); CHECK_ERR(pib_write(&adu->target, P9_ALTD_CONTROL_REG, ctrl_reg)); /* Start the command */ @@ -420,7 +420,7 @@ static int p9_adu_putmem(struct adu *adu, uint64_t addr, uint64_t data, int size CHECK_ERR(adu_reset(adu)); /* Set the address */ - ctrl_reg = SETFIELD(P9_FBC_ALTD_ADDRESS, 0, addr); + ctrl_reg = SETFIELD(P9_FBC_ALTD_ADDRESS, 0ULL, addr); retry: CHECK_ERR(pib_write(&adu->target, P9_ALTD_CONTROL_REG, ctrl_reg));