From patchwork Fri Jun 30 13:21:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 697950 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp452566wrs; Fri, 30 Jun 2023 06:27:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlE1WJhW/XSy+V7OY3njNMj1jmK9eq2KhtfZiYAeb9VEsA/hWW8v/M7ufW0YMbg5qvLp4w4s X-Received: by 2002:a05:6214:2427:b0:625:aa49:19f1 with SMTP id gy7-20020a056214242700b00625aa4919f1mr2848458qvb.62.1688131672252; Fri, 30 Jun 2023 06:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688131672; cv=none; d=google.com; s=arc-20160816; b=UpNcT7d9zcLAgJtdpfCbRr5aTXGmvzloSaDWgL2kZYXLnbzV/pBj/fGO93vZRkn5SJ MufL/ZbDIH3RYu0qMYrqyYLUtJZ2Vs7wd938cgAEGSEqIpqGb3SvryFWQglRPzfY6c2I AQaOIRB+I1XcSTEjCEagns15zeYxrroCYqUypPxll/QD42oBMkf90x9X8Z5ZgQKZMsF8 2Nn+ML13OWS4fEKBbBDRRH45XWUs8uEpu+Y7ebzPaUo1lGB9/pmUPsOwzcDvsXmkAnod LZyfSkA7c01fsvlagalS/8t4eWygzmBaer8JNrQdrwKpnPU38mEFYI2FIuLGREZAyHkt kbWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gT4NK9p8wEYJPmQQBQUhLbzesb3JroSJqWwYF2RqsEw=; fh=6bnXD+ip8BuPvzTWf97csbR5QVhpZvBV1AID0n9STS8=; b=nuOf0nImUW4qRCV45Z1mE4HnaJ/2GszUasHaalHwpui2GM+4HPVDC7Zi/yvDrdUGR8 lNbonXbkFCXaz/0B4fHH+VSp93ZJvYzzsHtjW/oxcLJQJu+qndYsuPtcI7z/ZwL5UAcw sES8hEKixNstNvjHLulsnZC5mQ4YiC7A/6p1l58pUjmAZJeb2luwloNK6+KldHYxTJN5 vxSdBjYPI0BGaK7PAd2m4S2oQfd6tSBpncB+qOIqGR9QeSlv48S+uUk+v7drr6wlIgi3 gt7FSMbabvPm8uj+svUKQ69j84G5IP5iimUii5E7l5s+6AYwqDOPuM2Qd89QQUqKTLiz dVXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IwSGEYbY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6-20020a05621420e600b00626009daf2csi7908653qvk.543.2023.06.30.06.27.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 06:27:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IwSGEYbY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFE4r-0007lX-8a; Fri, 30 Jun 2023 09:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFE4q-0007lP-JI for qemu-devel@nongnu.org; Fri, 30 Jun 2023 09:22:20 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFE4o-0003T4-UC for qemu-devel@nongnu.org; Fri, 30 Jun 2023 09:22:20 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-313df030ccaso2105397f8f.1 for ; Fri, 30 Jun 2023 06:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688131337; x=1690723337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gT4NK9p8wEYJPmQQBQUhLbzesb3JroSJqWwYF2RqsEw=; b=IwSGEYbYQtOu5yoCQo8Hgw4LQe/7+WK5hEzKTgXgC5Wtoc92rRvnIDJcFNs4PP26P4 bOqtRmJsFoUt60YLD8rVqhL2mBl2qJRvy2Sh9dPgvPFWuffJ1sirsTYaFQFnceSwH3g3 eUbGvLWV3EQmjDU4+YZG+GnOm90dp5PxXpJmeGGpRG+gPfgDLfbajYVNz9KzOHHpoD8e Cq/ksRjpAN2GKbReIpVuOxvszh5EdCPmgrvt0SgUkfUSXy82wOeoGowl3dUOIqo+p95i VfPSaDYpgsTkoX2xF+VKGyyeVeXQNj7aZqN+AMjd+Qm3RdWAHr64b2uwMldwlMWP1anl XzAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688131337; x=1690723337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gT4NK9p8wEYJPmQQBQUhLbzesb3JroSJqWwYF2RqsEw=; b=BgPOwZNLZr10lHeIj3P6jkgY2NuSQSjKmet8pDZFS8JIvNMDU533UXPokcR9Gpa7y0 1I/VFkZ/HoiaZlHHokNAu42xLOl09dFjw6zrXS2nXs2VmqAYeS8GgCyUqnqoh0DBZZgt OHDx5/YmefBJfNRFG8mgU9AiVJN+TRILkJMjZQPnRS9Pl5+hT2Lu9Q17C2MixJq3m6VM IrBnGSIN8lm3P7L879xHDR5hK/Wq5iYUUKGp4qOvuX1vsi5wcz2rbo7qeg/Trm/eBeJv 9zsiPQz78w+NCIbuNi21PCegTOjacgikdw3d3RLsGRV97AeIzuNR4rmouzjCTOnC0pp6 sayg== X-Gm-Message-State: ABy/qLYoEgZZQpOSxpJyggknrDUeL9tjXXaK764P9XO2LgN4GUl/99H5 8WkrVodcT1bYsd4S29DzilFUlUnbplmxE+X+y6UPBQ== X-Received: by 2002:a5d:45d0:0:b0:314:276e:30ce with SMTP id b16-20020a5d45d0000000b00314276e30cemr402000wrs.51.1688131337246; Fri, 30 Jun 2023 06:22:17 -0700 (PDT) Received: from localhost.localdomain ([139.47.41.96]) by smtp.gmail.com with ESMTPSA id a16-20020adfdd10000000b00313ef2150dcsm14571092wrm.45.2023.06.30.06.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 06:22:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mjt@tls.msk.ru, laurent@vivier.eu Subject: [PATCH 21/24] accel/tcg: Accept more page flags in page_check_range Date: Fri, 30 Jun 2023 15:21:56 +0200 Message-Id: <20230630132159.376995-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230630132159.376995-1-richard.henderson@linaro.org> References: <20230630132159.376995-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Only PAGE_WRITE needs special attention, all others can be handled as we do for PAGE_READ. Adjust the mask. Signed-off-by: Richard Henderson --- accel/tcg/user-exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index dee4931f86..7a36f95bbc 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -561,8 +561,8 @@ int page_check_range(target_ulong start, target_ulong len, int flags) } missing = flags & ~p->flags; - if (missing & PAGE_READ) { - ret = -1; /* page not readable */ + if (missing & ~PAGE_WRITE) { + ret = -1; /* page doesn't match */ break; } if (missing & PAGE_WRITE) {