From patchwork Mon Feb 10 10:25:55 2025 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: 863754 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e42:0:b0:385:e875:8a9e with SMTP id r2csp1518605wrt; Mon, 10 Feb 2025 02:27:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWY0OwL+fmCrYHKRZb9ks9p1bOtjKDd70qp9lYTjlSpsle2h1gsYuhCcIDTASuVJPGnV4I9ZQ==@linaro.org X-Google-Smtp-Source: AGHT+IFy1B8ceK6Dzul9avdw27LeG6vlqDIsE1+0TdKl/+VK4C+G2tMRjmLqQS5D9Q4mQOT/IEdV X-Received: by 2002:ad4:5caf:0:b0:6d8:a1fe:7293 with SMTP id 6a1803df08f44-6e44576b912mr208599716d6.42.1739183277565; Mon, 10 Feb 2025 02:27:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739183277; cv=none; d=google.com; s=arc-20240605; b=WOHPL3rKoDytF2y546arJbgTzl+BEsofrqWNZd1sD5JV1QrzZO1cIwS04BzLTpgesF EVA6m5t76OPuNHp39AblTVfsLe8+O95/RTsphTA1mAI1Tgmp1NhW7rV3AqLKPsM7yjga rnEZaVL5thqR77yp50hMF+67Wfho+utwzydDokRxiKCqUGGev7lZI5WxbBwhA9JzUrWk onQjpZV3gXRRUKZi4ab7rK9uz3+fcXjrRYRNbD0LhSWYWLuMrvioWizXiLHqdtjtMonD 5wWgoibLOQswAfb37FFCGImPeheCipOMnyxC+UrYJeccpYiDiO+HrNvYj6gmR86PExf4 jx0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=KVG9LleBgVUQXQy5aq+er1NbCMyLlUd6s760Io8ryMc=; fh=5gGtEWbs/bc4ZS50ZuMZZ2I/Jn5oaYqe3uWxuR8fBxU=; b=YvIWJ/jHPi6bEGgg+3dbcINU9mJZ9LEtp3Wr/kGaX3pjp6EoaIB6MR19JTXrkOiYVU nGtPrxxh3I1yMf4cZjU8anTaYtyT03I6cxGX2Tx+/fXDfdU+AOB+B2HNlGcrD8PJNLXP 2DTjhMSRg/BkgXe5ciKfxnqU/gBtIhkBzedGPzl3vlN7XIhz3xzXRI7AKy8POyXCGhIo ODxlPCcsye0c4r38cramDsihtBwYSntMTBm8ws0ngrsY5GHnTea5E4qYmSaxZRyKnY1i EbSZPodUvpPV9iazEXQ6sMkcBZ8OvkU6wXs5LnoW88yOlZg/96mP0k20J49thS1l1wF0 8qYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yQT+iUts; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e44e300842si61517956d6.84.2025.02.10.02.27.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Feb 2025 02:27:57 -0800 (PST) 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=yQT+iUts; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thQzh-000138-Be; Mon, 10 Feb 2025 05:26:25 -0500 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 1thQzX-0000nQ-Rv for qemu-devel@nongnu.org; Mon, 10 Feb 2025 05:26:16 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thQzW-0001dM-0f for qemu-devel@nongnu.org; Mon, 10 Feb 2025 05:26:15 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38dd91c313bso693550f8f.3 for ; Mon, 10 Feb 2025 02:26:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739183171; x=1739787971; 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=KVG9LleBgVUQXQy5aq+er1NbCMyLlUd6s760Io8ryMc=; b=yQT+iUtsVH5Yob4VEXYrftwBQrucQ04DzFeUZahZmPDw6wtKbnqm9oSLA8Jj3NpNBb juSr3l8Vf87pcHHhH0/B9ttHmW6pUutPiUfyQij3hyZB0ewsGPLkVRJkwk6UfkgVYhkB LczM655Mid6oVZUwC5POmrq/PJrZhNhYX+e4N5ssWSad8h5S5E6altZ3wf0IIF0IXFPQ St2QWop3p2w0IqaQ5goSgTmrRaCEOBeLPIalqnUJbYFL9smUtCGxsa9hU96ceoX1CLsn wmfIxkn0HdYYGkN3MWF33UENswJKKRXZIHJmTin/88WwLJ1WOK81lzEPyy8IGYrzVTvT FFVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739183171; x=1739787971; 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=KVG9LleBgVUQXQy5aq+er1NbCMyLlUd6s760Io8ryMc=; b=jEyLjRz8LAqanJWhZ0MkKmePP0/nJM6d6WO3IrwcZ+gm7n2pEht1MdQVYOFHln5s1N odpKgTWLaggnN1n88pfCMUU3LHcNILxxmdnnCqNMosPV8HSrvvlrYYDm/XxbF3Yf14A5 lSnN7EHpQspKBZsfN/PXJ0SpFQwINNqEllYADD0uv55C0X16k7qSky7Tq6hPsEc8pkTm Bi6KOII2xoOfm5jAPXPD3KdPXzmbN6hFXAnnkisO/84VEkQhxsFrAuDKllS/4WDGvh6i pZzXbFScCqufZw/A8xHAmZdg2rpv4iJF+e+Kp8rsN8JFDHB9AbaHLN1Oee4wGdB7ITjD AJTQ== X-Gm-Message-State: AOJu0YxW6vVW/Fe4DyaLLXjfJqyRYFlyEol9al2keEg7nbzli3ErTXmk b0qhuGEfyIfwPMiK8+oDQO63JZ58I3SExa0hUP4LXek6ZfhWbFBDZr3XggZ2aZHUPV4Uiy1uxPp dUas= X-Gm-Gg: ASbGncusTvt1USzMyP552iBuAQt1bzX6uPRICkO2asfY97vjl0vKqSvYBV1N9l5IFtc pLL6APlD4CzVr0xuzXveWFYwBXI60ZR1FaMd5syvNx8lsUKdDMFbxzYwRAiF6oYpwBewkeaeIPT KwWnIOY6qsy92kzxfw0zwmZpYYsdlLP7IXHcmaFXuVrui0Jgo9CqE4vQe115OMcrSNoYHDs5H2U QHtK16PyZf/8Wek0INC5NRwoZHNaF00nPtWF3SLLMqENE1Dd6jZtIjB5z+o+A8735RBkuyFyrBR 1pM6HiNsJuGJOnavNexa6ZTKe2190hUwpQ3TI96NwwBBT8DO0NrE/OUYdnU/LITXEa/PBl0= X-Received: by 2002:a05:6000:18ab:b0:38d:cf33:31d6 with SMTP id ffacd0b85a97d-38dcf333683mr7851954f8f.3.1739183171615; Mon, 10 Feb 2025 02:26:11 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dbde0fd18sm11930370f8f.72.2025.02.10.02.26.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Feb 2025 02:26:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 01/10] target/i386: Constify X86CPUModel uses Date: Mon, 10 Feb 2025 11:25:55 +0100 Message-ID: <20250210102604.34284-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250210102604.34284-1-philmd@linaro.org> References: <20250210102604.34284-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index c67b42d34fc..f9ce6970ee1 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2288,7 +2288,7 @@ struct X86CPUClass { * CPU definition, automatically loaded by instance_init if not NULL. * Should be eventually replaced by subclass-specific property defaults. */ - X86CPUModel *model; + const X86CPUModel *model; bool host_cpuid_required; int ordering; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b5dd60d2812..4b2da45366b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6436,7 +6436,7 @@ void x86_cpu_apply_props(X86CPU *cpu, PropValue *props) * Only for builtin_x86_defs models initialized with x86_register_cpudef_types. */ -static void x86_cpu_apply_version_props(X86CPU *cpu, X86CPUModel *model) +static void x86_cpu_apply_version_props(X86CPU *cpu, const X86CPUModel *model) { const X86CPUVersionDefinition *vdef; X86CPUVersion version = x86_cpu_model_resolve_version(model); @@ -6465,7 +6465,7 @@ static void x86_cpu_apply_version_props(X86CPU *cpu, X86CPUModel *model) } static const CPUCaches *x86_cpu_get_versioned_cache_info(X86CPU *cpu, - X86CPUModel *model) + const X86CPUModel *model) { const X86CPUVersionDefinition *vdef; X86CPUVersion version = x86_cpu_model_resolve_version(model); @@ -6493,7 +6493,7 @@ static const CPUCaches *x86_cpu_get_versioned_cache_info(X86CPU *cpu, * Load data from X86CPUDefinition into a X86CPU object. * Only for builtin_x86_defs models initialized with x86_register_cpudef_types. */ -static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) +static void x86_cpu_load_model(X86CPU *cpu, const X86CPUModel *model) { const X86CPUDefinition *def = model->cpudef; CPUX86State *env = &cpu->env; @@ -6563,7 +6563,7 @@ static const gchar *x86_gdb_arch_name(CPUState *cs) static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) { - X86CPUModel *model = data; + const X86CPUModel *model = data; X86CPUClass *xcc = X86_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(oc);