From patchwork Thu Apr 18 19:25:05 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: 789836 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp735058wrm; Thu, 18 Apr 2024 12:29:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWYBxhDZxM8JEJ7p3kh+4pqCO3bVOc8YfnKsOW3rqGaAe3hOsdnqI8P6CksDlC9ogo270KJuoZ5DkpC08rHn9gU X-Google-Smtp-Source: AGHT+IE/yCMES3j33eXJX2u5LEXkWQP7Wp9ms2rei0FprBa6PxdDQHHKLSBfiKHTpWnf6HBEAOar X-Received: by 2002:a0c:c602:0:b0:69b:6413:597 with SMTP id v2-20020a0cc602000000b0069b64130597mr3405334qvi.24.1713468539868; Thu, 18 Apr 2024 12:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713468539; cv=none; d=google.com; s=arc-20160816; b=p3a9Zd4ry7cQt43mwmYdm/CRfk/0LaEv/74gLztPjNM2znJRBss6Mj7aI+uD3Yquq1 Dmcf7r2GWcv/4qurUfRKxjiCIMJU+12xUpx/nNAhtmg1KamxgJL5DDmDU2PLtvVGkxWW hcb8wXplztkDjs/ILhWbCJ5eLxGadwebf/Ft8jgXsYBpwIFPAxoS2uhV3f4sy/B/Rhzo El9p2Y1IQbRZrhixidvyiEk072zv3VysPomq5B12S6VeYA+g6svOC2+ucm+INGx68rMx 1wtExCbEq8VGw3WzU/WFREbbnMJqmfYESYLjF/QmXpxkhtYOSiB/4ntUzpCD5rI2Cwel DoBQ== 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=kMOTCzZ8G1QDoqpRuDm+110xUKe36YwlxUEiY1YFvik=; fh=OldoyVsnxIotb3oLwZzdNfaQktZrdXn2xfyEQOuGV+M=; b=wf3NT8Y1nv1kW0uTO4P0YRcjzsZ4GGGORgup7xQ8Iihktk2gM4+CwAdw6Z7ffQJvF+ zQvGgIvdBD4nwd/iiDeBCwJK3WWwvTsUCGXc+ZNBn2La7GuQGfllhGc2cBZE4Q5KbtwF JK+yotHYH8/y/jeblyCudKNK3DmQVKFJR5aiB214qRm5kY4+PPodmxxyD1cOWt2j9oA1 XJhrgSSmYx/489vhNSIAxTPJMHPGtvX2aqPNtoxUlzB5x1XT56Swry6IdhjmGgAFnyd7 AaWPR2kwFpDJwpvx2tw052OhriVX3gyOR8RXdjcNORuw08h8ty/gKU6O+/GSCSX+r8Ke TVWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q7WYsWSZ; 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 i7-20020ad45c67000000b0069b5583fcb2si2173780qvh.225.2024.04.18.12.28.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Apr 2024 12:28:59 -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=Q7WYsWSZ; 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 1rxXR3-0003Bq-PL; Thu, 18 Apr 2024 15:28:42 -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 1rxXOb-0007mL-G4 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 15:26:11 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOZ-0007Lr-DC for qemu-devel@nongnu.org; Thu, 18 Apr 2024 15:26:09 -0400 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-56e6a1edecfso1870838a12.1 for ; Thu, 18 Apr 2024 12:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468365; x=1714073165; 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=kMOTCzZ8G1QDoqpRuDm+110xUKe36YwlxUEiY1YFvik=; b=Q7WYsWSZ+N9wV4Y81fNy5BB3MIr7PNKoUY0ZECRnyrkpvvL9iBKP71IYNc3o9FYV/S fqsnn/qte7tZgNO8cVtB7BOdeNSZpy3VXmpzKubQtcGPaeQni7nhCQncwybTRquoo3TU vhqc0IXMvMeeMOoNxsc+yTBcI1AeyzJdFivQh9gBBozbHzDwiEGPNKGZ97rg2GeoH8Nx cKPkJ8aefyE+g7KjVC/2Nftx0pX7T/HNtAzKZ8p89HeX0D7QUtP7iErq+6NQBR47T3f0 2UWThA3ztsI7N6OES/CGSf+0ZN/0aSJjDVUPYq+EDXivRGBkdpOOJJfpShhgmIZxC5YH /HmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468365; x=1714073165; 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=kMOTCzZ8G1QDoqpRuDm+110xUKe36YwlxUEiY1YFvik=; b=X/+Q7kTUmpY87XSCE0I3kgrjJxM2yK6/g4SfP52l9daDZfj/Yi7KDVC3nQ9VeTEILt D3tZ0jHyR5RXDMn4gPnbBLgiS3czGaQq1aPVNC65hhGqRGx+PS3R4RgNgyui+5WfFYgy IvOthHQgk/CCSCya5sQPGrXYM/O5tvMDoNYPFaJ+gkqPUz/jX8TmjN65mWw1WgeK1LCC 3/eVD7AZr5egINN02p++XQKgiJ6MkyaLeucwlvSAJiSr1vGXZSqQ43lczCgC81ZyRFrs drVg1VfqZ+zuvj8mjjNPQdaRj51w67rNxM4XyWR3s3tPv76WuEVVgijI/BDl78N0qip+ QpoQ== X-Gm-Message-State: AOJu0YyLR0uAcbvcgGdgVJC+AXwcMR7tgqdAOJNTy514SPvTZLQEl8Z1 2TSUlVPFwd+FKWjl63mDwanU7++pfhRNFdBOgbA7BZRMI/ZcY1SRFQo6d8OUrduKV6SN7emczL+ i X-Received: by 2002:a50:951a:0:b0:56e:2fb9:66d6 with SMTP id u26-20020a50951a000000b0056e2fb966d6mr107290eda.27.1713468365147; Thu, 18 Apr 2024 12:26:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id fj17-20020a0564022b9100b0056fe8f3eec6sm1194542edb.62.2024.04.18.12.26.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 06/24] exec: Have guest_addr_valid() methods take abi_ptr/size_t arguments Date: Thu, 18 Apr 2024 21:25:05 +0200 Message-ID: <20240418192525.97451-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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=unavailable 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 abi_ulong is target specific, replace by abi_ptr which isn't. Use size_t for the @len type. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index f3c2a3ca74..63186b07e4 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -92,12 +92,12 @@ static inline void *g2h(CPUState *cs, abi_ptr x) return g2h_untagged(cpu_untagged_addr(cs, x)); } -static inline bool guest_addr_valid_untagged(abi_ulong x) +static inline bool guest_addr_valid_untagged(abi_ptr x) { return x <= GUEST_ADDR_MAX; } -static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len) +static inline bool guest_range_valid_untagged(abi_ptr start, size_t len) { return len - 1 <= GUEST_ADDR_MAX && start <= GUEST_ADDR_MAX - len + 1; }