[PATCH 15/24] exec/cpu-all: Remove unused headers

Philippe Mathieu-Daudé posted 24 patches 1 year, 11 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, BALATON Zoltan <balaton@eik.bme.hu>, Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Harsh Prateek Bora <harshpb@linux.ibm.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Peter Xu <peterx@redhat.com>, Laurent Vivier <laurent@vivier.eu>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Brian Cain <bcain@quicinc.com>, Eduardo Habkost <eduardo@habkost.net>, Song Gao <gaosong@loongson.cn>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Huacai Chen <chenhuacai@kernel.org>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>, Stafford Horne <shorne@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liwei1518@gmail.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Max Filippov <jcmvbkbc@gmail.com>
There is a newer version of this series
[PATCH 15/24] exec/cpu-all: Remove unused headers
Posted by Philippe Mathieu-Daudé 1 year, 11 months ago
Nothing is required from the "qemu/thread.h" and
"hw/core/cpu.h" headers.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/exec/cpu-all.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 9a7b5737d3..b1e293a08f 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -22,8 +22,6 @@
 #include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "exec/tswap.h"
-#include "qemu/thread.h"
-#include "hw/core/cpu.h"
 #include "qemu/rcu.h"
 
 /* some important defines:
-- 
2.41.0


Re: [PATCH 15/24] exec/cpu-all: Remove unused headers
Posted by Richard Henderson 1 year, 11 months ago
On 12/11/23 13:19, Philippe Mathieu-Daudé wrote:
> Nothing is required from the "qemu/thread.h" and
> "hw/core/cpu.h" headers.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/exec/cpu-all.h | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
> index 9a7b5737d3..b1e293a08f 100644
> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -22,8 +22,6 @@
>   #include "exec/cpu-common.h"
>   #include "exec/memory.h"
>   #include "exec/tswap.h"
> -#include "qemu/thread.h"
> -#include "hw/core/cpu.h"

While thread.h is fine, I'm not sure removing hw/core/cpu.h from cpu-all.h is a good idea, 
and would explain the rather surprising changes to add core/cpu.h to other files.


r~

Re: [PATCH 15/24] exec/cpu-all: Remove unused headers
Posted by Philippe Mathieu-Daudé 1 year, 11 months ago
On 12/12/23 00:16, Richard Henderson wrote:
> On 12/11/23 13:19, Philippe Mathieu-Daudé wrote:
>> Nothing is required from the "qemu/thread.h" and
>> "hw/core/cpu.h" headers.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   include/exec/cpu-all.h | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
>> index 9a7b5737d3..b1e293a08f 100644
>> --- a/include/exec/cpu-all.h
>> +++ b/include/exec/cpu-all.h
>> @@ -22,8 +22,6 @@
>>   #include "exec/cpu-common.h"
>>   #include "exec/memory.h"
>>   #include "exec/tswap.h"
>> -#include "qemu/thread.h"
>> -#include "hw/core/cpu.h"
> 
> While thread.h is fine, I'm not sure removing hw/core/cpu.h from 
> cpu-all.h is a good idea, and would explain the rather surprising 
> changes to add core/cpu.h to other files.

"hw/core/cpu.h" defines the CPUState structure. Any code that
deref CPUState needs to include its definition from "hw/core/cpu.h".

Similarly, files that don't deref CPUState/CPUClass/cpu_foo methods
shouldn't be polluted by its declarations.

This series focuses on useremu, next comes sysemu and "exec/cpu-all.h"
is split. I'll see if I can postpone this change.