Skip to content

Commit a69b83e

Browse files
xairytorvalds
authored andcommitted
kcov: fix struct layout for kcov_remote_arg
Make the layout of kcov_remote_arg the same for 32-bit and 64-bit code. This makes it more convenient to write userspace apps that can be compiled into 32-bit or 64-bit binaries and still work with the same 64-bit kernel. Also use proper __u32 types in uapi headers instead of unsigned ints. Link: http://lkml.kernel.org/r/9e91020876029cfefc9211ff747685eba9536426.1575638983.git.andreyknvl@google.com Fixes: eec028c ("kcov: remote coverage support") Signed-off-by: Andrey Konovalov <[email protected]> Acked-by: Marco Elver <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Alan Stern <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Chunfeng Yun <[email protected]> Cc: "Jacky . Cao @ sony . com" <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Marco Elver <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ac8f05d commit a69b83e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Documentation/dev-tools/kcov.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ selectively from different subsystems.
251251
.. code-block:: c
252252
253253
struct kcov_remote_arg {
254-
unsigned trace_mode;
255-
unsigned area_size;
256-
unsigned num_handles;
257-
uint64_t common_handle;
258-
uint64_t handles[0];
254+
__u32 trace_mode;
255+
__u32 area_size;
256+
__u32 num_handles;
257+
__aligned_u64 common_handle;
258+
__aligned_u64 handles[0];
259259
};
260260
261261
#define KCOV_INIT_TRACE _IOR('c', 1, unsigned long)

include/uapi/linux/kcov.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* and the comment before kcov_remote_start() for usage details.
1010
*/
1111
struct kcov_remote_arg {
12-
unsigned int trace_mode; /* KCOV_TRACE_PC or KCOV_TRACE_CMP */
13-
unsigned int area_size; /* Length of coverage buffer in words */
14-
unsigned int num_handles; /* Size of handles array */
15-
__u64 common_handle;
16-
__u64 handles[0];
12+
__u32 trace_mode; /* KCOV_TRACE_PC or KCOV_TRACE_CMP */
13+
__u32 area_size; /* Length of coverage buffer in words */
14+
__u32 num_handles; /* Size of handles array */
15+
__aligned_u64 common_handle;
16+
__aligned_u64 handles[0];
1717
};
1818

1919
#define KCOV_REMOTE_MAX_HANDLES 0x100

0 commit comments

Comments
 (0)