From nobody Tue Feb 10 05:14:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1613918175; cv=none; d=zohomail.com; s=zohoarc; b=iy7YoF40zuGQlgvbkcSUcxM/uXWhjIkMezYPt1G9TrV1G9n/oOBbNm9OVPofeU4KrqANc/dzaT5238NvdxAkgx4eTQCXGIrlIHHLxow7Wu4TYrgBh9olDY/nDybq3pc4deX97P950dD9bcK+txjpwvnGBLjr4UaZZYiC1y1Vb5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613918175; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e15Rl8H6DBZJO0DusLxuCaUW4jtuBTP32AnE0pOPNJQ=; b=Y3uKYVJ9BwYifdPUqMShgwa629Kvyv/yu32JFP6DRh+UCbjl1z17TRYJSh6eAoCGNvLZUaGk4TWbspVlCHktRGgvHdl2+0fQt7VhDLsap8ndNXLRd7pSH3+zFt9csewY0wIuIsRbB2T5f39V4E74t/vl8WNRWokRIq8O7KCgs0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 1613918175330945.1116523977652; Sun, 21 Feb 2021 06:36:15 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id v15so16350167wrx.4 for ; Sun, 21 Feb 2021 06:36:14 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id w11sm2368961wru.3.2021.02.21.06.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 06:36: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=e15Rl8H6DBZJO0DusLxuCaUW4jtuBTP32AnE0pOPNJQ=; b=IukHqDdKdtDtwISKpz81Lw3mG0CFu5xp37eyql53GVtGluo81mPuzbQiwm78I/5jIk MaQG2yl4GnHxdHnTDKIQJJQgzSnfZtWLmILk9NS0wVqayHFtmlYtyBybu/QQfzmcZn80 CrJPn9/VrfdIpaibcGR60aGt8JQ6MVI1QRkZdLEeNxuzGpEtEeYaEVCbpeB20BxG5jg6 o3T1bqFNROtIbg7bBQPf17YQjv+lW9sxTUQ8xL3/cvQAv+pg9M+fW0Rd/XLDB3EQEIzJ yBJDBtaQG1ax1fuJQIvykhMmFS5KDzln0Ou79/zmu6w3sif+mNWp+sKltVvhryX/8wxZ Nt7w== 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=e15Rl8H6DBZJO0DusLxuCaUW4jtuBTP32AnE0pOPNJQ=; b=qN+Y1j5Z4sLfNPB2PmXbxZ1GZ0gOCs08JJxkvhyFG6tLSEa1wD7tPd2wAKWH7f3/wF gtwWSmju3/56HzqKg5J/TZiCEcXNivarha2p+XuFdoHVnu4hx+Kh7e8CiTeqn/xvR3Iu 13yU0yPFeXm63hgbiiOn8AfQNcQ28sGB31IDUkvjesp9bNlLwxz0JzePGnCphkibU7EF mexIGubv35bod3PLyOWrxkQCm2Nky+E8kaWtZdl4aVXqiPZMHsf9N/Op357ut0oIUTle Msesk/rb0Q3T/5AJOY0rBUBgbnO1FnWZnMrvFzjFf+KudnOAhObxtLwPp+hYhFU+aEEt ceEQ== X-Gm-Message-State: AOAM533cpRdkk0KuwnkCdwtTGk9jDqnGK/uciztDI4kivd9MfHN/w1EB 5YKrA3MaBRZvAT92lPPa9BA= X-Google-Smtp-Source: ABdhPJwtPA+o/TU9bXQVUC1AoPsz3ex5WRN8P8yAR64fSszXOy6LNhCRhWNM1nkqFcEiiS0XgXNTgw== X-Received: by 2002:a05:6000:18ac:: with SMTP id b12mr17792373wri.77.1613918173574; Sun, 21 Feb 2021 06:36:13 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paul Burton , Wainer dos Santos Moschetta , Aleksandar Rikalo , Aurelien Jarno , Marcel Apfelbaum , Cleber Rosa , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Huacai Chen , Jiaxun Yang , Richard Henderson Subject: [PULL 20/43] target/mips: Let CPUMIPSTLBContext::map_address() take MMUAccessType Date: Sun, 21 Feb 2021 15:34:09 +0100 Message-Id: <20210221143432.2468220-21-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210221143432.2468220-1-f4bug@amsat.org> References: <20210221143432.2468220-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) get_seg_physical_address() calls CPUMIPSTLBContext::map_address() handlers passing a MMUAccessType type. Update the prototype handlers to take a MMUAccessType argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Message-Id: <20210128144125.3696119-14-f4bug@amsat.org> --- target/mips/internal.h | 8 ++++---- target/mips/tlb_helper.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 34915c275c4..99264b8bf6a 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -111,7 +111,7 @@ struct CPUMIPSTLBContext { uint32_t nb_tlb; uint32_t tlb_in_use; int (*map_address)(struct CPUMIPSState *env, hwaddr *physical, int *pr= ot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); void (*helper_tlbwi)(struct CPUMIPSState *env); void (*helper_tlbwr)(struct CPUMIPSState *env); void (*helper_tlbp)(struct CPUMIPSState *env); @@ -126,11 +126,11 @@ struct CPUMIPSTLBContext { }; =20 int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); void r4k_helper_tlbwi(CPUMIPSState *env); void r4k_helper_tlbwr(CPUMIPSState *env); void r4k_helper_tlbp(CPUMIPSState *env); diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 4db8a7582d4..b48f892a513 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -39,7 +39,7 @@ enum { =20 /* no MMU emulation */ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { *physical =3D address; *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; @@ -48,7 +48,7 @@ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physica= l, int *prot, =20 /* fixed mapping MMU emulation */ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { if (address <=3D (int32_t)0x7FFFFFFFUL) { if (!(env->CP0_Status & (1 << CP0St_ERL))) { @@ -68,7 +68,7 @@ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *phys= ical, int *prot, =20 /* MIPS32/MIPS64 R4000-style MMU emulation */ int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { uint16_t ASID =3D env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask; uint32_t MMID =3D env->CP0_MemoryMapID; @@ -97,13 +97,13 @@ int r4k_map_address(CPUMIPSState *env, hwaddr *physical= , int *prot, if (!(n ? tlb->V1 : tlb->V0)) { return TLBRET_INVALID; } - if (rw =3D=3D MMU_INST_FETCH && (n ? tlb->XI1 : tlb->XI0)) { + if (access_type =3D=3D MMU_INST_FETCH && (n ? tlb->XI1 : tlb->= XI0)) { return TLBRET_XI; } - if (rw =3D=3D MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->RI0)) { + if (access_type =3D=3D MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->R= I0)) { return TLBRET_RI; } - if (rw !=3D MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)) { + if (access_type !=3D MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)= ) { *physical =3D tlb->PFN[n] | (address & (mask >> 1)); *prot =3D PAGE_READ; if (n ? tlb->D1 : tlb->D0) { --=20 2.26.2