From nobody Tue Nov 26 06:45:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1709122599; cv=none; d=zohomail.com; s=zohoarc; b=i9vvRQG+U6D/VPoHhWfeG3AnLk7XNtml9YhuMCH4XH/Ltzn6FOeDAe7e4+W2st5hrXKCG9RwrBuiHR6Ee4amQFA3CyOKNyeb/JWfdkxics9ABeeyCAsU2XFMxTnQESucauOGsDn8tbYpoK7aViupAjGa4oyrChiJ+bo3/4apv0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709122599; h=Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=bsaU8JD9jxD/cGGe3poa35jZsZ40xIaHJJ2cPGHgjLE=; b=QEmOQ/GLcckoUDugk80Mw+byRMKqqwSlagennt4qDzrWKsfzmyuxuB/ck/88xt2R9HBEqBtylh79T0Wsv++USL5WWc5eAz4o/TwhxCfT7TcRVVw+yC7GsN81CT53P10j6rSulGKZpflg7zVj1p3Oqj2U5l27oV8HM2k8df/TEBc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709122599083965.9048392747115; Wed, 28 Feb 2024 04:16:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfIoI-0007pI-Jz; Wed, 28 Feb 2024 07:13:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfF1Z-0000ce-VB for qemu-devel@nongnu.org; Wed, 28 Feb 2024 03:10:46 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfF1Q-0001Ey-FU for qemu-devel@nongnu.org; Wed, 28 Feb 2024 03:10:44 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-29ae4c7da02so1117083a91.2 for ; Wed, 28 Feb 2024 00:10:34 -0800 (PST) Received: from tpp14s.i.sslab.ics.keio.ac.jp (sslab-relay.ics.keio.ac.jp. [131.113.126.173]) by smtp.gmail.com with ESMTPSA id pq1-20020a17090b3d8100b0029a9eebf941sm918345pjb.11.2024.02.28.00.10.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 00:10:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709107833; x=1709712633; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=bsaU8JD9jxD/cGGe3poa35jZsZ40xIaHJJ2cPGHgjLE=; b=kEFOemvIZyVsM+GMEwMWEXt17Jlrb7BGA6T+Ynl64bpUrpnJkgtlj3bD2WMFTBw5et DJ3tm9Vh59MlseTXQmuzez5ph6j3JCGA5HlLSDGHKcFQsMOXS2XblK3+i01kIPQD2Olv Pw90xFIT5Bxn9S0mInppBlhu+cO0ck94kpSzgG0Zuh0A3q8rFmGdEfjnoNFlrDlH/SlN 3MYeKos9UB7Vzab1WApY6Oh6JJ3t9XdeugBpWM3VHrnuf4ZwM3SQ7p0ylykRGqpO/yqI DdzijLgEi4kOSJiS2WvuANcRGS+z1GnYUVRa3Fewzo8XkV9G44mL0IOEJwIjukyHtsFv LK6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709107833; x=1709712633; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bsaU8JD9jxD/cGGe3poa35jZsZ40xIaHJJ2cPGHgjLE=; b=jrTE2A/1hcySK9KZPf7Syu5cQL1FFucE/NRS4LmXeG2apBXnaOhCHrwxzSoR79TEGg W4S5HhuYxJIZYsWfBwVd7IdRMSJvrInzDAkHJkvO+mLhf5uOTdrwJAntrONq9KvRIRPt q5eoV3y2FCU4UJOn31s5S2e9z5//ofCZpnmSiBMaDNzlvEo8RSHJDmowBo6AR1DXftEq GoZrLyUs18+szIbTGeJ2DIw2MwnndBEvQPXPk5rd4R/mUpZEGGi40OZuwnwTdnLxTlRR 51gOfgCfJrTCZxQhHlhKdWhTPQCSLlOsK8i405Yv+yKdJVXJG4LytXNPEOf3nXhKEuhf civg== X-Gm-Message-State: AOJu0YynkqArkIk2HTtJVnsWyjRfJnyOlekIjcfhY8MShU77VcA1DAaC 5Zg2g351HzfsSLEctJDO2Hl79R7xop41lgwAhJk+H71nyiHSreDUbISzAezq X-Google-Smtp-Source: AGHT+IFF9Fir0UebcEWIHYKiQPGHnCtK4ZOIGuVfhH5LT4Raym+EhKOiGL5zvSekbPUSWuT6h071Wg== X-Received: by 2002:a17:90b:4f84:b0:29a:f9ad:a096 with SMTP id qe4-20020a17090b4f8400b0029af9ada096mr200830pjb.35.1709107832623; Wed, 28 Feb 2024 00:10:32 -0800 (PST) From: Hiroaki Yamamoto To: qemu-devel@nongnu.org Subject: [PATCH] target/riscv: Fix privilege mode of G-stage translation for debugging Date: Wed, 28 Feb 2024 17:10:28 +0900 Message-ID: <20240228081028.35081-1-hrak1529@gmail.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=hrak1529@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 28 Feb 2024 07:12:21 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1709122600160100003 Content-Type: text/plain; charset="utf-8" G-stage translation should be considered to be user-level access in riscv_c= pu_get_phys_page_debug(), as already done in riscv_cpu_tlb_fill(). This fixes a bug that prevents gdb from reading memory while the VM is runn= ing in VS-mode. Signed-off-by: Hiroaki Yamamoto Reviewed-by: Alistair Francis --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index d462d95ee1..6e13069da7 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1212,7 +1212,7 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, va= ddr addr) =20 if (env->virt_enabled) { if (get_physical_address(env, &phys_addr, &prot, phys_addr, NULL, - 0, mmu_idx, false, true, true)) { + 0, MMUIdx_U, false, true, true)) { return -1; } } --=20 2.43.2