From patchwork Sat Apr 27 15:57:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 792680 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp973891wrh; Sat, 27 Apr 2024 08:59:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX7yLtRAhOXyqRRjMd9nBTq1Zi7KR12swltODPmP5lIEKRwiCiXd/9yUAqT11zgo5Z9TWxk20FfnlZWnQkHnIUK X-Google-Smtp-Source: AGHT+IEgK2iVSMdHskkjzaUcDHMMWH0RnO3jXMP0NnILmbvhjbAA0f4Dp0W2KFAHDtmFYrUYo0fZ X-Received: by 2002:a05:620a:c4b:b0:790:a960:28f4 with SMTP id u11-20020a05620a0c4b00b00790a96028f4mr4739323qki.25.1714233592111; Sat, 27 Apr 2024 08:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714233592; cv=none; d=google.com; s=arc-20160816; b=DVj9MzDZLYsJckoYOhItfk6ZyehA/S+w6TV53AjqqsZ/pCU15Oh0mUHgqSH78h4Jmf PlA4hKt4lXTbHdQqP5bkiXcK3KzoeyIE/tKKVLdJbc/eAaknJOqGGVBFJB2BTkE/pqc2 MVz6/QQxGBw0Pxjjawww14JFOJh5zsZDqWf8xWmHqqqUfVKI13EjKKJrWGr5Rt/mlILS uJTjj558DLbJMoLUxwu1yIJZojTWyKI/KlrTqTWKX8cby7zMwGYI4rMy09DAEMhR2cQ0 5txnIIxD2g8k4++gTfy6THwdgh3ALU1sRxYeH5IdxRLLY8zGtQ+iBRvn3cQz5z9YUC2L bS6Q== 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=g/oe4rUpvk7kXuFveLVq55aFq0Uh1L1ccHbCyLJn5f0=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=eiQ9ys5hHm686A3T2tKdLionSYhDz+XEDgQAaXvlguIEsOQKn2Ct8B4xanKAd2kfWx FhMChSkdPzc9RKJyneFfIfVWdK2y/zvK4cu9YKHKb51CjZ3eQq0KvbyhYojmO5Yo2jNZ VEFLZTDTuVLkMufG4lSRgS9RmI1M7Lb8Iqw3L4a4uGL3vzbSgmIS2vwnopa+ua28Z5ob v0NwF8k8OA4mlldx81WfnFXnYq4I+KgN65ywFLBgJBGmezJMTN+fCkJs/p0Sj1TpC0Th +PVB2SY1RXetf0KMLaEnREb6bTtt0RPYMmLFbLB6kgsphUzoUhxUM9FtoaMBRbTWt1qw rYAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eT1Y0RpL; 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 d3-20020a37c403000000b00790652066a9si17241335qki.358.2024.04.27.08.59.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Apr 2024 08:59: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=eT1Y0RpL; 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 1s0kRI-00036R-LB; Sat, 27 Apr 2024 11:58:12 -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 1s0kRG-00035n-Vj for qemu-devel@nongnu.org; Sat, 27 Apr 2024 11:58:11 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0kRF-0005W3-9e for qemu-devel@nongnu.org; Sat, 27 Apr 2024 11:58:10 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-34c8f392172so583805f8f.3 for ; Sat, 27 Apr 2024 08:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714233487; x=1714838287; darn=nongnu.org; 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=g/oe4rUpvk7kXuFveLVq55aFq0Uh1L1ccHbCyLJn5f0=; b=eT1Y0RpLLjIavrW0+p8xcwZzFA+9MlACNB3jyO5jqKZdhBCvDC91Xd1XcT+Rj4lA13 I10oupqo3oXOqPfKoylPWj2s10NfUbLFtULIkkSqeHJc0HMW8QEFXLDxplA3XWQc0NdT irfBrVC0DFFfZRN9dbCMNykgvzSR4GafzHuiHSH/oRS09EdlX9bSFP1jIBIrMa5sQwdR 3Yk2rSbb8jQm3F7JnqpWS1vYunyFCV/sjGwKKYq4YvPt27BgyChSzUDZzDuem+JH5r30 qzdDAp2YEkyURJRmjbQiW0f+S6rRd29VmbK2l7hUkPSq9YHrwWvN8tqhpgqvO2GowHzp TDQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714233487; x=1714838287; 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=g/oe4rUpvk7kXuFveLVq55aFq0Uh1L1ccHbCyLJn5f0=; b=KhTmzoALzCeGDKe0Imeo8Ff1UeDsIDp4MexV6Xx33ajemSQ5gCkoIlXQ2orCsyFXy4 wkGWO47zZzEa434WTIz5i1grq4g8fWHWJ+zbVZ2HB+H57MBnXl/oHErmyI+r3BrJIoYg 1c1TevUz8bSopgyCOGMYfisWlwTQ2Pi6a2NrdWy4OPsPY9g4iAnkPX1XM3YyUkmdlcno KZoZM1f9/xggQCqSNwGFgzLj3wSFPR7puhsRAuJOnfA/LC/5wmjLzLqdRkr+DwoHZN8k cR9L/W5SG5s0UCJ1pOVGOCILwZzU61eqwyZzQwkRhS5HEzDOZMrHT0LFsX2uiiMvEqQg vc0g== X-Gm-Message-State: AOJu0YwQ2bFgBuUJ6a0V7HKiybr+N6ADCDdtGRDNdIiBbkgqqIhXL3jP iwBl8B4TtS6cLIj/f46L2LM3f3LeW3fM4L1OHemQjDxiPOufe81nJseMau8SgSk+JJQfXOHqZfn yIzk= X-Received: by 2002:adf:e44d:0:b0:349:7f87:fa20 with SMTP id t13-20020adfe44d000000b003497f87fa20mr4993613wrm.59.1714233487509; Sat, 27 Apr 2024 08:58:07 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.2]) by smtp.gmail.com with ESMTPSA id t18-20020a5d6912000000b0034997769ae4sm25188729wru.15.2024.04.27.08.58.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 27 Apr 2024 08:58:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [RFC PATCH 09/14] exec/cpu: Restrict user-specific page definitions Date: Sat, 27 Apr 2024 17:57:09 +0200 Message-ID: <20240427155714.53669-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240427155714.53669-1-philmd@linaro.org> References: <20240427155714.53669-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 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 User-specific PAGE definitions shouldn't be used on system emulation. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/page-prot-common.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/exec/page-prot-common.h b/include/exec/page-prot-common.h index 2722ded724..b1fce45c15 100644 --- a/include/exec/page-prot-common.h +++ b/include/exec/page-prot-common.h @@ -17,16 +17,22 @@ /* * Original state of the write flag (used when tracking self-modifying code) */ +#if defined(CONFIG_USER_ONLY) #define PAGE_WRITE_ORG 0x0010 +#endif /* * Invalidate the TLB entry immediately, helpful for s390x * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs() */ #define PAGE_WRITE_INV 0x0020 /* For use with page_set_flags: page is being replaced; target_data cleared. */ +#if defined(CONFIG_USER_ONLY) #define PAGE_RESET 0x0040 +#endif /* For linux-user, indicates that the page is MAP_ANON. */ +#if defined(CONFIG_USER_ONLY) #define PAGE_ANON 0x0080 +#endif /* Target-specific bits that will be used via page_get_flags(). */ #define PAGE_TARGET_1 0x0200 @@ -36,6 +42,8 @@ * For linux-user, indicates that the page is mapped with the same semantics * in both guest and host. */ +#if defined(CONFIG_USER_ONLY) #define PAGE_PASSTHROUGH 0x0800 +#endif #endif