History

Merge branch 'errata/tx2-219' into for-next/fixes

Workaround for Cavium/Marvell ThunderX2 erratum #219. * errata/tx2-219: arm64: Allow CAVIUM_TX2_ERRATUM_219 to be selected arm64: Avoid Cavium TX2 erratum 219 when switching TTBR arm64: Enable workaround for Cavium TX2 erratum 219 when running SMT arm64: KVM: Trap VM ops when ARM64_WORKAROUND_CAVIUM_TX2_219_TVM is set

Will Deacon committed 7 years ago

Commit 777d0622 parents 597399d 603afdc298 files · +2755 −1802Browse files

Showing the changes to include (13 of 298 files). Show all

Unified · Split

13 files
  1. include/linux/bitops.h +7 −0
  2. include/linux/dsa/sja1105.h +3 −1
  3. include/linux/kvm_host.h +2 −0
  4. include/linux/mii.h +9 −0
  5. include/linux/phy.h +2 −0
  6. include/linux/skbuff.h +1 −4
  7. include/linux/uaccess.h +70 −0
  8. include/trace/events/rxrpc.h +1 −1
  9. include/uapi/drm/amdgpu_drm.h +2 −0
  10. include/uapi/linux/nvme_ioctl.h +23 −0
  11. include/uapi/linux/pg.h +4 −1
  12. include/uapi/linux/sched.h +28 −2
  13. include/xen/xen-ops.h +1 −24
