summaryrefslogtreecommitdiff
path: root/dev-util/strace/files/strace-6.4-linux-headers-6.5.patch
blob: 2814dee76258c0f2a1d4b07599d358ca5577a3d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
https://bugs.gentoo.org/913170
https://github.com/strace/strace/issues/262
https://github.com/strace/strace/commit/a8cec18845220cc82e45014ffdcab449ad664584
https://github.com/strace/strace/commit/e0da3633669fcb829dd8d902d15443a755bd10fb

From a8cec18845220cc82e45014ffdcab449ad664584 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@strace.io>
Date: Tue, 4 Jul 2023 08:00:00 +0000
Subject: [PATCH] ptp: add max_phase_adj field and update rsv field of struct
 ptp_clock_caps

* bundled/linux/include/uapi/linux/ptp_clock.h (struct ptp_clock_caps):
Add max_phase_adj field and update rsv field following the change
introduced by Linux kernel commit v6.5-rc1~163^2~65^2~4.
* src/ptp.c (ptp_ioctl): Likewise.
* tests/ioctl_ptp.c (test_no_device): Update expected output.
--- a/bundled/linux/include/uapi/linux/ptp_clock.h
+++ b/bundled/linux/include/uapi/linux/ptp_clock.h
@@ -95,7 +95,8 @@ struct ptp_clock_caps {
 	int cross_timestamping;
 	/* Whether the clock supports adjust phase */
 	int adjust_phase;
-	int rsv[12];   /* Reserved for future use. */
+	int max_phase_adj; /* Maximum phase adjustment in nanoseconds. */
+	int rsv[11];       /* Reserved for future use. */
 };
 
 struct ptp_extts_request {
--- a/src/ptp.c
+++ b/src/ptp.c
@@ -78,7 +78,7 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
 	case PTP_CLOCK_GETCAPS:
 	case PTP_CLOCK_GETCAPS2: {
 		struct ptp_clock_caps caps;
-		CHECK_TYPE_SIZE(caps.rsv, sizeof(unsigned int) * 12);
+		CHECK_TYPE_SIZE(caps.rsv, sizeof(unsigned int) * 11);
 		CHECK_IOCTL_SIZE(PTP_CLOCK_GETCAPS, 80);
 		CHECK_IOCTL_SIZE(PTP_CLOCK_GETCAPS2, 80);
 
@@ -106,6 +106,8 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
 		PRINT_FIELD_D(caps, cross_timestamping);
 		tprint_struct_next();
 		PRINT_FIELD_D(caps, adjust_phase);
+		tprint_struct_next();
+		PRINT_FIELD_D(caps, max_phase_adj);
 		PRINT_RSV(caps, rsv);
 		tprint_struct_end();
 		break;
--- a/tests/ioctl_ptp.c
+++ b/tests/ioctl_ptp.c
@@ -151,7 +151,7 @@ test_no_device(void)
 		if (rc >= 0) {
 			printf("{max_adj=0, n_alarm=0, n_ext_ts=0, n_per_out=0"
 			       ", pps=0, n_pins=0, cross_timestamping=0"
-			       ", adjust_phase=0}");
+			       ", adjust_phase=0, max_phase_adj=0}");
 		} else {
 			printf("%p", caps);
 		}
@@ -166,7 +166,8 @@ test_no_device(void)
 			       ", pps=-2136948508, n_pins=-2136948507"
 			       ", cross_timestamping=-2136948506"
 			       ", adjust_phase=-2136948505"
-			       ", rsv=[0x80a0c0e8, 0x80a0c0e9, 0x80a0c0ea"
+			       ", max_phase_adj=-2136948504"
+			       ", rsv=[0x80a0c0e9, 0x80a0c0ea"
 			       ", 0x80a0c0eb, 0x80a0c0ec, 0x80a0c0ed"
 			       ", 0x80a0c0ee, 0x80a0c0ef, 0x80a0c0f0"
 			       ", 0x80a0c0f1, 0x80a0c0f2, 0x80a0c0f3]}");

From e0da3633669fcb829dd8d902d15443a755bd10fb Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@strace.io>
Date: Mon, 3 Jul 2023 08:00:00 +0000
Subject: [PATCH] io_uring: rename resv2 fields of io_[cs]qring_offsets to
 user_addr

* bundled/linux/include/uapi/linux/io_uring.h (struct io_sqring_offsets,
struct io_cqring_offsets): Rename resv2 to user_addr following
the change introduced by Linux kernel commit v6.5-rc1~235^2~32.
* src/io_uring.c (print_io_sqring_offsets, print_io_cqring_offsets):
Likewise.
* tests/io_uring_setup.c (main): Update expected output.
--- a/bundled/linux/include/uapi/linux/io_uring.h
+++ b/bundled/linux/include/uapi/linux/io_uring.h
@@ -406,7 +406,7 @@ struct io_sqring_offsets {
 	__u32 dropped;
 	__u32 array;
 	__u32 resv1;
-	__u64 resv2;
+	__u64 user_addr;
 };
 
 /*
@@ -425,7 +425,7 @@ struct io_cqring_offsets {
 	__u32 cqes;
 	__u32 flags;
 	__u32 resv1;
-	__u64 resv2;
+	__u64 user_addr;
 };
 
 /*
--- a/src/io_uring.c
+++ b/src/io_uring.c
@@ -45,10 +45,8 @@ print_io_sqring_offsets(const struct io_sqring_offsets *const p)
 		tprint_struct_next();
 		PRINT_FIELD_X(*p, resv1);
 	}
-	if (p->resv2) {
-		tprint_struct_next();
-		PRINT_FIELD_X(*p, resv2);
-	}
+	tprint_struct_next();
+	PRINT_FIELD_X(*p, user_addr);
 	tprint_struct_end();
 }
 
@@ -73,10 +71,8 @@ print_io_cqring_offsets(const struct io_cqring_offsets *const p)
 		tprint_struct_next();
 		PRINT_FIELD_X(*p, resv1);
 	}
-	if (p->resv2) {
-		tprint_struct_next();
-		PRINT_FIELD_X(*p, resv2);
-	}
+	tprint_struct_next();
+	PRINT_FIELD_X(*p, user_addr);
 	tprint_struct_end();
 }
 
--- a/tests/io_uring_setup.c
+++ b/tests/io_uring_setup.c
@@ -113,10 +113,9 @@ main(void)
 			       params->sq_off.array);
 			if (params->sq_off.resv1)
 				printf(", resv1=%#x", params->sq_off.resv1);
-			if (params->sq_off.resv2)
-				printf(", resv1=%#llx",
-				       (unsigned long long)
-						params->sq_off.resv2);
+			printf(", user_addr=%#llx",
+			       (unsigned long long)
+					params->sq_off.user_addr);
 
 			printf("}, cq_off={head=%u, tail=%u, ring_mask=%u"
 			       ", ring_entries=%u, overflow=%u, cqes=%u"
@@ -130,10 +129,9 @@ main(void)
 			       params->cq_off.flags);
 			if (params->cq_off.resv1)
 				printf(", resv1=%#x", params->cq_off.resv1);
-			if (params->cq_off.resv2)
-				printf(", resv2=%#llx",
-				       (unsigned long long)
-						params->cq_off.resv2);
+			printf(", user_addr=%#llx",
+			       (unsigned long long)
+					params->cq_off.user_addr);
 
 			printf("}}) = %ld<anon_inode:[io_uring]>\n", rc);
 		}