From patchwork Fri Feb 2 05:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 769173 Delivered-To: patch@linaro.org Received: by 2002:adf:9bca:0:b0:33a:e5bd:fedd with SMTP id e10csp755213wrc; Thu, 1 Feb 2024 21:58:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIkkJFepu3zV0PF0YaH/tyjXrIIPOnLJojJuV2GqXL8TzeYrTDUGCXbRb1ee+RRIEWCavs X-Received: by 2002:a05:620a:2491:b0:785:501c:2bd2 with SMTP id i17-20020a05620a249100b00785501c2bd2mr3676011qkn.38.1706853503253; Thu, 01 Feb 2024 21:58:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706853503; cv=none; d=google.com; s=arc-20160816; b=xQwI5UEqobhttGBh8uoiDd6LfxmGN/sLTwWGIktkTmE+PbSoBWesrPCP3WkVHWRyVa yXkNqfl6vcOTpTfkgCzZ3OqdQtpMIGlvcVoMVEP7dH4gqasOmSIsVWr4idpIfPwHH458 IaBFQcpSZxOtR6zPqtfGZXcSpXOXCunDKaT9oAnvGVFsHFWwAtrnBD392JCkieSMSanm q1f2tYRLTRHpddP6+ezXRTtKO0gFpp9ANJnW3uCQnx9Him5PNEcr9evZg3hjlIxSnk8n 8t1vuRAtI0gtGUdP1A6plRodW7FJJdbCbjvjpLZVPFKqprsLmD7uQu/C7PMhIE74/fxI /NYQ== 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=mJNaEL6q2/07U1Rp9ME1A8CbXMNqHRbwoUgEMBnXwIs=; fh=lAnzViEHqRVM3naSt1oqkDA4QXo91ZKfsaCgdHUj8tg=; b=PersAwPKwsV0WSPlLHmcfq4r34Z3WK4klW9568dIqkEz+v2HifOmjz29zOC59Aatop wJ4IBMWGVCEOlZ7d/K8FO/rHdOgWkp08aNX5BhFK91SGc8jYtxl9NZP3V8Nhh+7s3tMG aW9/doA/ej5vLB1VwTOIjzJDk5epnFoDJPCtYNEmby4tTJgmtGBHdTpocFGxnCWrcWc3 5K3Vvyx7NUWjAwt0cdpCUE6WIe4JiHh/GthvMh4hU3wBcg1wZP/OA8SyrYOROOap70tL kkSCZBk8iumQTu92f05MslnPkJRb8ueEYiqXQzI9oRpVC3EiP4/75t1LDUMKKgBD83zU qnoQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SrEQ0d9E; 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; AJvYcCXnSSXPn7C2fw42R4yyO2yo6974Gt/BWS4QK94290qqAnd8d3hjZMRea5s04HEzKvj438L+GgbXjVrRv6r6p6VE Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o3-20020a05620a2a0300b00783f874be2asi1436524qkp.512.2024.02.01.21.58.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2024 21:58:23 -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=SrEQ0d9E; 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-0001Fi-T8; Fri, 02 Feb 2024 00:51:21 -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 1rVmSJ-0001De-3a for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:51:15 -0500 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rVmSE-0001j2-TI for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:51:13 -0500 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3bda4bd14e2so1399450b6e.2 for ; Thu, 01 Feb 2024 21:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706853070; x=1707457870; 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=mJNaEL6q2/07U1Rp9ME1A8CbXMNqHRbwoUgEMBnXwIs=; b=SrEQ0d9EM9DBbzKXxXh/oLclf0LUmK3iEVBmVEcyWiWYT5Z6HzgKQxTW53SIU3LTBF ocGTPQf2wstPvG80/Jgk2eGvpuRFNkMrCD7kzp3D2VbI0aw9KV54DjU0cVZ5TMUA7wvD c0Rsazvt5DpdSxQ4rZV5D1i/6BC3QZqyqKOoVGecSwjuTAywwtFK0SWsUKcowqS8sjyI FUM5LTbfcXKDKDUkeSTKXJWrYBPY5n1OPPbh+LiHJakXZVXg8y/gS/bMNXKXrIGZdgNa 4o+wF5YcETnIzCH5RIXef3NznO/bmUbDlJoNIIY718zKlIuMBCQlz/LCkm9KEIwm4MTx +V2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706853070; x=1707457870; 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=mJNaEL6q2/07U1Rp9ME1A8CbXMNqHRbwoUgEMBnXwIs=; b=bO3JsNHr9FOVPJFqd8Sy23fpqKOJYlYPIGPm4RAJOZRozmhTNWv2tHpAU3+bmJoCdg Q2TBtJl3beEHB26kwv1gSaBdV7R5warHaB0bn9WfFzL4kQtAfZmhdp6bpk06UD7oS/Ge XboZiStO0vhMwNpEMiURI3CrToSH5CiE1HyK4zfZ6zWNoSX1yjMNYBLC1GbYpHfXRtZY sR6fgdsvA0nMfAgNHjCuJBiOYRl8IOzbbRK0jWXnS/NTSPKq1trp0K30dXvOvn8SYkjy lSiYfiKDMsPRCO5WamzAPQhChUBVG0puXn2lIlOnOLAQLAKgcmsRGvx5BJblua7Ux1p9 yzTw== X-Gm-Message-State: AOJu0YzJoTdxJBxVOIu+UjWbjSdfSAnTTrKyluM5AJSZl0kL7GOarVwZ YrVdEouPRFZn3MdFOSgtW1j7IzHUmwMNApGv5szgQgJ8f4QJE9Mwr22CxD6PHAsB+RWa6IA1F0/ sM1M= X-Received: by 2002:a05:6808:2089:b0:3be:a295:c54a with SMTP id s9-20020a056808208900b003bea295c54amr8355631oiw.0.1706853069909; Thu, 01 Feb 2024 21:51:09 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id h2-20020aa79f42000000b006dab0d72cd0sm715111pfr.214.2024.02.01.21.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 21:51:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 13/57] target/m68k: Populate CPUClass.mmu_index Date: Fri, 2 Feb 2024 15:49:52 +1000 Message-Id: <20240202055036.684176-15-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::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 44000f5869..8a8392e694 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -56,6 +56,11 @@ static bool m68k_cpu_has_work(CPUState *cs) return cs->interrupt_request & CPU_INTERRUPT_HARD; } +static int m68k_cpu_mmu_index(CPUState *cs, bool ifetch) +{ + return cpu_env(cs)->sr & SR_S ? MMU_KERNEL_IDX : MMU_USER_IDX; +} + static void m68k_set_feature(CPUM68KState *env, int feature) { env->features |= BIT_ULL(feature); @@ -551,6 +556,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = m68k_cpu_class_by_name; cc->has_work = m68k_cpu_has_work; + cc->mmu_index = m68k_cpu_mmu_index; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; cc->get_pc = m68k_cpu_get_pc;