From patchwork Wed Feb 12 21:32:33 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: 864481 Delivered-To: patch@linaro.org Received: by 2002:a5d:47a6:0:b0:38f:210b:807b with SMTP id 6csp137761wrb; Wed, 12 Feb 2025 13:34:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUzR00EsPHNEzzoQ8X8oclOX7Ju+Img8g2FmnfN4MN8w3CuQLu6YikAUFfvKBggOFAFuyNqtw==@linaro.org X-Google-Smtp-Source: AGHT+IHN9WS9GO4jSJ92gNAX0106g1bJeJEGEJFmmMyvOZdCu/ZForjnAGbATultfNbQCu9SVxHU X-Received: by 2002:a05:620a:45ab:b0:7c0:7753:9813 with SMTP id af79cd13be357-7c07a10daecmr167524985a.12.1739396069695; Wed, 12 Feb 2025 13:34:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739396069; cv=none; d=google.com; s=arc-20240605; b=DbonD4dE2F/vLBct5Ux8LvQ2y2LapORby+uRgngHjYmRBwW2EYGWUeIdGuCFk/hK+c kVclmjT+ONW6KaO8Bb5ABpmh4YpK+8m3xpGjfqvbroFdVZcS5BgR2KHjcyYv7yjVwxo4 FEPrwYVtBPSR9jcF6daRt2cYfrgOzTHWUxOGpeA/gngh34fvmTm30gmbrB9ll4KTjOmT DeShBb5GDeKdjYW5vgUBpSoC8NujQTnrcLjK3qlZKny89pmX38Y9a8eyxxGWLbAWnAFP TXhmT9QNsdjAKrkGOf6fZcaIULTILzslEeVksV8bVRZTWphjQ5jIHApf3rjUtXzrEY3H E1Mw== 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=YyHOKWoeSC403uuReOzBJ6t1qCvcqW/3Uih7M9Jpk2E=; fh=fz3DJMUXEzejNv0JWYQ+xa02BmrDN+/I7HIv5ot61VY=; b=QhxwZX1IUoN0VbP70bkywPlQ9ZyVB+1+ubaJJXluC+waL5T0tms6LkzyNF8SJAg2Hl TGS4mGGxZz+0S6lvWen1K0cuTXU9pjR1/wKWKAJpy2qFK6ZnMr+c0TzbH7QbcHhO1NEc XmSQVa706kol6vhnWt9AnpYvR3qTAe0dJDjRYvuINgwyJ9b5DySk/ob3HXT6oyFc2B8X 1mqkmop3sUQ8ZJWE4wlFbemE4vpCAE4Cq/idFRfe03fJOP7m0CZuuIPDPDfbP4S/6ZJe 7wIXwkpH6TDNWWjJ90OyvSIkuoUyo/MuD6bKP8ofVFWNKykp2XBC83dQcwdkjJgWBh4G oY5A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cOOETH3O; 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 af79cd13be357-7c05d577530si744324085a.621.2025.02.12.13.34.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2025 13:34:29 -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=cOOETH3O; 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 1tiKMG-0002yv-0u; Wed, 12 Feb 2025 16:33:24 -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 1tiKM3-0002wU-DX for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:11 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKM1-0000U3-JP for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:33:11 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso1278955e9.3 for ; Wed, 12 Feb 2025 13:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739395987; x=1740000787; 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=YyHOKWoeSC403uuReOzBJ6t1qCvcqW/3Uih7M9Jpk2E=; b=cOOETH3OnexnE+4Wo6fGkn2kycG1c8dHUar70lXeXc/xH2LPOt6bzFq5bCr0BIwWyA tHk+HfVYoJDlU2nuXCrQ71adnZT6bV1wP8yWc4RTqoj663WIbreHhJ4N99yBicclfSzu YwcJfZBr3A4ayyQVAFK/kg0AT82PZywSVM1Euvkr5UFWMq0dlEuANWOtaMqp6Rma4LnS pR7wLwL6haIKALLN6uapynaq8CfO9ogShsSQ9C2z4lRcpNsiCnnLw94DuRB0+Uo/CBRt svH5xZ2hftTCiLNRrsLhFirbCT44ummocCtZFO8IsTYX9hmbNxfYoh9zFkElvXBDhtVs vmZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739395987; x=1740000787; 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=YyHOKWoeSC403uuReOzBJ6t1qCvcqW/3Uih7M9Jpk2E=; b=m2V1ylha202kttzAzh0o1GddtDHj93D9MW1QX6aq9XOmvxLfOR3uHiN69CXe8YykwV axO9ei8bISqZsF4Aaay7LdCn+6HaoyN0smMsErSYijgi/Hkdr6QYvb2oko4pA6aygUBv uGwJcJEZru+MDOrrwh4FfvdSD80mPJ+Z30VQMWoprNYx1lOOEInsJAF0z4dJ2hPbr48g 3u9ILDDsaKiaJxPl/cwmMGISdajPCFT3l/WVKLxL0+UdlAz3JZO4yDOtx/DSdBfR6JLA PFSERZtWOmozjm3ZTY+cNB+XYv8K3aM+hIZQjkfuuDVk5CQqeVe1iD2umlpcKca0RZQm XWIw== X-Gm-Message-State: AOJu0YxD1QS8qDekaJeBQ5yXhSU7ntLUcuPgR0/8LEgJp7vIcFScOU4p fE56LesIoy3hYGOVy1Xz+PccbfHdStn9ZwcZai/hniJNJlpuY+Mk9DClJWgRyUZPyzreOdVMrlq mppo= X-Gm-Gg: ASbGncuL1cUZOzt5C8kN3mnBD2pGPRUtk609RI/nYobx4EZs9o7VkKQNCwXSss6SjAc T1iFLfig7etu9tlI2AHyVO35C7sobU3JH6sYl/MJT1qe2JCXrY2oxJUB0LMYgqmpIZgOtNZIWK0 Dfyjygby+un+KZvuKHSU8zIvbU3fshERDTZ5UJQx5ulaPLVTbrHOv1H3olNHmwUzm5TWf9667Pm qJU9Voka8x1jEroDCl/2OBR7IoMgvu0uIdRNRO3ijeckQ4qLvtfRznviEFXqLi3YCxj1cI7Jivs 5ojdKJY+VOgAja1eKoDsGy5mKfostSJ+1ZGVoUS22TtgQnVI+V7gcRPez3LZdMlszA== X-Received: by 2002:a05:6000:381:b0:38f:230d:4c77 with SMTP id ffacd0b85a97d-38f230d4e90mr1116619f8f.46.1739395987325; Wed, 12 Feb 2025 13:33:07 -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-38f259f7987sm20517f8f.87.2025.02.12.13.33.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:33:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v3 03/19] target/i386: Constify X86CPUModel uses Date: Wed, 12 Feb 2025 22:32:33 +0100 Message-ID: <20250212213249.45574-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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é Reviewed-by: Richard Henderson --- 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);