From nobody Wed Feb 11 00:59:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) client-ip=209.85.128.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1613918160; cv=none; d=zohomail.com; s=zohoarc; b=E4uQIT/+y2p9Ys9zIVVyfw+sk04k/KKtbl9wu5o7G5Jzkgs8qvjxQGZ4lD6/+2GG6XGlGTCVzp9vJdDbEq/59+Q9NLuVkhCFvM7GD/MNnZkIUkhdKQdKn6KZUrzVo7b1bjBq+qbzvZuNQf6L37b+3A0WJXUIaoHSgWpMNOQ+Wzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613918160; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A0/ujJTeBMNKa2bOzyTsl8jur83d23ulbZmLvhVWOXE=; b=ZNTd4biCpPxjZIoKQJs892OH7HXHBIYxhfu+/xtJnzBvlWL+KrqPLfVs4F+2odiU0G+l+NP4KhBJUF0y9BPtzFTtz08b4kNCrzVmu4pjYmV5EICmpjMNZ1e3jQ1FZBDnzBMmycPqRDiu9x0orSexMkNPXaXrcDA4YJB9GVrpn64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.zohomail.com with SMTPS id 1613918160468133.2597490886685; Sun, 21 Feb 2021 06:36:00 -0800 (PST) Received: by mail-wm1-f45.google.com with SMTP id a132so11244819wmc.0 for ; Sun, 21 Feb 2021 06:35:59 -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 h13sm24926189wrv.20.2021.02.21.06.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 06:35:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A0/ujJTeBMNKa2bOzyTsl8jur83d23ulbZmLvhVWOXE=; b=duvzXNJ48QDW9hlzkMFxS+nwJtQYqaQY3K57JeT6iaIqQWIrxgxUkqvBefo6VPGYyh bGleEsPHvtDUMfhfeu8NXuT2HAtpeeTRMHSgeAJcx+s0KYwEfTnBNxyUa/o0Ssg0i1dW 8lrVHTc1A+c0mxnckabgfhM8FySH9tTFS9IUzuTTjqpfoVdY29Ww5xBjRlWRI7gxEQJ3 3/Qt4TTpTwQLMBEg1lhUHTGmw0X1dElbSSbxaxoG+NBp8qIg6KFWCijBwscNnM8pKOja EdSzk+RbFzzbxO/ExHplolq1s6kryzH9yXgs99YG4b/DnJ4DF1ls1hqPIGUPEQHAoVna OVdA== 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=A0/ujJTeBMNKa2bOzyTsl8jur83d23ulbZmLvhVWOXE=; b=Jbj8UKXUAfnJQF2aUwnx/ZW0eVcnM10EFSngMhC8sRymUzMYmHZlnxkuACKKX7NQ3X u5FHY8tTARAhNc/Khop8750QPEOHT5lKQquaSxnenowNamEKi4cE6jZCG1mYCIGqMfFd pGsOLh/Yl79Z0sV5dZOjwmzf2TcDi3jfx+Q4KHrIPARXZLflendyL+5cye4C7RzyPG8X VBhXemWtMGaGDRbOV8YzJYiqOmlDT3V/bkgSGLTHVEe3xAE1Mh9e/YovqMcvv9OHWx27 yhHzUlfMv3AyIiWCaxD/zjmP6N1JAFi48onGzjpUu+dR9WcbnxEcP9FJcCzBMy8OPYeY TZpw== X-Gm-Message-State: AOAM5306RdTt6/45TaadUIHwL6nXLrKZJwaynWT7uIsXvq5UFFjCfZtV f1LgNdS6ilLFtELOLaOLgLg= X-Google-Smtp-Source: ABdhPJybQ2IL8sgBHY5alJHiietVAA3el1eZDu43P2Ybe7uQk7W/N+xpze9hwEL+4SFhE1Ejnmsu8A== X-Received: by 2002:a1c:7f46:: with SMTP id a67mr16129407wmd.94.1613918158661; Sun, 21 Feb 2021 06:35:58 -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 17/43] target/mips: Let raise_mmu_exception() take MMUAccessType argument Date: Sun, 21 Feb 2021 15:34:06 +0100 Message-Id: <20210221143432.2468220-18-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) Both mips_cpu_tlb_fill() and cpu_mips_translate_address() pass MMUAccessType to raise_mmu_exception(). Let the prototype use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Message-Id: <20210128144125.3696119-11-f4bug@amsat.org> --- 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 9bb635885dd..0ad2d51b11c 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -405,12 +405,12 @@ void cpu_mips_tlb_flush(CPUMIPSState *env) #endif /* !CONFIG_USER_ONLY */ =20 static void raise_mmu_exception(CPUMIPSState *env, target_ulong address, - int rw, int tlb_error) + MMUAccessType access_type, int tlb_error) { CPUState *cs =3D env_cpu(env); int exception =3D 0, error_code =3D 0; =20 - if (rw =3D=3D MMU_INST_FETCH) { + if (access_type =3D=3D MMU_INST_FETCH) { error_code |=3D EXCP_INST_NOTAVAIL; } =20 @@ -419,7 +419,7 @@ static void raise_mmu_exception(CPUMIPSState *env, targ= et_ulong address, case TLBRET_BADADDR: /* Reference to kernel address from user mode or supervisor mode */ /* Reference to supervisor address from user mode */ - if (rw =3D=3D MMU_DATA_STORE) { + if (access_type =3D=3D MMU_DATA_STORE) { exception =3D EXCP_AdES; } else { exception =3D EXCP_AdEL; @@ -427,7 +427,7 @@ static void raise_mmu_exception(CPUMIPSState *env, targ= et_ulong address, break; case TLBRET_NOMATCH: /* No TLB match for a mapped address */ - if (rw =3D=3D MMU_DATA_STORE) { + if (access_type =3D=3D MMU_DATA_STORE) { exception =3D EXCP_TLBS; } else { exception =3D EXCP_TLBL; @@ -436,7 +436,7 @@ static void raise_mmu_exception(CPUMIPSState *env, targ= et_ulong address, break; case TLBRET_INVALID: /* TLB match with no valid bit */ - if (rw =3D=3D MMU_DATA_STORE) { + if (access_type =3D=3D MMU_DATA_STORE) { exception =3D EXCP_TLBS; } else { exception =3D EXCP_TLBL; --=20 2.26.2