From nobody Tue Feb 10 20:07:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) client-ip=209.85.128.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1613918170; cv=none; d=zohomail.com; s=zohoarc; b=emqjF6RcFbrrcJwMk6OYwbYOt2fYeqktGTZgYL6GKZrokdPEX3rh9ixsYpuXqfsLJiuR/+7VS7XkBfxcoGx5ODJHFaOkVdZixnMGq3JJWVvLFHltDk7/PxMYv7XfKt8jNgkEzc9TgzUmTZ1EQCuUwo3udTi/u/d6HKRnKTChVks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613918170; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wfNdRFst6LfLn0VNAb4bbFY7EBizJDIkL87O+WLW55E=; b=XedbX7f06DaB6/edyYBvtSGG2EVog4h7x97XYJrSjCx9tagO2jr3nW8znz8GXemk1u8UFIpQ/bMhYo3cVvni4BwrxreTZ16lfAfwKqMQJhcwyi9M8+GWgJnIORrWucq1RHB46Fk7Kgq30mmeW4ZyeVLDB3hj0E+83GfFpQEGl4c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.zohomail.com with SMTPS id 1613918170231843.8295644469687; Sun, 21 Feb 2021 06:36:10 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id w4so11177900wmi.4 for ; Sun, 21 Feb 2021 06:36:09 -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 s11sm21388671wme.22.2021.02.21.06.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 06:36:08 -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=wfNdRFst6LfLn0VNAb4bbFY7EBizJDIkL87O+WLW55E=; b=YGx1C8/Lgapx6r+HfbjwLjKjnunq1C8sJnKv23a/u4LgnsqNPsqCO+y0kCjL/ZvkcV 1FWiblsbq1eRp042IJ2g+9LBciVH1QupZvYU9Xgkcx91zMWwbGOfV3BH76+UmeYBWVm7 L8JHgPqK5r3wC7+TSBuy9oc7us2cNLCQzLvqfrbczV1Rp2FBDs58bW1hOtHBZGaXXGrb 5LUV3LHe3qeFJyEVvLbrDyIHtUaVFxg6dGBbusC3+5baSbhGc9LHI47BSqRu7/zuev8z zIhhb4MbmCH5L3R3dOi4jVU+nNoVtT6UCmjuB5T7nFSfArYCsJ+1TsxfB4x6dS0+yu63 QqWA== 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=wfNdRFst6LfLn0VNAb4bbFY7EBizJDIkL87O+WLW55E=; b=gtrTCqObUk+EDhkUttF6OtheS39rlJDLOwA7L7kG1akYs9gYFj9JFXbhSOipEVnPJp Ism4QaVu8maliuDivv0GLcPBHMoTzG4HTpfwQFUYRkRxGJuQ07saOV4nbhkUY9XkJHQH ov8UPpmwLljDpVoX3kG+I+vO4Ich1DUQ0MiXJ5JEfdiwahfRIc8Vf0OSb/8B0YiQUA6M T4NVGei0myfkmAOAhMa2S2YtbQwApPekbjEzqPlWIIEIeWEX+atq2Hw4EdDyLxczaJOO gb8Y+p5iuw2XsjfLP1UhfqivZJ1EzlnQvrMNlztpFEd6yjRUHAZGWqWqSVaAG9AUIDzB jCWA== X-Gm-Message-State: AOAM530xN5VIyMZG/pdaFS5oTVWZHAEIUvJq+aYIdrJttMGLefjsrkYn Ro8qqkA1o3E5xbabLnIQ8lk= X-Google-Smtp-Source: ABdhPJxxcilPx80bgWpMFNgWWdKQx05Oy036cMxEsnAeg2jynAzK7FFxmGorOR7ILMQ58CuSFtTNIg== X-Received: by 2002:a1c:4386:: with SMTP id q128mr16402247wma.184.1613918168555; Sun, 21 Feb 2021 06:36:08 -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 19/43] target/mips: Let get_seg*_physical_address() take MMUAccessType arg Date: Sun, 21 Feb 2021 15:34:08 +0100 Message-Id: <20210221143432.2468220-20-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_physical_address() calls get_seg_physical_address() and get_segctl_physical_address() passing a MMUAccessType type. Let the prototypes use it as argument, as it is stricter than an integer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Message-Id: <20210128144125.3696119-13-f4bug@amsat.org> --- 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 f15cc48a062..4db8a7582d4 100644 --- a/target/mips/tlb_helper.c +++ b/target/mips/tlb_helper.c @@ -222,7 +222,7 @@ static int is_seg_am_mapped(unsigned int am, bool eu, i= nt mmu_idx) =20 static int get_seg_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_address, - int rw, int mmu_idx, + MMUAccessType access_type, int mmu_idx, unsigned int am, bool eu, target_ulong segmask, hwaddr physical_base) @@ -234,7 +234,8 @@ static int get_seg_physical_address(CPUMIPSState *env, = hwaddr *physical, return mapped; } else if (mapped) { /* The segment is TLB mapped */ - return env->tlb->map_address(env, physical, prot, real_address, rw= ); + return env->tlb->map_address(env, physical, prot, real_address, + access_type); } else { /* The segment is unmapped */ *physical =3D physical_base | (real_address & segmask); @@ -245,15 +246,15 @@ static int get_seg_physical_address(CPUMIPSState *env= , hwaddr *physical, =20 static int get_segctl_physical_address(CPUMIPSState *env, hwaddr *physical, int *prot, target_ulong real_addres= s, - int rw, int mmu_idx, + MMUAccessType access_type, int mmu_= idx, uint16_t segctl, target_ulong segma= sk) { unsigned int am =3D (segctl & CP0SC_AM_MASK) >> CP0SC_AM; bool eu =3D (segctl >> CP0SC_EU) & 1; hwaddr pa =3D ((hwaddr)segctl & CP0SC_PA_MASK) << 20; =20 - return get_seg_physical_address(env, physical, prot, real_address, rw, - mmu_idx, am, eu, segmask, + return get_seg_physical_address(env, physical, prot, real_address, + access_type, mmu_idx, am, eu, segmask, pa & ~(hwaddr)segmask); } =20 --=20 2.26.2