From 04aecf1372d30eb709d8de65152535ab66dcb74a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 00:55:45 +0200 Subject: Adding upstream version 7.0.16-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/HostDrivers/Support/SUPDrvTracer.cpp | 45 ++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'src/VBox/HostDrivers/Support/SUPDrvTracer.cpp') diff --git a/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp b/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp index 7b25b5ce..9ea87201 100644 --- a/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp +++ b/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp @@ -55,6 +55,15 @@ #include #include +#if defined(RT_OS_LINUX) +# if RTLNX_VER_MIN(4,15,10) +# include +# endif /* < 4.15.10 */ +# if RTLNX_VER_MIN(5,17,0) +# include +# endif /* < 5.17.0 */ +#endif /* !RT_OS_LINUX */ + /********************************************************************************************************************************* * Structures and Typedefs * @@ -96,7 +105,8 @@ typedef struct SUPDRVTPPROVIDER * tracer. */ bool fRegistered; /** The provider name (for logging purposes). */ - char szName[1]; + RT_FLEXIBLE_ARRAY_EXTENSION + char szName[RT_FLEXIBLE_ARRAY]; } SUPDRVTPPROVIDER; /** Pointer to the data for a tracepoint provider. */ typedef SUPDRVTPPROVIDER *PSUPDRVTPPROVIDER; @@ -161,7 +171,8 @@ typedef struct SUPDRVTRACERUMOD /** The number of probe locations. */ uint32_t cProbeLocs; /** Ring-0 probe location info. */ - SUPDRVPROBELOC aProbeLocs[1]; + RT_FLEXIBLE_ARRAY_EXTENSION + SUPDRVPROBELOC aProbeLocs[RT_FLEXIBLE_ARRAY]; } SUPDRVTRACERUMOD; /** Magic value for SUPDRVVTGCOPY. */ #define SUPDRVTRACERUMOD_MAGIC UINT32_C(0x00080486) @@ -1495,11 +1506,25 @@ SUPR0TracerFireProbe: \n\ # if defined(RT_ARCH_AMD64) __asm__("\ movq g_pfnSupdrvProbeFireKernel(%rip), %rax \n\ + " +# if defined(RT_OS_LINUX) +# if RTLNX_VER_MIN(4,15,10) + ANNOTATE_RETPOLINE_SAFE +# endif +# endif + " \n\ jmp *%rax \n\ "); # elif defined(RT_ARCH_X86) __asm__("\ movl g_pfnSupdrvProbeFireKernel, %eax \n\ + " +# if defined(RT_OS_LINUX) +# if RTLNX_VER_MIN(4,15,10) + ANNOTATE_RETPOLINE_SAFE +# endif +# endif + " \n\ jmp *%eax \n\ "); # else @@ -1511,8 +1536,20 @@ __asm__("\ .type supdrvTracerProbeFireStub,@function \n\ .global supdrvTracerProbeFireStub \n\ supdrvTracerProbeFireStub: \n\ - ret \n\ - .size supdrvTracerProbeFireStub, . - supdrvTracerProbeFireStub \n\ + " +# if defined(RT_OS_LINUX) +# if RTLNX_VER_MIN(5,17,0) + ASM_RET "\n\ + " +# else /* < 5.17.0 */ + "ret \n\ + " +# endif /* < 5.17.0 */ +# else /* !RT_OS_LINUX */ + "ret \n\ + " +# endif /* !RT_OS_LINUX */ + ".size supdrvTracerProbeFireStub, . - supdrvTracerProbeFireStub \n\ \n\ .previous \n\ "); -- cgit v1.2.3