From nobody Tue Feb 10 13:17:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) client-ip=209.85.218.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ej1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611844960; cv=none; d=zohomail.com; s=zohoarc; b=BxswF9FR9WvVRETIQjMYdGdoIen9dAUWH1b8CzY23B6DZlu9bl12tE56MjBUjc06YRw3ClapkcqNWJuCNIv7TdqZd7dAzAcmEL+1EYZlyOq/W0RaTvPcAI0Wws3xOIMEXsiWePK1/W05DTcRB8CrzFpPOmcOh+AKev8pter9MK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611844960; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LefTOWxu3inc8M7Wvu2JcycWzpy3LZGRauTlVjHIniA=; b=dY1Ge/1My8PsVnhTxEPKORAyshEdqM6xCwNuZ4YS7JysLByaggX+h48/hTtZDzjHMAGi6t2YnRaEHbUFY1YJfKyQRAIfG3f+7onvboz1lnIv13HKXpX8VMT+sZ4T0zt0oiNXfIfymtKf2lrAFtaD0b6ruSEBInZQZldngqHSfAQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mx.zohomail.com with SMTPS id 1611844960304287.39764765647544; Thu, 28 Jan 2021 06:42:40 -0800 (PST) Received: by mail-ej1-f46.google.com with SMTP id l9so8147056ejx.3 for ; Thu, 28 Jan 2021 06:42:39 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id co6sm3085161edb.96.2021.01.28.06.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LefTOWxu3inc8M7Wvu2JcycWzpy3LZGRauTlVjHIniA=; b=CAqQanQqoCCGv48+lYut0h4GPW52OpMAn5DC6Sqr/DzeDtppwV1xHyU+jVSdhJgErd yegyOP3WNDytFQavQw3/FOuU8p1qawalmGbyKnrxvG4xTcCFrjzcG0DgajtptJlqNdHN Ru4scxFD9H5rpddp+/FGCDad4UyOBdtiA9dZ8P6BuV83XfiBqiC6VoRnj+Viua/GaKew tTc64nOeeBgs6iV482t2MtfGcXYqhpU8y5+C+BZVxCKXZhILYqKFU03If4CWYK//yvlg TDCF3myzW4VJq8g76xorLCpERo/F9azI2wzS/75jN/LHOwfpUVGk0HQGLiVbDhj4h93l h+JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LefTOWxu3inc8M7Wvu2JcycWzpy3LZGRauTlVjHIniA=; b=ki623k43WEP1d1B3ExD5HOs8jpUeMoxJLpMrLSC9OhQBrdWlfjAnpHh8aDYZv5Sjrw cheWMK7vI32GkdM+q69CuCadvRCN4uVTDeesHXDVturEwU6YW+Z90ThC6Vx93rzJW0IY w5bJiKrzBQiMg9zI40C9WHUjVY84b8PC5fr0GV+TU+xAkg4t40mYcLHPjI36QlPwaQvw opcb5k/1pI2Kwnjlkvhe9idLVCjrqmFoCKppWVcIQAMSLVgHqedPWDBCnPwDMLLtTQ6t AM3gH4F9Mmp3U9Sq7MfMXpQoYyTSNbr+QLeMTcwMtfdrqtjITRPQaXA0qeK9Jtb8lj+6 n8mQ== X-Gm-Message-State: AOAM531qqwRTDc7quR7mHkUUSVxcUt4fkWGXHsEK9ivg/82xSJw72/pl j8vRMcJhUVG+d4eYeUbmIY4= X-Google-Smtp-Source: ABdhPJxccUDhcJr9D9KiiD7Q+5pPn9TCzbxmrNX7KSfDUnVm3CrZmqcNB5ZNKbggczWGEg5s/6kP+w== X-Received: by 2002:a17:906:9401:: with SMTP id q1mr11714453ejx.516.1611844958537; Thu, 28 Jan 2021 06:42:38 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Huacai Chen , Joe Komlodi , Aurelien Jarno , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Richard Henderson Subject: [PATCH 13/13] target/mips: Let CPUMIPSTLBContext::map_address() take MMUAccessType Date: Thu, 28 Jan 2021 15:41:25 +0100 Message-Id: <20210128144125.3696119-14-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210128144125.3696119-1-f4bug@amsat.org> References: <20210128144125.3696119-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) get_seg_physical_address() calls CPUMIPSTLBContext::map_address() handlers passing a MMUAccessType type. Update the prototype handlers to take a MMUAccessType argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang --- target/mips/internal.h | 8 ++++---- target/mips/tlb_helper.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 34915c275c4..99264b8bf6a 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -111,7 +111,7 @@ struct CPUMIPSTLBContext { uint32_t nb_tlb; uint32_t tlb_in_use; int (*map_address)(struct CPUMIPSState *env, hwaddr *physical, int *pr= ot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); void (*helper_tlbwi)(struct CPUMIPSState *env); void (*helper_tlbwr)(struct CPUMIPSState *env); void (*helper_tlbp)(struct CPUMIPSState *env); @@ -126,11 +126,11 @@ struct CPUMIPSTLBContext { }; =20 int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw); + target_ulong address, MMUAccessType access_type); void r4k_helper_tlbwi(CPUMIPSState *env); void r4k_helper_tlbwr(CPUMIPSState *env); void r4k_helper_tlbp(CPUMIPSState *env); diff --git a/target/mips/tlb_helper.c b/target/mips/tlb_helper.c index 14f5b1a0a9c..2dc8ecafc3b 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -39,7 +39,7 @@ enum { =20 /* no MMU emulation */ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { *physical =3D address; *prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; @@ -48,7 +48,7 @@ int no_mmu_map_address(CPUMIPSState *env, hwaddr *physica= l, int *prot, =20 /* fixed mapping MMU emulation */ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { if (address <=3D (int32_t)0x7FFFFFFFUL) { if (!(env->CP0_Status & (1 << CP0St_ERL))) { @@ -68,7 +68,7 @@ int fixed_mmu_map_address(CPUMIPSState *env, hwaddr *phys= ical, int *prot, =20 /* MIPS32/MIPS64 R4000-style MMU emulation */ int r4k_map_address(CPUMIPSState *env, hwaddr *physical, int *prot, - target_ulong address, int rw) + target_ulong address, MMUAccessType access_type) { uint16_t ASID =3D env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask; uint32_t MMID =3D env->CP0_MemoryMapID; @@ -97,13 +97,13 @@ int r4k_map_address(CPUMIPSState *env, hwaddr *physical= , int *prot, if (!(n ? tlb->V1 : tlb->V0)) { return TLBRET_INVALID; } - if (rw =3D=3D MMU_INST_FETCH && (n ? tlb->XI1 : tlb->XI0)) { + if (access_type =3D=3D MMU_INST_FETCH && (n ? tlb->XI1 : tlb->= XI0)) { return TLBRET_XI; } - if (rw =3D=3D MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->RI0)) { + if (access_type =3D=3D MMU_DATA_LOAD && (n ? tlb->RI1 : tlb->R= I0)) { return TLBRET_RI; } - if (rw !=3D MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)) { + if (access_type !=3D MMU_DATA_STORE || (n ? tlb->D1 : tlb->D0)= ) { *physical =3D tlb->PFN[n] | (address & (mask >> 1)); *prot =3D PAGE_READ; if (n ? tlb->D1 : tlb->D0) { --=20 2.26.2