[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 02/23] scripts/coccinelle: Add cpu_env.cocci_template scri
|
From: |
Richard Henderson |
|
Subject: |
Re: [PATCH v2 02/23] scripts/coccinelle: Add cpu_env.cocci_template script |
|
Date: |
Sat, 27 Jan 2024 15:01:15 +1000 |
|
User-agent: |
Mozilla Thunderbird |
On 1/27/24 08:03, Philippe Mathieu-Daudé wrote:
Add a Coccinelle script to convert the following slow path
(due to the QOM cast macro):
&ARCH_CPU(..)->env
to the following fast path:
cpu_env(..)
Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
---
MAINTAINERS | 1 +
scripts/coccinelle/cpu_env.cocci_template | 92 +++++++++++++++++++++++
2 files changed, 93 insertions(+)
create mode 100644 scripts/coccinelle/cpu_env.cocci_template
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
+/* Both first_cpu/current_cpu are CPUState* */
+@@
+symbol first_cpu;
+symbol current_cpu;
+@@
+(
+- CPU(first_cpu)
++ first_cpu
+|
+- CPU(current_cpu)
++ current_cpu
+)
I think part of Paolo's query is if there are any new instances of
commit 96449e4a30a56e3303d6d0407aca130c71671754
Author: Philippe Mathieu-Daudé <philmd@linaro.org>
Date: Tue May 12 09:00:18 2020 +0200
target: Remove unnecessary CPU() cast
...
@@
typedef CPUState;
CPUState *s;
@@
- CPU(s)
+ s
r~
- [PATCH v2 00/23] hw, target: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 01/23] hw/acpi/cpu: Use CPUState typedef, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 02/23] scripts/coccinelle: Add cpu_env.cocci_template script, Philippe Mathieu-Daudé, 2024/01/26
- Re: [PATCH v2 02/23] scripts/coccinelle: Add cpu_env.cocci_template script,
Richard Henderson <=
- [PATCH v2 03/23] bulk: Call in place single use cpu_env(), Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 04/23] target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 05/23] target/arm: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 06/23] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 07/23] target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26