From patchwork Fri Feb 2 05:50:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 769152 Delivered-To: patch@linaro.org Received: by 2002:adf:9bca:0:b0:33a:e5bd:fedd with SMTP id e10csp754434wrc; Thu, 1 Feb 2024 21:55:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdEesAsE3GhudmH2IYzf1PL7ikS7K/0QrtcGiuZLv+y5Tn2Pj7OS7mDXdH9TTUdsv8uR7F X-Received: by 2002:a05:622a:248:b0:42b:f649:ea5c with SMTP id c8-20020a05622a024800b0042bf649ea5cmr3946982qtx.14.1706853317106; Thu, 01 Feb 2024 21:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706853317; cv=none; d=google.com; s=arc-20160816; b=oKHDl+Dabb/n1yw3c8e+Gzc69Camj288+DJjXq14LzTMQSzCIkoKuvbxl11mnw2Iuf zBkPMSu12LiNoNivbff2maOjKdcqS67Cuz6Q1mH8c1CgwgbfR0+DNUXNgO2G0wxOkNT4 8Zu1vSqLRaIZ26haalWU5jdAJ0AjcbQ9M5YUbpjs5LlH1Gm17+ptIvwFOZQdjZYhpPE9 y7PGQiib0hbgaxLN7olVuVOFvNoZdRpxsmjOh/hspCWboAeqAVu4oaULYZbj1Qajhc2p 5rEbKdW/sDe36/ZiTLKAhi8lR/9xxu0T9lEo/IKhe8wNiyKBNW4yHTLqPS05fvztaVSl Vk6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nhzLuFE6ppEoB9HS2thFYeCAmUg0HDDP2UuzU+1BEtw=; fh=UCFBW18hUXWW4D6gRpyhYuTvoqo+ulp67sAhIrrsRcA=; b=KC2k/UEWgYSgXWDrRNyqhUsxCQcZrbPKRVzaFOQZHgqmrZr4i4YEzGlwWp3CbINFi3 qfDGRljyTv5B4v4/y5WMSonLPhQXfJoQ9LxDTa6rCix0u9KZj5rM7v2N8k8fa8qMgzbm Y49lWRD5OL9gZkEGy2FBfItcepBGxWO+MF+oSvvYGpbRgPzzn40KqoA9jpcyioMfZWT7 w3tJ+xrCQ8fki0SZpLrrR1GXGPUWqXNm/l+SLsbL6RXzI77M+nNFG5TVdhPOciUHIg0b 1cbf7YGGf2gKqMTOmZUj5vCxjUuHWkDTir0BHC3SmHzQ/1sYif2yilQpSlwCth7LYf2s EmGw==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWJwQaqU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=0; AJvYcCXSWyTm1Jf5xxr7+cwT4Sltn6FNdz/AjwI96FpnNUpsIjtNB4mPxHCumg+CSKBjQIvvXFCMMV79t6trMDDae/Ir Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h4-20020ac85844000000b0042be6309b86si1273918qth.429.2024.02.01.21.55.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2024 21:55:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWJwQaqU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rVmSp-0001X8-9Y; Fri, 02 Feb 2024 00:51:47 -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 1rVmSl-0001Tl-NS for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:51:43 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rVmSd-0001uS-4x for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:51:36 -0500 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5dbcfa0eb5dso1574254a12.3 for ; Thu, 01 Feb 2024 21:51:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706853094; x=1707457894; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nhzLuFE6ppEoB9HS2thFYeCAmUg0HDDP2UuzU+1BEtw=; b=YWJwQaqUGG9/Pdi9n/oxDcu9xArWNDKB9jSAE3GpviaybjFCPUPeu+Ota9Ps2u6B5y NVjW+Hy/t6LAy/zG+gsg03aBYl/1XNCthRa6rfVCZjekeOactX7LEmiNt6QwxBlEocaG wlADygSZatgDYGLAKDrw7SE9W5KB+xc9zUVOMPCXkCsO2t9iA3MPxcQYHSF/9ayB8R4M Q9xdclevjE4sIxkZAVDulANYJHy4TRaA/OR3eHOvd1/1FdmQXZlUIGODv+C6q6i3q+kn JodiOmzzO88DOKJTxp4plbx6RnuYhtXnRypexHl53Mq34JNaLZ/es2+OzTiaX1KVrrUQ 7tVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706853094; x=1707457894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nhzLuFE6ppEoB9HS2thFYeCAmUg0HDDP2UuzU+1BEtw=; b=gJemvN/DarsmzHJ8P+8TXEj+4bMug3TBRzPiiujSjJD49Wu7XmlW8roIIWdaGRVZ/z ZDqAdGzVdayeeiKpEaUZ4L/YEkahexa3zm3+uuchiiZw4ZneTEyQqdGmFjpjOjvg/Ulq zXGrnMDDN9Gh72ZqzyvDdCnfIaDKRTVa95Qv87koZrupUtpxuaP07X3itmht4eNdEs48 KMxJ9c2xY73+5VGecE8zQo7n0Qi4XLqPKdOEepemrCpFVjuVkMkXWA6KCqTzT4lIIddR ndE4EQZIE+m1W+K7vfioAIwV65rDCbqs7/OodBEUNNuOp7AvOxZ7A2jNeWb4NAnHg4Zn Iuiw== X-Gm-Message-State: AOJu0YxyLiRKb2rmA6lL6lTwYBAbnaec3/IGun6CPo3MHUlcoe4Sn5+f URoysphe4C4FPN1WBjMrQx8Vsd7GW2cHy0MLMiDxqJ9DZReiyTgb8ZdC3b99JeQUaEgLnB/zlXZ swLI= X-Received: by 2002:a05:6a20:c61e:b0:19c:b3ea:27ba with SMTP id gp30-20020a056a20c61e00b0019cb3ea27bamr6570462pzb.52.1706853093781; Thu, 01 Feb 2024 21:51:33 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWlKY66yzftTQ1Yd01vuQCQGZeRwDkPucpH7hbRPPsDjGVBYMZljz8PJKhNRKYtM6FGx4wL0MWXS/2Z6mfQ5gngog== Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id h2-20020aa79f42000000b006dab0d72cd0sm715111pfr.214.2024.02.01.21.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 21:51:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Alistair Francis , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 24/57] target/riscv: Populate CPUClass.mmu_index Date: Fri, 2 Feb 2024 15:50:03 +1000 Message-Id: <20240202055036.684176-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202055036.684176-1-richard.henderson@linaro.org> References: <20240202055036.684176-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/riscv/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8cbfc7e781..be21fa09c6 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -867,6 +867,11 @@ static bool riscv_cpu_has_work(CPUState *cs) #endif } +static int riscv_cpu_mmu_index(CPUState *cs, bool ifetch) +{ + return riscv_env_mmu_index(cpu_env(cs), ifetch); +} + static void riscv_cpu_reset_hold(Object *obj) { #ifndef CONFIG_USER_ONLY @@ -1810,6 +1815,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = riscv_cpu_class_by_name; cc->has_work = riscv_cpu_has_work; + cc->mmu_index = riscv_cpu_mmu_index; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; cc->get_pc = riscv_cpu_get_pc;