From patchwork Thu Jan 28 14:41:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oLLDc7M6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNVg6RVxz9sS8 for ; Fri, 29 Jan 2021 01:42:51 +1100 (AEDT) Received: from localhost ([::1]:44468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58VV-0000O4-Qo for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:42:49 -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) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" TLB map_address() handlers don't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang --- 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 *prot, - 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 { }; 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 { /* 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 = address; *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; @@ -48,7 +48,7 @@ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, /* 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 <= (int32_t)0x7FFFFFFFUL) { if (!(env->CP0_Status & (1 << CP0St_ERL))) { @@ -68,7 +68,7 @@ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, /* 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 = env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask; uint32_t MMID = 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 = physical_base | (real_address & segmask); @@ -314,7 +313,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, /* xuseg */ if (UX && address <= (0x3FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret = env->tlb->map_address(env, physical, prot, - real_address, rw, access_type); + real_address, rw); } else { ret = TLBRET_BADADDR; } @@ -323,7 +322,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, if ((supervisor_mode || kernel_mode) && SX && address <= (0x7FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret = env->tlb->map_address(env, physical, prot, - real_address, rw, access_type); + real_address, rw); } else { ret = TLBRET_BADADDR; } @@ -364,7 +363,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, if (kernel_mode && KX && address <= (0xFFFFFFFF7FFFFFFFULL & env->SEGMask)) { ret = env->tlb->map_address(env, physical, prot, - real_address, rw, access_type); + real_address, rw); } else { ret = TLBRET_BADADDR; } From patchwork Thu Jan 28 14:41:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZkYcj1cR; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNZG1P7pz9sS8 for ; Fri, 29 Jan 2021 01:45:58 +1100 (AEDT) Received: from localhost ([::1]:52790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58YW-00043w-49 for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:45:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58UV-0000QR-9p for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:47 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:39774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58UN-0007G6-SX for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:41 -0500 Received: by mail-ej1-x630.google.com with SMTP id g3so8113618ejb.6 for ; Thu, 28 Jan 2021 06:41:39 -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=pkHa2vI+XGhWMhcieY0vN3w5ZtM1IlwyjCYEJ6Yg7tU1/5Qz0+RYtEangf9ElwvHLG cuizHw6Mx23u9nZ/mz4UMmx6q1O6NKUXJMLiAqSpk/QR8KXXhqzo2qWvxHKAhCI3FdID 5BozjGOHR1r9IuakqKLAwR6k8RCJPf+LCwAhlKlO+PQ8td6ZBZKTMD+ZRTwAG+/1pq+B bqOcOIGNek1HiQYJpqKk838fhGa9NrsqifvDx9aAtMDy+lVJDvwO1y9LkRphQUjkcgu8 qEBAwzbBGw4dskMrrZWhFS3QthGthHUTaqDxj57xo+h34HafjOIPvZM9oLt0nc7/Ef25 6/Ow== X-Gm-Message-State: AOAM532xm+unSppCbgnESdyyRNzsh/W6NDbbzVrGRSeP4wmz3oZ6UL+K JWO863dQGuehSwrizbCYz8rcH7zl2yU= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x630.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" get_seg_physical_address() doesn't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang --- 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, int mmu_idx) 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 *env, hwaddr *physical, hwaddr pa = ((hwaddr)segctl & CP0SC_PA_MASK) << 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); } @@ -349,7 +349,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, /* Does CP0_Status.KX/SX/UX permit the access mode (am) */ if (env->CP0_Status & am_ksux[am]) { ret = get_seg_physical_address(env, physical, prot, - real_address, rw, access_type, + real_address, rw, mmu_idx, am, false, env->PAMask, 0); } else { From patchwork Thu Jan 28 14:41:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=cXhKKg6x; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNX129pkz9sT6 for ; Fri, 29 Jan 2021 01:44:01 +1100 (AEDT) Received: from localhost ([::1]:49326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58Wd-0002a6-6t for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:43:59 -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) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" get_segctl_physical_address() doesn't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang --- 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, static int get_segctl_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, uint16_t segctl, target_ulong segmask) { unsigned int am = (segctl & CP0SC_AM_MASK) >> CP0SC_AM; @@ -306,7 +306,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, segctl = env->CP0_SegCtl2 >> 16; } ret = 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, hwaddr *physical, #endif } else if (address < KSEG1_BASE) { /* kseg0 */ - ret = get_segctl_physical_address(env, physical, prot, real_address, rw, - access_type, mmu_idx, + ret = get_segctl_physical_address(env, physical, prot, real_address, + rw, mmu_idx, env->CP0_SegCtl1 >> 16, 0x1FFFFFFF); } else if (address < KSEG2_BASE) { /* kseg1 */ - ret = get_segctl_physical_address(env, physical, prot, real_address, rw, - access_type, mmu_idx, + ret = get_segctl_physical_address(env, physical, prot, real_address, + rw, mmu_idx, env->CP0_SegCtl1, 0x1FFFFFFF); } else if (address < KSEG3_BASE) { /* sseg (kseg2) */ - ret = get_segctl_physical_address(env, physical, prot, real_address, rw, - access_type, mmu_idx, + ret = get_segctl_physical_address(env, physical, prot, real_address, + rw, mmu_idx, env->CP0_SegCtl0 >> 16, 0x1FFFFFFF); } else { /* * kseg3 * XXX: debug segment is not emulated */ - ret = get_segctl_physical_address(env, physical, prot, real_address, rw, - access_type, mmu_idx, + ret = get_segctl_physical_address(env, physical, prot, real_address, + rw, mmu_idx, env->CP0_SegCtl0, 0x1FFFFFFF); } return ret; From patchwork Thu Jan 28 14:41:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=mMd63wZW; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNZX4dxWz9sS8 for ; Fri, 29 Jan 2021 01:46:12 +1100 (AEDT) Received: from localhost ([::1]:55210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58Yk-0005IL-Fs for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:46:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58Ua-0000ZY-LI for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:52 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:39780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58UY-0007J2-Id for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:41:52 -0500 Received: by mail-ej1-x634.google.com with SMTP id g3so8114510ejb.6 for ; Thu, 28 Jan 2021 06:41:50 -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=Y1T83pMveaIyQ3bWiAGokSEa/b8+iJKv68LCaaJGwgHecwcfjkPvGDZH3TwTeIE5S8 yGPqASgxoNWFoqMShIMC79KBOEnOYR6XOEqlxXPnISf4gohsc3iIEmL5VBiEdw6n/GKw idf0078TarEmj37/yDfMqieiRcxvR17X7BsAbaNt7HoA7fojrhsHe9TEDRgzy0F+yd/l JACtyjFrgDVybDHmkQzjydqlA8vKoPZXTqy8U95ndvkwloLNMaZR1IRqo0cUtnk/0STn udYX+osIAnxSxuA/EOsi+ZlyF2WeCvVYA32bz/ZJNDumqz0LEfbEgnpMG/1zIeUHw+2i 2kCg== X-Gm-Message-State: AOAM531m7z/6k34rHZ/faYJaljvB6YZlxTt9JDJQ/9MJD+OhWnXSKPzr ptWMPF2eLkt62dQOaKgKHbffJXmqcy8= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x634.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" get_physical_address() doesn't use the 'access_type' argument, remove it to simplify. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang --- 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 *env, hwaddr *physical, 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; - 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)) != 0) { return -1; } @@ -570,7 +570,7 @@ static int walk_directory(CPUMIPSState *env, uint64_t *vaddr, uint64_t w = 0; if (get_physical_address(env, &paddr, &prot, *vaddr, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) != + cpu_mmu_index(env, false)) != TLBRET_MATCH) { /* wrong base address */ return 0; @@ -598,7 +598,7 @@ static int walk_directory(CPUMIPSState *env, uint64_t *vaddr, *pw_entrylo0 = entry; } if (get_physical_address(env, &paddr, &prot, vaddr2, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) != + cpu_mmu_index(env, false)) != TLBRET_MATCH) { return 0; } @@ -752,7 +752,7 @@ static bool page_table_walk_refill(CPUMIPSState *env, vaddr address, int rw, /* Leaf Level Page Table - First half of PTE pair */ vaddr |= ptoffset0; if (get_physical_address(env, &paddr, &prot, vaddr, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) != + cpu_mmu_index(env, false)) != TLBRET_MATCH) { return false; } @@ -765,7 +765,7 @@ static bool page_table_walk_refill(CPUMIPSState *env, vaddr address, int rw, /* Leaf Level Page Table - Second half of PTE pair */ vaddr |= ptoffset1; if (get_physical_address(env, &paddr, &prot, vaddr, MMU_DATA_LOAD, - ACCESS_INT, cpu_mmu_index(env, false)) != + cpu_mmu_index(env, false)) != TLBRET_MATCH) { return false; } @@ -843,16 +843,14 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size, #if !defined(CONFIG_USER_ONLY) hwaddr physical; int prot; - int mips_access_type; #endif int ret = TLBRET_BADADDR; /* data access */ #if !defined(CONFIG_USER_ONLY) /* XXX: put correct access by using cpu_restore_state() correctly */ - mips_access_type = ACCESS_INT; ret = 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 |= mode; if (ret_walker) { ret = get_physical_address(env, &physical, &prot, address, - access_type, mips_access_type, mmu_idx); + access_type, mmu_idx); if (ret == 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 = 0; /* data access */ - access_type = ACCESS_INT; - ret = get_physical_address(env, &physical, &prot, address, rw, access_type, + ret = get_physical_address(env, &physical, &prot, address, rw, cpu_mmu_index(env, false)); if (ret != TLBRET_MATCH) { raise_mmu_exception(env, address, rw, ret); From patchwork Thu Jan 28 14:41:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TBzVjUTC; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNd547CKz9sS8 for ; Fri, 29 Jan 2021 01:48:25 +1100 (AEDT) Received: from localhost ([::1]:35194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58at-0000ST-Hd for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:48:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58Ui-0000hj-Mx for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:00 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:36621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58Uh-0007LP-5f for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:00 -0500 Received: by mail-ed1-x535.google.com with SMTP id d2so6901411edz.3 for ; Thu, 28 Jan 2021 06:41:55 -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=HwfJCn5xOusBdLo2A2gM9ySMHKLcZ0BG/uX/HG9v60AFrlI1Gh81M1GSo4/BpN/LLS cKBBlHtBLGvuXnYsFcTMjEqxGnJsYOFenkisket00ovy4SLyAcTSwLRfYsUII41x7cU3 cNph/L7UKE62UR6hl4D5/1imYAA5mT2CeGxcRFmnBfuEFOy1N5ZmUiNaLYk9+duJdZD9 2TI6khcgR37EtvcGpRaMbUTmO5kQySyJxnkpxQGso/E5Gf2GSs3uY1m3akcBwaNgqpWF K4NE9I47csY2UZ+chEm6niyjyDM/mr9Aw6shiia+9nqqqYSEdxbPB+jwtpfIv11rlqYj EHJw== X-Gm-Message-State: AOAM531jWue3g+DO3+GkeL4GTGV8saPzFg8bcny6UcrhCtgwW8rKjpzq 2m52OCjhK+Sox5oJXmrKS9mirPJ96Ao= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-x535.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove these confusing and unused definitions. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang --- 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; #include "exec/cpu-all.h" -/* - * 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 = 0x00, - ACCESS_SUPER = 0x01, - /* 1 bit to indicate direction */ - ACCESS_STORE = 0x02, - /* Type of instruction that generated the access */ - ACCESS_CODE = 0x10, /* Code fetch access */ - ACCESS_INT = 0x20, /* Integer load/store access */ - ACCESS_FLOAT = 0x30, /* floating point load/store access */ -}; - /* Exceptions */ enum { EXCP_NONE = -1, From patchwork Thu Jan 28 14:41:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Kjq4IIdA; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNf71XcXz9sS8 for ; Fri, 29 Jan 2021 01:49:19 +1100 (AEDT) Received: from localhost ([::1]:37736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58bl-0001bU-32 for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:49:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58Uk-0000nA-QW for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:02 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:39773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58Uj-0007MO-6T for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:02 -0500 Received: by mail-ej1-x629.google.com with SMTP id g3so8115397ejb.6 for ; Thu, 28 Jan 2021 06:42:00 -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=q0pH41aTymg1twJ11NDpQfqkYhv1zIWuCUqMQWJdSv1kASG7l+nmuCZGfGpT2GFacz aOA1yV1OAAi2Lk3lu5eD9v5NEZaCXPA3H3ANHkGzCCFsDSA8noYK42tCR4H8FW5cpisk TB/nit3xXYc/OkaqFkXO7r15Inf5XSfjwX3BuE1XKLBOO78f5Wa+JjCYzGrxQSNP+Fzj UQn0+6TTDHhnOvnhT1+zqrJ8ZYg2PfXUqOuFzQMm26HPgWAg7G/ljy3Dub5DsNOJKZ8r mo2ZsiTyeBi1KvIlHw5X2dX3pm+tQuU1bd+Vz/gh+Q3irhtQMJmX/UUs8j2GRDOu+tBK eLYg== X-Gm-Message-State: AOAM533moTw2/WPDH9YM8qB4wYx2nY4XICDVtKDHViPM2U1AagHpdai8 4sy1i/pO9/5jI3Cj0tyVTPWuCfcZc9U= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x629.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang --- 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_ulong arg, int mem_idx) \ } \ do_raise_exception(env, EXCP_AdEL, GETPC()); \ } \ - env->CP0_LLAddr = do_translate_address(env, arg, 0, GETPC()); \ + env->CP0_LLAddr = do_translate_address(env, arg, MMU_DATA_LOAD, GETPC()); \ env->lladdr = arg; \ env->llval = 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; - 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)) != 0) { return -1; } From patchwork Thu Jan 28 14:41:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432825 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=mmo+/8t7; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNcL3d1tz9sS8 for ; Fri, 29 Jan 2021 01:47:46 +1100 (AEDT) Received: from localhost ([::1]:33100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58aG-0007xj-F7 for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:47:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58Uq-0000yF-MX for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:08 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:37683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58Up-0007Oa-5M for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:08 -0500 Received: by mail-ej1-x62d.google.com with SMTP id kg20so8130381ejc.4 for ; Thu, 28 Jan 2021 06:42:06 -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=C6ggJ5noGMnjPc6pxOqP56+8s7gb2itSLYseDWXTdiJTbKQgFyRYNZS1U6qz2kb7TN Nw0uY8exLx9bqMr6nhK+3fqDvuJIjOoJwjrADJ1RfH+LM4BZzMzuRXTuBS7CiDQ0zlBp qCnQ8TuADnJSMs/PihgaKdGSM/NPVQaTR8rK9mPUoaFOaVnvXN3Q76yCRMGkJ4qEhMX8 +SVfnvKSpF7A7NPIoc53uIoakPLmY1h2ojFAD8n+v+sLjQ9I2OCkRnyLkWnJnQa1TBsY r6B2VMZEQZjnX1PW3asCcsHR9hV4GADeBKAPJrSBY4I/d4khOFfoevKYVICTaP4Kqite ma3Q== X-Gm-Message-State: AOAM531xfrsJHUItlOm+3WVziZF+AasAKz1vurtn53HAJqOH6m2s5LFd kb4zdI9ual+r5v4tgyLpU6pBhLI8Ri8= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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, } } -static bool page_table_walk_refill(CPUMIPSState *env, vaddr address, int rw, - int mmu_idx) +static bool page_table_walk_refill(CPUMIPSState *env, vaddr address, + MMUAccessType access_type, int mmu_idx) { int gdw = (env->CP0_PWSize >> CP0PS_GDW) & 0x3F; int udw = (env->CP0_PWSize >> CP0PS_UDW) & 0x3F; From patchwork Thu Jan 28 14:41:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sQRQnZ0f; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNhG0NKBz9sS8 for ; Fri, 29 Jan 2021 01:51:10 +1100 (AEDT) Received: from localhost ([::1]:41376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58dX-00039f-V4 for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:51:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58Uy-000175-0S for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:16 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:42167) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58Uw-0007Qf-8L for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:15 -0500 Received: by mail-ej1-x630.google.com with SMTP id r12so8105522ejb.9 for ; Thu, 28 Jan 2021 06:42:12 -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=eDrGjzoLUX8JRT+z3odd0L4+PO/VN+FWkbqhTQQ+D640iN3cNtgJ1rV9146LyZWVzH EO2SF2nu9XLuOwHoXKqgtltecgI7cvDMSbX3SHbRrwxa39QJweLihVE7DyodfeLavnCa XONOsOU3ApZ8l5hekGBtU0MlrmJjpgidna2aDfCzqKuvX7aZWp5utfY2wOGcqeS+XA53 3RJGhGZom2XQ/AS/IpWij38P1BOjnKUF41gczMzXotaJYPK6lS5LLKFkNSCF6+OHHMHy qXtWNxwyVdeUpAJ+S1IwyOGjvLRq4GO9STgslDBdcu0mvvkqMpMQIHH3XT9GZmsamnov 0sEQ== X-Gm-Message-State: AOAM532bbjFMkoSjybOuImCqmdWof9rIssxgyiUhdqLXQ1OyLsapuMiO Rr3WBp5e80aP4XuWz3J/ftEImE91VPo= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x630.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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 shift, uint32_t shiftx, #ifndef CONFIG_USER_ONLY static inline hwaddr do_translate_address(CPUMIPSState *env, - target_ulong address, - int rw, uintptr_t retaddr) + target_ulong address, + MMUAccessType access_type, + uintptr_t retaddr) { hwaddr paddr; CPUState *cs = env_cpu(env); - paddr = cpu_mips_translate_address(env, address, rw); + paddr = cpu_mips_translate_address(env, address, access_type); if (paddr == -1LL) { cpu_loop_exit_restore(cs, retaddr); From patchwork Thu Jan 28 14:41:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=sM350Ra0; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNWw6pVtz9sT6 for ; Fri, 29 Jan 2021 01:43:56 +1100 (AEDT) Received: from localhost ([::1]:48856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58WY-0002Nv-Rk for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:43:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58V2-0001Ck-PX for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:22 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:40457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58V0-0007T9-Dc for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:20 -0500 Received: by mail-ej1-x636.google.com with SMTP id gx5so8107316ejb.7 for ; Thu, 28 Jan 2021 06:42:18 -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=bLZ7I1l9tKhLW/4DWbR+ivywgeTSW9Smhn7FJKWA5lAvNL40j+vpOM1tNkSsIfHRpD RGXTH2yWzKgDFAsaZHNrEc5CIJl5oNWvjy0dCwiISvrymaNhlrQ5b/BXnvTtz36xOIWl unWcwLPtkyhrtHuu6Fy6NCwNvJ+chVplSEMD3IEC4toiLm+7whdAAe0i3ag9H7wKxeOF ABELvAGozsRGCytARwBhpTQanjP/W0u2Zk+G6pP8Vh5Tcfdu4L0LPx3MsLxSBdvNrJut tyqqB+e5GMPnQ/pCFEy5QOPPAF7WTcvS1LJQBSG9vfkdzUYFbqpFf0jPKWMw1ttBd7ol XNlw== X-Gm-Message-State: AOAM531sSg8x1ayJ7QIy0O4SbiiNPZW5nuACHq5YvVB5MtvT6PZjza2l 0qYuMXSfGQEFCGvDubB3YgdVkoH/d8A= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x636.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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, hwaddr physaddr, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, - int rw); + MMUAccessType access_type); #endif #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, int size, #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 = 0; /* data access */ - ret = get_physical_address(env, &physical, &prot, address, rw, + ret = get_physical_address(env, &physical, &prot, address, access_type, cpu_mmu_index(env, false)); if (ret != TLBRET_MATCH) { - raise_mmu_exception(env, address, rw, ret); + raise_mmu_exception(env, address, access_type, ret); return -1LL; } else { return physical; From patchwork Thu Jan 28 14:41:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UEImJVFj; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNlF6NlBz9sT6 for ; Fri, 29 Jan 2021 01:53:45 +1100 (AEDT) Received: from localhost ([::1]:52490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58g3-00082O-SQ for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:53:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58V7-0001FC-H8 for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:27 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:40450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58V6-0007UV-3r for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:25 -0500 Received: by mail-ej1-x62d.google.com with SMTP id gx5so8107777ejb.7 for ; Thu, 28 Jan 2021 06:42:23 -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=eZyqg5fveloQQrzddp+8ggUsHv5GxvBakDUmWnB5XjYhxjNkHcjgQ/vC8FJiGqT77d 077dg5Mk2SokNZ4Qu/bt40FWIoEWiGnG5u2TZEows8PQOJl1v+F8Xgpo4nyme2jR4Mqc oaP/tk0TD3WJmvbpo9LjNLGbnLudqDX3nRxMi1lvF0n5TmE4SYlc7a8gRNJqR/IsLitx Ngk87eQmPPtOKYmKdmvrMdhAtbZi+WM3wLvEG6qCHv4dQIuVoi2G7e5mR/PuZkwZLQ8a d/RXe+b2ynI8WnQa1v/lKPvjcbuMAZ4DKtVmZKOmO4FtKauXK5+MeW/HiWahWU3c0Ya1 Oj0Q== X-Gm-Message-State: AOAM5331eLDHC7NJhVKezoQA+nt6rgnDi7CdxLlGf6Hm/Lpb+ddfP0ry WiIMaCvWPpgU3sxH+vJL1bR8wxk2ylE= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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 */ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, - int rw, int tlb_error) + MMUAccessType access_type, int tlb_error) { CPUState *cs = env_cpu(env); int exception = 0, error_code = 0; - if (rw == MMU_INST_FETCH) { + if (access_type == MMU_INST_FETCH) { error_code |= EXCP_INST_NOTAVAIL; } @@ -419,7 +419,7 @@ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, case TLBRET_BADADDR: /* Reference to kernel address from user mode or supervisor mode */ /* Reference to supervisor address from user mode */ - if (rw == MMU_DATA_STORE) { + if (access_type == MMU_DATA_STORE) { exception = EXCP_AdES; } else { exception = EXCP_AdEL; @@ -427,7 +427,7 @@ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, break; case TLBRET_NOMATCH: /* No TLB match for a mapped address */ - if (rw == MMU_DATA_STORE) { + if (access_type == MMU_DATA_STORE) { exception = EXCP_TLBS; } else { exception = EXCP_TLBL; @@ -436,7 +436,7 @@ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, break; case TLBRET_INVALID: /* TLB match with no valid bit */ - if (rw == MMU_DATA_STORE) { + if (access_type == MMU_DATA_STORE) { exception = EXCP_TLBS; } else { exception = EXCP_TLBL; From patchwork Thu Jan 28 14:41:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Ez2jppMX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNpK6nVWz9sS8 for ; Fri, 29 Jan 2021 01:56:25 +1100 (AEDT) Received: from localhost ([::1]:59266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58id-0002cp-Ua for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:56:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58VF-0001H3-GN for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:35 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:36741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58VD-0007X1-VW for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:33 -0500 Received: by mail-ej1-x62a.google.com with SMTP id l9so8146110ejx.3 for ; Thu, 28 Jan 2021 06:42:28 -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=poEnMrP8cdwMCQBfxbRUovm3QoNDHCrXcNE7/a20Jpi5N3JIcV7NB2F0cTfacE+GIM heLn0mEaS6HdQ7qgTpDLeFysuyGiAzkXiV03NO3oJxJVSg9+sXzEZEJLFOGEimS8rk5N JcX1SAKd7I7zZ33b5cpnwpPNForFcuP3KVng5Xvp0aQ0vr6dQP5Yp262u24IGsHg3iab 2xn2nkGhU32CI11RMshBS3K6pIQE6tf5tfAZw6Ml149TkP+EoBkSs6OlKBsvrzxQbH4B N6S19q69zDbMGuBJwp2ta30JwrAy2Qw+5k72fMcEEDxZ+ZMauHOUUcKW9z2KupOWFf1c Gglw== X-Gm-Message-State: AOAM532aBGB38xDZpR0LsRYfKL2NDCnLQanZM2PrF20pgZBLKjWLE7fO 9+lepWTNySO6nbb7DU+86yGm0cAzYxM= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x62a.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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 *env, hwaddr *physical, 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, hwaddr *physical, segctl = env->CP0_SegCtl2 >> 16; } ret = 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 <= (0x3FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret = env->tlb->map_address(env, physical, prot, - real_address, rw); + real_address, access_type); } else { ret = TLBRET_BADADDR; } @@ -322,7 +322,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, if ((supervisor_mode || kernel_mode) && SX && address <= (0x7FFFFFFFFFFFFFFFULL & env->SEGMask)) { ret = env->tlb->map_address(env, physical, prot, - real_address, rw); + real_address, access_type); } else { ret = TLBRET_BADADDR; } @@ -349,7 +349,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, /* Does CP0_Status.KX/SX/UX permit the access mode (am) */ if (env->CP0_Status & am_ksux[am]) { ret = get_seg_physical_address(env, physical, prot, - real_address, rw, + real_address, access_type, mmu_idx, am, false, env->PAMask, 0); } else { @@ -363,7 +363,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, if (kernel_mode && KX && address <= (0xFFFFFFFF7FFFFFFFULL & env->SEGMask)) { ret = env->tlb->map_address(env, physical, prot, - real_address, rw); + real_address, access_type); } else { ret = TLBRET_BADADDR; } @@ -371,17 +371,17 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, } else if (address < KSEG1_BASE) { /* kseg0 */ ret = get_segctl_physical_address(env, physical, prot, real_address, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl1 >> 16, 0x1FFFFFFF); } else if (address < KSEG2_BASE) { /* kseg1 */ ret = get_segctl_physical_address(env, physical, prot, real_address, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl1, 0x1FFFFFFF); } else if (address < KSEG3_BASE) { /* sseg (kseg2) */ ret = get_segctl_physical_address(env, physical, prot, real_address, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl0 >> 16, 0x1FFFFFFF); } else { /* @@ -389,7 +389,7 @@ static int get_physical_address(CPUMIPSState *env, hwaddr *physical, * XXX: debug segment is not emulated */ ret = get_segctl_physical_address(env, physical, prot, real_address, - rw, mmu_idx, + access_type, mmu_idx, env->CP0_SegCtl0, 0x1FFFFFFF); } return ret; From patchwork Thu Jan 28 14:41:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nWDU2Oue; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNb53N53z9sT6 for ; Fri, 29 Jan 2021 01:46:41 +1100 (AEDT) Received: from localhost ([::1]:57232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58ZD-0006Bb-BD for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:46:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58VI-0001Hm-8G for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:36 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:34297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58VG-0007YC-Pc for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:36 -0500 Received: by mail-ej1-x62a.google.com with SMTP id hs11so8150046ejc.1 for ; Thu, 28 Jan 2021 06:42:34 -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=RtN3gv/CgF1RU/2Yx6DrxShWLk38WWVLuBCdyuEoNajucTO1VpTUSvI7Q6kw0CGRJb B8ciuLrF+qe+KRECnemjoo0fWULAH3hq8kk9M9vRP1TTnpMH0ZxQV4siPd04AhNMnVfk 0ITJ9mLbiXspjJBBX431S4whYYZwblyUGF9PF0004VJtjhkAgFoPZD4oDhO20fI2e3J9 gY0fDevPf7aGhDE5OXdoC9wqiFEyxvBVcUYfT++CzYODx0EvcwMI7SaRET2ImB3SJ5+O GYxAcX128wGMDOyeVwEQIy5UXwkY2N8dSb/eypovPw29SPLE3dkih4MeBGK5GA8e6iPT qtiQ== X-Gm-Message-State: AOAM530eE1RQYeV9tgC4LtowVI5jy1bAbyP9CJgnkXyU+gDoBSq61VQG mOoO3iabFPG60HmQRzCYbBLe6b+ntpA= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x62a.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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, int mmu_idx) 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 = physical_base | (real_address & segmask); @@ -245,15 +246,15 @@ static int get_seg_physical_address(CPUMIPSState *env, hwaddr *physical, static int get_segctl_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, - int rw, int mmu_idx, + MMUAccessType access_type, int mmu_idx, uint16_t segctl, target_ulong segmask) { unsigned int am = (segctl & CP0SC_AM_MASK) >> CP0SC_AM; bool eu = (segctl >> CP0SC_EU) & 1; hwaddr pa = ((hwaddr)segctl & CP0SC_PA_MASK) << 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); } From patchwork Thu Jan 28 14:41:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1432832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CAqQanQq; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRNhT0HXwz9sS8 for ; Fri, 29 Jan 2021 01:51:21 +1100 (AEDT) Received: from localhost ([::1]:43420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l58di-00042d-Oy for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2021 09:51:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l58VQ-0001J3-Hq for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:44 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:46540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l58VM-0007Za-22 for qemu-devel@nongnu.org; Thu, 28 Jan 2021 09:42:41 -0500 Received: by mail-ej1-x635.google.com with SMTP id rv9so8076759ejb.13 for ; Thu, 28 Jan 2021 06:42:39 -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=GHZw2D5Ve7m3m0EVLn/1qx/x94xHdDbQwB3DAlbj02MptVH71kzCVL2Xfj/M0m+ivO PHdsjOlNx8Bysan7h+orBqtkAnzTH+Rji6jWOjJsf08sBa/Q9iHzyYDsGKXkAEBJfPse Yc7FOGDIf4m+NGouJ0pa6JCnop2YrGheB2v6tVjMw5QD96YgrXLDKZMRVpo+4votNKvB JUjamuHJXaWdUbPpeDhBpeY9wZTS2MKTTZ5ZvJ7tteVJqAcUz+09rE0Bt+qSTZcAaZl9 XuodxxOF8eL1bqnfINMkZY1dZm0+ac4VzuHwMZ4xHZbbitLn5rTwnFxr1lvKY0q4Gg0F 23Ew== X-Gm-Message-State: AOAM533N2jhO5xhgb44qqAm4vl60K6jIr19V0JhkKy/y9Hpxwc9rx/FK ImnvVx7HzPa+P6jp+0e092tUyiG5km8= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-x635.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_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Joe Komlodi , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Jiaxun Yang --- 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 *prot, - 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 { }; 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 { /* 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 = address; *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; @@ -48,7 +48,7 @@ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, /* 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 <= (int32_t)0x7FFFFFFFUL) { if (!(env->CP0_Status & (1 << CP0St_ERL))) { @@ -68,7 +68,7 @@ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, /* 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 = env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask; uint32_t MMID = 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 == MMU_INST_FETCH && (n ? tlb->XI1 : tlb->XI0)) { + if (access_type == MMU_INST_FETCH && (n ? tlb->XI1 : tlb->XI0)) { return TLBRET_XI; } - if (rw == MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->RI0)) { + if (access_type == MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->RI0)) { return TLBRET_RI; } - if (rw != MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)) { + if (access_type != MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)) { *physical = tlb->PFN[n] | (address & (mask >> 1)); *prot = PAGE_READ; if (n ? tlb->D1 : tlb->D0) {