From nobody Thu Dec 18 08:11:54 2025 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=1589924895; cv=none; d=zohomail.com; s=zohoarc; b=jOF7jl2No06Kkvf3DOMO9T3KM8LUQlB7TuNg9fZAGiuqQ6ZrIIsy8xu/FsOx6MBYbivf+OS93gRdUW6N4hUPQma4lYX/d3jJVYRK/h4Vdb0HWTaK94NG6GeCpqH9EjIzfCpjAj+/UQWd0w1xcFOOgVA7q+O0e7oy9+btGb7kMhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589924895; 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=6JZn54pi4PvAwdusQBCABxzBuVF0TwNR217sZFSO7AA=; b=B55bByfG97uzJyRhkd7yQSS5zM4qMY4vMJUv3GQdu/exQofLRH820pf0gGHUfyUhm1ek/lJdnVrD13zChpOzsyt50EX/ItmDw0NRnx3V+CVpQJwkPehexBWj04i0DXg8ge7JcXAIxaz9b6tk0e8MEo4qq+Lfw9awgAVEJeDtsqU= 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 1589924895858611.4858142217801; Tue, 19 May 2020 14:48:15 -0700 (PDT) Received: from localhost ([::1]:46156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbA5u-00088b-Ma for importer@patchew.org; Tue, 19 May 2020 17:48:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb9yR-0004xn-Qj; Tue, 19 May 2020 17:40:31 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:10366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb9yN-0008RL-5Y; Tue, 19 May 2020 17:40:31 -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 May 2020 05:40:38 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 14:29:48 -0700 Received: from usa005149.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.57.14]) by uls-op-cesaip01.wdc.com with ESMTP; 19 May 2020 14:40:17 -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=1589924453; x=1621460453; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Yh6HDSpcIAYYoDrW0RtvHeW2Y2DC83cZu3PMMp8py4o=; b=Dp9PX7cCwJtR20FxnSSebpeSikszOPYVYBUjxfuth56cn6fZcjHNsHur SWvdqB9z+AnANL9iEzJ0mu6OjeD2VUSQqUc9f1wHnR7dQeVgD37ljZ2mB sNaNcrSD7kTPspVgIaBycyL/NmYCj0fZChgtzz3Oke46IfNCHU70IWIKK 2vus4hzv4cJXjSWX3nwu0P5gq9xOygB7afLGH+YlXPjLXT5HnmM9I4PlC HArqou+K2d8Kz+Po6A90u1PyaxD3W5GZSpiH5uWt95S3HoFo9/l/mXPyj K7c91+VZlYzUN4tqr/w+ajjfnfDv7GMlNTar8V8+NTvX+RtUReTW4jSaU w==; IronPort-SDR: wUTirav6ksxlH12u0k4VYHKg679oeD6HgZWeyxVepi+PpMLxPraU12tyuQupsUw0W6PASNA8x7 gHjqT68ZSbVp4rcn6KSf879AIf+ZwtWAK+4IAxjJ0eScPGl4T+VYEUT8AjS/jeH05KlAFr9363 AFAE1inHQe+1ADHA6jiG36HogqxIeO5YZhTbJ4uquwcTOfTV5ojsi8iNV3NOu7jEkrTV0RVwDf ixHll/hDFHkyoPj9ycS0uVgHnWPaYgjQYBVKgfjL56joQGsb2zJdCDIbW3s9Gt5Lw0Xs6WEhUh OL4= X-IronPort-AV: E=Sophos;i="5.73,411,1583164800"; d="scan'208";a="240814214" IronPort-SDR: Ll6DDovsWTd0voglFK0fDuWLPQyMVucCcuvqA4xe7J1MLZHUjXLiIksFt/56uB/n9n3ESgVAse UvEgdz/X6lA94hXctWM34S0jtOhMYOR8Y= IronPort-SDR: QiaGgoXzUZE/LdS08KnsAsYxMXdXF3CzJkls5tLdqxEbSgo9mB/Z6/RyYv2aIio4D1/GoPZ5JY +++JjwQ4fcHw== WDCIronportException: Internal From: Alistair Francis To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v3 9/9] target/riscv: Use a smaller guess size for no-MMU PMP Date: Tue, 19 May 2020 14:31:50 -0700 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: 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=401675184=alistair.francis@wdc.com; helo=esa2.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/19 17:39:51 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_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: alistair.francis@wdc.com, philmd@redhat.com, bmeng.cn@gmail.com, palmer@dabbelt.com, alistair23@gmail.com 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 --- 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..607a991260 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.26.2