include/linux/bitops.h+7−0
@@ -4,6 +4,13 @@ · 3 unmodified lines
44 #include <asm/types.h>
55 #include <linux/bits.h>
66
7+/* Set bits in the first 'n' bytes when loaded from memory */
8+#ifdef __LITTLE_ENDIAN
9+# define aligned_byte_mask(n) ((1UL << 8*(n))-1)
10+#else
11+# define aligned_byte_mask(n) (~0xffUL << (BITS_PER_LONG - 8 - 8*(n)))
12+#endif
13+
714 #define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
815 #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long))
916
include/linux/dsa/sja1105.h+3−1
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #define SJA1105_META_SMAC 0x222222222222ull
3232 #define SJA1105_META_DMAC 0x0180C200000Eull
3333
34+#define SJA1105_HWTS_RX_EN 0
35+
3436 /* Global tagger data: each struct sja1105_port has a reference to
3537 * the structure defined in struct sja1105_private.
3638 */
@@ -42,7 +44,7 @@ struct sja1105_tagger_data { · 5 unmodified lines
4244 * from taggers running on multiple ports on SMP systems
4345 */
4446 spinlock_t meta_lock;
45− bool hwts_rx_en;
47+ unsigned long state;
4648 };
4749
4850 struct sja1105_skb_cb {
include/linux/kvm_host.h+2−0
@@ -1090,6 +1090,7 @@ enum kvm_stat_kind { · 1089 unmodified lines
10901090
10911091 struct kvm_stat_data {
10921092 int offset;
1093+ int mode;
10931094 struct kvm *kvm;
10941095 };
10951096
@@ -1097,6 +1098,7 @@ struct kvm_stats_debugfs_item { · 1 unmodified line
10971098 const char *name;
10981099 int offset;
10991100 enum kvm_stat_kind kind;
1101+ int mode;
11001102 };
11011103 extern struct kvm_stats_debugfs_item debugfs_entries[];
11021104 extern struct dentry *kvm_debugfs_dir;
include/linux/mii.h+9−0
@@ -455,6 +455,15 @@ static inline void mii_lpa_mod_linkmode_lpa_t(unsigned long *lp_advertising, · 454 unmodified lines
455455 lp_advertising, lpa & LPA_LPACK);
456456 }
457457
458+static inline void mii_ctrl1000_mod_linkmode_adv_t(unsigned long *advertising,
459+ u32 ctrl1000)
460+{
461+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, advertising,
462+ ctrl1000 & ADVERTISE_1000HALF);
463+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, advertising,
464+ ctrl1000 & ADVERTISE_1000FULL);
465+}
466+
458467 /**
459468 * linkmode_adv_to_lcl_adv_t
460469 * @advertising:pointer to linkmode advertising
include/linux/phy.h+2−0
@@ -678,6 +678,7 @@ static inline bool phy_is_started(struct phy_device *phydev) · 677 unmodified lines
678678 return phydev->state >= PHY_UP;
679679 }
680680
681+void phy_resolve_aneg_pause(struct phy_device *phydev);
681682 void phy_resolve_aneg_linkmode(struct phy_device *phydev);
682683
683684 /**
@@ -1076,6 +1077,7 @@ int genphy_config_eee_advert(struct phy_device *phydev); · 392 unmodified lines
10761077 int __genphy_config_aneg(struct phy_device *phydev, bool changed);
10771078 int genphy_aneg_done(struct phy_device *phydev);
10781079 int genphy_update_link(struct phy_device *phydev);
1080+int genphy_read_lpa(struct phy_device *phydev);
10791081 int genphy_read_status(struct phy_device *phydev);
10801082 int genphy_suspend(struct phy_device *phydev);
10811083 int genphy_resume(struct phy_device *phydev);
include/linux/skbuff.h+1−4
@@ -4160,15 +4160,12 @@ static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {} · 4159 unmodified lines
41604160 static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {}
41614161 #endif /* CONFIG_SKB_EXTENSIONS */
41624162
4163−static inline void nf_reset(struct sk_buff *skb)
4163+static inline void nf_reset_ct(struct sk_buff *skb)
41644164 {
41654165 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
41664166 nf_conntrack_put(skb_nfct(skb));
41674167 skb->_nfct = 0;
41684168 #endif
4169−#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
4170− skb_ext_del(skb, SKB_EXT_BRIDGE_NF);
4171−#endif
41724169 }
41734170
41744171 static inline void nf_reset_trace(struct sk_buff *skb)
include/linux/uaccess.h+70−0
@@ -231,6 +231,76 @@ __copy_from_user_inatomic_nocache(void *to, const void __user *from, · 230 unmodified lines
231231
232232 #endif /* ARCH_HAS_NOCACHE_UACCESS */
233233
234+extern __must_check int check_zeroed_user(const void __user *from, size_t size);
235+
236+/**
237+ * copy_struct_from_user: copy a struct from userspace
238+ * @dst: Destination address, in kernel space. This buffer must be @ksize
239+ * bytes long.
240+ * @ksize: Size of @dst struct.
241+ * @src: Source address, in userspace.
242+ * @usize: (Alleged) size of @src struct.
243+ *
244+ * Copies a struct from userspace to kernel space, in a way that guarantees
245+ * backwards-compatibility for struct syscall arguments (as long as future
246+ * struct extensions are made such that all new fields are *appended* to the
247+ * old struct, and zeroed-out new fields have the same meaning as the old
248+ * struct).
249+ *
250+ * @ksize is just sizeof(*dst), and @usize should've been passed by userspace.
251+ * The recommended usage is something like the following:
252+ *
253+ * SYSCALL_DEFINE2(foobar, const struct foo __user *, uarg, size_t, usize)
254+ * {
255+ * int err;
256+ * struct foo karg = {};
257+ *
258+ * if (usize > PAGE_SIZE)
259+ * return -E2BIG;
260+ * if (usize < FOO_SIZE_VER0)
261+ * return -EINVAL;
262+ *
263+ * err = copy_struct_from_user(&karg, sizeof(karg), uarg, usize);
264+ * if (err)
265+ * return err;
266+ *
267+ * // ...
268+ * }
269+ *
270+ * There are three cases to consider:
271+ * * If @usize == @ksize, then it's copied verbatim.
272+ * * If @usize < @ksize, then the userspace has passed an old struct to a
273+ * newer kernel. The rest of the trailing bytes in @dst (@ksize - @usize)
274+ * are to be zero-filled.
275+ * * If @usize > @ksize, then the userspace has passed a new struct to an
276+ * older kernel. The trailing bytes unknown to the kernel (@usize - @ksize)
277+ * are checked to ensure they are zeroed, otherwise -E2BIG is returned.
278+ *
279+ * Returns (in all cases, some data may have been copied):
280+ * * -E2BIG: (@usize > @ksize) and there are non-zero trailing bytes in @src.
281+ * * -EFAULT: access to userspace failed.
282+ */
283+static __always_inline __must_check int
284+copy_struct_from_user(void *dst, size_t ksize, const void __user *src,
285+ size_t usize)
286+{
287+ size_t size = min(ksize, usize);
288+ size_t rest = max(ksize, usize) - size;
289+
290+ /* Deal with trailing bytes. */
291+ if (usize < ksize) {
292+ memset(dst + size, 0, rest);
293+ } else if (usize > ksize) {
294+ int ret = check_zeroed_user(src + size, rest);
295+ if (ret <= 0)
296+ return ret ?: -E2BIG;
297+ }
298+ /* Copy the interoperable parts of the struct. */
299+ if (copy_from_user(dst, src, size))
300+ return -EFAULT;
301+ return 0;
302+}
303+
234304 /*
235305 * probe_kernel_read(): safely attempt to read from a location
236306 * @dst: pointer to the buffer that shall take the data
include/trace/events/rxrpc.h+1−1
@@ -1068,7 +1068,7 @@ TRACE_EVENT(rxrpc_recvmsg, · 1067 unmodified lines
10681068 ),
10691069
10701070 TP_fast_assign(
1071− __entry->call = call->debug_id;
1071+ __entry->call = call ? call->debug_id : 0;
10721072 __entry->why = why;
10731073 __entry->seq = seq;
10741074 __entry->offset = offset;
include/uapi/drm/amdgpu_drm.h+2−0
@@ -1003,6 +1003,8 @@ struct drm_amdgpu_info_device { · 1002 unmodified lines
10031003 __u64 high_va_max;
10041004 /* gfx10 pa_sc_tile_steering_override */
10051005 __u32 pa_sc_tile_steering_override;
1006+ /* disabled TCCs */
1007+ __u64 tcc_disabled_mask;
10061008 };
10071009
10081010 struct drm_amdgpu_info_hw_ip {
include/uapi/linux/nvme_ioctl.h+23−0
@@ -45,6 +45,27 @@ struct nvme_passthru_cmd { · 44 unmodified lines
4545 __u32 result;
4646 };
4747
48+struct nvme_passthru_cmd64 {
49+ __u8 opcode;
50+ __u8 flags;
51+ __u16 rsvd1;
52+ __u32 nsid;
53+ __u32 cdw2;
54+ __u32 cdw3;
55+ __u64 metadata;
56+ __u64 addr;
57+ __u32 metadata_len;
58+ __u32 data_len;
59+ __u32 cdw10;
60+ __u32 cdw11;
61+ __u32 cdw12;
62+ __u32 cdw13;
63+ __u32 cdw14;
64+ __u32 cdw15;
65+ __u32 timeout_ms;
66+ __u64 result;
67+};
68+
4869 #define nvme_admin_cmd nvme_passthru_cmd
4970
5071 #define NVME_IOCTL_ID _IO('N', 0x40)
@@ -54,5 +75,7 @@ struct nvme_passthru_cmd { · 3 unmodified lines
5475 #define NVME_IOCTL_RESET _IO('N', 0x44)
5576 #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
5677 #define NVME_IOCTL_RESCAN _IO('N', 0x46)
78+#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)
79+#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)
5780
5881 #endif /* _UAPI_LINUX_NVME_IOCTL_H */
include/uapi/linux/pg.h+4−1
@@ -35,6 +35,9 @@ · 34 unmodified lines
3535
3636 */
3737
38+#ifndef _UAPI_LINUX_PG_H
39+#define _UAPI_LINUX_PG_H
40+
3841 #define PG_MAGIC 'P'
3942 #define PG_RESET 'Z'
4043 #define PG_COMMAND 'C'
@@ -61,4 +64,4 @@ struct pg_read_hdr { · 20 unmodified lines
6164
6265 };
6366
64−/* end of pg.h */
67+#endif /* _UAPI_LINUX_PG_H */
include/uapi/linux/sched.h+28−2
@@ -33,8 +33,31 @@ · 32 unmodified lines
3333 #define CLONE_NEWNET 0x40000000 /* New network namespace */
3434 #define CLONE_IO 0x80000000 /* Clone io context */
3535
36−/*
37− * Arguments for the clone3 syscall
36+#ifndef __ASSEMBLY__
37+/**
38+ * struct clone_args - arguments for the clone3 syscall
39+ * @flags: Flags for the new process as listed above.
40+ * All flags are valid except for CSIGNAL and
41+ * CLONE_DETACHED.
42+ * @pidfd: If CLONE_PIDFD is set, a pidfd will be
43+ * returned in this argument.
44+ * @child_tid: If CLONE_CHILD_SETTID is set, the TID of the
45+ * child process will be returned in the child's
46+ * memory.
47+ * @parent_tid: If CLONE_PARENT_SETTID is set, the TID of
48+ * the child process will be returned in the
49+ * parent's memory.
50+ * @exit_signal: The exit_signal the parent process will be
51+ * sent when the child exits.
52+ * @stack: Specify the location of the stack for the
53+ * child process.
54+ * @stack_size: The size of the stack for the child process.
55+ * @tls: If CLONE_SETTLS is set, the tls descriptor
56+ * is set to tls.
57+ *
58+ * The structure is versioned by size and thus extensible.
59+ * New struct members must go at the end of the struct and
60+ * must be properly 64bit aligned.
3861 */
3962 struct clone_args {
4063 __aligned_u64 flags;
@@ -46,6 +69,9 @@ struct clone_args { · 5 unmodified lines
4669 __aligned_u64 stack_size;
4770 __aligned_u64 tls;
4871 };
72+#endif
73+
74+#define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */
4975
5076 /*
5177 * Scheduling policies
include/xen/xen-ops.h+1−24
@@ -212,30 +212,7 @@ int xen_xlate_map_ballooned_pages(xen_pfn_t **pfns, void **vaddr, · 211 unmodified lines
212212
213213 bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
214214
215−efi_status_t xen_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc);
216−efi_status_t xen_efi_set_time(efi_time_t *tm);
217−efi_status_t xen_efi_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
218− efi_time_t *tm);
219−efi_status_t xen_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm);
220−efi_status_t xen_efi_get_variable(efi_char16_t *name, efi_guid_t *vendor,
221− u32 *attr, unsigned long *data_size,
222− void *data);
223−efi_status_t xen_efi_get_next_variable(unsigned long *name_size,
224− efi_char16_t *name, efi_guid_t *vendor);
225−efi_status_t xen_efi_set_variable(efi_char16_t *name, efi_guid_t *vendor,
226− u32 attr, unsigned long data_size,
227− void *data);
228−efi_status_t xen_efi_query_variable_info(u32 attr, u64 *storage_space,
229− u64 *remaining_space,
230− u64 *max_variable_size);
231−efi_status_t xen_efi_get_next_high_mono_count(u32 *count);
232−efi_status_t xen_efi_update_capsule(efi_capsule_header_t **capsules,
233− unsigned long count, unsigned long sg_list);
234−efi_status_t xen_efi_query_capsule_caps(efi_capsule_header_t **capsules,
235− unsigned long count, u64 *max_size,
236− int *reset_type);
237−void xen_efi_reset_system(int reset_type, efi_status_t status,
238− unsigned long data_size, efi_char16_t *data);
215+void xen_efi_runtime_setup(void);
239216
240217
241218 #ifdef CONFIG_PREEMPT

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t