[PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup

Pierrick Bouvier posted 7 patches 3 weeks, 4 days ago
[PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup
Posted by Pierrick Bouvier 3 weeks, 4 days ago
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 include/hw/hyperv/hyperv.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
index d717b4e13d4..63a8b65278f 100644
--- a/include/hw/hyperv/hyperv.h
+++ b/include/hw/hyperv/hyperv.h
@@ -10,7 +10,8 @@
 #ifndef HW_HYPERV_HYPERV_H
 #define HW_HYPERV_HYPERV_H
 
-#include "cpu-qom.h"
+#include "exec/hwaddr.h"
+#include "hw/core/cpu.h"
 #include "hw/hyperv/hyperv-proto.h"
 
 typedef struct HvSintRoute HvSintRoute;
-- 
2.39.5
Re: [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup
Posted by Philippe Mathieu-Daudé 3 weeks ago
On 7/3/25 22:56, Pierrick Bouvier wrote:
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   include/hw/hyperv/hyperv.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
> index d717b4e13d4..63a8b65278f 100644
> --- a/include/hw/hyperv/hyperv.h
> +++ b/include/hw/hyperv/hyperv.h
> @@ -10,7 +10,8 @@
>   #ifndef HW_HYPERV_HYPERV_H
>   #define HW_HYPERV_HYPERV_H
>   
> -#include "cpu-qom.h"
> +#include "exec/hwaddr.h"
> +#include "hw/core/cpu.h"

I don't see where "hw/core/cpu.h" is used.

>   #include "hw/hyperv/hyperv-proto.h"
>   
>   typedef struct HvSintRoute HvSintRoute;
Re: [PATCH v4 2/7] hw/hyperv/hyperv.h: header cleanup
Posted by Philippe Mathieu-Daudé 3 weeks ago
On 11/3/25 16:05, Philippe Mathieu-Daudé wrote:
> On 7/3/25 22:56, Pierrick Bouvier wrote:
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>>   include/hw/hyperv/hyperv.h | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h
>> index d717b4e13d4..63a8b65278f 100644
>> --- a/include/hw/hyperv/hyperv.h
>> +++ b/include/hw/hyperv/hyperv.h
>> @@ -10,7 +10,8 @@
>>   #ifndef HW_HYPERV_HYPERV_H
>>   #define HW_HYPERV_HYPERV_H
>> -#include "cpu-qom.h"
>> +#include "exec/hwaddr.h"
>> +#include "hw/core/cpu.h"
> 
> I don't see where "hw/core/cpu.h" is used.

OK found it:

static inline uint32_t hyperv_vp_index(CPUState *cs)
{
     return cs->cpu_index;
}

First, bringing this huge header for this single use is way overkill,
then I doubt this method deserves to be inlined, third @cpu_index is
an accelerator specific field, often incorrectly used. Maybe in this
case it is OK although, since IIUC we only support HyperV with KVM,
right?