From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1611845026; cv=none; d=zohomail.com; s=zohoarc; b=WH81mipsvr/YX851m5JvdcnR45gwGE3measKNGhcAg3aYTw56UyXRbtnVTVZZ+U0xssAkZh/lVkzHbjY0ELVd1N42/5KIlJ2btL7lXm64UeOXgDQL+G28vxzppXiNIQHFQ1rAT3U/cV2j7cin/hmyjiLoiCGtLetEYtXmzWLgpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611845026; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=86OADgMFXt0pB/TlfGwIBGmGBnkvqEMtjUaTaDnwVlY=; b=jcVqUCcc0xLIlL/gQkv2xr1EuY0WosZy0vLr4wCJPA6gNWVGtJqRvLEop6GaTK3Qn2EuaFJYs2GZaKJ2ScPkLvR8gC4CbFi9ks0pRT73v9pJ8gGcDM71z3lkRFSmc4cs8sTOgxt584BZNvWSBwPvsoGVQlZGBopFbwD8GAeeqUs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611845026670126.2766855375653; Thu, 28 Jan 2021 06:43:46 -0800 (PST) Received: from localhost ([::1]:48430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58WO-0002BZ-MV for importer@patchew.org; Thu, 28 Jan 2021 09:43:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58UK-0000FQ-BN for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:36 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:44093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58UI-0007EB-LE for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:36 -0500 Received: by mail-ej1-x62d.google.com with SMTP id w1so8079304ejf.11 for ; Thu, 28 Jan 2021 06:41:34 -0800 (PST) Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id v25sm3136321edx.49.2021.01.28.06.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:41:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=86OADgMFXt0pB/TlfGwIBGmGBnkvqEMtjUaTaDnwVlY=; b=oLLDc7M6icxr13m0gYrMy1nltEQwWM4JUpSl59sTm0xPhjeAf7EXSugASPscbmbl7M iG75PKnetq7wVkVkmC0+mAG8M36LJco5KBP4taAJO/uhA2b6atL8VAZHpzY8+muHUhMb OGmVYFioVG8nbIufiUZkdtPAY166cj7S8ZB73j1rgnpe4RwKkRyEXA1LxIhk51Ftb9Q4 7Hng42B1uRtX4Wm55HpTcmKFx1r58p0dG33zjG3ExmGNL+rqkuCixDHUyA3iFABkEENM C4gvvSjVl+w8UQunZ5eRDZqevxAblJmqBD7Fs/o2jLHlnVsrPuNlvuynUasC2E8UQTZv AvRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=86OADgMFXt0pB/TlfGwIBGmGBnkvqEMtjUaTaDnwVlY=; b=Y7EzBYl/aIYWKVkTvNOwrSLOt1R2Sl3ntaexfTzztaJ51BRXNaRxUnQHioOfDlwrY2 3jdyNjPWuDhVxGdXc6L0DKYU3YnZEIdACpr7vdU49nuqDkrB+l6iikaxt8Jrk8s8bX9f GgSm0r23+25SaPDRfbY+Rk7gS+8VrPhqCUcUCI1otQ1PphclvowaAUqkPynMd3otXTK6 +Y2pc2+u9LJ1v+jf+RAfeOs78XYQqivULpv6qxawocGCZ9sWM7QHlhwN7Wvlz2ufEQYN NgyPb1wMsu0I5k9e6o0V68ftik+b2TCOoZs2O7R8dcoXkZ8H6qkiLF6eOejCHBMu56bV bdbA== X-Gm-Message-State: AOAM533NWcECZw0XKLoJTgHX4B3yHyUASEa7o+5GPWJ+6+xJMA593rZ6 mR0nv8TDMWTF4fKfWP0Ajbz071nTnFE= X-Google-Smtp-Source: ABdhPJy/pTuc5ihnU07OF1u/Do51RCBCS04xNyJdMT4Xf56dRhA2y/youL/dv195bBR6CDElIjO7tg== X-Received: by 2002:a17:906:c7d2:: with SMTP id dc18mr11109931ejb.149.1611844893061; Thu, 28 Jan 2021 06:41:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 01/13] target/mips: Remove access_type argument from map_address() handler Date: Thu, 28 Jan 2021 15:41:13 +0100 Message-Id: <20210128144125.3696119-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::62d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Huacai Chen , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) TLB map_address() handlers don't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/internal.h | 8 ++++---- target/mips/tlb_helper.c | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 5dd17ff7333..d09afded5ea 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -111,7 +111,7 @@ struct CPUMIPSTLBContext { uint32_t nb_tlb; uint32_t tlb_in_use; int (*map_address)(struct CPUMIPSState *env, hwaddr *physical, int *pr= ot, - target_ulong address, int rw, int access_type); + target_ulong address, int rw); void (*helper_tlbwi)(struct CPUMIPSState *env); void (*helper_tlbwr)(struct CPUMIPSState *env); void (*helper_tlbp)(struct CPUMIPSState *env); @@ -126,11 +126,11 @@ struct CPUMIPSTLBContext { }; =20 int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw, int access_type); + target_ulong address, int rw); int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw, int access_type); + target_ulong address, int rw); int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw, int access_type); + target_ulong address, int rw); void r4k_helper_tlbwi(CPUMIPSState *env); void r4k_helper_tlbwr(CPUMIPSState *env); void r4k_helper_tlbp(CPUMIPSState *env); diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 082c17928d3..1af2dc969d6 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -39,7 +39,7 @@ enum { =20 /* no MMU emulation */ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw, int access_type) + target_ulong address, int rw) { *physical =3D address; *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; @@ -48,7 +48,7 @@ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physica= l, int *prot, =20 /* fixed mapping MMU emulation */ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw, int access_type) + target_ulong address, int rw) { if (address <=3D (int32_t)0x7FFFFFFFUL) { if (!(env->CP0_Status & (1 << CP0St_ERL))) { @@ -68,7 +68,7 @@ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *phys= ical, int *prot, =20 /* MIPS32/MIPS64 R4000-style MMU emulation */ int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw, int access_type) + target_ulong address, int rw) { uint16_t ASID =3D env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask; uint32_t MMID =3D env->CP0_MemoryMapID; @@ -234,8 +234,7 @@ static int get_seg_physical_address(CPUMIPSState *env, = hwaddr *physical, return mapped; } else if (mapped) { /* The segment is TLB mapped */ - return env->tlb->map_address(env, physical, prot, real_address, rw, - access_type); + return env->tlb->map_address(env, physical, prot, real_address, rw= ); } else { /* The segment is unmapped */ *physical =3D physical_base | (real_address & segmask); @@ -314,7 +313,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, /* xuseg */ if (UX && address <=3D (0x3FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret =3D env->tlb->map_address(env, physical, prot, - real_address, rw, access_type); + real_address, rw); } else { ret =3D TLBRET_BADADDR; } @@ -323,7 +322,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, if ((supervisor_mode || kernel_mode) && SX && address <=3D (0x7FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret =3D env->tlb->map_address(env, physical, prot, - real_address, rw, access_type); + real_address, rw); } else { ret =3D TLBRET_BADADDR; } @@ -364,7 +363,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, if (kernel_mode && KX && address <=3D (0xFFFFFFFF7FFFFFFFULL & env->SEGMask)) { ret =3D env->tlb->map_address(env, physical, prot, - real_address, rw, access_type); + real_address, rw); } else { ret =3D TLBRET_BADADDR; } --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.50 as permitted sender) client-ip=209.85.218.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844900; cv=none; d=zohomail.com; s=zohoarc; b=n1Ds0t8AwQoxq87+C33qoT50m6VtrmvqFKwdiAnRfmZCnS37l7n5OaSZy0NBFyGA7tgEFf3531hXYMm45XFkgr5BLUTAQr+HyaQjhaWNKo4+cEKvFMqQYXoW/lOMo0tfQNMGQ4xeejfvD4xdI0W63t2guSz7wYlcqUOlfmk0IT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844900; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OxiSlNZhRqvdz8D8CqFLTD2O33eubJzrqgRXZJj8j/Y=; b=dZQFC/OjZ3wVnn8SYKEraPbbB6dPDlKXYAqlszJ6YxkKrFEjeyVNM99AS0UndiWOWFGL03qEtvtsmqDb6Z/FHe5PVBkhKzOFHjLkgiXyJG9HALawSxPpJOKF878NpBx3TfLyuMhX/kHGv8doQ8g2sZ+Pf/5Xu7mbstsdN+AAXeM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.zohomail.com with SMTPS id 1611844900079975.1999997419144; Thu, 28 Jan 2021 06:41:40 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id g12so8103101ejf.8 for ; Thu, 28 Jan 2021 06:41:39 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id z6sm2392056ejx.17.2021.01.28.06.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OxiSlNZhRqvdz8D8CqFLTD2O33eubJzrqgRXZJj8j/Y=; b=ZkYcj1cRAlQlJVcwRSDi3WCYy7lwZuD3S87GKTO4ZyGo1driqgKnDBdZNVRO2g9hxf OStGtHc/uco9VnpG3ZNgNl4hgD0saNmXtF318eAorIWOxINurB/sAsv9PHEsyJ48M/Im nhPm3NprcfcnipyqD3QkX3UUC95nxrsvCh5vPMwhA106Iz5Sf4m+lxttSnBPDPGmBgNt L6ZvZHN3G6o6xEUJ4GcG4DYszEbP8mMCt5Ad65jWXWVDpc8InAV0fwp23Z2vaUnV3pZL nxjgM2DPz1EXixXbqwK2/cWyoAInU+YvFsRhGssm/fz5YQt/UKZ7ERj/Lu8sCkrCKk5r 3fRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OxiSlNZhRqvdz8D8CqFLTD2O33eubJzrqgRXZJj8j/Y=; b=loNQaufE91y9uhgt61vBE3cXxXIMDHReRCctIKIU/Vu5x5Vr+SJHk0ANwmO8Bqs1YF JxwBdI2inQd0Ie7LpzK/dWD3ujk1hAt7FjdcAO//z0TrwyrEQUqSjyQHYrYwvHZfIrC8 pHrXjyeVhi7bLYIucZl6o7eMwE7yJHkgWiRESYEc8bJTXBPVTS+G+eCPpcVpAu91+4eV hDImCikuuVStyJtrWztPcnD3XlrUNaYnF9SEtlF2ckdmfQ7rtq7KU2riPpYUlb7dnxbZ 8ppdggEGbh8MsykdJ49oZCSyUN5r5+QDdCQzv5NBZREsUN7M7ISJTy2AVDUvneexPpFP ep2A== X-Gm-Message-State: AOAM532BoLSjKz87xlRBS9BVSMr5PKxYJkySsNHTPKk/G6muNs6lw2Qs e3spYFmUbFqy1NZ1ZlNXzd8= X-Google-Smtp-Source: ABdhPJzKsS9ZmP1y6VsDK1sOVYduUVtuzuHfTEos+u8OZKh8jt5+ndzl521UDHwbx3ADOo+MZ+ZkQA== X-Received: by 2002:a17:906:6407:: with SMTP id d7mr9938453ejm.133.1611844898305; Thu, 28 Jan 2021 06:41:38 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 02/13] target/mips: Remove access_type argument from get_seg_physical_address Date: Thu, 28 Jan 2021 15:41:14 +0100 Message-Id: <20210128144125.3696119-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) get_seg_physical_address() doesn't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 1af2dc969d6..9906292440c 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -222,7 +222,7 @@ static int is_seg_am_mapped(unsigned int am, bool eu, i= nt mmu_idx) =20 static int get_seg_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, - int rw, int access_type, int mmu_idx, + int rw, int mmu_idx, unsigned int am, bool eu, target_ulong segmask, hwaddr physical_base) @@ -253,7 +253,7 @@ static int get_segctl_physical_address(CPUMIPSState *en= v, hwaddr *physical, hwaddr pa =3D ((hwaddr)segctl & CP0SC_PA_MASK) << 20; =20 return get_seg_physical_address(env, physical, prot, real_address, rw, - access_type, mmu_idx, am, eu, segmask, + mmu_idx, am, eu, segmask, pa & ~(hwaddr)segmask); } =20 @@ -349,7 +349,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, /* Does CP0_Status.KX/SX/UX permit the access mode (am) */ if (env->CP0_Status & am_ksux[am]) { ret =3D get_seg_physical_address(env, physical, prot, - real_address, rw, access_ty= pe, + real_address, rw, mmu_idx, am, false, env->PA= Mask, 0); } else { --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1611845146; cv=none; d=zohomail.com; s=zohoarc; b=aHNJJWMR8EkOl/MViR97HrPfe5dUHbLh/aUImY6ZwUz7nD35hro2vRbyoVyZj2pgcZztxzG79jZyHc2r99zfWDoYRGscQpBPoeaH5oyiIk4UNP7fP+IbMrAItjT14WkOleD/cs6J+9oktZfVgsW/o7McgO3hOPCkmLji497NLaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611845146; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iFGwwR/4NSh0QtY/SzSQl7FxOSMKZM6tQtbM7nkbMcg=; b=TS6MRK7ytfu+RywktGoJ7M3xE8lGP9QnkaTwfukLW1ZrbP3Nu9XP8uvBwrZy84LC535Ab95E56JkXZwIsm9LrHkDPg5EykRFEWHAp2t0HGTc09JkzGbJuBuJHxD0YFTM4hmU9FadMN5gb+XEzyr5P/MMqi4r9uwlgFhkbU6vPm8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161184514580889.07880500344709; Thu, 28 Jan 2021 06:45:45 -0800 (PST) Received: from localhost ([::1]:53270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58YJ-0004IP-2F for importer@patchew.org; Thu, 28 Jan 2021 09:45:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58UY-0000WJ-VO for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:50 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:38555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58UV-0007Hg-6l for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:50 -0500 Received: by mail-ed1-x531.google.com with SMTP id s11so6882516edd.5 for ; Thu, 28 Jan 2021 06:41:44 -0800 (PST) Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id b26sm3121997edy.57.2021.01.28.06.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iFGwwR/4NSh0QtY/SzSQl7FxOSMKZM6tQtbM7nkbMcg=; b=cXhKKg6xPaGb6ovWbCxn+FyPIAOuYN9c85+TIxoyIW91BWrIK47ulNT3AU/kFPwtbu 0lhBKL32Xf8yYuWnL4P2t7vUQ1n17mSH4SLbpbVLwaO7PGchDLKCth0AQlNBW0c10KEg lNmvjya8ONmm3KffX2iZND6TV2uC5CD3Y2Bw9HBhKz7L+sJCBQqIsAnE0Mz/CUDnAehJ IO3UKIhW51/l5ueIt3IBi6k0/G9pRoNlAhLEKdi8anyl8TghGbiTDMNOAIoHh1QKPY31 ++EkfNtpQC7ncbreFfUTO/DSHRVPaUYE9BVEbmS6cz+ULsMRxo92S56TRw3+NUqogfmi Wg0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iFGwwR/4NSh0QtY/SzSQl7FxOSMKZM6tQtbM7nkbMcg=; b=aCFNpMPjOSufnS+891wGrmIVCxlF0CuuIQq9OAPs4sgimb1dWVLWUSvubF7/L9xH0v v1YyktI6aUfgCHBLF8MJafJNmHi2LA73TQjQA3FGQLoD0jxl/XC4ogmNysRRBd1gaNAL 5fCxTuzmz2m08psR9kxjESbYd+g9PCy9S3mv7bpJOCVEAoayOA5EqakfrLFqnqLrrnPW 2gmFPHX+7XveAYZcn1ogOkObT+KQJivDkf+vD7evtZMHeVpcaNhV09few4Z67eb9kHtG P44Wobd/Hq8FFinU8CvhSC2V0mijpM23uDt2UC5mpBh6rdFQLKG7qt8Z9+ekPnDrZ9YJ c+jQ== X-Gm-Message-State: AOAM532kwZnEEnmUKaV5l5QSWnDc3IW1ByTc7nb/uNaJyGObA1p+KXah PahCW6fTesK3XQ1AUXbLopf1TTxIT5k= X-Google-Smtp-Source: ABdhPJy39/k6Ufoi6RsleopAbSRzIp96i1oV+DIK2U/bngLd2qBu5kod9npJ9zWNsF9XvDYMgnjGKA== X-Received: by 2002:aa7:db4e:: with SMTP id n14mr14386597edt.101.1611844903589; Thu, 28 Jan 2021 06:41:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 03/13] target/mips: Remove access_type arg from get_segctl_physical_address() Date: Thu, 28 Jan 2021 15:41:15 +0100 Message-Id: <20210128144125.3696119-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::531; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Huacai Chen , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) get_segctl_physical_address() doesn't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 9906292440c..d89ad87cb9d 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -245,7 +245,7 @@ static int get_seg_physical_address(CPUMIPSState *env, = hwaddr *physical, =20 static int get_segctl_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_addres= s, - int rw, int access_type, int mmu_id= x, + int rw, int mmu_idx, uint16_t segctl, target_ulong segma= sk) { unsigned int am =3D (segctl & CP0SC_AM_MASK) >> CP0SC_AM; @@ -306,7 +306,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, segctl =3D env->CP0_SegCtl2 >> 16; } ret =3D get_segctl_physical_address(env, physical, prot, - real_address, rw, access_type, + real_address, rw, mmu_idx, segctl, 0x3FFFFFFF); #if defined(TARGET_MIPS64) } else if (address < 0x4000000000000000ULL) { @@ -370,26 +370,26 @@ static int get_physical_address(CPUMIPSState *env, hw= addr *physical, #endif } else if (address < KSEG1_BASE) { /* kseg0 */ - ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, rw, - access_type, mmu_idx, + ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, + rw, mmu_idx, env->CP0_SegCtl1 >> 16, 0x1FFFFF= FF); } else if (address < KSEG2_BASE) { /* kseg1 */ - ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, rw, - access_type, mmu_idx, + ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, + rw, mmu_idx, env->CP0_SegCtl1, 0x1FFFFFFF); } else if (address < KSEG3_BASE) { /* sseg (kseg2) */ - ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, rw, - access_type, mmu_idx, + ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, + rw, mmu_idx, env->CP0_SegCtl0 >> 16, 0x1FFFFF= FF); } else { /* * kseg3 * XXX: debug segment is not emulated */ - ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, rw, - access_type, mmu_idx, + ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, + rw, mmu_idx, env->CP0_SegCtl0, 0x1FFFFFFF); } return ret; --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.47 as permitted sender) client-ip=209.85.218.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844910; cv=none; d=zohomail.com; s=zohoarc; b=DUju3bLQfx21up5pa1WCwQZQ8FKwcaYV3ffohZ7zHNSaHcodyTjJajc/fAh+aby8BtV2IjQ/r7GvIjxgbHGik9GP/fxXLICB6cOoFGH3/Prraq4aHWTWfL14RweGZnXmt7+8F/OxB4o6Ho0RtmhYoHkDYRRwvbTpaKqEjXPDTKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844910; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tCIz4+GwmUuvCIaVJUlWNUkHVZqipaJXGWDe+SF+xJU=; b=AzvnOOYEL1FVFmN0/M4Eaj95xOP2qMOriIIq0KkxbW3jZjaoKziVPttN6E6DWFYCdK+f19CRMU3eBNWxI1z2TgISWiDmGGxy/95CWL8ws3lcQnF4VBRk+8+OZYFjkEsJtRUidKzMoFxwXkAeRjnu3nWxT6PwsyVPrckkl1J3GkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.zohomail.com with SMTPS id 161184491080320.34821525734276; Thu, 28 Jan 2021 06:41:50 -0800 (PST) Received: by mail-ej1-f47.google.com with SMTP id ke15so8069874ejc.12 for ; Thu, 28 Jan 2021 06:41:50 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id s2sm3183742edx.77.2021.01.28.06.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:41:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tCIz4+GwmUuvCIaVJUlWNUkHVZqipaJXGWDe+SF+xJU=; b=mMd63wZWlHpQPxmiOUvNFP4wBrZla3efITsuj+kR9rGfHaHnWnRcqwYH+ANpd3QuY+ lsH0vWxaAqvJ/idAW6IiBY/Gak44I95VBdYlzFKfhlxndLG7KQeke+GBsDxGZjK91V8L /+vszRVetyjJf9hjJ7/pZHnNQW0OyWCG/5tySPEn0qXf1/4eaSQ8B6ECg0eJY4ugo3cj ZKw3iNtBwb+FycWa2NRn07N866qtosrC7PL0QI+BRTdPmsc89cBCulxVK323FNeb5v4Z 0eIVTOmkagGwYdpPfmR/S2dCTXlB1+8eKQZE6fi9xug82GGlFmY9wm065y6IjtjVZo8S CCZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tCIz4+GwmUuvCIaVJUlWNUkHVZqipaJXGWDe+SF+xJU=; b=WfGk8F7Pm59aomYXmKrrhQt4JVVcXSvxov978E7S8AeK/oVjdcfIJiP4d54FtO0yAp hf2nKkE2+wWQXfV5LbvzyscMjfEmw9KcDLdpgdwgf5Id9ZyukfZNe5kdBeg2febZGoBl bnMxIakz/HZnvP14XADCIdgG8sQTLx+GHYtv9XlEYVXV6JLpP68FSaasRN6EGC0XhCik GAtLtTPtm3j4v8kTieWzdg4n67H6jbMvBaeKtPGPIBlBENEndrQEy8Y6Kb/zqPsYWqZP KNu3DL+u9+l9PToSpZpiRQ26QPmKnqZktxqHvLUpMIzyzUbogZSviC4F7v6JDY7I69zF l0zw== X-Gm-Message-State: AOAM531Xfbsd03c5cfeEckUTjE98lSIRxODtW2EUyl8/XvGKbvnZ7tmI mkZuwgTTqzoL7E0gZ2K76XI= X-Google-Smtp-Source: ABdhPJxb3AGz+Etq2GDGsGfMHcZeLghZWJ5UzbrxebnKOz4HLfRXcOKwX+D266V9EIbtZpXuuqf9ug== X-Received: by 2002:a17:907:10c8:: with SMTP id rv8mr11097097ejb.228.1611844908906; Thu, 28 Jan 2021 06:41:48 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 04/13] target/mips: Remove access_type argument from get_physical_address() Date: Thu, 28 Jan 2021 15:41:16 +0100 Message-Id: <20210128144125.3696119-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) get_physical_address() doesn't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index d89ad87cb9d..c9535b7f72f 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -259,7 +259,7 @@ static int get_segctl_physical_address(CPUMIPSState *en= v, hwaddr *physical, =20 static int get_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, - int rw, int access_type, int mmu_idx) + int rw, int mmu_idx) { /* User mode can only access useg/xuseg */ #if defined(TARGET_MIPS64) @@ -492,7 +492,7 @@ hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr= addr) hwaddr phys_addr; int prot; =20 - if (get_physical_address(env, &phys_addr, &prot, addr, 0, ACCESS_INT, + if (get_physical_address(env, &phys_addr, &prot, addr, 0, cpu_mmu_index(env, false)) !=3D 0) { return -1; } @@ -570,7 +570,7 @@ static int walk_directory(CPUMIPSState *env, uint64_t *= vaddr, uint64_t w =3D 0; =20 if (get_physical_address(env, &paddr, &prot, *vaddr, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) !=3D + cpu_mmu_index(env, false)) !=3D TLBRET_MATCH) { /* wrong base address */ return 0; @@ -598,7 +598,7 @@ static int walk_directory(CPUMIPSState *env, uint64_t *= vaddr, *pw_entrylo0 =3D entry; } if (get_physical_address(env, &paddr, &prot, vaddr2, MMU_DATA_= LOAD, - ACCESS_INT, cpu_mmu_index(env, false)= ) !=3D + cpu_mmu_index(env, false)) !=3D TLBRET_MATCH) { return 0; } @@ -752,7 +752,7 @@ static bool page_table_walk_refill(CPUMIPSState *env, v= addr address, int rw, /* Leaf Level Page Table - First half of PTE pair */ vaddr |=3D ptoffset0; if (get_physical_address(env, &paddr, &prot, vaddr, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) !=3D + cpu_mmu_index(env, false)) !=3D TLBRET_MATCH) { return false; } @@ -765,7 +765,7 @@ static bool page_table_walk_refill(CPUMIPSState *env, v= addr address, int rw, /* Leaf Level Page Table - Second half of PTE pair */ vaddr |=3D ptoffset1; if (get_physical_address(env, &paddr, &prot, vaddr, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) !=3D + cpu_mmu_index(env, false)) !=3D TLBRET_MATCH) { return false; } @@ -843,16 +843,14 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, #if !defined(CONFIG_USER_ONLY) hwaddr physical; int prot; - int mips_access_type; #endif int ret =3D TLBRET_BADADDR; =20 /* data access */ #if !defined(CONFIG_USER_ONLY) /* XXX: put correct access by using cpu_restore_state() correctly */ - mips_access_type =3D ACCESS_INT; ret =3D get_physical_address(env, &physical, &prot, address, - access_type, mips_access_type, mmu_idx); + access_type, mmu_idx); switch (ret) { case TLBRET_MATCH: qemu_log_mask(CPU_LOG_MMU, @@ -884,7 +882,7 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, env->hflags |=3D mode; if (ret_walker) { ret =3D get_physical_address(env, &physical, &prot, address, - access_type, mips_access_type, mmu_= idx); + access_type, mmu_idx); if (ret =3D=3D TLBRET_MATCH) { tlb_set_page(cs, address & TARGET_PAGE_MASK, physical & TARGET_PAGE_MASK, prot, @@ -909,12 +907,10 @@ hwaddr cpu_mips_translate_address(CPUMIPSState *env, = target_ulong address, { hwaddr physical; int prot; - int access_type; int ret =3D 0; =20 /* data access */ - access_type =3D ACCESS_INT; - ret =3D get_physical_address(env, &physical, &prot, address, rw, acces= s_type, + ret =3D get_physical_address(env, &physical, &prot, address, rw, cpu_mmu_index(env, false)); if (ret !=3D TLBRET_MATCH) { raise_mmu_exception(env, address, rw, ret); --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.42 as permitted sender) client-ip=209.85.208.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844917; cv=none; d=zohomail.com; s=zohoarc; b=YjS7FXQode71rAkSMD6xdnOsQ0rlGoAud/bTU7LqRGY6prwoc3KHR4Dgdx1ZPf4EgnxlR+gM1AgfoEqFdUGqCqVK1cY8v6iCCqY0O7wAN0UwlvCD56eFU77+MlBzxK0EdjLMowxoISPUGGDlVDfTpMVI2VKeZpKixzeGNdAwBQA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844917; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+NyLP4/ImVPnecvb+eZeVSP/TUOelRx6xYCp4TmFnCg=; b=Yqzn5QueTjiBql/+F2LsOvXNKt9UgbDNollIkvMQ+X8dCeBY97LA7mFafkDCYR2U/WW0pWM7O6eOib0rjh3kin4x8R5vsok5jpxlsJPANpUotAYy+fAPsmfiCIshjTsRn3sEL5X/dJYRnb/vfJIgbkNOi4G7hvzc7PoJgObGvZo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by mx.zohomail.com with SMTPS id 1611844917898979.9119280542261; Thu, 28 Jan 2021 06:41:57 -0800 (PST) Received: by mail-ed1-f42.google.com with SMTP id c6so6910561ede.0 for ; Thu, 28 Jan 2021 06:41:55 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id lg21sm2372913ejb.91.2021.01.28.06.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:41:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+NyLP4/ImVPnecvb+eZeVSP/TUOelRx6xYCp4TmFnCg=; b=TBzVjUTCSL/4WMLOsCyvpxTj+JORpZguH+LpIjbbZLuGceE1GH1cODsh+FFkpEZ0BT x5fP0ZBC3e7Yg854KVuOHvORfOLwh5mfdeaC/l4RQO9X6PkJflDUMnwknoZolEEegCgU HIcKs1tvBwMeI/qARzQUH9cO/Kwv7AayuqAqRwsLyjzdcfqZ6UWuZKaWLBQj6JXRJzaS pPHn+suAGna4HYis4AKSIbisLewxR0DvNfjmlAKYsdamyruPVUz3gEwUiSU/Jb8RAYh2 ZsYfvaSnmSBjNXNLGJOdiVi8zSlPVMzXe7qtURJ0H1ImlZd02lC/oBEYKZahOaV30uyU zhlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+NyLP4/ImVPnecvb+eZeVSP/TUOelRx6xYCp4TmFnCg=; b=sP/KarqCkqBquK1tJvExypBatKaU9mTzWkDTAPo22CA5ESjvLwr/AspChzhYMgzLRM zslUmN+oOA0/BgF+gXxmA7QSBHro9pQhuzW3obRKC5/wIU5Gn/JFRzM6CTwIQ+KMWXjI NaDQzj5HK5PDL4K4HYtiiP+SZrUNhgAPgO2LUQDZvUmeVEUDRXrzqQ8Ez4n6uObEEwjm mP1pdNy38CPo85qdoG7zAyKUp4BDvofwrgIq6QQGV+97LiNEKiUd1WTNmcdam4gPLQyh pzx6pT73rcCzm0+JJuSzeZnA7sNHjnfQh2r66yp2FKf3dllS7d33MX7qb0CubkN4qhL9 D0qQ== X-Gm-Message-State: AOAM531CRpI9cPaJxuMgmUecYdZwY1H4qnSax5mfmB4cfSbFlHg6Z/5q wGrhTaYcgq80MWlLxOrH8b5dip4ECYY= X-Google-Smtp-Source: ABdhPJwQadWqyrEmTt6gI2FGcsumt2MQkO+GfbPoXcLR2aUUIdYf+PzxzEDyZ8FLP9TuUZOtjnyJyw== X-Received: by 2002:a05:6402:3487:: with SMTP id v7mr14728463edc.68.1611844914116; Thu, 28 Jan 2021 06:41:54 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 05/13] target/mips: Remove unused MMU definitions Date: Thu, 28 Jan 2021 15:41:17 +0100 Message-Id: <20210128144125.3696119-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Remove these confusing and unused definitions. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/cpu.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index b9e227a30e9..9e6028f8e63 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1220,22 +1220,6 @@ typedef MIPSCPU ArchCPU; =20 #include "exec/cpu-all.h" =20 -/* - * Memory access type : - * may be needed for precise access rights control and precise exceptions. - */ -enum { - /* 1 bit to define user level / supervisor access */ - ACCESS_USER =3D 0x00, - ACCESS_SUPER =3D 0x01, - /* 1 bit to indicate direction */ - ACCESS_STORE =3D 0x02, - /* Type of instruction that generated the access */ - ACCESS_CODE =3D 0x10, /* Code fetch access */ - ACCESS_INT =3D 0x20, /* Integer load/store access */ - ACCESS_FLOAT =3D 0x30, /* floating point load/store access */ -}; - /* Exceptions */ enum { EXCP_NONE =3D -1, --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.44 as permitted sender) client-ip=209.85.218.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844921; cv=none; d=zohomail.com; s=zohoarc; b=SGqr/FDAAo1CQQxv60vpuxetGMxGpVFLPZY8Enm3nXywcQ1nNud87ToyAFGF0jttLCry+7Yro+MM0R3qnBObOpTDQYJ4jACxYiM/rca+izE9h/8/euyDYnvkm2o3Qy6Hfx7LlEdHoKvBqxxM0sjdHUT0QrRd0AbvkbBMbL3ZQKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844921; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2njBE1pZa8pdGTXYyGM0UyS69kKbQOe35lfLGNmI8lg=; b=fnPoLzGmIIV8h2TtirgDKuM05yh6zltLouYwfCp8egYcEZDgBjobPqtUmbE3r3NF3HAdqLvq+ZYrTdVUV54sP/xJxc5NI95cWz9b537maLUVygGFH6IHDMP+So4juSEuZCh6JK9WEDlEd5w55iEhfBs8YQ+A+HKMtLy1iT2T5KE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.zohomail.com with SMTPS id 1611844921458351.4753950063632; Thu, 28 Jan 2021 06:42:01 -0800 (PST) Received: by mail-ej1-f44.google.com with SMTP id ox12so8150512ejb.2 for ; Thu, 28 Jan 2021 06:42:00 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id r7sm2369694ejo.20.2021.01.28.06.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2njBE1pZa8pdGTXYyGM0UyS69kKbQOe35lfLGNmI8lg=; b=Kjq4IIdAyNk1GKAkP94Zx4QNrLi+ttIR6FC7OG59OarYeiLLCJua1iI7LRDpPc9dhL UCQ+NMRhzYJXizi1Vy5hvxKoutpLpg/n15rNnrr+PSY4V0YGnGTFPKbzy6SPTcvbvY9e Fq8SESnfwni0BJZ8XVqhXCluxozuvmFJSry0hlQsER1C8QJMbvZ6BrXMW/8aBvPXq2EW kZaY6kNh3IHSwX2TysXhIwWN54s3dBLXOaD80oxdqacCcqa8OeKjn4uTZHMBLNKNda5R VzdXFwQv8XCmdxdAEuvAlrenzduFPkYYt/YXi4195hMfJ3ydSbA1q0Fcg75uocavr3KJ 8Kpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2njBE1pZa8pdGTXYyGM0UyS69kKbQOe35lfLGNmI8lg=; b=mLXZaGxQCNnJEUiejzjtCvwQuBqjU9dq+qTV7tyZROWZyo7Hg5D9zIQgwwCG6OqwE4 zqwyJyGsWIvyN5Yujpteb5UhAwYShxVhQ+edbB/Jw4BmIWsGhbP/LAos8H5wLyvTjiWO bOi4VFjvkxdJFJ86pgS8HY95zU+MJGYyCzZ9fbcusmd3QIv9F46Fm6hWToCmhs29ti/K xH+2i/ABM4NrA9wU+lNfWWtTYPjHm5rNor48UhZgLleQTKHMPVlBvXN5h8j/TwCDGBBH QVvB3x15CRrjP5whIiXQnLnI44/4OH1wYGjbpAd+9J7JuYLwFY22ZjWKzWGF7LvkiNRI 6DjQ== X-Gm-Message-State: AOAM530xgobVlG2lPPuy+it9PmqJdeF9ztB1GmL6hFMWQ7Vue1CrGn/8 +RulF8bB/1N60RZauT5jimg= X-Google-Smtp-Source: ABdhPJyx6ScR6irYIpLmtuUEXqmRcjO6xQLpv7LiDpIDcQPIv9rZBrRWwgQdN/b4V1Xb3um40LY6SQ== X-Received: by 2002:a17:906:2681:: with SMTP id t1mr11467750ejc.29.1611844919665; Thu, 28 Jan 2021 06:41:59 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 06/13] target/mips: Replace magic value by MMU_DATA_LOAD definition Date: Thu, 28 Jan 2021 15:41:18 +0100 Message-Id: <20210128144125.3696119-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/op_helper.c | 2 +- target/mips/tlb_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 89c7d4556a0..9fce0194b3e 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -312,7 +312,7 @@ target_ulong helper_##name(CPUMIPSState *env, target_ul= ong arg, int mem_idx) \ } = \ do_raise_exception(env, EXCP_AdEL, GETPC()); = \ } = \ - env->CP0_LLAddr =3D do_translate_address(env, arg, 0, GETPC()); = \ + env->CP0_LLAddr =3D do_translate_address(env, arg, MMU_DATA_LOAD, GETP= C()); \ env->lladdr =3D arg; = \ env->llval =3D do_cast cpu_##insn##_mmuidx_ra(env, arg, mem_idx, GETPC= ()); \ return env->llval; = \ diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index c9535b7f72f..9216c7a91b3 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -492,7 +492,7 @@ hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr= addr) hwaddr phys_addr; int prot; =20 - if (get_physical_address(env, &phys_addr, &prot, addr, 0, + if (get_physical_address(env, &phys_addr, &prot, addr, MMU_DATA_LOAD, cpu_mmu_index(env, false)) !=3D 0) { return -1; } --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) client-ip=209.85.218.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844927; cv=none; d=zohomail.com; s=zohoarc; b=nBYPJ4K8s5nNfs9DufUxTUJDh+8aFNNphAtIH5WBUQ23gvx1Cj5TkSX1vc8AScRhApBM9MDI8LGxh1cbGGzglPiUC46XyNWFDDWeLJanpL6xNIXohLHtOBEnm2yoJJr6chI5B3nwPImUeKUoD0DHz3B/2iAMqjDh9SdAVbZCDfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844927; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NePsERJCA+duW4QZFzCVHslJqsTw1k9Xp1nAXSAohg0=; b=KTp6nJIInAphX4mv1UshCeXXzfVkpUdApon7tU+olBzoERTjni6dSWNrQz2nf0xYIOsoHFO/zQXJYdkyPB2xtMjfHqU2+Ka6eXUSWoi0NervQy+iY/72921RanoNkilrrOP4j03UySOdizU0sTG8HFlKpJfx1CpVmkJP2+j6tkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.zohomail.com with SMTPS id 1611844927405462.19778475581086; Thu, 28 Jan 2021 06:42:07 -0800 (PST) Received: by mail-ej1-f48.google.com with SMTP id by1so8170452ejc.0 for ; Thu, 28 Jan 2021 06:42:06 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id he38sm2269490ejc.96.2021.01.28.06.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NePsERJCA+duW4QZFzCVHslJqsTw1k9Xp1nAXSAohg0=; b=mmo+/8t7T0o+E56cPv17XAUYRJO1vlcJrlK2jSarbGo2zEg3QSl+ZmhAkXp3T3lztN hwe12SwGe5FZAUSkHmVUH/IARqJNTnK17lBtzLYQJBia9dgMaCcoZDavCT7q4rfLk/cK 0T4KwGKbF2QgOiN1a3E+/m3e25PSYkpngQhPkav/nhQKWIObjSuUnhuQwflIUOv3D+AP Fe6d/kFX6PIMinQk5rwrMJhaaMoE966fIMz0vhKWaX3i4fD8MpvK8/BtBwmvL8lmwDBW kKVSIPC8tOIPvaZOMGMBSpTPvbmsiEKlCU6Ka2pQJ5jRI2v1x4xLtcfVY0r3VsY7mjae mnLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NePsERJCA+duW4QZFzCVHslJqsTw1k9Xp1nAXSAohg0=; b=ptXOFXEWLk5uBALT5DvV4eC/2406k/7a831IZK7X5ZhzKH3dcPVMBL1StK+HivB91D rd5DupspYPk3B38YTh4VQWWfSst9aYcdtfHAtraHrsMNC/I6MyN9kSBB5u5vhISQDik/ mPYkcqRxAY3ATvx1RUwIf6dHFseCVHgvCvqGKfBTFIWKtIEDJxj3kxvSgBYBfrvGHkRL 4pyPySLuEdRkoyQfPC/IZE8ZYWgxZLnrYSNBMAu2x5yRQIe7a6IdZHh3aGU4UEW0xEim U6GXhyh6ZMenOolY1/CL0GSMqvjk4UycyYLiGJ299UDrqICgRNxPKhUsOxfNQkj6zHNQ InFg== X-Gm-Message-State: AOAM532JmbALkHHOYNXr49H6lnlSTwyZrp+u7rIlf5wPDJXbC77r5ROK 3QRz5VGw8Oy1d3DwRKmoJcM= X-Google-Smtp-Source: ABdhPJyejaoNtcvyZR1GEPqhfDVa4VaNtP8PO2hkO+1fQk7kt3y5CeVF7GM7yzefcSUtoWkMgTJ3LQ== X-Received: by 2002:a17:906:3885:: with SMTP id q5mr11608862ejd.105.1611844925635; Thu, 28 Jan 2021 06:42:05 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 07/13] target/mips: Let page_table_walk_refill() take MMUAccessType argument Date: Thu, 28 Jan 2021 15:41:19 +0100 Message-Id: <20210128144125.3696119-8-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The single caller, mips_cpu_tlb_fill(), passes MMUAccessType to page_table_walk_refill(). Let the prototype use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 9216c7a91b3..afcc269750d 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -621,8 +621,8 @@ static int walk_directory(CPUMIPSState *env, uint64_t *= vaddr, } } =20 -static bool page_table_walk_refill(CPUMIPSState *env, vaddr address, int r= w, - int mmu_idx) +static bool page_table_walk_refill(CPUMIPSState *env, vaddr address, + MMUAccessType access_type, int mmu_idx) { int gdw =3D (env->CP0_PWSize >> CP0PS_GDW) & 0x3F; int udw =3D (env->CP0_PWSize >> CP0PS_UDW) & 0x3F; --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.43 as permitted sender) client-ip=209.85.218.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1611844932; cv=none; d=zohomail.com; s=zohoarc; b=PERikV6yziRuMBZTcK+emGElS5zpsoEQyCmuCgf4RIWxHdbkYa977+PvmZ5bNqx2K1dY7HTsN+AcrvePKamx20PN2d8XCrF71X+oKAgdiVdZjTIIcmnZjfYoa8KLJb1DSz7Wm2xL66//+yeCkwRpG09oVyxyTeZTBzT4k8t44Ag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844932; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/NZWiNgrL0JvRHxnsj+sLTCD94H0+awi3rBlYAhZllE=; b=hwVOC52YiclsUNt39u9OICL6DA95TGKTqealtzuT2IC+f/TAhVmYg/688eZlK+XSCXCD5NbDd0XWKa0FmPZuP2MFMoJiEYFAhSEXQWMD5sbnG/Vn12NvAbXNXeK1WAjr0e8+cp1QHB5RbCbIDTUmuQLDUzVkqZhTyoYywGezqrk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by mx.zohomail.com with SMTPS id 1611844932913121.68150584142859; Thu, 28 Jan 2021 06:42:12 -0800 (PST) Received: by mail-ej1-f43.google.com with SMTP id bl23so8128443ejb.5 for ; Thu, 28 Jan 2021 06:42:12 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id x21sm2372578eje.118.2021.01.28.06.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/NZWiNgrL0JvRHxnsj+sLTCD94H0+awi3rBlYAhZllE=; b=sQRQnZ0f6zWUSS81H381TlTKF2dRHT/G4HDbhc55wGazqCANc5fuk+qDwxs711hyqH M1IZhMvoiFKX0cGPahynB6b6q3PONhCiY2KWFxZhLgUhZbhstLFeumdHKoXUKDkgidQZ JdEEGVFcMd3Ucej25yZIRQpCY2lwNHy+6WXYMP42d1E13X/Ezr394VstWWB/S9ZKb/vQ WQEXmmJfqNg7ymXVOUdRLDrAzQFxpNdtxYQXf117SYLRBs3y7o8mItBFc0kuAnvqYC34 AsJSPETaNjlsij2K7dNdW8ZuhlsoxXGLh3RdMDgJo8wLGuSQG9jr9Zp0idt+u8g/Lmcd eVQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/NZWiNgrL0JvRHxnsj+sLTCD94H0+awi3rBlYAhZllE=; b=UprSXaTqHkW3gh5L4Z4dRetbRpshEAPo+tyr3eALLL+U2YTKdJ0zElsGtulK3g0192 5rmkUz8A5p0kucN8aRCHiLOcajuEytEamm44A9XN19TD4BS5YjlatMNCTbuRRLpq3vZN ew7SlU/VVSDWgFKJk7wuOl/5A1/Sl+GRZhbRUY63maYUugofWB6XnzBlB05YAWsTOdCK yqsWDteNQNdR9NHt7Lf4SFu249WX1VJ3wrDVURTMTtL8jVS37OZVngSihV8e+s7KXRzq 7epiXdJn2BXK8eKdSKcnV+E71V9w+DN9HlbEnXQu4czIR8txwAL/UHSIFGcvRjZwUZH/ diNA== X-Gm-Message-State: AOAM530d0zh47nJasPH3O8jOokeVmUmc+MI/leWYZJk/+R5ujZQ06O0n D7oxI2f0npOJbSJIJGC52g4OaZBsamk= X-Google-Smtp-Source: ABdhPJy3o+AJiJGeNYhKyIKqxs5gAhMp5E8chbD2YoPI/iBd7pXmmXnLOjobdH3esf8zYEhHWrtzcw== X-Received: by 2002:a17:906:e09:: with SMTP id l9mr11586525eji.196.1611844931184; Thu, 28 Jan 2021 06:42:11 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 08/13] target/mips: Let do_translate_address() take MMUAccessType argument Date: Thu, 28 Jan 2021 15:41:20 +0100 Message-Id: <20210128144125.3696119-9-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The single caller, HELPER_LD_ATOMIC(), passes MMUAccessType to do_translate_address(). Let the prototype use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/op_helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 9fce0194b3e..b80e8f75401 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -288,13 +288,14 @@ target_ulong helper_rotx(target_ulong rs, uint32_t sh= ift, uint32_t shiftx, #ifndef CONFIG_USER_ONLY =20 static inline hwaddr do_translate_address(CPUMIPSState *env, - target_ulong address, - int rw, uintptr_t re= taddr) + target_ulong address, + MMUAccessType access_type, + uintptr_t retaddr) { hwaddr paddr; CPUState *cs =3D env_cpu(env); =20 - paddr =3D cpu_mips_translate_address(env, address, rw); + paddr =3D cpu_mips_translate_address(env, address, access_type); =20 if (paddr =3D=3D -1LL) { cpu_loop_exit_restore(cs, retaddr); --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.50 as permitted sender) client-ip=209.85.218.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844938; cv=none; d=zohomail.com; s=zohoarc; b=nOaIFZ7GjCfiQmeg58SzN0Pfs97/8tbkmbb92LP7M1Vj83htxvKKMIqmDffh55biYcQoNGSL48IW70B4Uo97RuUwdM18u1CWbnJKZ0Da5X/AT279nwZbGZ9NhcYVbSxec11sNuuGdH68RkAlbVz/JN3vmKekvm44J9Yxb3fi1wU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844938; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CmTxj82w6c9LkOjct5SouHTai+uMb8a+ssmAiVzlGfc=; b=XVXScIvXOcPiKh0cgOsyNfIIeihBsno3MeT5OTTy6tKOF41PXcxg/KUW8EQzC+ksbYB4k5hbViZocsvF8dS6Rv2UEfeb3kG3Gcw8qH8UKHcAAHcYnhpiBOARXMhRz/+i7t4tfhjG3kreckleVVo0DTYfuK0ZiND63+n8g+m61XQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.zohomail.com with SMTPS id 161184493872585.75992704043881; Thu, 28 Jan 2021 06:42:18 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id kg20so8131307ejc.4 for ; Thu, 28 Jan 2021 06:42:18 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id p16sm3030245edw.44.2021.01.28.06.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CmTxj82w6c9LkOjct5SouHTai+uMb8a+ssmAiVzlGfc=; b=sM350Ra0Kbmtny045lXrjhY62opi9E3q1Mcb5gJyafXCl/CUkHzKQjj1/mtBKXb7P9 8vwfBJjnq07mdKexu2Uofv04O5eQkkDrEbrBsi/P1/MBxNZg7jKDGu+5OYv6timiQyve xpeovl7kY66Bq6VeIuD4YpiEvS0noE/GN9cZl7CU5hRCyKCzto/z/I+z0NZXTYBOIJ1O YnkOtUb5vAYE6q7tYtb/xkCUSuNUqZhDG1PPuhk/BGfdjIYX7NSP1NGUAY2CiDjt6yxD L2lYkaTKHq49NVbGN4Bh+bElehTd/TZ6mguhGvHSkVEqsS7mmZyL48wsDE7uDmV3hysz wqHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CmTxj82w6c9LkOjct5SouHTai+uMb8a+ssmAiVzlGfc=; b=crs72eeBOxo0oDe8Z/WlcloSxld7vE6kIwVXESbX3jtnxS85aDEk0CdauOOBo3Rnt1 FiX4W2fAh5LAkiPT6wEOJMzplWeiME0Ao9XBcEHctK3p4dLvn7ygk2koLKVHzEgzIjit ZnxkuKtWN2NVNsgXztWtR/S7IHVgesOCRx0GoduHq0BX8wi/9jL69BR3YT51gjBg1610 Fasd/dEP+lK4IpXmS6JTq2IoW33fG2BzEUd+Gs7WzuVDVaCi2wa7IKoVl57poCjtWy22 WSWx5NjzFYAoNU0u6VSnv0WUgZadfoGcMrXYCRlpBrifGdepCid3L79FMU9oBsa4uAaW fkMQ== X-Gm-Message-State: AOAM533fSDv5/h6sHMTtCCT0a5naxBUjXB7jEdjmx0shAm9ro7CV2H4p dRCoUSVHmDVvmT3Bvu7rBxQ= X-Google-Smtp-Source: ABdhPJwK1Gv/vjAiDkzvZaSCK1gEES6nSDqJc2n5cYHx/JM6jB8iM4VyvZ+l6fX6E0obU4vkgAU41Q== X-Received: by 2002:a17:906:aec1:: with SMTP id me1mr11972466ejb.114.1611844936950; Thu, 28 Jan 2021 06:42:16 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 09/13] target/mips: Let cpu_mips_translate_address() take MMUAccessType arg Date: Thu, 28 Jan 2021 15:41:21 +0100 Message-Id: <20210128144125.3696119-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The single caller, do_translate_address(), passes MMUAccessType to cpu_mips_translate_address(). Let the prototype use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/internal.h | 2 +- target/mips/tlb_helper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index d09afded5ea..34915c275c4 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -146,7 +146,7 @@ void mips_cpu_do_transaction_failed(CPUState *cs, hwadd= r physaddr, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retadd= r); hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, - int rw); + MMUAccessType access_type); #endif =20 #define cpu_signal_handler cpu_mips_signal_handler diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index afcc269750d..e9c3adeade6 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -903,17 +903,17 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, =20 #ifndef CONFIG_USER_ONLY hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, - int rw) + MMUAccessType access_type) { hwaddr physical; int prot; int ret =3D 0; =20 /* data access */ - ret =3D get_physical_address(env, &physical, &prot, address, rw, + ret =3D get_physical_address(env, &physical, &prot, address, access_ty= pe, cpu_mmu_index(env, false)); if (ret !=3D TLBRET_MATCH) { - raise_mmu_exception(env, address, rw, ret); + raise_mmu_exception(env, address, access_type, ret); return -1LL; } else { return physical; --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) client-ip=209.85.218.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844944; cv=none; d=zohomail.com; s=zohoarc; b=e/2p6IfOz148ynih7U8zNS4V1dgbC5nIJLFoFMbAXRWvRYk04CbAThZS/7gPQNOVfDHTHbMwiIwEZIWU3Fbh9zwtL8RITOHXXlM4k49cV60tfKyk4I9hdwudgpfqk+TP1J1N42QDFS9a79r+T9wc4OstZYM7jDFLoP6jlePIMYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844944; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XsxYNKQjHpshThFWLLVqysiRnDu3ltFMHigP65/X5BI=; b=PNAKS/aoSCbW7eDkGCUEUlep9354Ay2/bETrchV0tMY4dPySf/hcAHlZV+aiBCrrwrR2D/SYkYDJ/lQgflUKuXwiJGfyYcxrBpe8pjekFm6jxjr727QLC6NZzGUxTxDS2Cz/plES6Yna5qpeaWR1iD4+dvc7JnYHwG1WAEO0PKA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by mx.zohomail.com with SMTPS id 1611844944138746.1319541666418; Thu, 28 Jan 2021 06:42:24 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id bl23so8129477ejb.5 for ; Thu, 28 Jan 2021 06:42:23 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id de4sm3108822edb.38.2021.01.28.06.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XsxYNKQjHpshThFWLLVqysiRnDu3ltFMHigP65/X5BI=; b=UEImJVFjqEjnNLzas3rtV4Q39lD308R/PWSPu6jkIecdNmPhkgTSCaItk/c7h8326g RXLR0koU1BN0QhrItbQ4OBuhiiOpRhqK65KwRkFUkbjCaSc2ESk84dxfWxhz8Jzh9vd2 MIffNsSGacDMgOqY72OqTJsAtVfEKzpNrKseKzFzlIvkos9TCSwPxVtCdJpOHypiL/iX mw0Aa5M2wexq/HgfuOkGvtlt3VijEFfb5F68jOsICTP6oqSmt4lI7HjMtHP7jcSVJsaP Z97fggmCiwzanjYHlMZd54KUemH6eQ2JmH7aoo5NHFn9MxLUj6PGM9RJMptx/jHAMrqS QNyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XsxYNKQjHpshThFWLLVqysiRnDu3ltFMHigP65/X5BI=; b=eXL5XBIQ5vGkryiZECRRjwlhuxOSI/CLG0NFPTxscSNN0ijaUUj5lgWeNHopztggyw xFDRRBsyo4R8W7SEL+MdH+8UyKeZcdaV9mXp2ZC+cmKV17jJ21hRknqDttvYPdz0XpmU g1LTh192ipSiaw3hE3PsERpoY6Wl2ScXMXnpyQGihuRkJhN0BDwixWUXQplH1rk6ld/d zEDYjJhCISsDUvDZdn7ZyBYnNxlVRJ2uXCVOoTKiRVJ7C3w1fDvOWMKbAS7qO2UIfQ6j EJPcYu1QDlr+gdWn2NMlV0aQKns/qtcIjG+ftrMPYM/XSxXYNzl/l1nogEt7z3DCKK4P dVcw== X-Gm-Message-State: AOAM532gHTqZaabA/TXyceU4p46K3MraAhm4TcFGznDco4H7RbTZqdYS p77HsmnPQ6gwYyf3hTfHU9k= X-Google-Smtp-Source: ABdhPJwHs+n6xv6iDpX5I4P8fzehOs+GOoiYB+BdrsJdsUr2BKAHUCWc3nXJNE6QXaiMpKO6YH2H9Q== X-Received: by 2002:a17:906:4d08:: with SMTP id r8mr12121713eju.191.1611844942365; Thu, 28 Jan 2021 06:42:22 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 10/13] target/mips: Let raise_mmu_exception() take MMUAccessType argument Date: Thu, 28 Jan 2021 15:41:22 +0100 Message-Id: <20210128144125.3696119-11-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Both mips_cpu_tlb_fill() and cpu_mips_translate_address() pass MMUAccessType to raise_mmu_exception(). Let the prototype use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index e9c3adeade6..21b7d38f11c 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -405,12 +405,12 @@ void cpu_mips_tlb_flush(CPUMIPSState *env) #endif /* !CONFIG_USER_ONLY */ =20 static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, - int rw, int tlb_error) + MMUAccessType access_type, int tlb_error) { CPUState *cs =3D env_cpu(env); int exception =3D 0, error_code =3D 0; =20 - if (rw =3D=3D MMU_INST_FETCH) { + if (access_type =3D=3D MMU_INST_FETCH) { error_code |=3D EXCP_INST_NOTAVAIL; } =20 @@ -419,7 +419,7 @@ static void raise_mmu_exception(CPUMIPSState *env, targ= et_ulong address, case TLBRET_BADADDR: /* Reference to kernel address from user mode or supervisor mode */ /* Reference to supervisor address from user mode */ - if (rw =3D=3D MMU_DATA_STORE) { + if (access_type =3D=3D MMU_DATA_STORE) { exception =3D EXCP_AdES; } else { exception =3D EXCP_AdEL; @@ -427,7 +427,7 @@ static void raise_mmu_exception(CPUMIPSState *env, targ= et_ulong address, break; case TLBRET_NOMATCH: /* No TLB match for a mapped address */ - if (rw =3D=3D MMU_DATA_STORE) { + if (access_type =3D=3D MMU_DATA_STORE) { exception =3D EXCP_TLBS; } else { exception =3D EXCP_TLBL; @@ -436,7 +436,7 @@ static void raise_mmu_exception(CPUMIPSState *env, targ= et_ulong address, break; case TLBRET_INVALID: /* TLB match with no valid bit */ - if (rw =3D=3D MMU_DATA_STORE) { + if (access_type =3D=3D MMU_DATA_STORE) { exception =3D EXCP_TLBS; } else { exception =3D EXCP_TLBL; --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) client-ip=209.85.218.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1611844950; cv=none; d=zohomail.com; s=zohoarc; b=XzfB6u+eFn2hvDs287bnj5fNzRbLGCKtOA9hIiyVVt4lXUtqx9uvoBVXd4JxWQb3PFB+QfLAKtKK1SrudFnsVLUuOxlpaHrewuYm66Xv5ieLoekjwlCyQlxxUiwjqsGiGi0g9haZHiKwxWPgxnt7lA6bNfn7RUaVcu6E/cuC0Yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844950; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M8+6cLNWr/uAS+TNZ6Hbe5EtuSlUEfhm1Od8LZpx7QA=; b=a+yaBKHnJ34XH66Fk9g2kXx67ks3XDwV5+s6JiX5gQhsPuvG1YTr4nmCo8EU476Ma949XIE+ZDY1QqJI6T79+XzkCV9otHMIrJUMTBHZtOcM0dHJm8LXB0SkIB5LSTx+ZgL/cPeR8PEW5rldN9H0og/HM0MMQZKuKrR7EXYh84o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.zohomail.com with SMTPS id 1611844950724918.5115870848739; Thu, 28 Jan 2021 06:42:30 -0800 (PST) Received: by mail-ej1-f48.google.com with SMTP id a10so8093404ejg.10 for ; Thu, 28 Jan 2021 06:42:28 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id g10sm2362757ejp.37.2021.01.28.06.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M8+6cLNWr/uAS+TNZ6Hbe5EtuSlUEfhm1Od8LZpx7QA=; b=Ez2jppMXKYC1Pm4NLSeqnCEK5zPShk7o/LP/y6I6Jtim2STIzSlmsb7YvMQfnttsfb jpMWPD1Y/Dv5g/lMuH8Izoq1ZLbXxZZSwRztmsdFKBZUO15evR3KuWfpVHpRasyE7Ne9 DA/oXWFLQczXRqBJLJ1aDIXcpl14LpzOUIsQDaGHLqIdBmCMff+L7KRMi0Uq6uVyI9b3 +wrp0O6ITJ0Y1k/06UnMgpljrbaW/5gUcMaaQlTqIhU3TDX8IO2Xj0t6UHG7TXtcPvI3 XjcTcxKKltCze1IS0Tj/lyBTlIlH5CjGhJxVKQo/t947docoMRNLfR0Qu5/pIrl1Rnu2 6+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M8+6cLNWr/uAS+TNZ6Hbe5EtuSlUEfhm1Od8LZpx7QA=; b=PQqVi/K1qLrHwwaxzflCAEvf+8lWmnu+2hdperTTJ9A8czshRasX1Ddrx0OJdYabAZ j+54D9ZXq6Vow1HdMDPmgN25RKOFtg5Zkx2Hz2dLg1sRQpfTbM3xBmCfemUt9Mlwxh92 17gW/uINkJjzEmJNrILCw8eGskZFLT4WrdRpSjt8T2ol/beqIt7bE3Aasszwosc7ILwS yDFuQIlyqA9t6EOQCVCJzryfWESy84nV3Qipd2v30UrlfiHWn1hze7aFkMHkl6/oDgu6 beEsRBIFdkto/XSc6dKzAWMN5gC682HspUIxH1av3JA7RWKN4iegaDHnW0+c8c+a13Fw Twpw== X-Gm-Message-State: AOAM530qhZ5tET4oX4YQbSZOCVRLfkYf+KUDOzW3oFBipnox84k7jP4w tJbE0qTyKPrFjyX54Z+JDI4= X-Google-Smtp-Source: ABdhPJzB3atE4VDXUGrdYO2P/VxE34XduNNg15qvPzoCExAdpXqLlQzFuxpLgZRXuD4jxETYJWa7Xw== X-Received: by 2002:a17:906:7f8e:: with SMTP id f14mr11046445ejr.198.1611844947767; Thu, 28 Jan 2021 06:42:27 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 11/13] target/mips: Let get_physical_address() take MMUAccessType argument Date: Thu, 28 Jan 2021 15:41:23 +0100 Message-Id: <20210128144125.3696119-12-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) All these functions: - mips_cpu_get_phys_page_debug() - cpu_mips_translate_address() - mips_cpu_tlb_fill() - page_table_walk_refill() - walk_directory() call get_physical_address() passing a MMUAccessType type. Let the prototype use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 21b7d38f11c..64e89591abc 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -259,7 +259,7 @@ static int get_segctl_physical_address(CPUMIPSState *en= v, hwaddr *physical, =20 static int get_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, - int rw, int mmu_idx) + MMUAccessType access_type, int mmu_idx) { /* User mode can only access useg/xuseg */ #if defined(TARGET_MIPS64) @@ -306,14 +306,14 @@ static int get_physical_address(CPUMIPSState *env, hw= addr *physical, segctl =3D env->CP0_SegCtl2 >> 16; } ret =3D get_segctl_physical_address(env, physical, prot, - real_address, rw, + real_address, access_type, mmu_idx, segctl, 0x3FFFFFFF); #if defined(TARGET_MIPS64) } else if (address < 0x4000000000000000ULL) { /* xuseg */ if (UX && address <=3D (0x3FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret =3D env->tlb->map_address(env, physical, prot, - real_address, rw); + real_address, access_type); } else { ret =3D TLBRET_BADADDR; } @@ -322,7 +322,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, if ((supervisor_mode || kernel_mode) && SX && address <=3D (0x7FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret =3D env->tlb->map_address(env, physical, prot, - real_address, rw); + real_address, access_type); } else { ret =3D TLBRET_BADADDR; } @@ -349,7 +349,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, /* Does CP0_Status.KX/SX/UX permit the access mode (am) */ if (env->CP0_Status & am_ksux[am]) { ret =3D get_seg_physical_address(env, physical, prot, - real_address, rw, + real_address, access_type, mmu_idx, am, false, env->PA= Mask, 0); } else { @@ -363,7 +363,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, if (kernel_mode && KX && address <=3D (0xFFFFFFFF7FFFFFFFULL & env->SEGMask)) { ret =3D env->tlb->map_address(env, physical, prot, - real_address, rw); + real_address, access_type); } else { ret =3D TLBRET_BADADDR; } @@ -371,17 +371,17 @@ static int get_physical_address(CPUMIPSState *env, hw= addr *physical, } else if (address < KSEG1_BASE) { /* kseg0 */ ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl1 >> 16, 0x1FFFFF= FF); } else if (address < KSEG2_BASE) { /* kseg1 */ ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl1, 0x1FFFFFFF); } else if (address < KSEG3_BASE) { /* sseg (kseg2) */ ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl0 >> 16, 0x1FFFFF= FF); } else { /* @@ -389,7 +389,7 @@ static int get_physical_address(CPUMIPSState *env, hwad= dr *physical, * XXX: debug segment is not emulated */ ret =3D get_segctl_physical_address(env, physical, prot, real_addr= ess, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl0, 0x1FFFFFFF); } return ret; --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.54 as permitted sender) client-ip=209.85.218.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1611844954; cv=none; d=zohomail.com; s=zohoarc; b=nSiZDQ+KNGWJFEeP1WDtvF4PVSGETxVDmFXCIIIOLhfhq8Wd+EpYp8hMuQVmCh2G4mtI8vUYIdO6XaPhWj3cb/FIvIcW25gGD8aJ1YveuhpuaC+8ZQFCYkxHC3BKr2FINn8PdRrNI/iGbEIaM97uR5pBD8NIEvq69Dmz9ThaSwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844954; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r+FuDmEP89SHTv5edxuWj6VZ9o05Wz8zJTpkyRmkCaQ=; b=FA6batm2ScNC7vvJYTOrIVgaaDZUCkGyDsJ2DjjQIfPtmrnYbRb+plI/FfLia9sut0RDMjclwF8dht1neyWvH6F+h51IyJwuE1YbHTlqTWynn4KmvVXKxqZdaxRym8NV2JnylHXSzE9hicLJis8SiTJr1tBKZaNWw3R1qTvGWEQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mx.zohomail.com with SMTPS id 1611844954860825.57785256827; Thu, 28 Jan 2021 06:42:34 -0800 (PST) Received: by mail-ej1-f54.google.com with SMTP id bl23so8130382ejb.5 for ; Thu, 28 Jan 2021 06:42:34 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id x6sm2360798ejw.69.2021.01.28.06.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r+FuDmEP89SHTv5edxuWj6VZ9o05Wz8zJTpkyRmkCaQ=; b=nWDU2OueGlOy4nc0xCzxgLcBMSydNZLQdd9WW6t2e7ggHlzAI7ljpafcbhHu+yT3+a YErFgP7vIxj87QefKu9Dek0B6sX5YC8IK26FC802jm6BNVG6tkU4mQxTAoNrYbcJ80aL 36J9BerM8zor+XZQxMkLKSG9wPYih3kRHVjdH16DQl6LmVfiG02Wr1fQXYivLkSo33h0 bhnJhMH4DCTAb0JDi0pHAR/tkwSc/YkhplqjUnX46DpL0+GpP/Bq2rcDcFXhLuqpxPbZ 2eLcLkFGiKkWf+BdIW9ClMnd4RiztIVPB5JSAVHCUAqQ8Ccjt2tzqdv9tPOWHcr+RpDk 161g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=r+FuDmEP89SHTv5edxuWj6VZ9o05Wz8zJTpkyRmkCaQ=; b=ZcWcZfbkzYgSCg6tpL3xDk7hQGNG1nmxkQJuGMLE+pJxAUc4Ms40ELP9Q+OsFjVB4C Wm9N7pKVa67VRohxGX9fTox99b+fMaaIqCmxY+CcHDp/dZcgaJ73kCHoFvAE4OCI9Xzg W5mOJWi25noYfES+Wr/Cprwbmcd836DNPRWv1C+zV850EWHODSklCzacqZ2Sc7n3BEXu 1G2dEMi9BJ9c5n4WHPWITtJIX3OVWH+dkhrWkRAH67GOJA2nLgvy7yuchQzlF79qCNsG AyYRkbhvwYWxF9KY72HOJwyLwbTOZghqT+464qGhafccgGAVvVtnYnHOlzVCEvCoyoa+ JKow== X-Gm-Message-State: AOAM533lJIY0/A4SqYEsHaHp0qe0I+IdIdeZV0DSIDUZUK+KZ/zw8cYs owJOpwOHHSvSV1eKpHkVYMQ= X-Google-Smtp-Source: ABdhPJz4sMZwa6P4bJFeAjbVzfraEnl/UdmYDFXY3INEH7FKZxP3oh3Uv3L7fOEJziEX4xDEqO6Lng== X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr11189773ejb.540.1611844953105; Thu, 28 Jan 2021 06:42:33 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 12/13] target/mips: Let get_seg*_physical_address() take MMUAccessType arg Date: Thu, 28 Jan 2021 15:41:24 +0100 Message-Id: <20210128144125.3696119-13-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) get_physical_address() calls get_seg_physical_address() and get_segctl_physical_address() passing a MMUAccessType type. Let the prototypes use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/tlb_helper.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 64e89591abc..14f5b1a0a9c 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -222,7 +222,7 @@ static int is_seg_am_mapped(unsigned int am, bool eu, i= nt mmu_idx) =20 static int get_seg_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, - int rw, int mmu_idx, + MMUAccessType access_type, int mmu_idx, unsigned int am, bool eu, target_ulong segmask, hwaddr physical_base) @@ -234,7 +234,8 @@ static int get_seg_physical_address(CPUMIPSState *env, = hwaddr *physical, return mapped; } else if (mapped) { /* The segment is TLB mapped */ - return env->tlb->map_address(env, physical, prot, real_address, rw= ); + return env->tlb->map_address(env, physical, prot, real_address, + access_type); } else { /* The segment is unmapped */ *physical =3D physical_base | (real_address & segmask); @@ -245,15 +246,15 @@ static int get_seg_physical_address(CPUMIPSState *env= , hwaddr *physical, =20 static int get_segctl_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_addres= s, - int rw, int mmu_idx, + MMUAccessType access_type, int mmu_= idx, uint16_t segctl, target_ulong segma= sk) { unsigned int am =3D (segctl & CP0SC_AM_MASK) >> CP0SC_AM; bool eu =3D (segctl >> CP0SC_EU) & 1; hwaddr pa =3D ((hwaddr)segctl & CP0SC_PA_MASK) << 20; =20 - return get_seg_physical_address(env, physical, prot, real_address, rw, - mmu_idx, am, eu, segmask, + return get_seg_physical_address(env, physical, prot, real_address, + access_type, mmu_idx, am, eu, segmask, pa & ~(hwaddr)segmask); } =20 --=20 2.26.2 From nobody Tue May 21 06:59:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) client-ip=209.85.218.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844960; cv=none; d=zohomail.com; s=zohoarc; b=BxswF9FR9WvVRETIQjMYdGdoIen9dAUWH1b8CzY23B6DZlu9bl12tE56MjBUjc06YRw3ClapkcqNWJuCNIv7TdqZd7dAzAcmEL+1EYZlyOq/W0RaTvPcAI0Wws3xOIMEXsiWePK1/W05DTcRB8CrzFpPOmcOh+AKev8pter9MK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844960; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LefTOWxu3inc8M7Wvu2JcycWzpy3LZGRauTlVjHIniA=; b=dY1Ge/1My8PsVnhTxEPKORAyshEdqM6xCwNuZ4YS7JysLByaggX+h48/hTtZDzjHMAGi6t2YnRaEHbUFY1YJfKyQRAIfG3f+7onvboz1lnIv13HKXpX8VMT+sZ4T0zt0oiNXfIfymtKf2lrAFtaD0b6ruSEBInZQZldngqHSfAQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mx.zohomail.com with SMTPS id 1611844960304287.39764765647544; Thu, 28 Jan 2021 06:42:40 -0800 (PST) Received: by mail-ej1-f46.google.com with SMTP id l9so8147056ejx.3 for ; Thu, 28 Jan 2021 06:42:39 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id co6sm3085161edb.96.2021.01.28.06.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LefTOWxu3inc8M7Wvu2JcycWzpy3LZGRauTlVjHIniA=; b=CAqQanQqoCCGv48+lYut0h4GPW52OpMAn5DC6Sqr/DzeDtppwV1xHyU+jVSdhJgErd yegyOP3WNDytFQavQw3/FOuU8p1qawalmGbyKnrxvG4xTcCFrjzcG0DgajtptJlqNdHN Ru4scxFD9H5rpddp+/FGCDad4UyOBdtiA9dZ8P6BuV83XfiBqiC6VoRnj+Viua/GaKew tTc64nOeeBgs6iV482t2MtfGcXYqhpU8y5+C+BZVxCKXZhILYqKFU03If4CWYK//yvlg TDCF3myzW4VJq8g76xorLCpERo/F9azI2wzS/75jN/LHOwfpUVGk0HQGLiVbDhj4h93l h+JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LefTOWxu3inc8M7Wvu2JcycWzpy3LZGRauTlVjHIniA=; b=ki623k43WEP1d1B3ExD5HOs8jpUeMoxJLpMrLSC9OhQBrdWlfjAnpHh8aDYZv5Sjrw cheWMK7vI32GkdM+q69CuCadvRCN4uVTDeesHXDVturEwU6YW+Z90ThC6Vx93rzJW0IY w5bJiKrzBQiMg9zI40C9WHUjVY84b8PC5fr0GV+TU+xAkg4t40mYcLHPjI36QlPwaQvw opcb5k/1pI2Kwnjlkvhe9idLVCjrqmFoCKppWVcIQAMSLVgHqedPWDBCnPwDMLLtTQ6t AM3gH4F9Mmp3U9Sq7MfMXpQoYyTSNbr+QLeMTcwMtfdrqtjITRPQaXA0qeK9Jtb8lj+6 n8mQ== X-Gm-Message-State: AOAM531qqwRTDc7quR7mHkUUSVxcUt4fkWGXHsEK9ivg/82xSJw72/pl j8vRMcJhUVG+d4eYeUbmIY4= X-Google-Smtp-Source: ABdhPJxccUDhcJr9D9KiiD7Q+5pPn9TCzbxmrNX7KSfDUnVm3CrZmqcNB5ZNKbggczWGEg5s/6kP+w== X-Received: by 2002:a17:906:9401:: with SMTP id q1mr11714453ejx.516.1611844958537; Thu, 28 Jan 2021 06:42:38 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 13/13] target/mips: Let CPUMIPSTLBContext::map_address() take MMUAccessType Date: Thu, 28 Jan 2021 15:41:25 +0100 Message-Id: <20210128144125.3696119-14-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) get_seg_physical_address() calls CPUMIPSTLBContext::map_address() handlers passing a MMUAccessType type. Update the prototype handlers to take a MMUAccessType argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Reviewed-by: Richard Henderson --- target/mips/internal.h | 8 ++++---- target/mips/tlb_helper.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 34915c275c4..99264b8bf6a 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -111,7 +111,7 @@ struct CPUMIPSTLBContext { uint32_t nb_tlb; uint32_t tlb_in_use; int (*map_address)(struct CPUMIPSState *env, hwaddr *physical, int *pr= ot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); void (*helper_tlbwi)(struct CPUMIPSState *env); void (*helper_tlbwr)(struct CPUMIPSState *env); void (*helper_tlbp)(struct CPUMIPSState *env); @@ -126,11 +126,11 @@ struct CPUMIPSTLBContext { }; =20 int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); void r4k_helper_tlbwi(CPUMIPSState *env); void r4k_helper_tlbwr(CPUMIPSState *env); void r4k_helper_tlbp(CPUMIPSState *env); diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 14f5b1a0a9c..2dc8ecafc3b 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -39,7 +39,7 @@ enum { =20 /* no MMU emulation */ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { *physical =3D address; *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; @@ -48,7 +48,7 @@ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physica= l, int *prot, =20 /* fixed mapping MMU emulation */ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { if (address <=3D (int32_t)0x7FFFFFFFUL) { if (!(env->CP0_Status & (1 << CP0St_ERL))) { @@ -68,7 +68,7 @@ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *phys= ical, int *prot, =20 /* MIPS32/MIPS64 R4000-style MMU emulation */ int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { uint16_t ASID =3D env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask; uint32_t MMID =3D env->CP0_MemoryMapID; @@ -97,13 +97,13 @@ int r4k_map_address(CPUMIPSState *env, hwaddr *physical= , int *prot, if (!(n ? tlb->V1 : tlb->V0)) { return TLBRET_INVALID; } - if (rw =3D=3D MMU_INST_FETCH && (n ? tlb->XI1 : tlb->XI0)) { + if (access_type =3D=3D MMU_INST_FETCH && (n ? tlb->XI1 : tlb->= XI0)) { return TLBRET_XI; } - if (rw =3D=3D MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->RI0)) { + if (access_type =3D=3D MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->R= I0)) { return TLBRET_RI; } - if (rw !=3D MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)) { + if (access_type !=3D MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)= ) { *physical =3D tlb->PFN[n] | (address & (mask >> 1)); *prot =3D PAGE_READ; if (n ? tlb->D1 : tlb->D0) { --=20 2.26.2