From patchwork Fri Nov 6 03:28:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 320741 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp979986ilc; Thu, 5 Nov 2020 19:38:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT4ATP1DAV0YqsbwcYzpyFX5kZVXlchTYLSeoEVhJixyz293OhAfv3rF9pqqNjCyTBoLbQ X-Received: by 2002:a0c:82c4:: with SMTP id i62mr62592qva.28.1604633929693; Thu, 05 Nov 2020 19:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604633929; cv=none; d=google.com; s=arc-20160816; b=Zy+w+KwRaddblF8ToQYWdDuZSDIRBwzv38+MSYfy1U8pH6Taf95I4jXiVQzn4lKhOd euG56pjvWJJYUTNAmCuJv2Nhmr7sZnZoJxmu2488bY5TxKDE0BS348Bbn9wjWoDOQsbE m12IUqyNIbnkHZIYU+o4Q3o/9uqeHAblvu+UHwxJBU52SzzyuSlFqdkV71uD2C7ClkvT 4CPSOfCSKCytsXnu9PPzhS96YrdZv1P/PHjgv+GIoevU2ACocjoo9C2d49TK5F/F+T2a 3ONy1uGxNWRTujwQ5rCwHxCYFp82mt+heK1Razx1KdeuSmJbHLS0D9Sm9a/VbxxGQLa/ rblg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=EZoWS2rDJTXqXpM5kSibnRtpefjrKqjOzA1oHfZm56Y=; b=A2e/bQ4Ro4LHcJXBaO4g+cMdnBpB3e3AIgLcNnWcWZtPYzvajWTXBM7TJfpWWumCvB iGYkGPPQI4e90A7vB4yZKqenBHOGZELYAqRSuussXlLK1s217gvzWH24umyzDUfhXUH0 HrK4CTXuauJb/wjSdA3LGFrMCrq+QssJQzStSz7ltLRbMz8Ek8pdvaIQB2ZVgLnCzOlU A302uVSUi62cgnv0Va4VztJUfYANxv1Dqrq0GyqH0lp5yCBOfoVJnhG5R7y0nnqfQXzh IaxHCg/58S4WkRadUotJFIcGQZmMQLJuYuoJJi3jo/qhRWky0pnHd7oQtEMzak9VXXWu NAsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oqR/bUhr"; 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 j22si1748616qtp.279.2020.11.05.19.38.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 19:38:49 -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="oqR/bUhr"; 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]:51806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kasaP-0001pG-3I for patch@linaro.org; Thu, 05 Nov 2020 22:38:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kasRf-0004qz-4L for qemu-devel@nongnu.org; Thu, 05 Nov 2020 22:29:47 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:34694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kasRc-0006wb-EZ for qemu-devel@nongnu.org; Thu, 05 Nov 2020 22:29:46 -0500 Received: by mail-pl1-x633.google.com with SMTP id p4so33365plr.1 for ; Thu, 05 Nov 2020 19:29:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EZoWS2rDJTXqXpM5kSibnRtpefjrKqjOzA1oHfZm56Y=; b=oqR/bUhrHnAHVQoxbHf53anIdc7hqhvPg2ocOAywG6Q5um8Ug7uTuRjWwz9vWYEMvd zD04VzsFq5pR1fU6WVmmgn42aMFBp8votNgdOMel6fZBhyiUpkSNPO3x6KS2cx7vLX7J s9m8gfnGoRRAz8uCrVKyYg8SjLYZJJ+oAcMwFRFtyTi4Dc7RpdiEfsYqq7mBK/vw4UZ3 4B/T2uDhH4PkdILH4ZCf6T853eOPzXBIxm+gyjzD98+V0ZxoUukFjtKjF1hB2Ugj2iRI vQrM5xLy3m7mBFe7j4OOPSO5EkVTZz+rWwYC7yBQsgqbQTkWVtd4zmN6Oymz1bFpQkEK +JjQ== 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=EZoWS2rDJTXqXpM5kSibnRtpefjrKqjOzA1oHfZm56Y=; b=XuauZahu9DvhWx4tpIy0SH5QsnFwZkH31HaH1ggJCQsYtcTy7KQhodVtUvGCaQs3hU KlBrqLgWfXH0Db0CAuBB6WI2wrRYfXatJL2w3RcocW5TPq6PThtP7E7b+ZFgy20qu5lM Nz+/0NmOwYkaiBB5l1qD4yxnItSw2+dljwssVbKTh2hZtAe8K2Eef8QcfqDBOOTrxoPv Ot/gKYFeQ9iJJ/8lSWS+LX93+JtJIoEFTF1b8gk0FqpFYTsfXSVnfhfFb6/J4m5ia6b+ wAT4cBZgJ8wC4NQro6+8t5Bdz6xctKZU3nXu2X2GvqKTENQl5/omyMdN7OTNSyVIxGmi 3HpA== X-Gm-Message-State: AOAM531KTn8eInZRUxRGWCQ2lyERpwGy+b+gDfZq03CXPFqkDjqoe72e SFSYCUVnCzBXlxXPiodWFp0sTF4g5lq0Xg== X-Received: by 2002:a17:902:6f10:b029:d6:e6f5:1dab with SMTP id w16-20020a1709026f10b02900d6e6f51dabmr4989074plk.1.1604633378748; Thu, 05 Nov 2020 19:29:38 -0800 (PST) Received: from localhost.localdomain (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id i10sm40773pfd.60.2020.11.05.19.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 19:29:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 12/41] tcg: Make tb arg to synchronize_from_tb const Date: Thu, 5 Nov 2020 19:28:52 -0800 Message-Id: <20201106032921.600200-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201106032921.600200-1-richard.henderson@linaro.org> References: <20201106032921.600200-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: j@getutm.app Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is nothing within the translators that ought to be changing the TranslationBlock data, so make it const. This does not actually use the read-only copy of the data structure that exists within the rx region. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 3 ++- target/arm/cpu.c | 3 ++- target/avr/cpu.c | 3 ++- target/hppa/cpu.c | 3 ++- target/i386/cpu.c | 3 ++- target/microblaze/cpu.c | 3 ++- target/mips/cpu.c | 3 ++- target/riscv/cpu.c | 3 ++- target/rx/cpu.c | 3 ++- target/sh4/cpu.c | 3 ++- target/sparc/cpu.c | 3 ++- target/tricore/cpu.c | 2 +- 12 files changed, 23 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 3d92c967ff..44c336a96a 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -189,7 +189,8 @@ struct CPUClass { void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list, Error **errp); void (*set_pc)(CPUState *cpu, vaddr value); - void (*synchronize_from_tb)(CPUState *cpu, struct TranslationBlock *tb); + void (*synchronize_from_tb)(CPUState *cpu, + const struct TranslationBlock *tb); bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 07492e9f9a..2f9be1c0ee 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -54,7 +54,8 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value) } } -static void arm_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void arm_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 5d9c4ad5bf..6f3d5a9e4a 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -41,7 +41,8 @@ static bool avr_cpu_has_work(CPUState *cs) && cpu_interrupts_enabled(env); } -static void avr_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void avr_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { AVRCPU *cpu = AVR_CPU(cs); CPUAVRState *env = &cpu->env; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 71b6aca45d..e28f047d10 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -35,7 +35,8 @@ static void hppa_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.iaoq_b = value + 4; } -static void hppa_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void hppa_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { HPPACPU *cpu = HPPA_CPU(cs); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 0d8606958e..01a8acafe3 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7012,7 +7012,8 @@ static void x86_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.eip = value; } -static void x86_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void x86_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { X86CPU *cpu = X86_CPU(cs); diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 9b2482159d..c8e754cfb1 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -83,7 +83,8 @@ static void mb_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.iflags = 0; } -static void mb_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void mb_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 76d50b00b4..79eee215cf 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -44,7 +44,8 @@ static void mips_cpu_set_pc(CPUState *cs, vaddr value) } } -static void mips_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void mips_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { MIPSCPU *cpu = MIPS_CPU(cs); CPUMIPSState *env = &cpu->env; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 6a0264fc6b..1b2f40de47 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -285,7 +285,8 @@ static void riscv_cpu_set_pc(CPUState *cs, vaddr value) env->pc = value; } -static void riscv_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void riscv_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 23ee17a701..2bb14144a7 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -33,7 +33,8 @@ static void rx_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } -static void rx_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void rx_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { RXCPU *cpu = RX_CPU(cs); diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 3c68021c56..1e0f05a15b 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -34,7 +34,8 @@ static void superh_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } -static void superh_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void superh_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { SuperHCPU *cpu = SUPERH_CPU(cs); diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index cf21efd85f..b9241208b1 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -691,7 +691,8 @@ static void sparc_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.npc = value + 4; } -static void sparc_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb) +static void sparc_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { SPARCCPU *cpu = SPARC_CPU(cs); diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 2f2e5b029f..4bff1d4718 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -42,7 +42,7 @@ static void tricore_cpu_set_pc(CPUState *cs, vaddr value) } static void tricore_cpu_synchronize_from_tb(CPUState *cs, - TranslationBlock *tb) + const TranslationBlock *tb) { TriCoreCPU *cpu = TRICORE_CPU(cs); CPUTriCoreState *env = &cpu->env;