From nobody Tue Feb 10 10:58:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1592586871; cv=none; d=zohomail.com; s=zohoarc; b=JfXnM9p1wXZmPv0u+NcYEzJkiOraSI5KZKY2RQpOSLj73Hid8jRZM2g5BJ18rI+9/Ih52iDMlyq3gEySim5iZC8oz2Bc/oCmLujiKBwSCxca3mCOUhZEPfZjPLGvAplsZZMn0eU+8YEG92LdlRN9IbyFF3wirxl81JaBqX5IDBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592586871; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UrMbW0Wsr+uGtTRjpv1sT1DKcKiVwKW289h+OJlov98=; b=lblDXxKrDrOg6DAKAd3jYAXnOR0QUUaH2S+D+aIUaipNkL4jzBI7034LLUPuIaWW0FWfAa4pZJ3VpqNjT5TKaAd5N/a7RmcZPPChTRaEbr9PiLBB+VW2gw4Mj+mFXS4ikuMc8F9piRZzpKWxQCslagL/ai9xszcFBPPE7JUWCbI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592586871987761.376757229489; Fri, 19 Jun 2020 10:14:31 -0700 (PDT) Received: from localhost ([::1]:58002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmKb0-0001A8-Id for importer@patchew.org; Fri, 19 Jun 2020 13:14:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmKUD-0000g4-MA for qemu-devel@nongnu.org; Fri, 19 Jun 2020 13:07:29 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:24436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmKUC-0004Q3-0k for qemu-devel@nongnu.org; Fri, 19 Jun 2020 13:07:29 -0400 Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2020 01:07:26 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2020 09:56:02 -0700 Received: from unknown (HELO risc6-mainframe.hgst.com) ([10.86.58.142]) by uls-op-cesaip02.wdc.com with ESMTP; 19 Jun 2020 10:07:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1592586450; x=1624122450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=81HMh1gHLXQkIcSglIbxP90s73UN4Lp7ZsuwWeLGYlk=; b=dGxSDty1cWip2XsHIOLvERz/K0SzG6yeArbvur7gh0qHkYLxrTzHnSfw qBCX3qhyKZZtytzueh0Q23icS6VdA1TBuZa1Lex80kvhrwWhAozkA6C0d SC7HDDiTUIpRTg2meZ91trJRXctEJgE0Ui4XukkWGXr1jWIaAUAJXj9rP GA/e4BwlslAsqwc7n6VH+S41tVMIE/8I8InXdm3Fdmp461zWKapdwhRNc AbfTEE+lS6zz3/WF74G+i3x4THTaygWzFLupH9gE3WSJQ0rS86ow/dVHD vJlUaU40MmdpZwstPw8nlBpDwVhD5flw26EBTLAvTH4TodYemUNFhe35j w==; IronPort-SDR: WU8S5MvgT+xIXU0JjsnyhyJHRmgdKspnkYfBb2n/E5qeRqUdiZXOTCui7z2JCEbpNef2N84CYb 1dBoi3ei+A3kjrvWQURamtbPZ/B9gmvjSbvbsCRrqfMdtcZ66tbVUicjQ+upFAfhJZuBXYgZ7K fq6/nsqzJnvciT75xD3Co7LPxVLCmAXBJbpnPQiq7Zf7Oc4iVSzGBT/sNv1WnVlwBJmodVkWUs LlQ2BN/p0+f/1kN4i8rj0mmKeeFyFt/cpLEhpzTLKLNEiD5DRHyART1OfcdEu2Z72DKOQeFKkO d6k= X-IronPort-AV: E=Sophos;i="5.75,256,1589212800"; d="scan'208";a="243416995" IronPort-SDR: r6eGJskz6iMRkve7RjR6KA56/QSe789VlGmmfjSmhnZ0KKUV++EfRlyFstzzoMC/9FY0/DqFWc SArityFtDh00uQLUN/jFP8oypnag/MQZA= IronPort-SDR: kP8VdEr8/OSTHb8AWKYhVJYtLsb0y0ihSBhb3HE2gUDINx4RB+MDjge6evsI5i6v3OdHv0uTau /e3KJycCuIGg== WDCIronportException: Internal From: Alistair Francis To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PULL v2 16/32] target/riscv: Use a smaller guess size for no-MMU PMP Date: Fri, 19 Jun 2020 09:58:01 -0700 Message-Id: <20200619165817.4144200-17-alistair.francis@wdc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619165817.4144200-1-alistair.francis@wdc.com> References: <20200619165817.4144200-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=68.232.143.124; envelope-from=prvs=4324eb4de=alistair.francis@wdc.com; helo=esa2.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 13:07:24 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: alistair23@gmail.com, Bin Meng , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Alistair Francis Reviewed-by: Bin Meng --- target/riscv/pmp.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 0e6b640fbd..9418660f1b 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -233,12 +233,16 @@ bool pmp_hart_has_privs(CPURISCVState *env, target_ul= ong addr, return true; } =20 - /* - * if size is unknown (0), assume that all bytes - * from addr to the end of the page will be accessed. - */ if (size =3D=3D 0) { - pmp_size =3D -(addr | TARGET_PAGE_MASK); + if (riscv_feature(env, RISCV_FEATURE_MMU)) { + /* + * If size is unknown (0), assume that all bytes + * from addr to the end of the page will be accessed. + */ + pmp_size =3D -(addr | TARGET_PAGE_MASK); + } else { + pmp_size =3D sizeof(target_ulong); + } } else { pmp_size =3D size; } --=20 2.27.0