diff mbox series

[10/14] exec/user: Restrict 'syscall-trace.h' to user emulation

Message ID 20240427155714.53669-11-philmd@linaro.org
State New
Headers show
Series exec: Rework around CPUState user fields | expand

Commit Message

Philippe Mathieu-Daudé April 27, 2024, 3:57 p.m. UTC
System emulation shouldn't use "user/syscall-trace.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/user/syscall-trace.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Richard Henderson April 28, 2024, 6:32 p.m. UTC | #1
On 4/27/24 08:57, Philippe Mathieu-Daudé wrote:
> System emulation shouldn't use "user/syscall-trace.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/user/syscall-trace.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h
> index b48b2b2d0a..6926434d9a 100644
> --- a/include/user/syscall-trace.h
> +++ b/include/user/syscall-trace.h
> @@ -10,6 +10,10 @@
>   #ifndef SYSCALL_TRACE_H
>   #define SYSCALL_TRACE_H
>   
> +#ifndef CONFIG_USER_ONLY
> +#error Cannot include this header from system emulation
> +#endif
> +
>   #include "exec/user/abitypes.h"
>   #include "gdbstub/user.h"
>   #include "qemu/plugin.h"

Are we really going to do this for all include/user/ headers?


r~
Philippe Mathieu-Daudé April 28, 2024, 8:13 p.m. UTC | #2
On 28/4/24 20:32, Richard Henderson wrote:
> On 4/27/24 08:57, Philippe Mathieu-Daudé wrote:
>> System emulation shouldn't use "user/syscall-trace.h".
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   include/user/syscall-trace.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h
>> index b48b2b2d0a..6926434d9a 100644
>> --- a/include/user/syscall-trace.h
>> +++ b/include/user/syscall-trace.h
>> @@ -10,6 +10,10 @@
>>   #ifndef SYSCALL_TRACE_H
>>   #define SYSCALL_TRACE_H
>> +#ifndef CONFIG_USER_ONLY
>> +#error Cannot include this header from system emulation
>> +#endif
>> +
>>   #include "exec/user/abitypes.h"
>>   #include "gdbstub/user.h"
>>   #include "qemu/plugin.h"
> 
> Are we really going to do this for all include/user/ headers?

I'd like to, there are only 2 more files left,
user/tswap-target.h and user/thunk.h.
diff mbox series

Patch

diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h
index b48b2b2d0a..6926434d9a 100644
--- a/include/user/syscall-trace.h
+++ b/include/user/syscall-trace.h
@@ -10,6 +10,10 @@ 
 #ifndef SYSCALL_TRACE_H
 #define SYSCALL_TRACE_H
 
+#ifndef CONFIG_USER_ONLY
+#error Cannot include this header from system emulation
+#endif
+
 #include "exec/user/abitypes.h"
 #include "gdbstub/user.h"
 #include "qemu/plugin.h"