From patchwork Fri Apr 26 06:06:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 1091354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="dTGzGbed"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44r4BP5f7Nz9s3l for ; Fri, 26 Apr 2019 16:38:21 +1000 (AEST) Received: from localhost ([127.0.0.1]:40390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJuV1-0002bZ-Q3 for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2019 02:38:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJu1P-0006TO-9m for qemu-devel@nongnu.org; Fri, 26 Apr 2019 02:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJu1O-0005ks-7n for qemu-devel@nongnu.org; Fri, 26 Apr 2019 02:07:43 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:46241 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJu1N-0005AP-RF; Fri, 26 Apr 2019 02:07:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 44r3Tr2vFVz9sP7; Fri, 26 Apr 2019 16:06:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1556258800; bh=BGUxo+69DyxWOcoYW0v+TrohW3b5SGY5IZ68jpOhStM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTGzGbedQ+PzgKasO/vdbhEELR4cCBVnkjItpDnAvpfLWSA3QpC1th9zNBL2NcMbp wj4+ACrw1kwtRWvxiRrZxE0kZVhuc/GEtHkfc2uuFi8Shsm9y5D8NUIte7zz5Oklnk 3A3z/0mjZ4aL51S2KKYN/z5VcLMdutnnooxqlcPc= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 26 Apr 2019 16:06:24 +1000 Message-Id: <20190426060627.18153-34-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190426060627.18153-1-david@gibson.dropbear.id.au> References: <20190426060627.18153-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 33/36] ppc/spapr: Use proper HPTE accessors for H_READ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gkurz@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Cédric Le Goater Message-Id: <20190411080004.8690-3-clg@kaod.org> Signed-off-by: David Gibson --- hw/ppc/spapr_hcall.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 8a736797b9..3534079777 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -304,8 +304,8 @@ static target_ulong h_read(PowerPCCPU *cpu, SpaprMachineState *spapr, { target_ulong flags = args[0]; target_ulong ptex = args[1]; - uint8_t *hpte; int i, ridx, n_entries = 1; + const ppc_hash_pte64_t *hptes; if (!valid_ptex(cpu, ptex)) { return H_PARAMETER; @@ -317,13 +317,12 @@ static target_ulong h_read(PowerPCCPU *cpu, SpaprMachineState *spapr, n_entries = 4; } - hpte = spapr->htab + (ptex * HASH_PTE_SIZE_64); - + hptes = ppc_hash64_map_hptes(cpu, ptex, n_entries); for (i = 0, ridx = 0; i < n_entries; i++) { - args[ridx++] = ldq_p(hpte); - args[ridx++] = ldq_p(hpte + (HASH_PTE_SIZE_64/2)); - hpte += HASH_PTE_SIZE_64; + args[ridx++] = ppc_hash64_hpte0(cpu, hptes, i); + args[ridx++] = ppc_hash64_hpte1(cpu, hptes, i); } + ppc_hash64_unmap_hptes(cpu, hptes, ptex, n_entries); return H_SUCCESS; }