From patchwork Wed Dec 6 20:03:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10097117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 021B1602BF for ; Wed, 6 Dec 2017 20:27:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E512C29D99 for ; Wed, 6 Dec 2017 20:27:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D741529E95; Wed, 6 Dec 2017 20:27:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 94BD029D99 for ; Wed, 6 Dec 2017 20:27:21 +0000 (UTC) Received: from localhost ([::1]:57652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMgHo-00044y-RI for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Dec 2017 15:27:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMfvf-0005qg-8L for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMfvc-0002Pv-06 for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:27 -0500 Received: from mail-dm3nam03on0082.outbound.protection.outlook.com ([104.47.41.82]:38528 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMfvb-0002PH-Mc for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=T4NgeT4/p+wPFTZznhXj6/7z8MB1pdcei4jzqLu/s3o=; b=iXNRLZP1xtmlTF+9JZf4Z1RSMayIdArNWKuSeDWTgkSuNjDZ1v5XkoSbRMCuK2nCF5/dYiE5b1g3nCX7dDeUE4qIn44F72fy2CpyzTq7Z1RE0n1rS1DlA0wtdCDCozYxd4ZAN9dIbcNSWqm46t23hBaZwfp3EAuKvE4Yc4GxuuQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 6 Dec 2017 20:04:17 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 6 Dec 2017 14:03:27 -0600 Message-Id: <20171206200346.116537-5-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171206200346.116537-1-brijesh.singh@amd.com> References: <20171206200346.116537-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR14CA0035.namprd14.prod.outlook.com (10.171.172.149) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c8639998-4f64-4c29-81f7-08d53ce488cd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603286); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:ymUWZ1ueIEZCuBITOBkaiAdfYLoCoSMblI/6tU3XAK1sdHyldQx8T/lT29saSWX0ptSXzKkUian11OP/zs2G44bwEQ1poYfvG5cMtLEa/L/A+toOyt/vJ/q2vZUocjEFPIYn5cmLo1bM63ScohL1ad8Hmyc6uZVgXlWm9TkcUWngfqPOGcyJezm77G5xDzrJzHEw/gyc7HCvedow37X8/ipSRo0Ze9gpqisLx6UL+Vmw1uEEgaP75BREbCevQAPC; 25:AGY9YWOFFbfEr5cf3IpNVdwK/5KAkzuXvnA/AU+L+EC7rTGLhe/QawZbkIzy89H6iIS/tK2+St2eGqVHPbO/vib5OLV1gtiAqpAkdGzmjWXJAkc9Ej5zgd8L6JdKPfRopedtrnz673UE2S5wGqu5mO63l6zS3SVg4d2UQtVRUEiWeh5DRkXVmOJjDAXJh0ImqZzP5KnlpjxJoEnZQW8hIf5u33gaKy5BQ4+96zyp0pdXV+eqo96JArhXDSNBmiNDcZItEed4z0CbX/fn32soYghGu7ntTSoWdAHuw2vwa17XL2U8ZcmgXTyX4x4+gQzrDJXyr9z1GDujr+OHWmy5vA==; 31:3bL7Hn/O7gxg3YlCGDa5rVPSMDPnR31uVQra5C9PH114jOnV8zP32a6+dDvp0sX5XnMvuVC1K0icGUFjGQcdePrrk+h6L9i+K1bUgfVXaTkRjiY4YtNM6aqZEJGkQQSi/N21i9SMIvUX6dJqwzQHhqDfOVQkQVnqEG/Pd7SXAagxP8x+vEw6WFcpVEhLTF8ACN+Dwi/oGHoxMbJ0qj07AouVCx8nPEeYMsAJCWSEnWI= X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:Z3X+dB4YCk/FHJiKVQciY7WxQnT0fcEXyfnuh6BQd8acpLP85FZxls/fISZGQMq429w+0lUzL4/NiWAjIV6lCxBFxE4U7w/qZEml/MVEWmmQmx43u1TIgx1cG0AZg+jXHrZXOtXZ5zSOkWcv+RH9Dt82sEUZGIPwD/H4b1yvL1bk9U71gRzB8/no14F8aPgQo6/PHa0N6JlS7EtA3DNQYtThqFleziXKper8KNEmRuXHY4XZ/xQo7gUl4+e0v6TW9EMREryLNZubWzZGdd3B7AzPe3AjNtGj9eVy3ozf2m4yWtyby92TI9R1bxdC60gBqi4NSbwVKBChL5hisIfeekke95huTTavDgrPA27MF7w5hQsZwQEx0IHLYVLaO+1G6wquGR/i2fsroy9hi8j75V53SERb6+bYOQU2nJeJ4JtjPhJ4fKWxzimhv6yAo/yEP7qnZMaljewGU+e+fMUBuLvIj8XXdHdXbcv8nflKwxtUm9wMQ/ywCheY77fWj6eV; 4:JROx6RgVqFSyGKULAZTnLDtc09y5Mqj4/HSDuNvkJ5X1Y3WUouMKnIOsyeLh76dRer3yH8qyEXP5FCFpAvlDxu30XUgQMAGDcRUC30yEe0Up1R3q8mABVNQ1ZFvUKnpp3PGijNywgm1buoXL+ZoujLhYvrN5RJzgRgRfYAg5LEvfdHWCCOY4TjzWo55Ai/QJkwJt3IBCFMeelOQArhZQgGU9e48zWvJV6JBJdNeEiHIGJMnC6A6gqBKG1V4y5Su72bSTUn9Qmb4QtgPbFc4ADi0tsEkxRepO8jqW19O8I01nnSSd278302X1WgK1YLK6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231022)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR12MB0158; X-Forefront-PRVS: 05134F8B4F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(366004)(199004)(189003)(16526018)(16586007)(33646002)(53416004)(105586002)(39060400002)(4326008)(305945005)(2351001)(106356001)(2361001)(7736002)(7696005)(86362001)(52116002)(8936002)(316002)(575784001)(53936002)(97736004)(76176011)(51416003)(36756003)(66066001)(1076002)(3846002)(25786009)(6116002)(47776003)(50226002)(68736007)(54906003)(6916009)(2950100002)(478600001)(6666003)(8666007)(5660300001)(8656006)(8676002)(101416001)(81156014)(81166006)(2906002)(7416002)(48376002)(6486002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:ZNEx2amRlfJU485arMhlFILnSffWa8qtkxLbDqA1k?= =?us-ascii?Q?IWw3K0g9sZSd1vURGn6W+0LdFQH3lqj8xvLMf4Roa2Ncl1AgJ2yHOLWPRbG5?= =?us-ascii?Q?McVP6+Ry+V215VtEFlbQ2ezplo5s9w/SGcMtaN5vwdwpRhLNdhCUEkXb6Oz8?= =?us-ascii?Q?EAa43JtNKY0T93u2uVqWUtrmEkuCdmSfJ8Eii0IfMaynrs9JlYf1INbO6vgV?= =?us-ascii?Q?MCJlh1a/en9PPhVpXuIxYU7YDRu2lUj1zXt8Gbf7NIx159KQb7FZdksOb999?= =?us-ascii?Q?FBIwi+jtIdWFPr2xfYRqvpxry+G1TITj3jmg8OgL9xNp226SmW7VbcrL4Pm2?= =?us-ascii?Q?dDyp/nDVMYTzdQ0Y2Ja8MJN7Hy4M1bLjQ9C3z87Bus8jdOCFaSXMddus5tMQ?= =?us-ascii?Q?jfzopkOYB2fqd6AbWBWaPYsywtHOb+BG3Dd4QeeCV2WX0nkNDmgAJR+FBEEv?= =?us-ascii?Q?E0+Qgjq9MWcHE6jDAQPu7/pZ2Ub426Z7fJzxNnxoyFFcP3TARCbU2RfKUDHF?= =?us-ascii?Q?gSLsae5xxtY1E04C+LdN/OIQ0/+m5BoT1cQZJnThDgKRsk0MBjZr/oTh6nf0?= =?us-ascii?Q?uhC77hkYbm9CnDjRE4ec44IEqMZrr8WfvqAVjDky1hQd2uFw+h7zFQ999alC?= =?us-ascii?Q?sj4CWt7cUULRcKZYXDO67hrJ1Am1Kt+FWn8gCqRNcDZAMbNBX3bBqEVm0Bf/?= =?us-ascii?Q?qRMlIuMLqyKRFxMXj49oeZVqh+Zb2tBlKGnK+/ug1PVLodfUGBzR5lyA3feP?= =?us-ascii?Q?866nMhD+WrdDlhdlaJ4vrvXIyCJZyFCowI23XVTj3PM9yLMQqXjSx+AjyEx2?= =?us-ascii?Q?ryG9iO1ojoDpitXcsDJy23LK7KZe37DKWN6aA+zuqkxW/arLgZx7+dQGiQId?= =?us-ascii?Q?Gj5bGwAdEpqBHepnmkHWIQaQ2eu0qiWyNPR8/xBF9/9kVfwWu2tfhhPIEQZM?= =?us-ascii?Q?766Pjx1UntYC78JNhNnzkVCXx3grTGzL7lbMsYhHooMABHLPZV3/tfYlJ3SC?= =?us-ascii?Q?+nWHm/Ok4rNEIawbyOB+7YHkLoO/5uUX7xGQj2aA7x3PN4INnP8iZSGzz6br?= =?us-ascii?Q?Ygd1WtRmTI7ZbC96F3MPiONZhB5J3Nmyxu36HUvHMRZfYygKbi9l0KEuVBJT?= =?us-ascii?Q?hNjAiODCLGqgNN4XEhpdkFvtHZXHE5ONbnXhnTvGBAtvxLExnOUrPduQLFve?= =?us-ascii?Q?+k026EUxehxqg3O8qKbkExNpIDq8DeSpAPEGboOx8eUqtf+JrnljD0gfQf6z?= =?us-ascii?Q?Ayl40F9woy70XL7WT4=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 6:VNyIK24ZPO5+0lrNKIYNCCJGNgXFV3JTemywob+j3SJsxWNi1qsYj69RgAHzK06yGjj0WuKBEIuKqRPyy/1cEYFXWAWNztC/YIIbQ2UriNssciblBu576TkNNe/dVBLvGYtLxqVfuzvNjkqQRFQjzuk5wAcMH3V6STwts/isXDlaW4Q81W7oXWhAUkPPLV+/c2JLGYAXDeiuqhOLyR6Yqx3hAj5nQLuBksGrShC4L6IL9ENbW1E9FNDHhLGGGDHQl3VSnKvmqQbXPIEFKW7wDmeJGCf/RTuVRTebJ/uDMMKXEsK77aOJIFOFuV9LQ3krWyDcZv5VUs0SYQt/hRHaPWXnr8Ix/SRIW2kEzOXc6Co=; 5:S8gaCayphUEijQSDqEXwtjtYprICuMmXhIGkDEdlwDrZLkaSMklhhTOxB7F+XT7t9OWcsOj+56JP9/DsdV1w6V6GNY+sredAa8SSuwxW3BbnG9cgezHcoNfzDAZmtLKTRuBqDVMHLExHgXiyJZcEGYU7exFOel4WSbMrlnKSdL8=; 24:CBYu3h1jHGAhHN0l7t8LVBP2BF5HFltwyj7MIdwf2zk2ErbQp+lbKsF8Oct9zAJMor5yJzfDGuwqpeI3y4zGqNfUTFMyF1LTrlcA/8Zee8M=; 7:5idyZuuzfhv5Ojz2dh92HER/g2E59znxMSDmh8OT90PSvCmZXJYg/aYYsrKAmlg7E75QQpqpw9BepnJT+HIAUPLI2cpmTKi7uTPPCtX7HYrXb4lQrVrQ+nS8OXNodCfkCb/FfbrXkVp02L9tpt7ybEBJe9uwqMxIyreNs5QXKFWxlsUeS7KMTDCDcqb6V3/f63YeE/ACBCtZQHn94YR3+31meKDNMccdS2z5KFVxuMtnuNq3rY5mhDFxXg59GrHI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:4sj7b5Shr4DLOCTTcPu/E4QWqRW8CTBgAaTS3lni1yT6SDbLZDchpf44xRW80j37jqsiG1vu+358MomvJ/7QRFsyQtGeLQZlh4c36tP4UBn+JW5Wpkqe/0/3yNntQb8MTsVsBe7CUvRk8fQOIM51BCtVtvDxTJKCIQqMOocT8LtWxPASpXdbi8/XF1LGYn9McjdJauXKwJ1K5RIsI4ecfoc2xhrl87x8gnR2ZAbnuxpA3lntCQiNfi6eRTQ0O2r5 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 20:04:17.1141 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8639998-4f64-4c29-81f7-08d53ce488cd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.82 Subject: [Qemu-devel] [PATCH v5 04/23] monitor/i386: use debug APIs when accessing guest memory 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: "Edgar E . Iglesias " , Peter Maydell , Peter Crosthwaite , Eduardo Habkost , kvm@vger.kernel.org, Marcel Apfelbaum , Markus Armbruster , "Michael S. Tsirkin" , Richard Henderson , "Dr. David Alan Gilbert" , Alistair Francis , Christian Borntraeger , Brijesh Singh , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Thomas Lendacky , Borislav Petkov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Updates HMP commands to use the debug version of APIs when accessing the guest memory. Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster Cc: Eduardo Habkost Signed-off-by: Brijesh Singh --- cpus.c | 2 +- disas.c | 2 +- monitor.c | 2 +- target/i386/helper.c | 14 ++++++------ target/i386/monitor.c | 59 +++++++++++++++++++++++++++------------------------ 5 files changed, 41 insertions(+), 38 deletions(-) diff --git a/cpus.c b/cpus.c index 114c29b6a0d3..d1e7e28993e8 100644 --- a/cpus.c +++ b/cpus.c @@ -2026,7 +2026,7 @@ void qmp_pmemsave(int64_t addr, int64_t size, const char *filename, l = sizeof(buf); if (l > size) l = size; - cpu_physical_memory_read(addr, buf, l); + cpu_physical_memory_read_debug(addr, buf, l); if (fwrite(buf, 1, l, f) != l) { error_setg(errp, QERR_IO_ERROR); goto exit; diff --git a/disas.c b/disas.c index d4ad1089efb3..fcedbf263302 100644 --- a/disas.c +++ b/disas.c @@ -586,7 +586,7 @@ static int physical_read_memory(bfd_vma memaddr, bfd_byte *myaddr, int length, struct disassemble_info *info) { - cpu_physical_memory_read(memaddr, myaddr, length); + cpu_physical_memory_read_debug(memaddr, myaddr, length); return 0; } diff --git a/monitor.c b/monitor.c index e36fb5308d34..d8f05b9f88fa 100644 --- a/monitor.c +++ b/monitor.c @@ -1359,7 +1359,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, if (l > line_size) l = line_size; if (is_physical) { - cpu_physical_memory_read(addr, buf, l); + cpu_physical_memory_read_debug(addr, buf, l); } else { if (cpu_memory_rw_debug(cs, addr, buf, l, 0) < 0) { monitor_printf(mon, " Cannot access memory\n"); diff --git a/target/i386/helper.c b/target/i386/helper.c index f63eb3d3f4fb..5dc9e8839bc8 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -757,7 +757,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) if (la57) { pml5e_addr = ((env->cr[3] & ~0xfff) + (((addr >> 48) & 0x1ff) << 3)) & a20_mask; - pml5e = x86_ldq_phys(cs, pml5e_addr); + pml5e = ldq_phys_debug(cs, pml5e_addr); if (!(pml5e & PG_PRESENT_MASK)) { return -1; } @@ -767,7 +767,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) pml4e_addr = ((pml5e & PG_ADDRESS_MASK) + (((addr >> 39) & 0x1ff) << 3)) & a20_mask; - pml4e = x86_ldq_phys(cs, pml4e_addr); + pml4e = ldq_phys_debug(cs, pml4e_addr); if (!(pml4e & PG_PRESENT_MASK)) { return -1; } @@ -788,14 +788,14 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { pdpe_addr = ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & a20_mask; - pdpe = x86_ldq_phys(cs, pdpe_addr); + pdpe = ldq_phys_debug(cs, pdpe_addr); if (!(pdpe & PG_PRESENT_MASK)) return -1; } pde_addr = ((pdpe & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) << 3)) & a20_mask; - pde = x86_ldq_phys(cs, pde_addr); + pde = ldq_phys_debug(cs, pde_addr); if (!(pde & PG_PRESENT_MASK)) { return -1; } @@ -808,7 +808,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) pte_addr = ((pde & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) << 3)) & a20_mask; page_size = 4096; - pte = x86_ldq_phys(cs, pte_addr); + pte = ldq_phys_debug(cs, pte_addr); } if (!(pte & PG_PRESENT_MASK)) { return -1; @@ -818,7 +818,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) /* page directory entry */ pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & a20_mask; - pde = x86_ldl_phys(cs, pde_addr); + pde = ldl_phys_debug(cs, pde_addr); if (!(pde & PG_PRESENT_MASK)) return -1; if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { @@ -827,7 +827,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) } else { /* page directory entry */ pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & a20_mask; - pte = x86_ldl_phys(cs, pte_addr); + pte = ldl_phys_debug(cs, pte_addr); if (!(pte & PG_PRESENT_MASK)) { return -1; } diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 75e155ffb1c4..96890547f6b4 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -66,7 +66,7 @@ static void tlb_info_32(Monitor *mon, CPUArchState *env) pgd = env->cr[3] & ~0xfff; for(l1 = 0; l1 < 1024; l1++) { - cpu_physical_memory_read(pgd + l1 * 4, &pde, 4); + cpu_physical_memory_read_debug(pgd + l1 * 4, &pde, 4); pde = le32_to_cpu(pde); if (pde & PG_PRESENT_MASK) { if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { @@ -74,7 +74,8 @@ static void tlb_info_32(Monitor *mon, CPUArchState *env) print_pte(mon, env, (l1 << 22), pde, ~((1 << 21) - 1)); } else { for(l2 = 0; l2 < 1024; l2++) { - cpu_physical_memory_read((pde & ~0xfff) + l2 * 4, &pte, 4); + cpu_physical_memory_read_debug((pde & ~0xfff) + l2 * 4, + &pte, 4); pte = le32_to_cpu(pte); if (pte & PG_PRESENT_MASK) { print_pte(mon, env, (l1 << 22) + (l2 << 12), @@ -95,12 +96,12 @@ static void tlb_info_pae32(Monitor *mon, CPUArchState *env) pdp_addr = env->cr[3] & ~0x1f; for (l1 = 0; l1 < 4; l1++) { - cpu_physical_memory_read(pdp_addr + l1 * 8, &pdpe, 8); + cpu_physical_memory_read_debug(pdp_addr + l1 * 8, &pdpe, 8); pdpe = le64_to_cpu(pdpe); if (pdpe & PG_PRESENT_MASK) { pd_addr = pdpe & 0x3fffffffff000ULL; for (l2 = 0; l2 < 512; l2++) { - cpu_physical_memory_read(pd_addr + l2 * 8, &pde, 8); + cpu_physical_memory_read_debug(pd_addr + l2 * 8, &pde, 8); pde = le64_to_cpu(pde); if (pde & PG_PRESENT_MASK) { if (pde & PG_PSE_MASK) { @@ -110,7 +111,8 @@ static void tlb_info_pae32(Monitor *mon, CPUArchState *env) } else { pt_addr = pde & 0x3fffffffff000ULL; for (l3 = 0; l3 < 512; l3++) { - cpu_physical_memory_read(pt_addr + l3 * 8, &pte, 8); + cpu_physical_memory_read_debug(pt_addr + l3 * 8, + &pte, 8); pte = le64_to_cpu(pte); if (pte & PG_PRESENT_MASK) { print_pte(mon, env, (l1 << 30) + (l2 << 21) @@ -135,7 +137,7 @@ static void tlb_info_la48(Monitor *mon, CPUArchState *env, uint64_t pdp_addr, pd_addr, pt_addr; for (l1 = 0; l1 < 512; l1++) { - cpu_physical_memory_read(pml4_addr + l1 * 8, &pml4e, 8); + cpu_physical_memory_read_debug(pml4_addr + l1 * 8, &pml4e, 8); pml4e = le64_to_cpu(pml4e); if (!(pml4e & PG_PRESENT_MASK)) { continue; @@ -143,7 +145,7 @@ static void tlb_info_la48(Monitor *mon, CPUArchState *env, pdp_addr = pml4e & 0x3fffffffff000ULL; for (l2 = 0; l2 < 512; l2++) { - cpu_physical_memory_read(pdp_addr + l2 * 8, &pdpe, 8); + cpu_physical_memory_read_debug(pdp_addr + l2 * 8, &pdpe, 8); pdpe = le64_to_cpu(pdpe); if (!(pdpe & PG_PRESENT_MASK)) { continue; @@ -158,7 +160,7 @@ static void tlb_info_la48(Monitor *mon, CPUArchState *env, pd_addr = pdpe & 0x3fffffffff000ULL; for (l3 = 0; l3 < 512; l3++) { - cpu_physical_memory_read(pd_addr + l3 * 8, &pde, 8); + cpu_physical_memory_read_debug(pd_addr + l3 * 8, &pde, 8); pde = le64_to_cpu(pde); if (!(pde & PG_PRESENT_MASK)) { continue; @@ -173,9 +175,7 @@ static void tlb_info_la48(Monitor *mon, CPUArchState *env, pt_addr = pde & 0x3fffffffff000ULL; for (l4 = 0; l4 < 512; l4++) { - cpu_physical_memory_read(pt_addr - + l4 * 8, - &pte, 8); + cpu_physical_memory_read_debug(pt_addr + l4 * 8, &pte, 8); pte = le64_to_cpu(pte); if (pte & PG_PRESENT_MASK) { print_pte(mon, env, (l0 << 48) + (l1 << 39) + @@ -196,7 +196,7 @@ static void tlb_info_la57(Monitor *mon, CPUArchState *env) pml5_addr = env->cr[3] & 0x3fffffffff000ULL; for (l0 = 0; l0 < 512; l0++) { - cpu_physical_memory_read(pml5_addr + l0 * 8, &pml5e, 8); + cpu_physical_memory_read_debug(pml5_addr + l0 * 8, &pml5e, 8); pml5e = le64_to_cpu(pml5e); if (pml5e & PG_PRESENT_MASK) { tlb_info_la48(mon, env, l0, pml5e & 0x3fffffffff000ULL); @@ -271,7 +271,7 @@ static void mem_info_32(Monitor *mon, CPUArchState *env) last_prot = 0; start = -1; for(l1 = 0; l1 < 1024; l1++) { - cpu_physical_memory_read(pgd + l1 * 4, &pde, 4); + cpu_physical_memory_read_debug(pgd + l1 * 4, &pde, 4); pde = le32_to_cpu(pde); end = l1 << 22; if (pde & PG_PRESENT_MASK) { @@ -280,7 +280,8 @@ static void mem_info_32(Monitor *mon, CPUArchState *env) mem_print(mon, &start, &last_prot, end, prot); } else { for(l2 = 0; l2 < 1024; l2++) { - cpu_physical_memory_read((pde & ~0xfff) + l2 * 4, &pte, 4); + cpu_physical_memory_read_debug((pde & ~0xfff) + l2 * 4, + &pte, 4); pte = le32_to_cpu(pte); end = (l1 << 22) + (l2 << 12); if (pte & PG_PRESENT_MASK) { @@ -313,13 +314,13 @@ static void mem_info_pae32(Monitor *mon, CPUArchState *env) last_prot = 0; start = -1; for (l1 = 0; l1 < 4; l1++) { - cpu_physical_memory_read(pdp_addr + l1 * 8, &pdpe, 8); + cpu_physical_memory_read_debug(pdp_addr + l1 * 8, &pdpe, 8); pdpe = le64_to_cpu(pdpe); end = l1 << 30; if (pdpe & PG_PRESENT_MASK) { pd_addr = pdpe & 0x3fffffffff000ULL; for (l2 = 0; l2 < 512; l2++) { - cpu_physical_memory_read(pd_addr + l2 * 8, &pde, 8); + cpu_physical_memory_read_debug(pd_addr + l2 * 8, &pde, 8); pde = le64_to_cpu(pde); end = (l1 << 30) + (l2 << 21); if (pde & PG_PRESENT_MASK) { @@ -330,7 +331,8 @@ static void mem_info_pae32(Monitor *mon, CPUArchState *env) } else { pt_addr = pde & 0x3fffffffff000ULL; for (l3 = 0; l3 < 512; l3++) { - cpu_physical_memory_read(pt_addr + l3 * 8, &pte, 8); + cpu_physical_memory_read_debug(pt_addr + l3 * 8, + &pte, 8); pte = le64_to_cpu(pte); end = (l1 << 30) + (l2 << 21) + (l3 << 12); if (pte & PG_PRESENT_MASK) { @@ -369,13 +371,13 @@ static void mem_info_la48(Monitor *mon, CPUArchState *env) last_prot = 0; start = -1; for (l1 = 0; l1 < 512; l1++) { - cpu_physical_memory_read(pml4_addr + l1 * 8, &pml4e, 8); + cpu_physical_memory_read_debug(pml4_addr + l1 * 8, &pml4e, 8); pml4e = le64_to_cpu(pml4e); end = l1 << 39; if (pml4e & PG_PRESENT_MASK) { pdp_addr = pml4e & 0x3fffffffff000ULL; for (l2 = 0; l2 < 512; l2++) { - cpu_physical_memory_read(pdp_addr + l2 * 8, &pdpe, 8); + cpu_physical_memory_read_debug(pdp_addr + l2 * 8, &pdpe, 8); pdpe = le64_to_cpu(pdpe); end = (l1 << 39) + (l2 << 30); if (pdpe & PG_PRESENT_MASK) { @@ -387,7 +389,8 @@ static void mem_info_la48(Monitor *mon, CPUArchState *env) } else { pd_addr = pdpe & 0x3fffffffff000ULL; for (l3 = 0; l3 < 512; l3++) { - cpu_physical_memory_read(pd_addr + l3 * 8, &pde, 8); + cpu_physical_memory_read_debug(pd_addr + l3 * 8, + &pde, 8); pde = le64_to_cpu(pde); end = (l1 << 39) + (l2 << 30) + (l3 << 21); if (pde & PG_PRESENT_MASK) { @@ -399,9 +402,9 @@ static void mem_info_la48(Monitor *mon, CPUArchState *env) } else { pt_addr = pde & 0x3fffffffff000ULL; for (l4 = 0; l4 < 512; l4++) { - cpu_physical_memory_read(pt_addr - + l4 * 8, - &pte, 8); + cpu_physical_memory_read_debug(pt_addr + + l4 * 8, + &pte, 8); pte = le64_to_cpu(pte); end = (l1 << 39) + (l2 << 30) + (l3 << 21) + (l4 << 12); @@ -446,7 +449,7 @@ static void mem_info_la57(Monitor *mon, CPUArchState *env) last_prot = 0; start = -1; for (l0 = 0; l0 < 512; l0++) { - cpu_physical_memory_read(pml5_addr + l0 * 8, &pml5e, 8); + cpu_physical_memory_read_debug(pml5_addr + l0 * 8, &pml5e, 8); pml5e = le64_to_cpu(pml5e); end = l0 << 48; if (!(pml5e & PG_PRESENT_MASK)) { @@ -457,7 +460,7 @@ static void mem_info_la57(Monitor *mon, CPUArchState *env) pml4_addr = pml5e & 0x3fffffffff000ULL; for (l1 = 0; l1 < 512; l1++) { - cpu_physical_memory_read(pml4_addr + l1 * 8, &pml4e, 8); + cpu_physical_memory_read_debug(pml4_addr + l1 * 8, &pml4e, 8); pml4e = le64_to_cpu(pml4e); end = (l0 << 48) + (l1 << 39); if (!(pml4e & PG_PRESENT_MASK)) { @@ -468,7 +471,7 @@ static void mem_info_la57(Monitor *mon, CPUArchState *env) pdp_addr = pml4e & 0x3fffffffff000ULL; for (l2 = 0; l2 < 512; l2++) { - cpu_physical_memory_read(pdp_addr + l2 * 8, &pdpe, 8); + cpu_physical_memory_read_debug(pdp_addr + l2 * 8, &pdpe, 8); pdpe = le64_to_cpu(pdpe); end = (l0 << 48) + (l1 << 39) + (l2 << 30); if (pdpe & PG_PRESENT_MASK) { @@ -487,7 +490,7 @@ static void mem_info_la57(Monitor *mon, CPUArchState *env) pd_addr = pdpe & 0x3fffffffff000ULL; for (l3 = 0; l3 < 512; l3++) { - cpu_physical_memory_read(pd_addr + l3 * 8, &pde, 8); + cpu_physical_memory_read_debug(pd_addr + l3 * 8, &pde, 8); pde = le64_to_cpu(pde); end = (l0 << 48) + (l1 << 39) + (l2 << 30) + (l3 << 21); if (pde & PG_PRESENT_MASK) { @@ -506,7 +509,7 @@ static void mem_info_la57(Monitor *mon, CPUArchState *env) pt_addr = pde & 0x3fffffffff000ULL; for (l4 = 0; l4 < 512; l4++) { - cpu_physical_memory_read(pt_addr + l4 * 8, &pte, 8); + cpu_physical_memory_read_debug(pt_addr + l4 * 8, &pte, 8); pte = le64_to_cpu(pte); end = (l0 << 48) + (l1 << 39) + (l2 << 30) + (l3 << 21) + (l4 << 12);