From nobody Fri Apr 19 17:38:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620063334; cv=none; d=zohomail.com; s=zohoarc; b=hXnZYH3lidwpUOL/8GEEAOjRfYykNEficlMnwJdNB2e+f8oeIhY+E0oV3ptciSsMox00wiZ/nvz5Po2zz7E5EIRKyfnu8q/2yR/vKe1pgcDSRCdPyDOF7Zh2JcpLGK9uZ4BPqv6yn0gQqBag5pyDFPedPNCLxc2LehZtdhGi6+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620063334; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=9YgWkBOpmW47z0vCe4sUC8C/PYvyTKvQToOOdtPZ8r8=; b=BWFvOmGC8IE2vw0NZ7owB+VELuZo/yHFODeQsEURek15AhWyF8tmHiyac6P7bAUYIKBXClSDArSfo0pkIRNYKUQ/aP54MZxVuOwQNZpfUBlBNL2VlEXbRz87TDhC5nCy3rjHF5dPURz5+A0JGWk3uf9bMInA3U26tnRoBGsMzvU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620063334678174.89657542645796; Mon, 3 May 2021 10:35:34 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-2xQE4JMHOQOFANnSplxJsQ-1; Mon, 03 May 2021 13:35:32 -0400 Received: by mail-wr1-f70.google.com with SMTP id 67-20020adf81490000b029010756d109e6so4291586wrm.13 for ; Mon, 03 May 2021 10:35:32 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id k6sm75457wmi.42.2021.05.03.10.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 10:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620063333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9YgWkBOpmW47z0vCe4sUC8C/PYvyTKvQToOOdtPZ8r8=; b=MDx8CaPnjjCZ8p6X3Vcvu/9f6/KTr3SiVPzjDeuuoYlPoHOeJAIKKvMBcbzhTprBl69dwX u1Wv3Q1m/bnyJoNfw0N4FCSHkhrh3TJ1HERQA6LJOchcwZNFbvIUk4q3x7fRSVcrvHJfyu DohK9tdRgWbB471WAn/3CkPpDhAasLc= X-MC-Unique: 2xQE4JMHOQOFANnSplxJsQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9YgWkBOpmW47z0vCe4sUC8C/PYvyTKvQToOOdtPZ8r8=; b=rwnbVK77THWjzmBXqNxTpOhRrmwVhJs7LZ1xccIfZYLzNbyF171OMT/xbS97YoMA2N ZiKF1Nz+cPC6mOPnsNKWnNIjH0dfmRv6Pj+ddjhij5TkPcnh/nFD2Hp7yFIF0xYlsMi3 sAxDvqLDVeR1afjIPBPlGUPj+zleIGEL78mwQ5t+ahYpjwLGzou2S8+od24UNSDM+3MS M8rkXP0X+gUjBhF3PYGJRbSxWUc5ame8cH/8VzEcYiR5p5+rXsT85RMgeHQ2ev9yb22H X+rFG3yPchYkC6plJaYGdLVbFYT+yAU+Jz1KW1crbX1PJ2tF7K7GYbi1MZzzimG7GFe2 XHHQ== X-Gm-Message-State: AOAM532c/OtpakAyDcgVO8T3H9kkJsfTAP3VM9zQox6L21wrT0iD4NEW 8nOvXjcqvQPK1YIp4AfzS1BLj/PA3IP7hwxn7smvqC0InV2Ncz80gG9qPrq1bhw14948TmGrxxA DKOI/YxDFJrabtw== X-Received: by 2002:a5d:525c:: with SMTP id k28mr26048527wrc.158.1620063330969; Mon, 03 May 2021 10:35:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXNy6dP9AUAL5JAPfb6lk4qmRpYPVIF4Xk5j/X81wW+7xku9n976nupPNl0vx6nVTBHZpHjA== X-Received: by 2002:a5d:525c:: with SMTP id k28mr26048514wrc.158.1620063330847; Mon, 03 May 2021 10:35:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/2] target/i386/cpu: Constify CPUCaches Date: Mon, 3 May 2021 19:35:23 +0200 Message-Id: <20210503173524.833052-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210503173524.833052-1-philmd@redhat.com> References: <20210503173524.833052-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ad99cad0e7c..c7ded968e74 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1655,7 +1655,7 @@ typedef struct X86CPUDefinition { int stepping; FeatureWordArray features; const char *model_id; - CPUCaches *cache_info; + const CPUCaches *const cache_info; /* * Definitions for alternative versions of CPU model. * List is terminated by item with version =3D=3D 0. @@ -1698,7 +1698,7 @@ static const X86CPUVersionDefinition *x86_cpu_def_get= _versions(X86CPUDefinition return def->versions ?: default_version_list; } =20 -static CPUCaches epyc_cache_info =3D { +static const CPUCaches epyc_cache_info =3D { .l1d_cache =3D &(CPUCacheInfo) { .type =3D DATA_CACHE, .level =3D 1, @@ -1748,7 +1748,7 @@ static CPUCaches epyc_cache_info =3D { }, }; =20 -static CPUCaches epyc_rome_cache_info =3D { +static const CPUCaches epyc_rome_cache_info =3D { .l1d_cache =3D &(CPUCacheInfo) { .type =3D DATA_CACHE, .level =3D 1, @@ -1798,7 +1798,7 @@ static CPUCaches epyc_rome_cache_info =3D { }, }; =20 -static CPUCaches epyc_milan_cache_info =3D { +static const CPUCaches epyc_milan_cache_info =3D { .l1d_cache =3D &(CPUCacheInfo) { .type =3D DATA_CACHE, .level =3D 1, --=20 2.26.3 From nobody Fri Apr 19 17:38:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620063341; cv=none; d=zohomail.com; s=zohoarc; b=QVocIdH7wLjTLO0oLyDktlg8CB20UMysGk5wVwiYBP+rN/z112FGYk+vrZuTwflOEKDPPgve4DvlRnrCvnNybtsItgeWOueNIsME1OhD6DDzexs18lg8xo2ZqDgH+uUt7WMh7Z2LBV4DodSeBpL1MV21m2zvIafjU6zGeMrXJAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620063341; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=w85E9X6fr/rpsgzjFIOCIamOZMIKhlKm8ouDJEHbPs8=; b=PXZlIVYm4MiijQ0oJVOgnGf+oT53BKBEfvVvImSERGdQNqsvQ9Tv5300yAmFuNY2+EmOY6HjJRhtFYbyf13nL63HxE553kGvk+5xGjsR6dgyULEk/ak3E2os/IoMQ9sy7pYPYU/PihsqfndG2hlydHWppZNpZK+6DaRi+vVfUwY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620063341704514.3026394653829; Mon, 3 May 2021 10:35:41 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431-IQ-h273QNsSy9mh3FkZzsg-1; Mon, 03 May 2021 13:35:36 -0400 Received: by mail-wm1-f72.google.com with SMTP id x7-20020a7bc2070000b0290149dcabfd85so805482wmi.8 for ; Mon, 03 May 2021 10:35:36 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id y8sm16235970wru.27.2021.05.03.10.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 10:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620063340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w85E9X6fr/rpsgzjFIOCIamOZMIKhlKm8ouDJEHbPs8=; b=Rh43APygj5KRhdcE+YrP/iRrJCfEIOUWZ85xW/hYODSoyL/RuIj5aRYEIgsqPqv2rJqM1U 70l5ZmjB1hswAnjBNtljamdlPvdxxpEDPiXrk5yjStABvdgkRuJ9l6z3WZoEkLQVXg+sL7 zKP3/Q/fM0Tq1cs93dOCqK6BzLpLN/g= X-MC-Unique: IQ-h273QNsSy9mh3FkZzsg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w85E9X6fr/rpsgzjFIOCIamOZMIKhlKm8ouDJEHbPs8=; b=aYufeJsh01hDE4wDlVoloVwnmpXaHf6UEVjqlTDGPhN0DlDZi+JYndpwz6vagzBptz VKNQ0DtoJHIcO0GbV/vRvocoNYQUzsrH826WgWHguhl8i0qVLNojez8VdqpOcdlAzYS8 FAfelPpc21Lcbdo5b3OQn5OL/KbHGxcJqa76UNXVqtLs/oXfmV9bMysjXDoYzC07mQyS jvaXBIDudHIeqJbtC9bES31hD36ytE5GJsYDU4xbHoR/r9pvx21+xh5wYmwe6aLT/W6Q HMCxwG7UYkPc3b6iXB5zFLyFOjGK308Sd76muzrbLFiTaWN/qGZ2xZ5m1W5Ifv1r+gYG fLKA== X-Gm-Message-State: AOAM530sbXM1cuJgWaziSpM8hdbdbpsUPzV61eDeQHG3hcUyWPlnnHl6 aAHxaey64V2XAkFwpUXxPaJOqvO4x/UHrum2/d2HxcPgrSANoOa9HaUmbIXWdNg1PpEHCMAlRUX L63vE85b/7DIyMQ== X-Received: by 2002:a05:6000:1051:: with SMTP id c17mr4747166wrx.43.1620063335607; Mon, 03 May 2021 10:35:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfwUvJxh81DqCsdOWxIdg1x/QebCcurGDOCBB36MTI0PHRRU8K8radB+Zh95mU0hoU+TLPLg== X-Received: by 2002:a05:6000:1051:: with SMTP id c17mr4747158wrx.43.1620063335508; Mon, 03 May 2021 10:35:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] target/i386/cpu: Constify X86CPUDefinition Date: Mon, 3 May 2021 19:35:24 +0200 Message-Id: <20210503173524.833052-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210503173524.833052-1-philmd@redhat.com> References: <20210503173524.833052-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c7ded968e74..3a6f1c55ef3 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1668,7 +1668,7 @@ typedef struct X86CPUDefinition { /* Reference to a specific CPU model version */ struct X86CPUModel { /* Base CPU definition */ - X86CPUDefinition *cpudef; + const X86CPUDefinition *cpudef; /* CPU model version */ X86CPUVersion version; const char *note; @@ -1680,14 +1680,15 @@ struct X86CPUModel { }; =20 /* Get full model name for CPU version */ -static char *x86_cpu_versioned_model_name(X86CPUDefinition *cpudef, +static char *x86_cpu_versioned_model_name(const X86CPUDefinition *cpudef, X86CPUVersion version) { assert(version > 0); return g_strdup_printf("%s-v%d", cpudef->name, (int)version); } =20 -static const X86CPUVersionDefinition *x86_cpu_def_get_versions(X86CPUDefin= ition *def) +static const X86CPUVersionDefinition * +x86_cpu_def_get_versions(const X86CPUDefinition *def) { /* When X86CPUDefinition::versions is NULL, we register only v1 */ static const X86CPUVersionDefinition default_version_list[] =3D { @@ -1876,7 +1877,7 @@ static const CPUCaches epyc_milan_cache_info =3D { * PT in VMX operation */ =20 -static X86CPUDefinition builtin_x86_defs[] =3D { +static const X86CPUDefinition builtin_x86_defs[] =3D { { .name =3D "qemu64", .level =3D 0xd, @@ -5246,7 +5247,7 @@ static void x86_cpu_apply_version_props(X86CPU *cpu, = X86CPUModel *model) */ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) { - X86CPUDefinition *def =3D model->cpudef; + const X86CPUDefinition *def =3D model->cpudef; CPUX86State *env =3D &cpu->env; const char *vendor; char host_vendor[CPUID_VENDOR_SZ + 1]; @@ -5553,7 +5554,7 @@ static void x86_register_cpu_model_type(const char *n= ame, X86CPUModel *model) type_register(&ti); } =20 -static void x86_register_cpudef_types(X86CPUDefinition *def) +static void x86_register_cpudef_types(const X86CPUDefinition *def) { X86CPUModel *m; const X86CPUVersionDefinition *vdef; --=20 2.26.3