* Remove the following patches, which become obsolete by updating to
4.18.9:
- 0007-nvme-update-timeout-module-parameter-type.patch
- 0028-ACPI-SPCR-Make-SPCR-available-to-x86.patch
- 0030-locking-paravirt-Use-new-static-key-for-controlling-.patch
- 0031-KVM-Introduce-paravirtualization-hints-and-KVM_HINTS.patch
- 0032-KVM-X86-Choose-qspinlock-when-dedicated-physical-CPU.patch
- 0033-x86-paravirt-Set-up-the-virt_spin_lock_key-after-sta.patch
- 0034-KVM-X86-Fix-setup-the-virt_spin_lock_key-before-stat.patch
- 0036-xen-netfront-Update-features-after-registering-netde.patch
- 0038-blk-mq-simplify-queue-mapping-schedule-with-each-pos.patch
- 0040-x86-MCE-AMD-Read-MCx_MISC-block-addresses-on-any-CPU.patch
- 0041-x86-bugs-Add-AMD-s-variant-of-SSB_NO.patch
- 0042-x86-bugs-Add-AMD-s-SPEC_CTRL-MSR-usage.patch
- 0043-x86-bugs-Switch-the-selection-of-mitigation-from-CPU.patch
- 0044-x86-CPU-Rename-intel_cacheinfo.c-to-cacheinfo.c.patch
- 0045-x86-CPU-AMD-Calculate-last-level-cache-ID-from-numbe.patch
- 0046-x86-CPU-AMD-Fix-LLC-ID-bit-shift-calculation.patch
- 0047-x86-bugs-Update-when-to-check-for-the-LS_CFG-SSBD-mi.patch
- 0048-x86-bugs-Fix-the-AMD-SSBD-usage-of-the-SPEC_CTRL-MSR.patch
- 0049-tools-power-turbostat-Read-extended-processor-family.patch
- 0050-sched-topology-Introduce-NUMA-identity-node-sched-do.patch
- 0051-x86-CPU-AMD-Derive-CPU-topology-from-CPUID-function-.patch
- 0052-vmxnet3-increase-default-rx-ring-sizes.patch
- 0053-Revert-e1000e-Separate-signaling-for-link-check-link.patch
- 0054-e1000e-Fix-link-check-race-condition.patch
* Remove the now unused version of the steal time accounting patch.
* Update the Amazon ENA driver to version 1.6.0 to get it to build
with linux kernel 4.18.9
Change-Id: I659a5f2e13e0d54e9b5991c4d08a1e02de9498e9
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5954
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,1110 +0,0 @@ |
| 1 |
-From f34488a615da4b0dd68f697587f1cf13e4535e5d Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: John Johansen <john.johansen@canonical.com> |
|
| 3 |
-Date: Tue, 18 Jul 2017 23:18:33 -0700 |
|
| 4 |
-Subject: [PATCH 1/2] apparmor: add base infastructure for socket mediation |
|
| 5 |
- |
|
| 6 |
-Provide a basic mediation of sockets. This is not a full net mediation |
|
| 7 |
-but just whether a spcific family of socket can be used by an |
|
| 8 |
-application, along with setting up some basic infrastructure for |
|
| 9 |
-network mediation to follow. |
|
| 10 |
- |
|
| 11 |
-the user space rule hav the basic form of |
|
| 12 |
- NETWORK RULE = [ QUALIFIERS ] 'network' [ DOMAIN ] |
|
| 13 |
- [ TYPE | PROTOCOL ] |
|
| 14 |
- |
|
| 15 |
- DOMAIN = ( 'inet' | 'ax25' | 'ipx' | 'appletalk' | 'netrom' | |
|
| 16 |
- 'bridge' | 'atmpvc' | 'x25' | 'inet6' | 'rose' | |
|
| 17 |
- 'netbeui' | 'security' | 'key' | 'packet' | 'ash' | |
|
| 18 |
- 'econet' | 'atmsvc' | 'sna' | 'irda' | 'pppox' | |
|
| 19 |
- 'wanpipe' | 'bluetooth' | 'netlink' | 'unix' | 'rds' | |
|
| 20 |
- 'llc' | 'can' | 'tipc' | 'iucv' | 'rxrpc' | 'isdn' | |
|
| 21 |
- 'phonet' | 'ieee802154' | 'caif' | 'alg' | 'nfc' | |
|
| 22 |
- 'vsock' | 'mpls' | 'ib' | 'kcm' ) ',' |
|
| 23 |
- |
|
| 24 |
- TYPE = ( 'stream' | 'dgram' | 'seqpacket' | 'rdm' | 'raw' | |
|
| 25 |
- 'packet' ) |
|
| 26 |
- |
|
| 27 |
- PROTOCOL = ( 'tcp' | 'udp' | 'icmp' ) |
|
| 28 |
- |
|
| 29 |
-eg. |
|
| 30 |
- network, |
|
| 31 |
- network inet, |
|
| 32 |
- |
|
| 33 |
-Signed-off-by: John Johansen <john.johansen@canonical.com> |
|
| 34 |
-Acked-by: Seth Arnold <seth.arnold@canonical.com> |
|
| 35 |
- security/apparmor/.gitignore | 1 + |
|
| 36 |
- security/apparmor/Makefile | 43 ++++- |
|
| 37 |
- security/apparmor/apparmorfs.c | 1 + |
|
| 38 |
- security/apparmor/file.c | 30 +++ |
|
| 39 |
- security/apparmor/include/audit.h | 26 ++- |
|
| 40 |
- security/apparmor/include/net.h | 114 +++++++++++ |
|
| 41 |
- security/apparmor/include/perms.h | 5 +- |
|
| 42 |
- security/apparmor/include/policy.h | 13 ++ |
|
| 43 |
- security/apparmor/lib.c | 5 +- |
|
| 44 |
- security/apparmor/lsm.c | 387 +++++++++++++++++++++++++++++++++++++ |
|
| 45 |
- security/apparmor/net.c | 184 ++++++++++++++++++ |
|
| 46 |
- security/apparmor/policy_unpack.c | 51 ++++- |
|
| 47 |
- 12 files changed, 844 insertions(+), 16 deletions(-) |
|
| 48 |
- create mode 100644 security/apparmor/include/net.h |
|
| 49 |
- create mode 100644 security/apparmor/net.c |
|
| 50 |
- |
|
| 51 |
-diff --git a/security/apparmor/.gitignore b/security/apparmor/.gitignore |
|
| 52 |
-index 9cdec70d72b8..d5b291e94264 100644 |
|
| 53 |
-+++ b/security/apparmor/.gitignore |
|
| 54 |
-@@ -1,5 +1,6 @@ |
|
| 55 |
- # |
|
| 56 |
- # Generated include files |
|
| 57 |
- # |
|
| 58 |
-+net_names.h |
|
| 59 |
- capability_names.h |
|
| 60 |
- rlim_names.h |
|
| 61 |
-diff --git a/security/apparmor/Makefile b/security/apparmor/Makefile |
|
| 62 |
-index 9a6b4033d52b..e7ff2183532a 100644 |
|
| 63 |
-+++ b/security/apparmor/Makefile |
|
| 64 |
-@@ -5,11 +5,44 @@ obj-$(CONFIG_SECURITY_APPARMOR) += apparmor.o |
|
| 65 |
- |
|
| 66 |
- apparmor-y := apparmorfs.o audit.o capability.o context.o ipc.o lib.o match.o \ |
|
| 67 |
- path.o domain.o policy.o policy_unpack.o procattr.o lsm.o \ |
|
| 68 |
-- resource.o secid.o file.o policy_ns.o label.o mount.o |
|
| 69 |
-+ resource.o secid.o file.o policy_ns.o label.o mount.o net.o |
|
| 70 |
- apparmor-$(CONFIG_SECURITY_APPARMOR_HASH) += crypto.o |
|
| 71 |
- |
|
| 72 |
--clean-files := capability_names.h rlim_names.h |
|
| 73 |
-+clean-files := capability_names.h rlim_names.h net_names.h |
|
| 74 |
- |
|
| 75 |
-+# Build a lower case string table of address family names |
|
| 76 |
-+# Transform lines from |
|
| 77 |
-+# #define AF_LOCAL 1 /* POSIX name for AF_UNIX */ |
|
| 78 |
-+# #define AF_INET 2 /* Internet IP Protocol */ |
|
| 79 |
-+# to |
|
| 80 |
-+# [1] = "local", |
|
| 81 |
-+# [2] = "inet", |
|
| 82 |
-+# |
|
| 83 |
-+# and build the securityfs entries for the mapping. |
|
| 84 |
-+# Transforms lines from |
|
| 85 |
-+# #define AF_INET 2 /* Internet IP Protocol */ |
|
| 86 |
-+# to |
|
| 87 |
-+# #define AA_SFS_AF_MASK "local inet" |
|
| 88 |
-+quiet_cmd_make-af = GEN $@ |
|
| 89 |
-+cmd_make-af = echo "static const char *address_family_names[] = {" > $@ ;\
|
|
| 90 |
-+ sed $< >>$@ -r -n -e "/AF_MAX/d" -e "/AF_LOCAL/d" -e "/AF_ROUTE/d" -e \ |
|
| 91 |
-+ 's/^\#define[ \t]+AF_([A-Z0-9_]+)[ \t]+([0-9]+)(.*)/[\2] = "\L\1",/p';\ |
|
| 92 |
-+ echo "};" >> $@ ;\ |
|
| 93 |
-+ printf '%s' '\#define AA_SFS_AF_MASK "' >> $@ ;\ |
|
| 94 |
-+ sed -r -n -e "/AF_MAX/d" -e "/AF_LOCAL/d" -e "/AF_ROUTE/d" -e \ |
|
| 95 |
-+ 's/^\#define[ \t]+AF_([A-Z0-9_]+)[ \t]+([0-9]+)(.*)/\L\1/p'\ |
|
| 96 |
-+ $< | tr '\n' ' ' | sed -e 's/ $$/"\n/' >> $@ |
|
| 97 |
-+ |
|
| 98 |
-+# Build a lower case string table of sock type names |
|
| 99 |
-+# Transform lines from |
|
| 100 |
-+# SOCK_STREAM = 1, |
|
| 101 |
-+# to |
|
| 102 |
-+# [1] = "stream", |
|
| 103 |
-+quiet_cmd_make-sock = GEN $@ |
|
| 104 |
-+cmd_make-sock = echo "static const char *sock_type_names[] = {" >> $@ ;\
|
|
| 105 |
-+ sed $^ >>$@ -r -n \ |
|
| 106 |
-+ -e 's/^\tSOCK_([A-Z0-9_]+)[\t]+=[ \t]+([0-9]+)(.*)/[\2] = "\L\1",/p';\ |
|
| 107 |
-+ echo "};" >> $@ |
|
| 108 |
- |
|
| 109 |
- # Build a lower case string table of capability names |
|
| 110 |
- # Transforms lines from |
|
| 111 |
-@@ -62,6 +95,7 @@ cmd_make-rlim = echo "static const char *const rlim_names[RLIM_NLIMITS] = {" \
|
|
| 112 |
- tr '\n' ' ' | sed -e 's/ $$/"\n/' >> $@ |
|
| 113 |
- |
|
| 114 |
- $(obj)/capability.o : $(obj)/capability_names.h |
|
| 115 |
-+$(obj)/net.o : $(obj)/net_names.h |
|
| 116 |
- $(obj)/resource.o : $(obj)/rlim_names.h |
|
| 117 |
- $(obj)/capability_names.h : $(srctree)/include/uapi/linux/capability.h \ |
|
| 118 |
- $(src)/Makefile |
|
| 119 |
-@@ -69,3 +103,8 @@ $(obj)/capability_names.h : $(srctree)/include/uapi/linux/capability.h \ |
|
| 120 |
- $(obj)/rlim_names.h : $(srctree)/include/uapi/asm-generic/resource.h \ |
|
| 121 |
- $(src)/Makefile |
|
| 122 |
- $(call cmd,make-rlim) |
|
| 123 |
-+$(obj)/net_names.h : $(srctree)/include/linux/socket.h \ |
|
| 124 |
-+ $(srctree)/include/linux/net.h \ |
|
| 125 |
-+ $(src)/Makefile |
|
| 126 |
-+ $(call cmd,make-af) |
|
| 127 |
-+ $(call cmd,make-sock) |
|
| 128 |
-diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c |
|
| 129 |
-index caaf51dda648..518d5928661b 100644 |
|
| 130 |
-+++ b/security/apparmor/apparmorfs.c |
|
| 131 |
-@@ -2202,6 +2202,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = {
|
|
| 132 |
- AA_SFS_DIR("policy", aa_sfs_entry_policy),
|
|
| 133 |
- AA_SFS_DIR("domain", aa_sfs_entry_domain),
|
|
| 134 |
- AA_SFS_DIR("file", aa_sfs_entry_file),
|
|
| 135 |
-+ AA_SFS_DIR("network", aa_sfs_entry_network),
|
|
| 136 |
- AA_SFS_DIR("mount", aa_sfs_entry_mount),
|
|
| 137 |
- AA_SFS_DIR("namespaces", aa_sfs_entry_ns),
|
|
| 138 |
- AA_SFS_FILE_U64("capability", VFS_CAP_FLAGS_MASK),
|
|
| 139 |
-diff --git a/security/apparmor/file.c b/security/apparmor/file.c |
|
| 140 |
-index 3382518b87fa..db80221891c6 100644 |
|
| 141 |
-+++ b/security/apparmor/file.c |
|
| 142 |
-@@ -21,6 +21,7 @@ |
|
| 143 |
- #include "include/context.h" |
|
| 144 |
- #include "include/file.h" |
|
| 145 |
- #include "include/match.h" |
|
| 146 |
-+#include "include/net.h" |
|
| 147 |
- #include "include/path.h" |
|
| 148 |
- #include "include/policy.h" |
|
| 149 |
- #include "include/label.h" |
|
| 150 |
-@@ -566,6 +567,32 @@ static int __file_path_perm(const char *op, struct aa_label *label, |
|
| 151 |
- return error; |
|
| 152 |
- } |
|
| 153 |
- |
|
| 154 |
-+static int __file_sock_perm(const char *op, struct aa_label *label, |
|
| 155 |
-+ struct aa_label *flabel, struct file *file, |
|
| 156 |
-+ u32 request, u32 denied) |
|
| 157 |
-+{
|
|
| 158 |
-+ struct socket *sock = (struct socket *) file->private_data; |
|
| 159 |
-+ int error; |
|
| 160 |
-+ |
|
| 161 |
-+ AA_BUG(!sock); |
|
| 162 |
-+ |
|
| 163 |
-+ /* revalidation due to label out of date. No revocation at this time */ |
|
| 164 |
-+ if (!denied && aa_label_is_subset(flabel, label)) |
|
| 165 |
-+ return 0; |
|
| 166 |
-+ |
|
| 167 |
-+ /* TODO: improve to skip profiles cached in flabel */ |
|
| 168 |
-+ error = aa_sock_file_perm(label, op, request, sock); |
|
| 169 |
-+ if (denied) {
|
|
| 170 |
-+ /* TODO: improve to skip profiles checked above */ |
|
| 171 |
-+ /* check every profile in file label to is cached */ |
|
| 172 |
-+ last_error(error, aa_sock_file_perm(flabel, op, request, sock)); |
|
| 173 |
-+ } |
|
| 174 |
-+ if (!error) |
|
| 175 |
-+ update_file_ctx(file_ctx(file), label, request); |
|
| 176 |
-+ |
|
| 177 |
-+ return error; |
|
| 178 |
-+} |
|
| 179 |
-+ |
|
| 180 |
- /** |
|
| 181 |
- * aa_file_perm - do permission revalidation check & audit for @file |
|
| 182 |
- * @op: operation being checked |
|
| 183 |
-@@ -610,6 +637,9 @@ int aa_file_perm(const char *op, struct aa_label *label, struct file *file, |
|
| 184 |
- error = __file_path_perm(op, label, flabel, file, request, |
|
| 185 |
- denied); |
|
| 186 |
- |
|
| 187 |
-+ else if (S_ISSOCK(file_inode(file)->i_mode)) |
|
| 188 |
-+ error = __file_sock_perm(op, label, flabel, file, request, |
|
| 189 |
-+ denied); |
|
| 190 |
- done: |
|
| 191 |
- rcu_read_unlock(); |
|
| 192 |
- |
|
| 193 |
-diff --git a/security/apparmor/include/audit.h b/security/apparmor/include/audit.h |
|
| 194 |
-index 2ebc00a..ff4316e 100644 |
|
| 195 |
-+++ b/security/apparmor/include/audit.h |
|
| 196 |
-@@ -123,14 +123,20 @@ struct apparmor_audit_data {
|
|
| 197 |
- struct aa_label *peer; |
|
| 198 |
- union {
|
|
| 199 |
- struct {
|
|
| 200 |
-- const char *target; |
|
| 201 |
- kuid_t ouid; |
|
| 202 |
-+ const char *target; |
|
| 203 |
- } fs; |
|
| 204 |
- struct {
|
|
| 205 |
-+ int type, protocol; |
|
| 206 |
-+ struct sock *peer_sk; |
|
| 207 |
-+ void *addr; |
|
| 208 |
-+ int addrlen; |
|
| 209 |
-+ } net; |
|
| 210 |
-+ int signal; |
|
| 211 |
-+ struct {
|
|
| 212 |
- int rlim; |
|
| 213 |
- unsigned long max; |
|
| 214 |
- } rlim; |
|
| 215 |
-- int signal; |
|
| 216 |
- }; |
|
| 217 |
- }; |
|
| 218 |
- struct {
|
|
| 219 |
-diff --git a/security/apparmor/include/net.h b/security/apparmor/include/net.h |
|
| 220 |
-new file mode 100644 |
|
| 221 |
-index 000000000000..140c8efcf364 |
|
| 222 |
-+++ b/security/apparmor/include/net.h |
|
| 223 |
-@@ -0,0 +1,114 @@ |
|
| 224 |
-+/* |
|
| 225 |
-+ * AppArmor security module |
|
| 226 |
-+ * |
|
| 227 |
-+ * This file contains AppArmor network mediation definitions. |
|
| 228 |
-+ * |
|
| 229 |
-+ * Copyright (C) 1998-2008 Novell/SUSE |
|
| 230 |
-+ * Copyright 2009-2017 Canonical Ltd. |
|
| 231 |
-+ * |
|
| 232 |
-+ * This program is free software; you can redistribute it and/or |
|
| 233 |
-+ * modify it under the terms of the GNU General Public License as |
|
| 234 |
-+ * published by the Free Software Foundation, version 2 of the |
|
| 235 |
-+ * License. |
|
| 236 |
-+ */ |
|
| 237 |
-+ |
|
| 238 |
-+#ifndef __AA_NET_H |
|
| 239 |
-+#define __AA_NET_H |
|
| 240 |
-+ |
|
| 241 |
-+#include <net/sock.h> |
|
| 242 |
-+#include <linux/path.h> |
|
| 243 |
-+ |
|
| 244 |
-+#include "apparmorfs.h" |
|
| 245 |
-+#include "label.h" |
|
| 246 |
-+#include "perms.h" |
|
| 247 |
-+#include "policy.h" |
|
| 248 |
-+ |
|
| 249 |
-+#define AA_MAY_SEND AA_MAY_WRITE |
|
| 250 |
-+#define AA_MAY_RECEIVE AA_MAY_READ |
|
| 251 |
-+ |
|
| 252 |
-+#define AA_MAY_SHUTDOWN AA_MAY_DELETE |
|
| 253 |
-+ |
|
| 254 |
-+#define AA_MAY_CONNECT AA_MAY_OPEN |
|
| 255 |
-+#define AA_MAY_ACCEPT 0x00100000 |
|
| 256 |
-+ |
|
| 257 |
-+#define AA_MAY_BIND 0x00200000 |
|
| 258 |
-+#define AA_MAY_LISTEN 0x00400000 |
|
| 259 |
-+ |
|
| 260 |
-+#define AA_MAY_SETOPT 0x01000000 |
|
| 261 |
-+#define AA_MAY_GETOPT 0x02000000 |
|
| 262 |
-+ |
|
| 263 |
-+#define NET_PERMS_MASK (AA_MAY_SEND | AA_MAY_RECEIVE | AA_MAY_CREATE | \ |
|
| 264 |
-+ AA_MAY_SHUTDOWN | AA_MAY_BIND | AA_MAY_LISTEN | \ |
|
| 265 |
-+ AA_MAY_CONNECT | AA_MAY_ACCEPT | AA_MAY_SETATTR | \ |
|
| 266 |
-+ AA_MAY_GETATTR | AA_MAY_SETOPT | AA_MAY_GETOPT) |
|
| 267 |
-+ |
|
| 268 |
-+#define NET_FS_PERMS (AA_MAY_SEND | AA_MAY_RECEIVE | AA_MAY_CREATE | \ |
|
| 269 |
-+ AA_MAY_SHUTDOWN | AA_MAY_CONNECT | AA_MAY_RENAME |\ |
|
| 270 |
-+ AA_MAY_SETATTR | AA_MAY_GETATTR | AA_MAY_CHMOD | \ |
|
| 271 |
-+ AA_MAY_CHOWN | AA_MAY_CHGRP | AA_MAY_LOCK | \ |
|
| 272 |
-+ AA_MAY_MPROT) |
|
| 273 |
-+ |
|
| 274 |
-+#define NET_PEER_MASK (AA_MAY_SEND | AA_MAY_RECEIVE | AA_MAY_CONNECT | \ |
|
| 275 |
-+ AA_MAY_ACCEPT) |
|
| 276 |
-+struct aa_sk_ctx {
|
|
| 277 |
-+ struct aa_label *label; |
|
| 278 |
-+ struct aa_label *peer; |
|
| 279 |
-+ struct path path; |
|
| 280 |
-+}; |
|
| 281 |
-+ |
|
| 282 |
-+#define SK_CTX(X) ((X)->sk_security) |
|
| 283 |
-+#define SOCK_ctx(X) SOCK_INODE(X)->i_security |
|
| 284 |
-+#define DEFINE_AUDIT_NET(NAME, OP, SK, F, T, P) \ |
|
| 285 |
-+ struct lsm_network_audit NAME ## _net = { .sk = (SK), \
|
|
| 286 |
-+ .family = (F)}; \ |
|
| 287 |
-+ DEFINE_AUDIT_DATA(NAME, \ |
|
| 288 |
-+ ((SK) && (F) != AF_UNIX) ? LSM_AUDIT_DATA_NET : \ |
|
| 289 |
-+ LSM_AUDIT_DATA_NONE, \ |
|
| 290 |
-+ OP); \ |
|
| 291 |
-+ NAME.u.net = &(NAME ## _net); \ |
|
| 292 |
-+ aad(&NAME)->net.type = (T); \ |
|
| 293 |
-+ aad(&NAME)->net.protocol = (P) |
|
| 294 |
-+ |
|
| 295 |
-+#define DEFINE_AUDIT_SK(NAME, OP, SK) \ |
|
| 296 |
-+ DEFINE_AUDIT_NET(NAME, OP, SK, (SK)->sk_family, (SK)->sk_type, \ |
|
| 297 |
-+ (SK)->sk_protocol) |
|
| 298 |
-+ |
|
| 299 |
-+/* struct aa_net - network confinement data |
|
| 300 |
-+ * @allow: basic network families permissions |
|
| 301 |
-+ * @audit: which network permissions to force audit |
|
| 302 |
-+ * @quiet: which network permissions to quiet rejects |
|
| 303 |
-+ */ |
|
| 304 |
-+struct aa_net {
|
|
| 305 |
-+ u16 allow[AF_MAX]; |
|
| 306 |
-+ u16 audit[AF_MAX]; |
|
| 307 |
-+ u16 quiet[AF_MAX]; |
|
| 308 |
-+}; |
|
| 309 |
-+ |
|
| 310 |
-+ |
|
| 311 |
-+extern struct aa_sfs_entry aa_sfs_entry_network[]; |
|
| 312 |
-+ |
|
| 313 |
-+void audit_net_cb(struct audit_buffer *ab, void *va); |
|
| 314 |
-+int aa_profile_af_perm(struct aa_profile *profile, struct common_audit_data *sa, |
|
| 315 |
-+ u32 request, u16 family, int type); |
|
| 316 |
-+int aa_af_perm(struct aa_label *label, const char *op, u32 request, u16 family, |
|
| 317 |
-+ int type, int protocol); |
|
| 318 |
-+static inline int aa_profile_af_sk_perm(struct aa_profile *profile, |
|
| 319 |
-+ struct common_audit_data *sa, |
|
| 320 |
-+ u32 request, |
|
| 321 |
-+ struct sock *sk) |
|
| 322 |
-+{
|
|
| 323 |
-+ return aa_profile_af_perm(profile, sa, request, sk->sk_family, |
|
| 324 |
-+ sk->sk_type); |
|
| 325 |
-+} |
|
| 326 |
-+int aa_sk_perm(const char *op, u32 request, struct sock *sk); |
|
| 327 |
-+ |
|
| 328 |
-+int aa_sock_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 329 |
-+ struct socket *sock); |
|
| 330 |
-+ |
|
| 331 |
-+ |
|
| 332 |
-+static inline void aa_free_net_rules(struct aa_net *new) |
|
| 333 |
-+{
|
|
| 334 |
-+ /* NOP */ |
|
| 335 |
-+} |
|
| 336 |
-+ |
|
| 337 |
-+#endif /* __AA_NET_H */ |
|
| 338 |
-diff --git a/security/apparmor/include/perms.h b/security/apparmor/include/perms.h |
|
| 339 |
-index 2b27bb79aec4..af04d5a7d73d 100644 |
|
| 340 |
-+++ b/security/apparmor/include/perms.h |
|
| 341 |
-@@ -135,9 +135,10 @@ extern struct aa_perms allperms; |
|
| 342 |
- |
|
| 343 |
- |
|
| 344 |
- void aa_perm_mask_to_str(char *str, const char *chrs, u32 mask); |
|
| 345 |
--void aa_audit_perm_names(struct audit_buffer *ab, const char **names, u32 mask); |
|
| 346 |
-+void aa_audit_perm_names(struct audit_buffer *ab, const char * const *names, |
|
| 347 |
-+ u32 mask); |
|
| 348 |
- void aa_audit_perm_mask(struct audit_buffer *ab, u32 mask, const char *chrs, |
|
| 349 |
-- u32 chrsmask, const char **names, u32 namesmask); |
|
| 350 |
-+ u32 chrsmask, const char * const *names, u32 namesmask); |
|
| 351 |
- void aa_apply_modes_to_perms(struct aa_profile *profile, |
|
| 352 |
- struct aa_perms *perms); |
|
| 353 |
- void aa_compute_perms(struct aa_dfa *dfa, unsigned int state, |
|
| 354 |
-diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h |
|
| 355 |
-index 17fe41a9cac3..4364088a0b9e 100644 |
|
| 356 |
-+++ b/security/apparmor/include/policy.h |
|
| 357 |
-@@ -30,6 +30,7 @@ |
|
| 358 |
- #include "file.h" |
|
| 359 |
- #include "lib.h" |
|
| 360 |
- #include "label.h" |
|
| 361 |
-+#include "net.h" |
|
| 362 |
- #include "perms.h" |
|
| 363 |
- #include "resource.h" |
|
| 364 |
- |
|
| 365 |
-@@ -111,6 +112,7 @@ struct aa_data {
|
|
| 366 |
- * @policy: general match rules governing policy |
|
| 367 |
- * @file: The set of rules governing basic file access and domain transitions |
|
| 368 |
- * @caps: capabilities for the profile |
|
| 369 |
-+ * @net: network controls for the profile |
|
| 370 |
- * @rlimits: rlimits for the profile |
|
| 371 |
- * |
|
| 372 |
- * @dents: dentries for the profiles file entries in apparmorfs |
|
| 373 |
-@@ -148,6 +150,7 @@ struct aa_profile {
|
|
| 374 |
- struct aa_policydb policy; |
|
| 375 |
- struct aa_file_rules file; |
|
| 376 |
- struct aa_caps caps; |
|
| 377 |
-+ struct aa_net net; |
|
| 378 |
- struct aa_rlimit rlimits; |
|
| 379 |
- |
|
| 380 |
- struct aa_loaddata *rawdata; |
|
| 381 |
-@@ -220,6 +223,16 @@ static inline unsigned int PROFILE_MEDIATES_SAFE(struct aa_profile *profile, |
|
| 382 |
- return 0; |
|
| 383 |
- } |
|
| 384 |
- |
|
| 385 |
-+static inline unsigned int PROFILE_MEDIATES_AF(struct aa_profile *profile, |
|
| 386 |
-+ u16 AF) {
|
|
| 387 |
-+ unsigned int state = PROFILE_MEDIATES(profile, AA_CLASS_NET); |
|
| 388 |
-+ u16 be_af = cpu_to_be16(AF); |
|
| 389 |
-+ |
|
| 390 |
-+ if (!state) |
|
| 391 |
-+ return 0; |
|
| 392 |
-+ return aa_dfa_match_len(profile->policy.dfa, state, (char *) &be_af, 2); |
|
| 393 |
-+} |
|
| 394 |
-+ |
|
| 395 |
- /** |
|
| 396 |
- * aa_get_profile - increment refcount on profile @p |
|
| 397 |
- * @p: profile (MAYBE NULL) |
|
| 398 |
-diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c |
|
| 399 |
-index 08ca26bcca77..8818621b5d95 100644 |
|
| 400 |
-+++ b/security/apparmor/lib.c |
|
| 401 |
-@@ -211,7 +211,8 @@ void aa_perm_mask_to_str(char *str, const char *chrs, u32 mask) |
|
| 402 |
- *str = '\0'; |
|
| 403 |
- } |
|
| 404 |
- |
|
| 405 |
--void aa_audit_perm_names(struct audit_buffer *ab, const char **names, u32 mask) |
|
| 406 |
-+void aa_audit_perm_names(struct audit_buffer *ab, const char * const *names, |
|
| 407 |
-+ u32 mask) |
|
| 408 |
- {
|
|
| 409 |
- const char *fmt = "%s"; |
|
| 410 |
- unsigned int i, perm = 1; |
|
| 411 |
-@@ -229,7 +230,7 @@ void aa_audit_perm_names(struct audit_buffer *ab, const char **names, u32 mask) |
|
| 412 |
- } |
|
| 413 |
- |
|
| 414 |
- void aa_audit_perm_mask(struct audit_buffer *ab, u32 mask, const char *chrs, |
|
| 415 |
-- u32 chrsmask, const char **names, u32 namesmask) |
|
| 416 |
-+ u32 chrsmask, const char * const *names, u32 namesmask) |
|
| 417 |
- {
|
|
| 418 |
- char str[33]; |
|
| 419 |
- |
|
| 420 |
-diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c |
|
| 421 |
-index 1346ee5be04f..72b915dfcaf7 100644 |
|
| 422 |
-+++ b/security/apparmor/lsm.c |
|
| 423 |
-@@ -33,6 +33,7 @@ |
|
| 424 |
- #include "include/context.h" |
|
| 425 |
- #include "include/file.h" |
|
| 426 |
- #include "include/ipc.h" |
|
| 427 |
-+#include "include/net.h" |
|
| 428 |
- #include "include/path.h" |
|
| 429 |
- #include "include/label.h" |
|
| 430 |
- #include "include/policy.h" |
|
| 431 |
-@@ -736,6 +737,368 @@ static int apparmor_task_kill(struct task_struct *target, struct siginfo *info, |
|
| 432 |
- return error; |
|
| 433 |
- } |
|
| 434 |
- |
|
| 435 |
-+/** |
|
| 436 |
-+ * apparmor_sk_alloc_security - allocate and attach the sk_security field |
|
| 437 |
-+ */ |
|
| 438 |
-+static int apparmor_sk_alloc_security(struct sock *sk, int family, gfp_t flags) |
|
| 439 |
-+{
|
|
| 440 |
-+ struct aa_sk_ctx *ctx; |
|
| 441 |
-+ |
|
| 442 |
-+ ctx = kzalloc(sizeof(*ctx), flags); |
|
| 443 |
-+ if (!ctx) |
|
| 444 |
-+ return -ENOMEM; |
|
| 445 |
-+ |
|
| 446 |
-+ SK_CTX(sk) = ctx; |
|
| 447 |
-+ |
|
| 448 |
-+ return 0; |
|
| 449 |
-+} |
|
| 450 |
-+ |
|
| 451 |
-+/** |
|
| 452 |
-+ * apparmor_sk_free_security - free the sk_security field |
|
| 453 |
-+ */ |
|
| 454 |
-+static void apparmor_sk_free_security(struct sock *sk) |
|
| 455 |
-+{
|
|
| 456 |
-+ struct aa_sk_ctx *ctx = SK_CTX(sk); |
|
| 457 |
-+ |
|
| 458 |
-+ SK_CTX(sk) = NULL; |
|
| 459 |
-+ aa_put_label(ctx->label); |
|
| 460 |
-+ aa_put_label(ctx->peer); |
|
| 461 |
-+ path_put(&ctx->path); |
|
| 462 |
-+ kfree(ctx); |
|
| 463 |
-+} |
|
| 464 |
-+ |
|
| 465 |
-+/** |
|
| 466 |
-+ * apparmor_clone_security - clone the sk_security field |
|
| 467 |
-+ */ |
|
| 468 |
-+static void apparmor_sk_clone_security(const struct sock *sk, |
|
| 469 |
-+ struct sock *newsk) |
|
| 470 |
-+{
|
|
| 471 |
-+ struct aa_sk_ctx *ctx = SK_CTX(sk); |
|
| 472 |
-+ struct aa_sk_ctx *new = SK_CTX(newsk); |
|
| 473 |
-+ |
|
| 474 |
-+ new->label = aa_get_label(ctx->label); |
|
| 475 |
-+ new->peer = aa_get_label(ctx->peer); |
|
| 476 |
-+ new->path = ctx->path; |
|
| 477 |
-+ path_get(&new->path); |
|
| 478 |
-+} |
|
| 479 |
-+ |
|
| 480 |
-+static int aa_sock_create_perm(struct aa_label *label, int family, int type, |
|
| 481 |
-+ int protocol) |
|
| 482 |
-+{
|
|
| 483 |
-+ AA_BUG(!label); |
|
| 484 |
-+ AA_BUG(in_interrupt()); |
|
| 485 |
-+ |
|
| 486 |
-+ return aa_af_perm(label, OP_CREATE, AA_MAY_CREATE, family, type, |
|
| 487 |
-+ protocol); |
|
| 488 |
-+} |
|
| 489 |
-+ |
|
| 490 |
-+ |
|
| 491 |
-+/** |
|
| 492 |
-+ * apparmor_socket_create - check perms before creating a new socket |
|
| 493 |
-+ */ |
|
| 494 |
-+static int apparmor_socket_create(int family, int type, int protocol, int kern) |
|
| 495 |
-+{
|
|
| 496 |
-+ struct aa_label *label; |
|
| 497 |
-+ int error = 0; |
|
| 498 |
-+ |
|
| 499 |
-+ label = begin_current_label_crit_section(); |
|
| 500 |
-+ if (!(kern || unconfined(label))) |
|
| 501 |
-+ error = aa_sock_create_perm(label, family, type, protocol); |
|
| 502 |
-+ end_current_label_crit_section(label); |
|
| 503 |
-+ |
|
| 504 |
-+ return error; |
|
| 505 |
-+} |
|
| 506 |
-+ |
|
| 507 |
-+/** |
|
| 508 |
-+ * apparmor_socket_post_create - setup the per-socket security struct |
|
| 509 |
-+ * |
|
| 510 |
-+ * Note: |
|
| 511 |
-+ * - kernel sockets currently labeled unconfined but we may want to |
|
| 512 |
-+ * move to a special kernel label |
|
| 513 |
-+ * - socket may not have sk here if created with sock_create_lite or |
|
| 514 |
-+ * sock_alloc. These should be accept cases which will be handled in |
|
| 515 |
-+ * sock_graft. |
|
| 516 |
-+ */ |
|
| 517 |
-+static int apparmor_socket_post_create(struct socket *sock, int family, |
|
| 518 |
-+ int type, int protocol, int kern) |
|
| 519 |
-+{
|
|
| 520 |
-+ struct aa_label *label; |
|
| 521 |
-+ |
|
| 522 |
-+ if (kern) {
|
|
| 523 |
-+ struct aa_ns *ns = aa_get_current_ns(); |
|
| 524 |
-+ |
|
| 525 |
-+ label = aa_get_label(ns_unconfined(ns)); |
|
| 526 |
-+ aa_put_ns(ns); |
|
| 527 |
-+ } else |
|
| 528 |
-+ label = aa_get_current_label(); |
|
| 529 |
-+ |
|
| 530 |
-+ if (sock->sk) {
|
|
| 531 |
-+ struct aa_sk_ctx *ctx = SK_CTX(sock->sk); |
|
| 532 |
-+ |
|
| 533 |
-+ aa_put_label(ctx->label); |
|
| 534 |
-+ ctx->label = aa_get_label(label); |
|
| 535 |
-+ } |
|
| 536 |
-+ aa_put_label(label); |
|
| 537 |
-+ |
|
| 538 |
-+ return 0; |
|
| 539 |
-+} |
|
| 540 |
-+ |
|
| 541 |
-+/** |
|
| 542 |
-+ * apparmor_socket_bind - check perms before bind addr to socket |
|
| 543 |
-+ */ |
|
| 544 |
-+static int apparmor_socket_bind(struct socket *sock, |
|
| 545 |
-+ struct sockaddr *address, int addrlen) |
|
| 546 |
-+{
|
|
| 547 |
-+ AA_BUG(!sock); |
|
| 548 |
-+ AA_BUG(!sock->sk); |
|
| 549 |
-+ AA_BUG(!address); |
|
| 550 |
-+ AA_BUG(in_interrupt()); |
|
| 551 |
-+ |
|
| 552 |
-+ return aa_sk_perm(OP_BIND, AA_MAY_BIND, sock->sk); |
|
| 553 |
-+} |
|
| 554 |
-+ |
|
| 555 |
-+/** |
|
| 556 |
-+ * apparmor_socket_connect - check perms before connecting @sock to @address |
|
| 557 |
-+ */ |
|
| 558 |
-+static int apparmor_socket_connect(struct socket *sock, |
|
| 559 |
-+ struct sockaddr *address, int addrlen) |
|
| 560 |
-+{
|
|
| 561 |
-+ AA_BUG(!sock); |
|
| 562 |
-+ AA_BUG(!sock->sk); |
|
| 563 |
-+ AA_BUG(!address); |
|
| 564 |
-+ AA_BUG(in_interrupt()); |
|
| 565 |
-+ |
|
| 566 |
-+ return aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sock->sk); |
|
| 567 |
-+} |
|
| 568 |
-+ |
|
| 569 |
-+/** |
|
| 570 |
-+ * apparmor_socket_list - check perms before allowing listen |
|
| 571 |
-+ */ |
|
| 572 |
-+static int apparmor_socket_listen(struct socket *sock, int backlog) |
|
| 573 |
-+{
|
|
| 574 |
-+ AA_BUG(!sock); |
|
| 575 |
-+ AA_BUG(!sock->sk); |
|
| 576 |
-+ AA_BUG(in_interrupt()); |
|
| 577 |
-+ |
|
| 578 |
-+ return aa_sk_perm(OP_LISTEN, AA_MAY_LISTEN, sock->sk); |
|
| 579 |
-+} |
|
| 580 |
-+ |
|
| 581 |
-+/** |
|
| 582 |
-+ * apparmor_socket_accept - check perms before accepting a new connection. |
|
| 583 |
-+ * |
|
| 584 |
-+ * Note: while @newsock is created and has some information, the accept |
|
| 585 |
-+ * has not been done. |
|
| 586 |
-+ */ |
|
| 587 |
-+static int apparmor_socket_accept(struct socket *sock, struct socket *newsock) |
|
| 588 |
-+{
|
|
| 589 |
-+ AA_BUG(!sock); |
|
| 590 |
-+ AA_BUG(!sock->sk); |
|
| 591 |
-+ AA_BUG(!newsock); |
|
| 592 |
-+ AA_BUG(in_interrupt()); |
|
| 593 |
-+ |
|
| 594 |
-+ return aa_sk_perm(OP_ACCEPT, AA_MAY_ACCEPT, sock->sk); |
|
| 595 |
-+} |
|
| 596 |
-+ |
|
| 597 |
-+static int aa_sock_msg_perm(const char *op, u32 request, struct socket *sock, |
|
| 598 |
-+ struct msghdr *msg, int size) |
|
| 599 |
-+{
|
|
| 600 |
-+ AA_BUG(!sock); |
|
| 601 |
-+ AA_BUG(!sock->sk); |
|
| 602 |
-+ AA_BUG(!msg); |
|
| 603 |
-+ AA_BUG(in_interrupt()); |
|
| 604 |
-+ |
|
| 605 |
-+ return aa_sk_perm(op, request, sock->sk); |
|
| 606 |
-+} |
|
| 607 |
-+ |
|
| 608 |
-+/** |
|
| 609 |
-+ * apparmor_socket_sendmsg - check perms before sending msg to another socket |
|
| 610 |
-+ */ |
|
| 611 |
-+static int apparmor_socket_sendmsg(struct socket *sock, |
|
| 612 |
-+ struct msghdr *msg, int size) |
|
| 613 |
-+{
|
|
| 614 |
-+ return aa_sock_msg_perm(OP_SENDMSG, AA_MAY_SEND, sock, msg, size); |
|
| 615 |
-+} |
|
| 616 |
-+ |
|
| 617 |
-+/** |
|
| 618 |
-+ * apparmor_socket_recvmsg - check perms before receiving a message |
|
| 619 |
-+ */ |
|
| 620 |
-+static int apparmor_socket_recvmsg(struct socket *sock, |
|
| 621 |
-+ struct msghdr *msg, int size, int flags) |
|
| 622 |
-+{
|
|
| 623 |
-+ return aa_sock_msg_perm(OP_RECVMSG, AA_MAY_RECEIVE, sock, msg, size); |
|
| 624 |
-+} |
|
| 625 |
-+ |
|
| 626 |
-+/* revaliation, get/set attr, shutdown */ |
|
| 627 |
-+static int aa_sock_perm(const char *op, u32 request, struct socket *sock) |
|
| 628 |
-+{
|
|
| 629 |
-+ AA_BUG(!sock); |
|
| 630 |
-+ AA_BUG(!sock->sk); |
|
| 631 |
-+ AA_BUG(in_interrupt()); |
|
| 632 |
-+ |
|
| 633 |
-+ return aa_sk_perm(op, request, sock->sk); |
|
| 634 |
-+} |
|
| 635 |
-+ |
|
| 636 |
-+/** |
|
| 637 |
-+ * apparmor_socket_getsockname - check perms before getting the local address |
|
| 638 |
-+ */ |
|
| 639 |
-+static int apparmor_socket_getsockname(struct socket *sock) |
|
| 640 |
-+{
|
|
| 641 |
-+ return aa_sock_perm(OP_GETSOCKNAME, AA_MAY_GETATTR, sock); |
|
| 642 |
-+} |
|
| 643 |
-+ |
|
| 644 |
-+/** |
|
| 645 |
-+ * apparmor_socket_getpeername - check perms before getting remote address |
|
| 646 |
-+ */ |
|
| 647 |
-+static int apparmor_socket_getpeername(struct socket *sock) |
|
| 648 |
-+{
|
|
| 649 |
-+ return aa_sock_perm(OP_GETPEERNAME, AA_MAY_GETATTR, sock); |
|
| 650 |
-+} |
|
| 651 |
-+ |
|
| 652 |
-+/* revaliation, get/set attr, opt */ |
|
| 653 |
-+static int aa_sock_opt_perm(const char *op, u32 request, struct socket *sock, |
|
| 654 |
-+ int level, int optname) |
|
| 655 |
-+{
|
|
| 656 |
-+ AA_BUG(!sock); |
|
| 657 |
-+ AA_BUG(!sock->sk); |
|
| 658 |
-+ AA_BUG(in_interrupt()); |
|
| 659 |
-+ |
|
| 660 |
-+ return aa_sk_perm(op, request, sock->sk); |
|
| 661 |
-+} |
|
| 662 |
-+ |
|
| 663 |
-+/** |
|
| 664 |
-+ * apparmor_getsockopt - check perms before getting socket options |
|
| 665 |
-+ */ |
|
| 666 |
-+static int apparmor_socket_getsockopt(struct socket *sock, int level, |
|
| 667 |
-+ int optname) |
|
| 668 |
-+{
|
|
| 669 |
-+ return aa_sock_opt_perm(OP_GETSOCKOPT, AA_MAY_GETOPT, sock, |
|
| 670 |
-+ level, optname); |
|
| 671 |
-+} |
|
| 672 |
-+ |
|
| 673 |
-+/** |
|
| 674 |
-+ * apparmor_setsockopt - check perms before setting socket options |
|
| 675 |
-+ */ |
|
| 676 |
-+static int apparmor_socket_setsockopt(struct socket *sock, int level, |
|
| 677 |
-+ int optname) |
|
| 678 |
-+{
|
|
| 679 |
-+ return aa_sock_opt_perm(OP_SETSOCKOPT, AA_MAY_SETOPT, sock, |
|
| 680 |
-+ level, optname); |
|
| 681 |
-+} |
|
| 682 |
-+ |
|
| 683 |
-+/** |
|
| 684 |
-+ * apparmor_socket_shutdown - check perms before shutting down @sock conn |
|
| 685 |
-+ */ |
|
| 686 |
-+static int apparmor_socket_shutdown(struct socket *sock, int how) |
|
| 687 |
-+{
|
|
| 688 |
-+ return aa_sock_perm(OP_SHUTDOWN, AA_MAY_SHUTDOWN, sock); |
|
| 689 |
-+} |
|
| 690 |
-+ |
|
| 691 |
-+/** |
|
| 692 |
-+ * apparmor_socket_sock_recv_skb - check perms before associating skb to sk |
|
| 693 |
-+ * |
|
| 694 |
-+ * Note: can not sleep may be called with locks held |
|
| 695 |
-+ * |
|
| 696 |
-+ * dont want protocol specific in __skb_recv_datagram() |
|
| 697 |
-+ * to deny an incoming connection socket_sock_rcv_skb() |
|
| 698 |
-+ */ |
|
| 699 |
-+static int apparmor_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) |
|
| 700 |
-+{
|
|
| 701 |
-+ return 0; |
|
| 702 |
-+} |
|
| 703 |
-+ |
|
| 704 |
-+ |
|
| 705 |
-+static struct aa_label *sk_peer_label(struct sock *sk) |
|
| 706 |
-+{
|
|
| 707 |
-+ struct aa_sk_ctx *ctx = SK_CTX(sk); |
|
| 708 |
-+ |
|
| 709 |
-+ if (ctx->peer) |
|
| 710 |
-+ return ctx->peer; |
|
| 711 |
-+ |
|
| 712 |
-+ return ERR_PTR(-ENOPROTOOPT); |
|
| 713 |
-+} |
|
| 714 |
-+ |
|
| 715 |
-+/** |
|
| 716 |
-+ * apparmor_socket_getpeersec_stream - get security context of peer |
|
| 717 |
-+ * |
|
| 718 |
-+ * Note: for tcp only valid if using ipsec or cipso on lan |
|
| 719 |
-+ */ |
|
| 720 |
-+static int apparmor_socket_getpeersec_stream(struct socket *sock, |
|
| 721 |
-+ char __user *optval, |
|
| 722 |
-+ int __user *optlen, |
|
| 723 |
-+ unsigned int len) |
|
| 724 |
-+{
|
|
| 725 |
-+ char *name; |
|
| 726 |
-+ int slen, error = 0; |
|
| 727 |
-+ struct aa_label *label; |
|
| 728 |
-+ struct aa_label *peer; |
|
| 729 |
-+ |
|
| 730 |
-+ label = begin_current_label_crit_section(); |
|
| 731 |
-+ peer = sk_peer_label(sock->sk); |
|
| 732 |
-+ if (IS_ERR(peer)) {
|
|
| 733 |
-+ error = PTR_ERR(peer); |
|
| 734 |
-+ goto done; |
|
| 735 |
-+ } |
|
| 736 |
-+ slen = aa_label_asxprint(&name, labels_ns(label), peer, |
|
| 737 |
-+ FLAG_SHOW_MODE | FLAG_VIEW_SUBNS | |
|
| 738 |
-+ FLAG_HIDDEN_UNCONFINED, GFP_KERNEL); |
|
| 739 |
-+ /* don't include terminating \0 in slen, it breaks some apps */ |
|
| 740 |
-+ if (slen < 0) {
|
|
| 741 |
-+ error = -ENOMEM; |
|
| 742 |
-+ } else {
|
|
| 743 |
-+ if (slen > len) {
|
|
| 744 |
-+ error = -ERANGE; |
|
| 745 |
-+ } else if (copy_to_user(optval, name, slen)) {
|
|
| 746 |
-+ error = -EFAULT; |
|
| 747 |
-+ goto out; |
|
| 748 |
-+ } |
|
| 749 |
-+ if (put_user(slen, optlen)) |
|
| 750 |
-+ error = -EFAULT; |
|
| 751 |
-+out: |
|
| 752 |
-+ kfree(name); |
|
| 753 |
-+ |
|
| 754 |
-+ } |
|
| 755 |
-+ |
|
| 756 |
-+done: |
|
| 757 |
-+ end_current_label_crit_section(label); |
|
| 758 |
-+ |
|
| 759 |
-+ return error; |
|
| 760 |
-+} |
|
| 761 |
-+ |
|
| 762 |
-+/** |
|
| 763 |
-+ * apparmor_socket_getpeersec_dgram - get security label of packet |
|
| 764 |
-+ * @sock: the peer socket |
|
| 765 |
-+ * @skb: packet data |
|
| 766 |
-+ * @secid: pointer to where to put the secid of the packet |
|
| 767 |
-+ * |
|
| 768 |
-+ * Sets the netlabel socket state on sk from parent |
|
| 769 |
-+ */ |
|
| 770 |
-+static int apparmor_socket_getpeersec_dgram(struct socket *sock, |
|
| 771 |
-+ struct sk_buff *skb, u32 *secid) |
|
| 772 |
-+ |
|
| 773 |
-+{
|
|
| 774 |
-+ /* TODO: requires secid support */ |
|
| 775 |
-+ return -ENOPROTOOPT; |
|
| 776 |
-+} |
|
| 777 |
-+ |
|
| 778 |
-+/** |
|
| 779 |
-+ * apparmor_sock_graft - Initialize newly created socket |
|
| 780 |
-+ * @sk: child sock |
|
| 781 |
-+ * @parent: parent socket |
|
| 782 |
-+ * |
|
| 783 |
-+ * Note: could set off of SOCK_CTX(parent) but need to track inode and we can |
|
| 784 |
-+ * just set sk security information off of current creating process label |
|
| 785 |
-+ * Labeling of sk for accept case - probably should be sock based |
|
| 786 |
-+ * instead of task, because of the case where an implicitly labeled |
|
| 787 |
-+ * socket is shared by different tasks. |
|
| 788 |
-+ */ |
|
| 789 |
-+static void apparmor_sock_graft(struct sock *sk, struct socket *parent) |
|
| 790 |
-+{
|
|
| 791 |
-+ struct aa_sk_ctx *ctx = SK_CTX(sk); |
|
| 792 |
-+ |
|
| 793 |
-+ if (!ctx->label) |
|
| 794 |
-+ ctx->label = aa_get_current_label(); |
|
| 795 |
-+} |
|
| 796 |
-+ |
|
| 797 |
- static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = {
|
|
| 798 |
- LSM_HOOK_INIT(ptrace_access_check, apparmor_ptrace_access_check), |
|
| 799 |
- LSM_HOOK_INIT(ptrace_traceme, apparmor_ptrace_traceme), |
|
| 800 |
-@@ -770,6 +1133,30 @@ static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = {
|
|
| 801 |
- LSM_HOOK_INIT(getprocattr, apparmor_getprocattr), |
|
| 802 |
- LSM_HOOK_INIT(setprocattr, apparmor_setprocattr), |
|
| 803 |
- |
|
| 804 |
-+ LSM_HOOK_INIT(sk_alloc_security, apparmor_sk_alloc_security), |
|
| 805 |
-+ LSM_HOOK_INIT(sk_free_security, apparmor_sk_free_security), |
|
| 806 |
-+ LSM_HOOK_INIT(sk_clone_security, apparmor_sk_clone_security), |
|
| 807 |
-+ |
|
| 808 |
-+ LSM_HOOK_INIT(socket_create, apparmor_socket_create), |
|
| 809 |
-+ LSM_HOOK_INIT(socket_post_create, apparmor_socket_post_create), |
|
| 810 |
-+ LSM_HOOK_INIT(socket_bind, apparmor_socket_bind), |
|
| 811 |
-+ LSM_HOOK_INIT(socket_connect, apparmor_socket_connect), |
|
| 812 |
-+ LSM_HOOK_INIT(socket_listen, apparmor_socket_listen), |
|
| 813 |
-+ LSM_HOOK_INIT(socket_accept, apparmor_socket_accept), |
|
| 814 |
-+ LSM_HOOK_INIT(socket_sendmsg, apparmor_socket_sendmsg), |
|
| 815 |
-+ LSM_HOOK_INIT(socket_recvmsg, apparmor_socket_recvmsg), |
|
| 816 |
-+ LSM_HOOK_INIT(socket_getsockname, apparmor_socket_getsockname), |
|
| 817 |
-+ LSM_HOOK_INIT(socket_getpeername, apparmor_socket_getpeername), |
|
| 818 |
-+ LSM_HOOK_INIT(socket_getsockopt, apparmor_socket_getsockopt), |
|
| 819 |
-+ LSM_HOOK_INIT(socket_setsockopt, apparmor_socket_setsockopt), |
|
| 820 |
-+ LSM_HOOK_INIT(socket_shutdown, apparmor_socket_shutdown), |
|
| 821 |
-+ LSM_HOOK_INIT(socket_sock_rcv_skb, apparmor_socket_sock_rcv_skb), |
|
| 822 |
-+ LSM_HOOK_INIT(socket_getpeersec_stream, |
|
| 823 |
-+ apparmor_socket_getpeersec_stream), |
|
| 824 |
-+ LSM_HOOK_INIT(socket_getpeersec_dgram, |
|
| 825 |
-+ apparmor_socket_getpeersec_dgram), |
|
| 826 |
-+ LSM_HOOK_INIT(sock_graft, apparmor_sock_graft), |
|
| 827 |
-+ |
|
| 828 |
- LSM_HOOK_INIT(cred_alloc_blank, apparmor_cred_alloc_blank), |
|
| 829 |
- LSM_HOOK_INIT(cred_free, apparmor_cred_free), |
|
| 830 |
- LSM_HOOK_INIT(cred_prepare, apparmor_cred_prepare), |
|
| 831 |
-diff --git a/security/apparmor/net.c b/security/apparmor/net.c |
|
| 832 |
-new file mode 100644 |
|
| 833 |
-index 000000000000..33d54435f8d6 |
|
| 834 |
-+++ b/security/apparmor/net.c |
|
| 835 |
-@@ -0,0 +1,184 @@ |
|
| 836 |
-+/* |
|
| 837 |
-+ * AppArmor security module |
|
| 838 |
-+ * |
|
| 839 |
-+ * This file contains AppArmor network mediation |
|
| 840 |
-+ * |
|
| 841 |
-+ * Copyright (C) 1998-2008 Novell/SUSE |
|
| 842 |
-+ * Copyright 2009-2017 Canonical Ltd. |
|
| 843 |
-+ * |
|
| 844 |
-+ * This program is free software; you can redistribute it and/or |
|
| 845 |
-+ * modify it under the terms of the GNU General Public License as |
|
| 846 |
-+ * published by the Free Software Foundation, version 2 of the |
|
| 847 |
-+ * License. |
|
| 848 |
-+ */ |
|
| 849 |
-+ |
|
| 850 |
-+#include "include/apparmor.h" |
|
| 851 |
-+#include "include/audit.h" |
|
| 852 |
-+#include "include/context.h" |
|
| 853 |
-+#include "include/label.h" |
|
| 854 |
-+#include "include/net.h" |
|
| 855 |
-+#include "include/policy.h" |
|
| 856 |
-+ |
|
| 857 |
-+#include "net_names.h" |
|
| 858 |
-+ |
|
| 859 |
-+ |
|
| 860 |
-+struct aa_sfs_entry aa_sfs_entry_network[] = {
|
|
| 861 |
-+ AA_SFS_FILE_STRING("af_mask", AA_SFS_AF_MASK),
|
|
| 862 |
-+ { }
|
|
| 863 |
-+}; |
|
| 864 |
-+ |
|
| 865 |
-+static const char * const net_mask_names[] = {
|
|
| 866 |
-+ "unknown", |
|
| 867 |
-+ "send", |
|
| 868 |
-+ "receive", |
|
| 869 |
-+ "unknown", |
|
| 870 |
-+ |
|
| 871 |
-+ "create", |
|
| 872 |
-+ "shutdown", |
|
| 873 |
-+ "connect", |
|
| 874 |
-+ "unknown", |
|
| 875 |
-+ |
|
| 876 |
-+ "setattr", |
|
| 877 |
-+ "getattr", |
|
| 878 |
-+ "setcred", |
|
| 879 |
-+ "getcred", |
|
| 880 |
-+ |
|
| 881 |
-+ "chmod", |
|
| 882 |
-+ "chown", |
|
| 883 |
-+ "chgrp", |
|
| 884 |
-+ "lock", |
|
| 885 |
-+ |
|
| 886 |
-+ "mmap", |
|
| 887 |
-+ "mprot", |
|
| 888 |
-+ "unknown", |
|
| 889 |
-+ "unknown", |
|
| 890 |
-+ |
|
| 891 |
-+ "accept", |
|
| 892 |
-+ "bind", |
|
| 893 |
-+ "listen", |
|
| 894 |
-+ "unknown", |
|
| 895 |
-+ |
|
| 896 |
-+ "setopt", |
|
| 897 |
-+ "getopt", |
|
| 898 |
-+ "unknown", |
|
| 899 |
-+ "unknown", |
|
| 900 |
-+ |
|
| 901 |
-+ "unknown", |
|
| 902 |
-+ "unknown", |
|
| 903 |
-+ "unknown", |
|
| 904 |
-+ "unknown", |
|
| 905 |
-+}; |
|
| 906 |
-+ |
|
| 907 |
-+ |
|
| 908 |
-+/* audit callback for net specific fields */ |
|
| 909 |
-+void audit_net_cb(struct audit_buffer *ab, void *va) |
|
| 910 |
-+{
|
|
| 911 |
-+ struct common_audit_data *sa = va; |
|
| 912 |
-+ |
|
| 913 |
-+ audit_log_format(ab, " family="); |
|
| 914 |
-+ if (address_family_names[sa->u.net->family]) |
|
| 915 |
-+ audit_log_string(ab, address_family_names[sa->u.net->family]); |
|
| 916 |
-+ else |
|
| 917 |
-+ audit_log_format(ab, "\"unknown(%d)\"", sa->u.net->family); |
|
| 918 |
-+ audit_log_format(ab, " sock_type="); |
|
| 919 |
-+ if (sock_type_names[aad(sa)->net.type]) |
|
| 920 |
-+ audit_log_string(ab, sock_type_names[aad(sa)->net.type]); |
|
| 921 |
-+ else |
|
| 922 |
-+ audit_log_format(ab, "\"unknown(%d)\"", aad(sa)->net.type); |
|
| 923 |
-+ audit_log_format(ab, " protocol=%d", aad(sa)->net.protocol); |
|
| 924 |
-+ |
|
| 925 |
-+ if (aad(sa)->request & NET_PERMS_MASK) {
|
|
| 926 |
-+ audit_log_format(ab, " requested_mask="); |
|
| 927 |
-+ aa_audit_perm_mask(ab, aad(sa)->request, NULL, 0, |
|
| 928 |
-+ net_mask_names, NET_PERMS_MASK); |
|
| 929 |
-+ |
|
| 930 |
-+ if (aad(sa)->denied & NET_PERMS_MASK) {
|
|
| 931 |
-+ audit_log_format(ab, " denied_mask="); |
|
| 932 |
-+ aa_audit_perm_mask(ab, aad(sa)->denied, NULL, 0, |
|
| 933 |
-+ net_mask_names, NET_PERMS_MASK); |
|
| 934 |
-+ } |
|
| 935 |
-+ } |
|
| 936 |
-+ if (aad(sa)->peer) {
|
|
| 937 |
-+ audit_log_format(ab, " peer="); |
|
| 938 |
-+ aa_label_xaudit(ab, labels_ns(aad(sa)->label), aad(sa)->peer, |
|
| 939 |
-+ FLAGS_NONE, GFP_ATOMIC); |
|
| 940 |
-+ } |
|
| 941 |
-+} |
|
| 942 |
-+ |
|
| 943 |
-+ |
|
| 944 |
-+/* Generic af perm */ |
|
| 945 |
-+int aa_profile_af_perm(struct aa_profile *profile, struct common_audit_data *sa, |
|
| 946 |
-+ u32 request, u16 family, int type) |
|
| 947 |
-+{
|
|
| 948 |
-+ struct aa_perms perms = { };
|
|
| 949 |
-+ |
|
| 950 |
-+ AA_BUG(family >= AF_MAX); |
|
| 951 |
-+ AA_BUG(type < 0 || type >= SOCK_MAX); |
|
| 952 |
-+ |
|
| 953 |
-+ if (profile_unconfined(profile)) |
|
| 954 |
-+ return 0; |
|
| 955 |
-+ |
|
| 956 |
-+ perms.allow = (profile->net.allow[family] & (1 << type)) ? |
|
| 957 |
-+ ALL_PERMS_MASK : 0; |
|
| 958 |
-+ perms.audit = (profile->net.audit[family] & (1 << type)) ? |
|
| 959 |
-+ ALL_PERMS_MASK : 0; |
|
| 960 |
-+ perms.quiet = (profile->net.quiet[family] & (1 << type)) ? |
|
| 961 |
-+ ALL_PERMS_MASK : 0; |
|
| 962 |
-+ aa_apply_modes_to_perms(profile, &perms); |
|
| 963 |
-+ |
|
| 964 |
-+ return aa_check_perms(profile, &perms, request, sa, audit_net_cb); |
|
| 965 |
-+} |
|
| 966 |
-+ |
|
| 967 |
-+int aa_af_perm(struct aa_label *label, const char *op, u32 request, u16 family, |
|
| 968 |
-+ int type, int protocol) |
|
| 969 |
-+{
|
|
| 970 |
-+ struct aa_profile *profile; |
|
| 971 |
-+ DEFINE_AUDIT_NET(sa, op, NULL, family, type, protocol); |
|
| 972 |
-+ |
|
| 973 |
-+ return fn_for_each_confined(label, profile, |
|
| 974 |
-+ aa_profile_af_perm(profile, &sa, request, family, |
|
| 975 |
-+ type)); |
|
| 976 |
-+} |
|
| 977 |
-+ |
|
| 978 |
-+static int aa_label_sk_perm(struct aa_label *label, const char *op, u32 request, |
|
| 979 |
-+ struct sock *sk) |
|
| 980 |
-+{
|
|
| 981 |
-+ struct aa_profile *profile; |
|
| 982 |
-+ DEFINE_AUDIT_SK(sa, op, sk); |
|
| 983 |
-+ |
|
| 984 |
-+ AA_BUG(!label); |
|
| 985 |
-+ AA_BUG(!sk); |
|
| 986 |
-+ |
|
| 987 |
-+ if (unconfined(label)) |
|
| 988 |
-+ return 0; |
|
| 989 |
-+ |
|
| 990 |
-+ return fn_for_each_confined(label, profile, |
|
| 991 |
-+ aa_profile_af_sk_perm(profile, &sa, request, sk)); |
|
| 992 |
-+} |
|
| 993 |
-+ |
|
| 994 |
-+int aa_sk_perm(const char *op, u32 request, struct sock *sk) |
|
| 995 |
-+{
|
|
| 996 |
-+ struct aa_label *label; |
|
| 997 |
-+ int error; |
|
| 998 |
-+ |
|
| 999 |
-+ AA_BUG(!sk); |
|
| 1000 |
-+ AA_BUG(in_interrupt()); |
|
| 1001 |
-+ |
|
| 1002 |
-+ /* TODO: switch to begin_current_label ???? */ |
|
| 1003 |
-+ label = begin_current_label_crit_section(); |
|
| 1004 |
-+ error = aa_label_sk_perm(label, op, request, sk); |
|
| 1005 |
-+ end_current_label_crit_section(label); |
|
| 1006 |
-+ |
|
| 1007 |
-+ return error; |
|
| 1008 |
-+} |
|
| 1009 |
-+ |
|
| 1010 |
-+ |
|
| 1011 |
-+int aa_sock_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 1012 |
-+ struct socket *sock) |
|
| 1013 |
-+{
|
|
| 1014 |
-+ AA_BUG(!label); |
|
| 1015 |
-+ AA_BUG(!sock); |
|
| 1016 |
-+ AA_BUG(!sock->sk); |
|
| 1017 |
-+ |
|
| 1018 |
-+ return aa_label_sk_perm(label, op, request, sock->sk); |
|
| 1019 |
-+} |
|
| 1020 |
-diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c |
|
| 1021 |
-index 4ede87c30f8b..e348f8dec45d 100644 |
|
| 1022 |
-+++ b/security/apparmor/policy_unpack.c |
|
| 1023 |
-@@ -275,6 +275,19 @@ static bool unpack_nameX(struct aa_ext *e, enum aa_code code, const char *name) |
|
| 1024 |
- return 0; |
|
| 1025 |
- } |
|
| 1026 |
- |
|
| 1027 |
-+static bool unpack_u16(struct aa_ext *e, u16 *data, const char *name) |
|
| 1028 |
-+{
|
|
| 1029 |
-+ if (unpack_nameX(e, AA_U16, name)) {
|
|
| 1030 |
-+ if (!inbounds(e, sizeof(u16))) |
|
| 1031 |
-+ return 0; |
|
| 1032 |
-+ if (data) |
|
| 1033 |
-+ *data = le16_to_cpu(get_unaligned((__le16 *) e->pos)); |
|
| 1034 |
-+ e->pos += sizeof(u16); |
|
| 1035 |
-+ return 1; |
|
| 1036 |
-+ } |
|
| 1037 |
-+ return 0; |
|
| 1038 |
-+} |
|
| 1039 |
-+ |
|
| 1040 |
- static bool unpack_u32(struct aa_ext *e, u32 *data, const char *name) |
|
| 1041 |
- {
|
|
| 1042 |
- if (unpack_nameX(e, AA_U32, name)) {
|
|
| 1043 |
-@@ -584,7 +597,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) |
|
| 1044 |
- struct aa_profile *profile = NULL; |
|
| 1045 |
- const char *tmpname, *tmpns = NULL, *name = NULL; |
|
| 1046 |
- const char *info = "failed to unpack profile"; |
|
| 1047 |
-- size_t ns_len; |
|
| 1048 |
-+ size_t size = 0, ns_len; |
|
| 1049 |
- struct rhashtable_params params = { 0 };
|
|
| 1050 |
- char *key = NULL; |
|
| 1051 |
- struct aa_data *data; |
|
| 1052 |
-@@ -717,6 +730,42 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name) |
|
| 1053 |
- goto fail; |
|
| 1054 |
- } |
|
| 1055 |
- |
|
| 1056 |
-+ size = unpack_array(e, "net_allowed_af"); |
|
| 1057 |
-+ if (size) {
|
|
| 1058 |
-+ |
|
| 1059 |
-+ for (i = 0; i < size; i++) {
|
|
| 1060 |
-+ /* discard extraneous rules that this kernel will |
|
| 1061 |
-+ * never request |
|
| 1062 |
-+ */ |
|
| 1063 |
-+ if (i >= AF_MAX) {
|
|
| 1064 |
-+ u16 tmp; |
|
| 1065 |
-+ |
|
| 1066 |
-+ if (!unpack_u16(e, &tmp, NULL) || |
|
| 1067 |
-+ !unpack_u16(e, &tmp, NULL) || |
|
| 1068 |
-+ !unpack_u16(e, &tmp, NULL)) |
|
| 1069 |
-+ goto fail; |
|
| 1070 |
-+ continue; |
|
| 1071 |
-+ } |
|
| 1072 |
-+ if (!unpack_u16(e, &profile->net.allow[i], NULL)) |
|
| 1073 |
-+ goto fail; |
|
| 1074 |
-+ if (!unpack_u16(e, &profile->net.audit[i], NULL)) |
|
| 1075 |
-+ goto fail; |
|
| 1076 |
-+ if (!unpack_u16(e, &profile->net.quiet[i], NULL)) |
|
| 1077 |
-+ goto fail; |
|
| 1078 |
-+ } |
|
| 1079 |
-+ if (!unpack_nameX(e, AA_ARRAYEND, NULL)) |
|
| 1080 |
-+ goto fail; |
|
| 1081 |
-+ } else {
|
|
| 1082 |
-+ /* support policy pre AF socket mediation */ |
|
| 1083 |
-+ for (i = 0; i < AF_MAX; i++) |
|
| 1084 |
-+ profile->net.allow[i] = 0xffff; |
|
| 1085 |
-+ } |
|
| 1086 |
-+ if (VERSION_LT(e->version, v7)) {
|
|
| 1087 |
-+ /* pre v7 policy always allowed these */ |
|
| 1088 |
-+ profile->net.allow[AF_UNIX] = 0xffff; |
|
| 1089 |
-+ profile->net.allow[AF_NETLINK] = 0xffff; |
|
| 1090 |
-+ } |
|
| 1091 |
-+ |
|
| 1092 |
- if (unpack_nameX(e, AA_STRUCT, "policydb")) {
|
|
| 1093 |
- /* generic policy dfa - optional and may be NULL */ |
|
| 1094 |
- info = "failed to unpack policydb"; |
|
| 1095 |
-2.14.1 |
|
| 1096 |
- |
| 1097 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,138 +0,0 @@ |
| 1 |
-From 0fd09a9a3418124e59cded88699d4c6bcdb811b2 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: "Srivatsa S. Bhat" <srivatsa@csail.mit.edu> |
|
| 3 |
-Date: Tue, 18 Sep 2018 18:33:06 -0700 |
|
| 4 |
-Subject: [PATCH] hwrng: rdrand - Add RNG driver based on x86 rdrand |
|
| 5 |
- instruction |
|
| 6 |
- |
|
| 7 |
-Add a Hardware Random Number Generator driver, which uses the |
|
| 8 |
-rdrand/rdseed instructions available on modern Intel and AMD CPUs. |
|
| 9 |
- |
|
| 10 |
-This can be used to feed the kernel's entropy pool on entropy-starved |
|
| 11 |
-virtual machines. |
|
| 12 |
- |
|
| 13 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 14 |
- drivers/char/hw_random/Kconfig | 14 ++++++++ |
|
| 15 |
- drivers/char/hw_random/Makefile | 1 + |
|
| 16 |
- drivers/char/hw_random/rdrand-rng.c | 72 +++++++++++++++++++++++++++++++++++++ |
|
| 17 |
- 3 files changed, 87 insertions(+) |
|
| 18 |
- create mode 100644 drivers/char/hw_random/rdrand-rng.c |
|
| 19 |
- |
|
| 20 |
-diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig |
|
| 21 |
-index 95a031e..c7e7ce7 100644 |
|
| 22 |
-+++ b/drivers/char/hw_random/Kconfig |
|
| 23 |
-@@ -60,6 +60,20 @@ config HW_RANDOM_AMD |
|
| 24 |
- |
|
| 25 |
- If unsure, say Y. |
|
| 26 |
- |
|
| 27 |
-+config HW_RANDOM_RDRAND |
|
| 28 |
-+ tristate "x86 rdrand Random Number Generator support" |
|
| 29 |
-+ depends on (X86_32 || X86_64) && ARCH_RANDOM |
|
| 30 |
-+ default HW_RANDOM |
|
| 31 |
-+ ---help--- |
|
| 32 |
-+ This driver provides kernel-side support for a Random Number |
|
| 33 |
-+ Generator that uses the RDRAND/RDSEED instructions on modern Intel |
|
| 34 |
-+ and AMD CPUs. |
|
| 35 |
-+ |
|
| 36 |
-+ To compile this driver as a module, choose M here: the |
|
| 37 |
-+ module will be called rdrand-rng. |
|
| 38 |
-+ |
|
| 39 |
-+ If unsure, say N. |
|
| 40 |
-+ |
|
| 41 |
- config HW_RANDOM_ATMEL |
|
| 42 |
- tristate "Atmel Random Number Generator support" |
|
| 43 |
- depends on ARCH_AT91 && HAVE_CLK && OF |
|
| 44 |
-diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile |
|
| 45 |
-index f3728d0..c677d3a 100644 |
|
| 46 |
-+++ b/drivers/char/hw_random/Makefile |
|
| 47 |
-@@ -8,6 +8,7 @@ rng-core-y := core.o |
|
| 48 |
- obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o |
|
| 49 |
- obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o |
|
| 50 |
- obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o |
|
| 51 |
-+obj-$(CONFIG_HW_RANDOM_RDRAND) += rdrand-rng.o |
|
| 52 |
- obj-$(CONFIG_HW_RANDOM_ATMEL) += atmel-rng.o |
|
| 53 |
- obj-$(CONFIG_HW_RANDOM_BCM63XX) += bcm63xx-rng.o |
|
| 54 |
- obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o |
|
| 55 |
-diff --git a/drivers/char/hw_random/rdrand-rng.c b/drivers/char/hw_random/rdrand-rng.c |
|
| 56 |
-new file mode 100644 |
|
| 57 |
-index 0000000..ba017f3 |
|
| 58 |
-+++ b/drivers/char/hw_random/rdrand-rng.c |
|
| 59 |
-@@ -0,0 +1,72 @@ |
|
| 60 |
-+// SPDX-License-Identifier: GPL-2.0 |
|
| 61 |
-+/* |
|
| 62 |
-+ * RNG driver that uses the RDRAND/RDSEED instructions (found on modern |
|
| 63 |
-+ * Intel and AMD CPUs). |
|
| 64 |
-+ * |
|
| 65 |
-+ * Author: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 66 |
-+ * |
|
| 67 |
-+ */ |
|
| 68 |
-+ |
|
| 69 |
-+#include <linux/hw_random.h> |
|
| 70 |
-+#include <linux/kernel.h> |
|
| 71 |
-+#include <linux/module.h> |
|
| 72 |
-+#include <asm/archrandom.h> |
|
| 73 |
-+ |
|
| 74 |
-+#define PFX KBUILD_MODNAME ": " |
|
| 75 |
-+ |
|
| 76 |
-+static int rdrand_rng_read(struct hwrng *rng, void *buf, size_t max_bytes, bool wait) |
|
| 77 |
-+{
|
|
| 78 |
-+ char *p = buf; |
|
| 79 |
-+ size_t read_bytes = 0; |
|
| 80 |
-+ |
|
| 81 |
-+ while (max_bytes) {
|
|
| 82 |
-+ unsigned long v; |
|
| 83 |
-+ size_t chunk = min(max_bytes, (int)sizeof(unsigned long)); |
|
| 84 |
-+ |
|
| 85 |
-+ if (unlikely(!arch_get_random_seed_long(&v)) && |
|
| 86 |
-+ unlikely(!arch_get_random_long(&v))) {
|
|
| 87 |
-+ break; |
|
| 88 |
-+ } |
|
| 89 |
-+ |
|
| 90 |
-+ memcpy(p, &v, chunk); |
|
| 91 |
-+ p += chunk; |
|
| 92 |
-+ max_bytes -= chunk; |
|
| 93 |
-+ read_bytes += chunk; |
|
| 94 |
-+ } |
|
| 95 |
-+ |
|
| 96 |
-+ return read_bytes; |
|
| 97 |
-+} |
|
| 98 |
-+ |
|
| 99 |
-+static struct hwrng rdrand_rng = {
|
|
| 100 |
-+ .name = KBUILD_MODNAME, |
|
| 101 |
-+ .quality = 1000, |
|
| 102 |
-+ .read = rdrand_rng_read, |
|
| 103 |
-+}; |
|
| 104 |
-+ |
|
| 105 |
-+static int __init mod_init(void) |
|
| 106 |
-+{
|
|
| 107 |
-+ int err = -ENODEV; |
|
| 108 |
-+ |
|
| 109 |
-+ if (!arch_has_random_seed() && !arch_has_random()) {
|
|
| 110 |
-+ pr_err(PFX "Neither RDSEED nor RDRAND is available.\n"); |
|
| 111 |
-+ return err; |
|
| 112 |
-+ } |
|
| 113 |
-+ |
|
| 114 |
-+ err = hwrng_register(&rdrand_rng); |
|
| 115 |
-+ if (err) |
|
| 116 |
-+ pr_err(PFX "RNG registration failed (%d)\n", err); |
|
| 117 |
-+ |
|
| 118 |
-+ return err; |
|
| 119 |
-+} |
|
| 120 |
-+ |
|
| 121 |
-+static void __exit mod_exit(void) |
|
| 122 |
-+{
|
|
| 123 |
-+ hwrng_unregister(&rdrand_rng); |
|
| 124 |
-+} |
|
| 125 |
-+ |
|
| 126 |
-+module_init(mod_init); |
|
| 127 |
-+module_exit(mod_exit); |
|
| 128 |
-+ |
|
| 129 |
-+MODULE_AUTHOR("Srivatsa S. Bhat <srivatsa@csail.mit.edu>");
|
|
| 130 |
-+MODULE_DESCRIPTION("H/W RNG driver for x86 CPUs that support RDRAND/RDSEED");
|
|
| 131 |
-+MODULE_LICENSE("GPL");
|
|
| 132 |
-2.7.4 |
|
| 133 |
- |
| 134 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,1395 +0,0 @@ |
| 1 |
-From 2e7f6d0dc0f1d3642950f529b451af73fa1baf9c Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: John Johansen <john.johansen@canonical.com> |
|
| 3 |
-Date: Tue, 18 Jul 2017 23:27:23 -0700 |
|
| 4 |
-Subject: [PATCH 2/2] apparmor: af_unix mediation |
|
| 5 |
- |
|
| 6 |
-af_socket mediation did not make it into 4.14 so add remaining out |
|
| 7 |
-of tree patch |
|
| 8 |
- |
|
| 9 |
-Signed-off-by: John Johansen <john.johansen@canonical.com> |
|
| 10 |
-Signed-off-by: Seth Forshee <seth.forshee@canonical.com> |
|
| 11 |
- security/apparmor/Makefile | 3 +- |
|
| 12 |
- security/apparmor/af_unix.c | 651 ++++++++++++++++++++++++++++++++++++ |
|
| 13 |
- security/apparmor/apparmorfs.c | 6 + |
|
| 14 |
- security/apparmor/file.c | 4 +- |
|
| 15 |
- security/apparmor/include/af_unix.h | 114 +++++++ |
|
| 16 |
- security/apparmor/include/net.h | 16 +- |
|
| 17 |
- security/apparmor/include/path.h | 1 + |
|
| 18 |
- security/apparmor/include/policy.h | 2 +- |
|
| 19 |
- security/apparmor/lsm.c | 169 ++++++---- |
|
| 20 |
- security/apparmor/net.c | 174 +++++++++- |
|
| 21 |
- 10 files changed, 1072 insertions(+), 68 deletions(-) |
|
| 22 |
- create mode 100644 security/apparmor/af_unix.c |
|
| 23 |
- create mode 100644 security/apparmor/include/af_unix.h |
|
| 24 |
- |
|
| 25 |
-diff --git a/security/apparmor/Makefile b/security/apparmor/Makefile |
|
| 26 |
-index e7ff2183532a..90c118f39e13 100644 |
|
| 27 |
-+++ b/security/apparmor/Makefile |
|
| 28 |
-@@ -5,7 +5,8 @@ obj-$(CONFIG_SECURITY_APPARMOR) += apparmor.o |
|
| 29 |
- |
|
| 30 |
- apparmor-y := apparmorfs.o audit.o capability.o context.o ipc.o lib.o match.o \ |
|
| 31 |
- path.o domain.o policy.o policy_unpack.o procattr.o lsm.o \ |
|
| 32 |
-- resource.o secid.o file.o policy_ns.o label.o mount.o net.o |
|
| 33 |
-+ resource.o secid.o file.o policy_ns.o label.o mount.o net.o \ |
|
| 34 |
-+ af_unix.o |
|
| 35 |
- apparmor-$(CONFIG_SECURITY_APPARMOR_HASH) += crypto.o |
|
| 36 |
- |
|
| 37 |
- clean-files := capability_names.h rlim_names.h net_names.h |
|
| 38 |
-diff --git a/security/apparmor/af_unix.c b/security/apparmor/af_unix.c |
|
| 39 |
-new file mode 100644 |
|
| 40 |
-index 000000000000..c6876db2dbde |
|
| 41 |
-+++ b/security/apparmor/af_unix.c |
|
| 42 |
-@@ -0,0 +1,651 @@ |
|
| 43 |
-+/* |
|
| 44 |
-+ * AppArmor security module |
|
| 45 |
-+ * |
|
| 46 |
-+ * This file contains AppArmor af_unix fine grained mediation |
|
| 47 |
-+ * |
|
| 48 |
-+ * Copyright 2014 Canonical Ltd. |
|
| 49 |
-+ * |
|
| 50 |
-+ * This program is free software; you can redistribute it and/or |
|
| 51 |
-+ * modify it under the terms of the GNU General Public License as |
|
| 52 |
-+ * published by the Free Software Foundation, version 2 of the |
|
| 53 |
-+ * License. |
|
| 54 |
-+ */ |
|
| 55 |
-+ |
|
| 56 |
-+#include <net/tcp_states.h> |
|
| 57 |
-+ |
|
| 58 |
-+#include "include/af_unix.h" |
|
| 59 |
-+#include "include/apparmor.h" |
|
| 60 |
-+#include "include/context.h" |
|
| 61 |
-+#include "include/file.h" |
|
| 62 |
-+#include "include/label.h" |
|
| 63 |
-+#include "include/path.h" |
|
| 64 |
-+#include "include/policy.h" |
|
| 65 |
-+ |
|
| 66 |
-+static inline struct sock *aa_sock(struct unix_sock *u) |
|
| 67 |
-+{
|
|
| 68 |
-+ return &u->sk; |
|
| 69 |
-+} |
|
| 70 |
-+ |
|
| 71 |
-+static inline int unix_fs_perm(const char *op, u32 mask, struct aa_label *label, |
|
| 72 |
-+ struct unix_sock *u, int flags) |
|
| 73 |
-+{
|
|
| 74 |
-+ AA_BUG(!label); |
|
| 75 |
-+ AA_BUG(!u); |
|
| 76 |
-+ AA_BUG(!UNIX_FS(aa_sock(u))); |
|
| 77 |
-+ |
|
| 78 |
-+ if (unconfined(label) || !LABEL_MEDIATES(label, AA_CLASS_FILE)) |
|
| 79 |
-+ return 0; |
|
| 80 |
-+ |
|
| 81 |
-+ mask &= NET_FS_PERMS; |
|
| 82 |
-+ if (!u->path.dentry) {
|
|
| 83 |
-+ struct path_cond cond = { };
|
|
| 84 |
-+ struct aa_perms perms = { };
|
|
| 85 |
-+ struct aa_profile *profile; |
|
| 86 |
-+ |
|
| 87 |
-+ /* socket path has been cleared because it is being shutdown |
|
| 88 |
-+ * can only fall back to original sun_path request |
|
| 89 |
-+ */ |
|
| 90 |
-+ struct aa_sk_ctx *ctx = SK_CTX(&u->sk); |
|
| 91 |
-+ if (ctx->path.dentry) |
|
| 92 |
-+ return aa_path_perm(op, label, &ctx->path, flags, mask, |
|
| 93 |
-+ &cond); |
|
| 94 |
-+ return fn_for_each_confined(label, profile, |
|
| 95 |
-+ ((flags | profile->path_flags) & PATH_MEDIATE_DELETED) ? |
|
| 96 |
-+ __aa_path_perm(op, profile, |
|
| 97 |
-+ u->addr->name->sun_path, mask, |
|
| 98 |
-+ &cond, flags, &perms) : |
|
| 99 |
-+ aa_audit_file(profile, &nullperms, op, mask, |
|
| 100 |
-+ u->addr->name->sun_path, NULL, |
|
| 101 |
-+ NULL, cond.uid, |
|
| 102 |
-+ "Failed name lookup - " |
|
| 103 |
-+ "deleted entry", -EACCES)); |
|
| 104 |
-+ } else {
|
|
| 105 |
-+ /* the sunpath may not be valid for this ns so use the path */ |
|
| 106 |
-+ struct path_cond cond = { u->path.dentry->d_inode->i_uid,
|
|
| 107 |
-+ u->path.dentry->d_inode->i_mode |
|
| 108 |
-+ }; |
|
| 109 |
-+ |
|
| 110 |
-+ return aa_path_perm(op, label, &u->path, flags, mask, &cond); |
|
| 111 |
-+ } |
|
| 112 |
-+ |
|
| 113 |
-+ return 0; |
|
| 114 |
-+} |
|
| 115 |
-+ |
|
| 116 |
-+/* passing in state returned by PROFILE_MEDIATES_AF */ |
|
| 117 |
-+static unsigned int match_to_prot(struct aa_profile *profile, |
|
| 118 |
-+ unsigned int state, int type, int protocol, |
|
| 119 |
-+ const char **info) |
|
| 120 |
-+{
|
|
| 121 |
-+ __be16 buffer[2]; |
|
| 122 |
-+ buffer[0] = cpu_to_be16(type); |
|
| 123 |
-+ buffer[1] = cpu_to_be16(protocol); |
|
| 124 |
-+ state = aa_dfa_match_len(profile->policy.dfa, state, (char *) &buffer, |
|
| 125 |
-+ 4); |
|
| 126 |
-+ if (!state) |
|
| 127 |
-+ *info = "failed type and protocol match"; |
|
| 128 |
-+ return state; |
|
| 129 |
-+} |
|
| 130 |
-+ |
|
| 131 |
-+static unsigned int match_addr(struct aa_profile *profile, unsigned int state, |
|
| 132 |
-+ struct sockaddr_un *addr, int addrlen) |
|
| 133 |
-+{
|
|
| 134 |
-+ if (addr) |
|
| 135 |
-+ /* include leading \0 */ |
|
| 136 |
-+ state = aa_dfa_match_len(profile->policy.dfa, state, |
|
| 137 |
-+ addr->sun_path, |
|
| 138 |
-+ unix_addr_len(addrlen)); |
|
| 139 |
-+ else |
|
| 140 |
-+ /* anonymous end point */ |
|
| 141 |
-+ state = aa_dfa_match_len(profile->policy.dfa, state, "\x01", |
|
| 142 |
-+ 1); |
|
| 143 |
-+ /* todo change to out of band */ |
|
| 144 |
-+ state = aa_dfa_null_transition(profile->policy.dfa, state); |
|
| 145 |
-+ return state; |
|
| 146 |
-+} |
|
| 147 |
-+ |
|
| 148 |
-+static unsigned int match_to_local(struct aa_profile *profile, |
|
| 149 |
-+ unsigned int state, int type, int protocol, |
|
| 150 |
-+ struct sockaddr_un *addr, int addrlen, |
|
| 151 |
-+ const char **info) |
|
| 152 |
-+{
|
|
| 153 |
-+ state = match_to_prot(profile, state, type, protocol, info); |
|
| 154 |
-+ if (state) {
|
|
| 155 |
-+ state = match_addr(profile, state, addr, addrlen); |
|
| 156 |
-+ if (state) {
|
|
| 157 |
-+ /* todo: local label matching */ |
|
| 158 |
-+ state = aa_dfa_null_transition(profile->policy.dfa, |
|
| 159 |
-+ state); |
|
| 160 |
-+ if (!state) |
|
| 161 |
-+ *info = "failed local label match"; |
|
| 162 |
-+ } else |
|
| 163 |
-+ *info = "failed local address match"; |
|
| 164 |
-+ } |
|
| 165 |
-+ |
|
| 166 |
-+ return state; |
|
| 167 |
-+} |
|
| 168 |
-+ |
|
| 169 |
-+static unsigned int match_to_sk(struct aa_profile *profile, |
|
| 170 |
-+ unsigned int state, struct unix_sock *u, |
|
| 171 |
-+ const char **info) |
|
| 172 |
-+{
|
|
| 173 |
-+ struct sockaddr_un *addr = NULL; |
|
| 174 |
-+ int addrlen = 0; |
|
| 175 |
-+ |
|
| 176 |
-+ if (u->addr) {
|
|
| 177 |
-+ addr = u->addr->name; |
|
| 178 |
-+ addrlen = u->addr->len; |
|
| 179 |
-+ } |
|
| 180 |
-+ |
|
| 181 |
-+ return match_to_local(profile, state, u->sk.sk_type, u->sk.sk_protocol, |
|
| 182 |
-+ addr, addrlen, info); |
|
| 183 |
-+} |
|
| 184 |
-+ |
|
| 185 |
-+#define CMD_ADDR 1 |
|
| 186 |
-+#define CMD_LISTEN 2 |
|
| 187 |
-+#define CMD_OPT 4 |
|
| 188 |
-+ |
|
| 189 |
-+static inline unsigned int match_to_cmd(struct aa_profile *profile, |
|
| 190 |
-+ unsigned int state, struct unix_sock *u, |
|
| 191 |
-+ char cmd, const char **info) |
|
| 192 |
-+{
|
|
| 193 |
-+ state = match_to_sk(profile, state, u, info); |
|
| 194 |
-+ if (state) {
|
|
| 195 |
-+ state = aa_dfa_match_len(profile->policy.dfa, state, &cmd, 1); |
|
| 196 |
-+ if (!state) |
|
| 197 |
-+ *info = "failed cmd selection match"; |
|
| 198 |
-+ } |
|
| 199 |
-+ |
|
| 200 |
-+ return state; |
|
| 201 |
-+} |
|
| 202 |
-+ |
|
| 203 |
-+static inline unsigned int match_to_peer(struct aa_profile *profile, |
|
| 204 |
-+ unsigned int state, |
|
| 205 |
-+ struct unix_sock *u, |
|
| 206 |
-+ struct sockaddr_un *peer_addr, |
|
| 207 |
-+ int peer_addrlen, |
|
| 208 |
-+ const char **info) |
|
| 209 |
-+{
|
|
| 210 |
-+ state = match_to_cmd(profile, state, u, CMD_ADDR, info); |
|
| 211 |
-+ if (state) {
|
|
| 212 |
-+ state = match_addr(profile, state, peer_addr, peer_addrlen); |
|
| 213 |
-+ if (!state) |
|
| 214 |
-+ *info = "failed peer address match"; |
|
| 215 |
-+ } |
|
| 216 |
-+ return state; |
|
| 217 |
-+} |
|
| 218 |
-+ |
|
| 219 |
-+static int do_perms(struct aa_profile *profile, unsigned int state, u32 request, |
|
| 220 |
-+ struct common_audit_data *sa) |
|
| 221 |
-+{
|
|
| 222 |
-+ struct aa_perms perms; |
|
| 223 |
-+ |
|
| 224 |
-+ AA_BUG(!profile); |
|
| 225 |
-+ |
|
| 226 |
-+ aa_compute_perms(profile->policy.dfa, state, &perms); |
|
| 227 |
-+ aa_apply_modes_to_perms(profile, &perms); |
|
| 228 |
-+ return aa_check_perms(profile, &perms, request, sa, |
|
| 229 |
-+ audit_net_cb); |
|
| 230 |
-+} |
|
| 231 |
-+ |
|
| 232 |
-+static int match_label(struct aa_profile *profile, struct aa_profile *peer, |
|
| 233 |
-+ unsigned int state, u32 request, |
|
| 234 |
-+ struct common_audit_data *sa) |
|
| 235 |
-+{
|
|
| 236 |
-+ AA_BUG(!profile); |
|
| 237 |
-+ AA_BUG(!peer); |
|
| 238 |
-+ |
|
| 239 |
-+ aad(sa)->peer = &peer->label; |
|
| 240 |
-+ |
|
| 241 |
-+ if (state) {
|
|
| 242 |
-+ state = aa_dfa_match(profile->policy.dfa, state, |
|
| 243 |
-+ peer->base.hname); |
|
| 244 |
-+ if (!state) |
|
| 245 |
-+ aad(sa)->info = "failed peer label match"; |
|
| 246 |
-+ } |
|
| 247 |
-+ return do_perms(profile, state, request, sa); |
|
| 248 |
-+} |
|
| 249 |
-+ |
|
| 250 |
-+ |
|
| 251 |
-+/* unix sock creation comes before we know if the socket will be an fs |
|
| 252 |
-+ * socket |
|
| 253 |
-+ * v6 - semantics are handled by mapping in profile load |
|
| 254 |
-+ * v7 - semantics require sock create for tasks creating an fs socket. |
|
| 255 |
-+ */ |
|
| 256 |
-+static int profile_create_perm(struct aa_profile *profile, int family, |
|
| 257 |
-+ int type, int protocol) |
|
| 258 |
-+{
|
|
| 259 |
-+ unsigned int state; |
|
| 260 |
-+ DEFINE_AUDIT_NET(sa, OP_CREATE, NULL, family, type, protocol); |
|
| 261 |
-+ |
|
| 262 |
-+ AA_BUG(!profile); |
|
| 263 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 264 |
-+ |
|
| 265 |
-+ if ((state = PROFILE_MEDIATES_AF(profile, AF_UNIX))) {
|
|
| 266 |
-+ state = match_to_prot(profile, state, type, protocol, |
|
| 267 |
-+ &aad(&sa)->info); |
|
| 268 |
-+ return do_perms(profile, state, AA_MAY_CREATE, &sa); |
|
| 269 |
-+ } |
|
| 270 |
-+ |
|
| 271 |
-+ return aa_profile_af_perm(profile, &sa, AA_MAY_CREATE, family, type); |
|
| 272 |
-+} |
|
| 273 |
-+ |
|
| 274 |
-+int aa_unix_create_perm(struct aa_label *label, int family, int type, |
|
| 275 |
-+ int protocol) |
|
| 276 |
-+{
|
|
| 277 |
-+ struct aa_profile *profile; |
|
| 278 |
-+ |
|
| 279 |
-+ if (unconfined(label)) |
|
| 280 |
-+ return 0; |
|
| 281 |
-+ |
|
| 282 |
-+ return fn_for_each_confined(label, profile, |
|
| 283 |
-+ profile_create_perm(profile, family, type, protocol)); |
|
| 284 |
-+} |
|
| 285 |
-+ |
|
| 286 |
-+ |
|
| 287 |
-+static inline int profile_sk_perm(struct aa_profile *profile, const char *op, |
|
| 288 |
-+ u32 request, struct sock *sk) |
|
| 289 |
-+{
|
|
| 290 |
-+ unsigned int state; |
|
| 291 |
-+ DEFINE_AUDIT_SK(sa, op, sk); |
|
| 292 |
-+ |
|
| 293 |
-+ AA_BUG(!profile); |
|
| 294 |
-+ AA_BUG(!sk); |
|
| 295 |
-+ AA_BUG(UNIX_FS(sk)); |
|
| 296 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 297 |
-+ |
|
| 298 |
-+ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); |
|
| 299 |
-+ if (state) {
|
|
| 300 |
-+ state = match_to_sk(profile, state, unix_sk(sk), |
|
| 301 |
-+ &aad(&sa)->info); |
|
| 302 |
-+ return do_perms(profile, state, request, &sa); |
|
| 303 |
-+ } |
|
| 304 |
-+ |
|
| 305 |
-+ return aa_profile_af_sk_perm(profile, &sa, request, sk); |
|
| 306 |
-+} |
|
| 307 |
-+ |
|
| 308 |
-+int aa_unix_label_sk_perm(struct aa_label *label, const char *op, u32 request, |
|
| 309 |
-+ struct sock *sk) |
|
| 310 |
-+{
|
|
| 311 |
-+ struct aa_profile *profile; |
|
| 312 |
-+ |
|
| 313 |
-+ return fn_for_each_confined(label, profile, |
|
| 314 |
-+ profile_sk_perm(profile, op, request, sk)); |
|
| 315 |
-+} |
|
| 316 |
-+ |
|
| 317 |
-+static int unix_label_sock_perm(struct aa_label *label, const char *op, u32 request, |
|
| 318 |
-+ struct socket *sock) |
|
| 319 |
-+{
|
|
| 320 |
-+ if (unconfined(label)) |
|
| 321 |
-+ return 0; |
|
| 322 |
-+ if (UNIX_FS(sock->sk)) |
|
| 323 |
-+ return unix_fs_perm(op, request, label, unix_sk(sock->sk), 0); |
|
| 324 |
-+ |
|
| 325 |
-+ return aa_unix_label_sk_perm(label, op, request, sock->sk); |
|
| 326 |
-+} |
|
| 327 |
-+ |
|
| 328 |
-+/* revaliation, get/set attr */ |
|
| 329 |
-+int aa_unix_sock_perm(const char *op, u32 request, struct socket *sock) |
|
| 330 |
-+{
|
|
| 331 |
-+ struct aa_label *label; |
|
| 332 |
-+ int error; |
|
| 333 |
-+ |
|
| 334 |
-+ label = begin_current_label_crit_section(); |
|
| 335 |
-+ error = unix_label_sock_perm(label, op, request, sock); |
|
| 336 |
-+ end_current_label_crit_section(label); |
|
| 337 |
-+ |
|
| 338 |
-+ return error; |
|
| 339 |
-+} |
|
| 340 |
-+ |
|
| 341 |
-+static int profile_bind_perm(struct aa_profile *profile, struct sock *sk, |
|
| 342 |
-+ struct sockaddr *addr, int addrlen) |
|
| 343 |
-+{
|
|
| 344 |
-+ unsigned int state; |
|
| 345 |
-+ DEFINE_AUDIT_SK(sa, OP_BIND, sk); |
|
| 346 |
-+ |
|
| 347 |
-+ AA_BUG(!profile); |
|
| 348 |
-+ AA_BUG(!sk); |
|
| 349 |
-+ AA_BUG(addr->sa_family != AF_UNIX); |
|
| 350 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 351 |
-+ AA_BUG(unix_addr_fs(addr, addrlen)); |
|
| 352 |
-+ |
|
| 353 |
-+ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); |
|
| 354 |
-+ if (state) {
|
|
| 355 |
-+ /* bind for abstract socket */ |
|
| 356 |
-+ aad(&sa)->net.addr = unix_addr(addr); |
|
| 357 |
-+ aad(&sa)->net.addrlen = addrlen; |
|
| 358 |
-+ |
|
| 359 |
-+ state = match_to_local(profile, state, |
|
| 360 |
-+ sk->sk_type, sk->sk_protocol, |
|
| 361 |
-+ unix_addr(addr), addrlen, |
|
| 362 |
-+ &aad(&sa)->info); |
|
| 363 |
-+ return do_perms(profile, state, AA_MAY_BIND, &sa); |
|
| 364 |
-+ } |
|
| 365 |
-+ |
|
| 366 |
-+ return aa_profile_af_sk_perm(profile, &sa, AA_MAY_BIND, sk); |
|
| 367 |
-+} |
|
| 368 |
-+ |
|
| 369 |
-+int aa_unix_bind_perm(struct socket *sock, struct sockaddr *address, |
|
| 370 |
-+ int addrlen) |
|
| 371 |
-+{
|
|
| 372 |
-+ struct aa_profile *profile; |
|
| 373 |
-+ struct aa_label *label; |
|
| 374 |
-+ int error = 0; |
|
| 375 |
-+ |
|
| 376 |
-+ label = begin_current_label_crit_section(); |
|
| 377 |
-+ /* fs bind is handled by mknod */ |
|
| 378 |
-+ if (!(unconfined(label) || unix_addr_fs(address, addrlen))) |
|
| 379 |
-+ error = fn_for_each_confined(label, profile, |
|
| 380 |
-+ profile_bind_perm(profile, sock->sk, address, |
|
| 381 |
-+ addrlen)); |
|
| 382 |
-+ end_current_label_crit_section(label); |
|
| 383 |
-+ |
|
| 384 |
-+ return error; |
|
| 385 |
-+} |
|
| 386 |
-+ |
|
| 387 |
-+int aa_unix_connect_perm(struct socket *sock, struct sockaddr *address, |
|
| 388 |
-+ int addrlen) |
|
| 389 |
-+{
|
|
| 390 |
-+ /* unix connections are covered by the |
|
| 391 |
-+ * - unix_stream_connect (stream) and unix_may_send hooks (dgram) |
|
| 392 |
-+ * - fs connect is handled by open |
|
| 393 |
-+ */ |
|
| 394 |
-+ return 0; |
|
| 395 |
-+} |
|
| 396 |
-+ |
|
| 397 |
-+static int profile_listen_perm(struct aa_profile *profile, struct sock *sk, |
|
| 398 |
-+ int backlog) |
|
| 399 |
-+{
|
|
| 400 |
-+ unsigned int state; |
|
| 401 |
-+ DEFINE_AUDIT_SK(sa, OP_LISTEN, sk); |
|
| 402 |
-+ |
|
| 403 |
-+ AA_BUG(!profile); |
|
| 404 |
-+ AA_BUG(!sk); |
|
| 405 |
-+ AA_BUG(UNIX_FS(sk)); |
|
| 406 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 407 |
-+ |
|
| 408 |
-+ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); |
|
| 409 |
-+ if (state) {
|
|
| 410 |
-+ __be16 b = cpu_to_be16(backlog); |
|
| 411 |
-+ |
|
| 412 |
-+ state = match_to_cmd(profile, state, unix_sk(sk), CMD_LISTEN, |
|
| 413 |
-+ &aad(&sa)->info); |
|
| 414 |
-+ if (state) {
|
|
| 415 |
-+ state = aa_dfa_match_len(profile->policy.dfa, state, |
|
| 416 |
-+ (char *) &b, 2); |
|
| 417 |
-+ if (!state) |
|
| 418 |
-+ aad(&sa)->info = "failed listen backlog match"; |
|
| 419 |
-+ } |
|
| 420 |
-+ return do_perms(profile, state, AA_MAY_LISTEN, &sa); |
|
| 421 |
-+ } |
|
| 422 |
-+ |
|
| 423 |
-+ return aa_profile_af_sk_perm(profile, &sa, AA_MAY_LISTEN, sk); |
|
| 424 |
-+} |
|
| 425 |
-+ |
|
| 426 |
-+int aa_unix_listen_perm(struct socket *sock, int backlog) |
|
| 427 |
-+{
|
|
| 428 |
-+ struct aa_profile *profile; |
|
| 429 |
-+ struct aa_label *label; |
|
| 430 |
-+ int error = 0; |
|
| 431 |
-+ |
|
| 432 |
-+ label = begin_current_label_crit_section(); |
|
| 433 |
-+ if (!(unconfined(label) || UNIX_FS(sock->sk))) |
|
| 434 |
-+ error = fn_for_each_confined(label, profile, |
|
| 435 |
-+ profile_listen_perm(profile, sock->sk, |
|
| 436 |
-+ backlog)); |
|
| 437 |
-+ end_current_label_crit_section(label); |
|
| 438 |
-+ |
|
| 439 |
-+ return error; |
|
| 440 |
-+} |
|
| 441 |
-+ |
|
| 442 |
-+ |
|
| 443 |
-+static inline int profile_accept_perm(struct aa_profile *profile, |
|
| 444 |
-+ struct sock *sk, |
|
| 445 |
-+ struct sock *newsk) |
|
| 446 |
-+{
|
|
| 447 |
-+ unsigned int state; |
|
| 448 |
-+ DEFINE_AUDIT_SK(sa, OP_ACCEPT, sk); |
|
| 449 |
-+ |
|
| 450 |
-+ AA_BUG(!profile); |
|
| 451 |
-+ AA_BUG(!sk); |
|
| 452 |
-+ AA_BUG(UNIX_FS(sk)); |
|
| 453 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 454 |
-+ |
|
| 455 |
-+ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); |
|
| 456 |
-+ if (state) {
|
|
| 457 |
-+ state = match_to_sk(profile, state, unix_sk(sk), |
|
| 458 |
-+ &aad(&sa)->info); |
|
| 459 |
-+ return do_perms(profile, state, AA_MAY_ACCEPT, &sa); |
|
| 460 |
-+ } |
|
| 461 |
-+ |
|
| 462 |
-+ return aa_profile_af_sk_perm(profile, &sa, AA_MAY_ACCEPT, sk); |
|
| 463 |
-+} |
|
| 464 |
-+ |
|
| 465 |
-+/* ability of sock to connect, not peer address binding */ |
|
| 466 |
-+int aa_unix_accept_perm(struct socket *sock, struct socket *newsock) |
|
| 467 |
-+{
|
|
| 468 |
-+ struct aa_profile *profile; |
|
| 469 |
-+ struct aa_label *label; |
|
| 470 |
-+ int error = 0; |
|
| 471 |
-+ |
|
| 472 |
-+ label = begin_current_label_crit_section(); |
|
| 473 |
-+ if (!(unconfined(label) || UNIX_FS(sock->sk))) |
|
| 474 |
-+ error = fn_for_each_confined(label, profile, |
|
| 475 |
-+ profile_accept_perm(profile, sock->sk, |
|
| 476 |
-+ newsock->sk)); |
|
| 477 |
-+ end_current_label_crit_section(label); |
|
| 478 |
-+ |
|
| 479 |
-+ return error; |
|
| 480 |
-+} |
|
| 481 |
-+ |
|
| 482 |
-+ |
|
| 483 |
-+/* dgram handled by unix_may_sendmsg, right to send on stream done at connect |
|
| 484 |
-+ * could do per msg unix_stream here |
|
| 485 |
-+ */ |
|
| 486 |
-+/* sendmsg, recvmsg */ |
|
| 487 |
-+int aa_unix_msg_perm(const char *op, u32 request, struct socket *sock, |
|
| 488 |
-+ struct msghdr *msg, int size) |
|
| 489 |
-+{
|
|
| 490 |
-+ return 0; |
|
| 491 |
-+} |
|
| 492 |
-+ |
|
| 493 |
-+ |
|
| 494 |
-+static int profile_opt_perm(struct aa_profile *profile, const char *op, u32 request, |
|
| 495 |
-+ struct sock *sk, int level, int optname) |
|
| 496 |
-+{
|
|
| 497 |
-+ unsigned int state; |
|
| 498 |
-+ DEFINE_AUDIT_SK(sa, op, sk); |
|
| 499 |
-+ |
|
| 500 |
-+ AA_BUG(!profile); |
|
| 501 |
-+ AA_BUG(!sk); |
|
| 502 |
-+ AA_BUG(UNIX_FS(sk)); |
|
| 503 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 504 |
-+ |
|
| 505 |
-+ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); |
|
| 506 |
-+ if (state) {
|
|
| 507 |
-+ __be16 b = cpu_to_be16(optname); |
|
| 508 |
-+ |
|
| 509 |
-+ state = match_to_cmd(profile, state, unix_sk(sk), CMD_OPT, |
|
| 510 |
-+ &aad(&sa)->info); |
|
| 511 |
-+ if (state) {
|
|
| 512 |
-+ state = aa_dfa_match_len(profile->policy.dfa, state, |
|
| 513 |
-+ (char *) &b, 2); |
|
| 514 |
-+ if (!state) |
|
| 515 |
-+ aad(&sa)->info = "failed sockopt match"; |
|
| 516 |
-+ } |
|
| 517 |
-+ return do_perms(profile, state, request, &sa); |
|
| 518 |
-+ } |
|
| 519 |
-+ |
|
| 520 |
-+ return aa_profile_af_sk_perm(profile, &sa, request, sk); |
|
| 521 |
-+} |
|
| 522 |
-+ |
|
| 523 |
-+int aa_unix_opt_perm(const char *op, u32 request, struct socket *sock, int level, |
|
| 524 |
-+ int optname) |
|
| 525 |
-+{
|
|
| 526 |
-+ struct aa_profile *profile; |
|
| 527 |
-+ struct aa_label *label; |
|
| 528 |
-+ int error = 0; |
|
| 529 |
-+ |
|
| 530 |
-+ label = begin_current_label_crit_section(); |
|
| 531 |
-+ if (!(unconfined(label) || UNIX_FS(sock->sk))) |
|
| 532 |
-+ error = fn_for_each_confined(label, profile, |
|
| 533 |
-+ profile_opt_perm(profile, op, request, |
|
| 534 |
-+ sock->sk, level, optname)); |
|
| 535 |
-+ end_current_label_crit_section(label); |
|
| 536 |
-+ |
|
| 537 |
-+ return error; |
|
| 538 |
-+} |
|
| 539 |
-+ |
|
| 540 |
-+/* null peer_label is allowed, in which case the peer_sk label is used */ |
|
| 541 |
-+static int profile_peer_perm(struct aa_profile *profile, const char *op, u32 request, |
|
| 542 |
-+ struct sock *sk, struct sock *peer_sk, |
|
| 543 |
-+ struct aa_label *peer_label, |
|
| 544 |
-+ struct common_audit_data *sa) |
|
| 545 |
-+{
|
|
| 546 |
-+ unsigned int state; |
|
| 547 |
-+ |
|
| 548 |
-+ AA_BUG(!profile); |
|
| 549 |
-+ AA_BUG(profile_unconfined(profile)); |
|
| 550 |
-+ AA_BUG(!sk); |
|
| 551 |
-+ AA_BUG(!peer_sk); |
|
| 552 |
-+ AA_BUG(UNIX_FS(peer_sk)); |
|
| 553 |
-+ |
|
| 554 |
-+ state = PROFILE_MEDIATES_AF(profile, AF_UNIX); |
|
| 555 |
-+ if (state) {
|
|
| 556 |
-+ struct aa_sk_ctx *peer_ctx = SK_CTX(peer_sk); |
|
| 557 |
-+ struct aa_profile *peerp; |
|
| 558 |
-+ struct sockaddr_un *addr = NULL; |
|
| 559 |
-+ int len = 0; |
|
| 560 |
-+ if (unix_sk(peer_sk)->addr) {
|
|
| 561 |
-+ addr = unix_sk(peer_sk)->addr->name; |
|
| 562 |
-+ len = unix_sk(peer_sk)->addr->len; |
|
| 563 |
-+ } |
|
| 564 |
-+ state = match_to_peer(profile, state, unix_sk(sk), |
|
| 565 |
-+ addr, len, &aad(sa)->info); |
|
| 566 |
-+ if (!peer_label) |
|
| 567 |
-+ peer_label = peer_ctx->label; |
|
| 568 |
-+ return fn_for_each_in_ns(peer_label, peerp, |
|
| 569 |
-+ match_label(profile, peerp, state, request, |
|
| 570 |
-+ sa)); |
|
| 571 |
-+ } |
|
| 572 |
-+ |
|
| 573 |
-+ return aa_profile_af_sk_perm(profile, sa, request, sk); |
|
| 574 |
-+} |
|
| 575 |
-+ |
|
| 576 |
-+/** |
|
| 577 |
-+ * |
|
| 578 |
-+ * Requires: lock held on both @sk and @peer_sk |
|
| 579 |
-+ */ |
|
| 580 |
-+int aa_unix_peer_perm(struct aa_label *label, const char *op, u32 request, |
|
| 581 |
-+ struct sock *sk, struct sock *peer_sk, |
|
| 582 |
-+ struct aa_label *peer_label) |
|
| 583 |
-+{
|
|
| 584 |
-+ struct unix_sock *peeru = unix_sk(peer_sk); |
|
| 585 |
-+ struct unix_sock *u = unix_sk(sk); |
|
| 586 |
-+ |
|
| 587 |
-+ AA_BUG(!label); |
|
| 588 |
-+ AA_BUG(!sk); |
|
| 589 |
-+ AA_BUG(!peer_sk); |
|
| 590 |
-+ |
|
| 591 |
-+ if (UNIX_FS(aa_sock(peeru))) |
|
| 592 |
-+ return unix_fs_perm(op, request, label, peeru, 0); |
|
| 593 |
-+ else if (UNIX_FS(aa_sock(u))) |
|
| 594 |
-+ return unix_fs_perm(op, request, label, u, 0); |
|
| 595 |
-+ else {
|
|
| 596 |
-+ struct aa_profile *profile; |
|
| 597 |
-+ DEFINE_AUDIT_SK(sa, op, sk); |
|
| 598 |
-+ aad(&sa)->net.peer_sk = peer_sk; |
|
| 599 |
-+ |
|
| 600 |
-+ /* TODO: ns!!! */ |
|
| 601 |
-+ if (!net_eq(sock_net(sk), sock_net(peer_sk))) {
|
|
| 602 |
-+ ; |
|
| 603 |
-+ } |
|
| 604 |
-+ |
|
| 605 |
-+ if (unconfined(label)) |
|
| 606 |
-+ return 0; |
|
| 607 |
-+ |
|
| 608 |
-+ return fn_for_each_confined(label, profile, |
|
| 609 |
-+ profile_peer_perm(profile, op, request, sk, |
|
| 610 |
-+ peer_sk, peer_label, &sa)); |
|
| 611 |
-+ } |
|
| 612 |
-+} |
|
| 613 |
-+ |
|
| 614 |
-+ |
|
| 615 |
-+/* from net/unix/af_unix.c */ |
|
| 616 |
-+static void unix_state_double_lock(struct sock *sk1, struct sock *sk2) |
|
| 617 |
-+{
|
|
| 618 |
-+ if (unlikely(sk1 == sk2) || !sk2) {
|
|
| 619 |
-+ unix_state_lock(sk1); |
|
| 620 |
-+ return; |
|
| 621 |
-+ } |
|
| 622 |
-+ if (sk1 < sk2) {
|
|
| 623 |
-+ unix_state_lock(sk1); |
|
| 624 |
-+ unix_state_lock_nested(sk2); |
|
| 625 |
-+ } else {
|
|
| 626 |
-+ unix_state_lock(sk2); |
|
| 627 |
-+ unix_state_lock_nested(sk1); |
|
| 628 |
-+ } |
|
| 629 |
-+} |
|
| 630 |
-+ |
|
| 631 |
-+static void unix_state_double_unlock(struct sock *sk1, struct sock *sk2) |
|
| 632 |
-+{
|
|
| 633 |
-+ if (unlikely(sk1 == sk2) || !sk2) {
|
|
| 634 |
-+ unix_state_unlock(sk1); |
|
| 635 |
-+ return; |
|
| 636 |
-+ } |
|
| 637 |
-+ unix_state_unlock(sk1); |
|
| 638 |
-+ unix_state_unlock(sk2); |
|
| 639 |
-+} |
|
| 640 |
-+ |
|
| 641 |
-+int aa_unix_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 642 |
-+ struct socket *sock) |
|
| 643 |
-+{
|
|
| 644 |
-+ struct sock *peer_sk = NULL; |
|
| 645 |
-+ u32 sk_req = request & ~NET_PEER_MASK; |
|
| 646 |
-+ int error = 0; |
|
| 647 |
-+ |
|
| 648 |
-+ AA_BUG(!label); |
|
| 649 |
-+ AA_BUG(!sock); |
|
| 650 |
-+ AA_BUG(!sock->sk); |
|
| 651 |
-+ AA_BUG(sock->sk->sk_family != AF_UNIX); |
|
| 652 |
-+ |
|
| 653 |
-+ /* TODO: update sock label with new task label */ |
|
| 654 |
-+ unix_state_lock(sock->sk); |
|
| 655 |
-+ peer_sk = unix_peer(sock->sk); |
|
| 656 |
-+ if (peer_sk) |
|
| 657 |
-+ sock_hold(peer_sk); |
|
| 658 |
-+ if (!unix_connected(sock) && sk_req) {
|
|
| 659 |
-+ error = unix_label_sock_perm(label, op, sk_req, sock); |
|
| 660 |
-+ if (!error) {
|
|
| 661 |
-+ // update label |
|
| 662 |
-+ } |
|
| 663 |
-+ } |
|
| 664 |
-+ unix_state_unlock(sock->sk); |
|
| 665 |
-+ if (!peer_sk) |
|
| 666 |
-+ return error; |
|
| 667 |
-+ |
|
| 668 |
-+ unix_state_double_lock(sock->sk, peer_sk); |
|
| 669 |
-+ if (UNIX_FS(sock->sk)) {
|
|
| 670 |
-+ error = unix_fs_perm(op, request, label, unix_sk(sock->sk), |
|
| 671 |
-+ PATH_SOCK_COND); |
|
| 672 |
-+ } else if (UNIX_FS(peer_sk)) {
|
|
| 673 |
-+ error = unix_fs_perm(op, request, label, unix_sk(peer_sk), |
|
| 674 |
-+ PATH_SOCK_COND); |
|
| 675 |
-+ } else {
|
|
| 676 |
-+ struct aa_sk_ctx *pctx = SK_CTX(peer_sk); |
|
| 677 |
-+ if (sk_req) |
|
| 678 |
-+ error = aa_unix_label_sk_perm(label, op, sk_req, |
|
| 679 |
-+ sock->sk); |
|
| 680 |
-+ last_error(error, |
|
| 681 |
-+ xcheck(aa_unix_peer_perm(label, op, |
|
| 682 |
-+ MAY_READ | MAY_WRITE, |
|
| 683 |
-+ sock->sk, peer_sk, NULL), |
|
| 684 |
-+ aa_unix_peer_perm(pctx->label, op, |
|
| 685 |
-+ MAY_READ | MAY_WRITE, |
|
| 686 |
-+ peer_sk, sock->sk, label))); |
|
| 687 |
-+ } |
|
| 688 |
-+ |
|
| 689 |
-+ unix_state_double_unlock(sock->sk, peer_sk); |
|
| 690 |
-+ sock_put(peer_sk); |
|
| 691 |
-+ |
|
| 692 |
-+ return error; |
|
| 693 |
-+} |
|
| 694 |
-diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c |
|
| 695 |
-index 518d5928661b..63a8a462fc96 100644 |
|
| 696 |
-+++ b/security/apparmor/apparmorfs.c |
|
| 697 |
-@@ -2187,6 +2187,11 @@ static struct aa_sfs_entry aa_sfs_entry_ns[] = {
|
|
| 698 |
- { }
|
|
| 699 |
- }; |
|
| 700 |
- |
|
| 701 |
-+static struct aa_sfs_entry aa_sfs_entry_dbus[] = {
|
|
| 702 |
-+ AA_SFS_FILE_STRING("mask", "acquire send receive"),
|
|
| 703 |
-+ { }
|
|
| 704 |
-+}; |
|
| 705 |
-+ |
|
| 706 |
- static struct aa_sfs_entry aa_sfs_entry_query_label[] = {
|
|
| 707 |
- AA_SFS_FILE_STRING("perms", "allow deny audit quiet"),
|
|
| 708 |
- AA_SFS_FILE_BOOLEAN("data", 1),
|
|
| 709 |
-@@ -2210,6 +2215,7 @@ static struct aa_sfs_entry aa_sfs_entry_features[] = {
|
|
| 710 |
- AA_SFS_DIR("caps", aa_sfs_entry_caps),
|
|
| 711 |
- AA_SFS_DIR("ptrace", aa_sfs_entry_ptrace),
|
|
| 712 |
- AA_SFS_DIR("signal", aa_sfs_entry_signal),
|
|
| 713 |
-+ AA_SFS_DIR("dbus", aa_sfs_entry_dbus),
|
|
| 714 |
- AA_SFS_DIR("query", aa_sfs_entry_query),
|
|
| 715 |
- { }
|
|
| 716 |
- }; |
|
| 717 |
-diff --git a/security/apparmor/file.c b/security/apparmor/file.c |
|
| 718 |
-index db80221891c6..e62791106900 100644 |
|
| 719 |
-+++ b/security/apparmor/file.c |
|
| 720 |
-@@ -16,6 +16,7 @@ |
|
| 721 |
- #include <linux/fdtable.h> |
|
| 722 |
- #include <linux/file.h> |
|
| 723 |
- |
|
| 724 |
-+#include "include/af_unix.h" |
|
| 725 |
- #include "include/apparmor.h" |
|
| 726 |
- #include "include/audit.h" |
|
| 727 |
- #include "include/context.h" |
|
| 728 |
-@@ -289,7 +290,8 @@ int __aa_path_perm(const char *op, struct aa_profile *profile, const char *name, |
|
| 729 |
- {
|
|
| 730 |
- int e = 0; |
|
| 731 |
- |
|
| 732 |
-- if (profile_unconfined(profile)) |
|
| 733 |
-+ if (profile_unconfined(profile) || |
|
| 734 |
-+ ((flags & PATH_SOCK_COND) && !PROFILE_MEDIATES_AF(profile, AF_UNIX))) |
|
| 735 |
- return 0; |
|
| 736 |
- aa_str_perms(profile->file.dfa, profile->file.start, name, cond, perms); |
|
| 737 |
- if (request & ~perms->allow) |
|
| 738 |
-diff --git a/security/apparmor/include/af_unix.h b/security/apparmor/include/af_unix.h |
|
| 739 |
-new file mode 100644 |
|
| 740 |
-index 000000000000..d1b7f2316be4 |
|
| 741 |
-+++ b/security/apparmor/include/af_unix.h |
|
| 742 |
-@@ -0,0 +1,114 @@ |
|
| 743 |
-+/* |
|
| 744 |
-+ * AppArmor security module |
|
| 745 |
-+ * |
|
| 746 |
-+ * This file contains AppArmor af_unix fine grained mediation |
|
| 747 |
-+ * |
|
| 748 |
-+ * Copyright 2014 Canonical Ltd. |
|
| 749 |
-+ * |
|
| 750 |
-+ * This program is free software; you can redistribute it and/or |
|
| 751 |
-+ * modify it under the terms of the GNU General Public License as |
|
| 752 |
-+ * published by the Free Software Foundation, version 2 of the |
|
| 753 |
-+ * License. |
|
| 754 |
-+ */ |
|
| 755 |
-+#ifndef __AA_AF_UNIX_H |
|
| 756 |
-+ |
|
| 757 |
-+#include <net/af_unix.h> |
|
| 758 |
-+ |
|
| 759 |
-+#include "label.h" |
|
| 760 |
-+//#include "include/net.h" |
|
| 761 |
-+ |
|
| 762 |
-+#define unix_addr_len(L) ((L) - sizeof(sa_family_t)) |
|
| 763 |
-+#define unix_abstract_name_len(L) (unix_addr_len(L) - 1) |
|
| 764 |
-+#define unix_abstract_len(U) (unix_abstract_name_len((U)->addr->len)) |
|
| 765 |
-+#define addr_unix_abstract_name(B) ((B)[0] == 0) |
|
| 766 |
-+#define addr_unix_anonymous(U) (addr_unix_len(U) <= 0) |
|
| 767 |
-+#define addr_unix_abstract(U) (!addr_unix_anonymous(U) && addr_unix_abstract_name((U)->addr)) |
|
| 768 |
-+//#define unix_addr_fs(U) (!unix_addr_anonymous(U) && !unix_addr_abstract_name((U)->addr)) |
|
| 769 |
-+ |
|
| 770 |
-+#define unix_addr(A) ((struct sockaddr_un *)(A)) |
|
| 771 |
-+#define unix_addr_anon(A, L) ((A) && unix_addr_len(L) <= 0) |
|
| 772 |
-+#define unix_addr_fs(A, L) (!unix_addr_anon(A, L) && !addr_unix_abstract_name(unix_addr(A)->sun_path)) |
|
| 773 |
-+ |
|
| 774 |
-+#define UNIX_ANONYMOUS(U) (!unix_sk(U)->addr) |
|
| 775 |
-+/* from net/unix/af_unix.c */ |
|
| 776 |
-+#define UNIX_ABSTRACT(U) (!UNIX_ANONYMOUS(U) && \ |
|
| 777 |
-+ unix_sk(U)->addr->hash < UNIX_HASH_SIZE) |
|
| 778 |
-+#define UNIX_FS(U) (!UNIX_ANONYMOUS(U) && unix_sk(U)->addr->name->sun_path[0]) |
|
| 779 |
-+#define unix_peer(sk) (unix_sk(sk)->peer) |
|
| 780 |
-+#define unix_connected(S) ((S)->state == SS_CONNECTED) |
|
| 781 |
-+ |
|
| 782 |
-+static inline void print_unix_addr(struct sockaddr_un *A, int L) |
|
| 783 |
-+{
|
|
| 784 |
-+ char *buf = (A) ? (char *) &(A)->sun_path : NULL; |
|
| 785 |
-+ int len = unix_addr_len(L); |
|
| 786 |
-+ if (!buf || len <= 0) |
|
| 787 |
-+ printk(" <anonymous>");
|
|
| 788 |
-+ else if (buf[0]) |
|
| 789 |
-+ printk(" %s", buf);
|
|
| 790 |
-+ else |
|
| 791 |
-+ /* abstract name len includes leading \0 */ |
|
| 792 |
-+ printk(" %d @%.*s", len - 1, len - 1, buf+1);
|
|
| 793 |
-+}; |
|
| 794 |
-+ |
|
| 795 |
-+/* |
|
| 796 |
-+ printk("%s: %s: f %d, t %d, p %d", __FUNCTION__, \
|
|
| 797 |
-+ #SK , \ |
|
| 798 |
-+*/ |
|
| 799 |
-+#define print_unix_sk(SK) \ |
|
| 800 |
-+do { \
|
|
| 801 |
-+ struct unix_sock *u = unix_sk(SK); \ |
|
| 802 |
-+ printk("%s: f %d, t %d, p %d", #SK , \
|
|
| 803 |
-+ (SK)->sk_family, (SK)->sk_type, (SK)->sk_protocol); \ |
|
| 804 |
-+ if (u->addr) \ |
|
| 805 |
-+ print_unix_addr(u->addr->name, u->addr->len); \ |
|
| 806 |
-+ else \ |
|
| 807 |
-+ print_unix_addr(NULL, sizeof(sa_family_t)); \ |
|
| 808 |
-+ /* printk("\n");*/ \
|
|
| 809 |
-+} while (0) |
|
| 810 |
-+ |
|
| 811 |
-+#define print_sk(SK) \ |
|
| 812 |
-+do { \
|
|
| 813 |
-+ if (!(SK)) { \
|
|
| 814 |
-+ printk("%s: %s is null\n", __FUNCTION__, #SK); \
|
|
| 815 |
-+ } else if ((SK)->sk_family == PF_UNIX) { \
|
|
| 816 |
-+ print_unix_sk(SK); \ |
|
| 817 |
-+ printk("\n"); \
|
|
| 818 |
-+ } else { \
|
|
| 819 |
-+ printk("%s: %s: family %d\n", __FUNCTION__, #SK , \
|
|
| 820 |
-+ (SK)->sk_family); \ |
|
| 821 |
-+ } \ |
|
| 822 |
-+} while (0) |
|
| 823 |
-+ |
|
| 824 |
-+#define print_sock_addr(U) \ |
|
| 825 |
-+do { \
|
|
| 826 |
-+ printk("%s:\n", __FUNCTION__); \
|
|
| 827 |
-+ printk(" sock %s:", sock_ctx && sock_ctx->label ? aa_label_printk(sock_ctx->label, GFP_ATOMIC); : "<null>"); print_sk(sock); \
|
|
| 828 |
-+ printk(" other %s:", other_ctx && other_ctx->label ? aa_label_printk(other_ctx->label, GFP_ATOMIC); : "<null>"); print_sk(other); \
|
|
| 829 |
-+ printk(" new %s", new_ctx && new_ctx->label ? aa_label_printk(new_ctx->label, GFP_ATOMIC); : "<null>"); print_sk(newsk); \
|
|
| 830 |
-+} while (0) |
|
| 831 |
-+ |
|
| 832 |
-+ |
|
| 833 |
-+ |
|
| 834 |
-+ |
|
| 835 |
-+int aa_unix_peer_perm(struct aa_label *label, const char *op, u32 request, |
|
| 836 |
-+ struct sock *sk, struct sock *peer_sk, |
|
| 837 |
-+ struct aa_label *peer_label); |
|
| 838 |
-+int aa_unix_label_sk_perm(struct aa_label *label, const char *op, u32 request, |
|
| 839 |
-+ struct sock *sk); |
|
| 840 |
-+int aa_unix_sock_perm(const char *op, u32 request, struct socket *sock); |
|
| 841 |
-+int aa_unix_create_perm(struct aa_label *label, int family, int type, |
|
| 842 |
-+ int protocol); |
|
| 843 |
-+int aa_unix_bind_perm(struct socket *sock, struct sockaddr *address, |
|
| 844 |
-+ int addrlen); |
|
| 845 |
-+int aa_unix_connect_perm(struct socket *sock, struct sockaddr *address, |
|
| 846 |
-+ int addrlen); |
|
| 847 |
-+int aa_unix_listen_perm(struct socket *sock, int backlog); |
|
| 848 |
-+int aa_unix_accept_perm(struct socket *sock, struct socket *newsock); |
|
| 849 |
-+int aa_unix_msg_perm(const char *op, u32 request, struct socket *sock, |
|
| 850 |
-+ struct msghdr *msg, int size); |
|
| 851 |
-+int aa_unix_opt_perm(const char *op, u32 request, struct socket *sock, int level, |
|
| 852 |
-+ int optname); |
|
| 853 |
-+int aa_unix_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 854 |
-+ struct socket *sock); |
|
| 855 |
-+ |
|
| 856 |
-+#endif /* __AA_AF_UNIX_H */ |
|
| 857 |
-diff --git a/security/apparmor/include/net.h b/security/apparmor/include/net.h |
|
| 858 |
-index 140c8efcf364..0ae45240c352 100644 |
|
| 859 |
-+++ b/security/apparmor/include/net.h |
|
| 860 |
-@@ -90,8 +90,6 @@ extern struct aa_sfs_entry aa_sfs_entry_network[]; |
|
| 861 |
- void audit_net_cb(struct audit_buffer *ab, void *va); |
|
| 862 |
- int aa_profile_af_perm(struct aa_profile *profile, struct common_audit_data *sa, |
|
| 863 |
- u32 request, u16 family, int type); |
|
| 864 |
--int aa_af_perm(struct aa_label *label, const char *op, u32 request, u16 family, |
|
| 865 |
-- int type, int protocol); |
|
| 866 |
- static inline int aa_profile_af_sk_perm(struct aa_profile *profile, |
|
| 867 |
- struct common_audit_data *sa, |
|
| 868 |
- u32 request, |
|
| 869 |
-@@ -100,8 +98,20 @@ static inline int aa_profile_af_sk_perm(struct aa_profile *profile, |
|
| 870 |
- return aa_profile_af_perm(profile, sa, request, sk->sk_family, |
|
| 871 |
- sk->sk_type); |
|
| 872 |
- } |
|
| 873 |
--int aa_sk_perm(const char *op, u32 request, struct sock *sk); |
|
| 874 |
- |
|
| 875 |
-+int aa_sock_perm(const char *op, u32 request, struct socket *sock); |
|
| 876 |
-+int aa_sock_create_perm(struct aa_label *label, int family, int type, |
|
| 877 |
-+ int protocol); |
|
| 878 |
-+int aa_sock_bind_perm(struct socket *sock, struct sockaddr *address, |
|
| 879 |
-+ int addrlen); |
|
| 880 |
-+int aa_sock_connect_perm(struct socket *sock, struct sockaddr *address, |
|
| 881 |
-+ int addrlen); |
|
| 882 |
-+int aa_sock_listen_perm(struct socket *sock, int backlog); |
|
| 883 |
-+int aa_sock_accept_perm(struct socket *sock, struct socket *newsock); |
|
| 884 |
-+int aa_sock_msg_perm(const char *op, u32 request, struct socket *sock, |
|
| 885 |
-+ struct msghdr *msg, int size); |
|
| 886 |
-+int aa_sock_opt_perm(const char *op, u32 request, struct socket *sock, int level, |
|
| 887 |
-+ int optname); |
|
| 888 |
- int aa_sock_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 889 |
- struct socket *sock); |
|
| 890 |
- |
|
| 891 |
-diff --git a/security/apparmor/include/path.h b/security/apparmor/include/path.h |
|
| 892 |
-index 05fb3305671e..26762db2207d 100644 |
|
| 893 |
-+++ b/security/apparmor/include/path.h |
|
| 894 |
-@@ -18,6 +18,7 @@ |
|
| 895 |
- |
|
| 896 |
- enum path_flags {
|
|
| 897 |
- PATH_IS_DIR = 0x1, /* path is a directory */ |
|
| 898 |
-+ PATH_SOCK_COND = 0x2, |
|
| 899 |
- PATH_CONNECT_PATH = 0x4, /* connect disconnected paths to / */ |
|
| 900 |
- PATH_CHROOT_REL = 0x8, /* do path lookup relative to chroot */ |
|
| 901 |
- PATH_CHROOT_NSCONNECT = 0x10, /* connect paths that are at ns root */ |
|
| 902 |
-diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h |
|
| 903 |
-index 4364088a0b9e..26660a1a50b0 100644 |
|
| 904 |
-+++ b/security/apparmor/include/policy.h |
|
| 905 |
-@@ -226,7 +226,7 @@ static inline unsigned int PROFILE_MEDIATES_SAFE(struct aa_profile *profile, |
|
| 906 |
- static inline unsigned int PROFILE_MEDIATES_AF(struct aa_profile *profile, |
|
| 907 |
- u16 AF) {
|
|
| 908 |
- unsigned int state = PROFILE_MEDIATES(profile, AA_CLASS_NET); |
|
| 909 |
-- u16 be_af = cpu_to_be16(AF); |
|
| 910 |
-+ __be16 be_af = cpu_to_be16(AF); |
|
| 911 |
- |
|
| 912 |
- if (!state) |
|
| 913 |
- return 0; |
|
| 914 |
-diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c |
|
| 915 |
-index 72b915dfcaf7..5533d2f1d9de 100644 |
|
| 916 |
-+++ b/security/apparmor/lsm.c |
|
| 917 |
-@@ -26,6 +26,7 @@ |
|
| 918 |
- #include <linux/kmemleak.h> |
|
| 919 |
- #include <net/sock.h> |
|
| 920 |
- |
|
| 921 |
-+#include "include/af_unix.h" |
|
| 922 |
- #include "include/apparmor.h" |
|
| 923 |
- #include "include/apparmorfs.h" |
|
| 924 |
- #include "include/audit.h" |
|
| 925 |
-@@ -782,16 +783,96 @@ static void apparmor_sk_clone_security(const struct sock *sk, |
|
| 926 |
- path_get(&new->path); |
|
| 927 |
- } |
|
| 928 |
- |
|
| 929 |
--static int aa_sock_create_perm(struct aa_label *label, int family, int type, |
|
| 930 |
-- int protocol) |
|
| 931 |
-+static struct path *UNIX_FS_CONN_PATH(struct sock *sk, struct sock *newsk) |
|
| 932 |
- {
|
|
| 933 |
-- AA_BUG(!label); |
|
| 934 |
-- AA_BUG(in_interrupt()); |
|
| 935 |
-+ if (sk->sk_family == PF_UNIX && UNIX_FS(sk)) |
|
| 936 |
-+ return &unix_sk(sk)->path; |
|
| 937 |
-+ else if (newsk->sk_family == PF_UNIX && UNIX_FS(newsk)) |
|
| 938 |
-+ return &unix_sk(newsk)->path; |
|
| 939 |
-+ return NULL; |
|
| 940 |
-+} |
|
| 941 |
-+ |
|
| 942 |
-+/** |
|
| 943 |
-+ * apparmor_unix_stream_connect - check perms before making unix domain conn |
|
| 944 |
-+ * |
|
| 945 |
-+ * peer is locked when this hook is called |
|
| 946 |
-+ */ |
|
| 947 |
-+static int apparmor_unix_stream_connect(struct sock *sk, struct sock *peer_sk, |
|
| 948 |
-+ struct sock *newsk) |
|
| 949 |
-+{
|
|
| 950 |
-+ struct aa_sk_ctx *sk_ctx = SK_CTX(sk); |
|
| 951 |
-+ struct aa_sk_ctx *peer_ctx = SK_CTX(peer_sk); |
|
| 952 |
-+ struct aa_sk_ctx *new_ctx = SK_CTX(newsk); |
|
| 953 |
-+ struct aa_label *label; |
|
| 954 |
-+ struct path *path; |
|
| 955 |
-+ int error; |
|
| 956 |
- |
|
| 957 |
-- return aa_af_perm(label, OP_CREATE, AA_MAY_CREATE, family, type, |
|
| 958 |
-- protocol); |
|
| 959 |
-+ label = __begin_current_label_crit_section(); |
|
| 960 |
-+ error = aa_unix_peer_perm(label, OP_CONNECT, |
|
| 961 |
-+ (AA_MAY_CONNECT | AA_MAY_SEND | AA_MAY_RECEIVE), |
|
| 962 |
-+ sk, peer_sk, NULL); |
|
| 963 |
-+ if (!UNIX_FS(peer_sk)) {
|
|
| 964 |
-+ last_error(error, |
|
| 965 |
-+ aa_unix_peer_perm(peer_ctx->label, OP_CONNECT, |
|
| 966 |
-+ (AA_MAY_ACCEPT | AA_MAY_SEND | AA_MAY_RECEIVE), |
|
| 967 |
-+ peer_sk, sk, label)); |
|
| 968 |
-+ } |
|
| 969 |
-+ __end_current_label_crit_section(label); |
|
| 970 |
-+ |
|
| 971 |
-+ if (error) |
|
| 972 |
-+ return error; |
|
| 973 |
-+ |
|
| 974 |
-+ /* label newsk if it wasn't labeled in post_create. Normally this |
|
| 975 |
-+ * would be done in sock_graft, but because we are directly looking |
|
| 976 |
-+ * at the peer_sk to obtain peer_labeling for unix socks this |
|
| 977 |
-+ * does not work |
|
| 978 |
-+ */ |
|
| 979 |
-+ if (!new_ctx->label) |
|
| 980 |
-+ new_ctx->label = aa_get_label(peer_ctx->label); |
|
| 981 |
-+ |
|
| 982 |
-+ /* Cross reference the peer labels for SO_PEERSEC */ |
|
| 983 |
-+ if (new_ctx->peer) |
|
| 984 |
-+ aa_put_label(new_ctx->peer); |
|
| 985 |
-+ |
|
| 986 |
-+ if (sk_ctx->peer) |
|
| 987 |
-+ aa_put_label(sk_ctx->peer); |
|
| 988 |
-+ |
|
| 989 |
-+ new_ctx->peer = aa_get_label(sk_ctx->label); |
|
| 990 |
-+ sk_ctx->peer = aa_get_label(peer_ctx->label); |
|
| 991 |
-+ |
|
| 992 |
-+ path = UNIX_FS_CONN_PATH(sk, peer_sk); |
|
| 993 |
-+ if (path) {
|
|
| 994 |
-+ new_ctx->path = *path; |
|
| 995 |
-+ sk_ctx->path = *path; |
|
| 996 |
-+ path_get(path); |
|
| 997 |
-+ path_get(path); |
|
| 998 |
-+ } |
|
| 999 |
-+ return 0; |
|
| 1000 |
- } |
|
| 1001 |
- |
|
| 1002 |
-+/** |
|
| 1003 |
-+ * apparmor_unix_may_send - check perms before conn or sending unix dgrams |
|
| 1004 |
-+ * |
|
| 1005 |
-+ * other is locked when this hook is called |
|
| 1006 |
-+ * |
|
| 1007 |
-+ * dgram connect calls may_send, peer setup but path not copied????? |
|
| 1008 |
-+ */ |
|
| 1009 |
-+static int apparmor_unix_may_send(struct socket *sock, struct socket *peer) |
|
| 1010 |
-+{
|
|
| 1011 |
-+ struct aa_sk_ctx *peer_ctx = SK_CTX(peer->sk); |
|
| 1012 |
-+ struct aa_label *label; |
|
| 1013 |
-+ int error; |
|
| 1014 |
-+ |
|
| 1015 |
-+ label = __begin_current_label_crit_section(); |
|
| 1016 |
-+ error = xcheck(aa_unix_peer_perm(label, OP_SENDMSG, AA_MAY_SEND, |
|
| 1017 |
-+ sock->sk, peer->sk, NULL), |
|
| 1018 |
-+ aa_unix_peer_perm(peer_ctx->label, OP_SENDMSG, |
|
| 1019 |
-+ AA_MAY_RECEIVE, |
|
| 1020 |
-+ peer->sk, sock->sk, label)); |
|
| 1021 |
-+ __end_current_label_crit_section(label); |
|
| 1022 |
-+ |
|
| 1023 |
-+ return error; |
|
| 1024 |
-+} |
|
| 1025 |
- |
|
| 1026 |
- /** |
|
| 1027 |
- * apparmor_socket_create - check perms before creating a new socket |
|
| 1028 |
-@@ -849,12 +930,7 @@ static int apparmor_socket_post_create(struct socket *sock, int family, |
|
| 1029 |
- static int apparmor_socket_bind(struct socket *sock, |
|
| 1030 |
- struct sockaddr *address, int addrlen) |
|
| 1031 |
- {
|
|
| 1032 |
-- AA_BUG(!sock); |
|
| 1033 |
-- AA_BUG(!sock->sk); |
|
| 1034 |
-- AA_BUG(!address); |
|
| 1035 |
-- AA_BUG(in_interrupt()); |
|
| 1036 |
-- |
|
| 1037 |
-- return aa_sk_perm(OP_BIND, AA_MAY_BIND, sock->sk); |
|
| 1038 |
-+ return aa_sock_bind_perm(sock, address, addrlen); |
|
| 1039 |
- } |
|
| 1040 |
- |
|
| 1041 |
- /** |
|
| 1042 |
-@@ -863,12 +939,7 @@ static int apparmor_socket_bind(struct socket *sock, |
|
| 1043 |
- static int apparmor_socket_connect(struct socket *sock, |
|
| 1044 |
- struct sockaddr *address, int addrlen) |
|
| 1045 |
- {
|
|
| 1046 |
-- AA_BUG(!sock); |
|
| 1047 |
-- AA_BUG(!sock->sk); |
|
| 1048 |
-- AA_BUG(!address); |
|
| 1049 |
-- AA_BUG(in_interrupt()); |
|
| 1050 |
-- |
|
| 1051 |
-- return aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sock->sk); |
|
| 1052 |
-+ return aa_sock_connect_perm(sock, address, addrlen); |
|
| 1053 |
- } |
|
| 1054 |
- |
|
| 1055 |
- /** |
|
| 1056 |
-@@ -876,11 +947,7 @@ static int apparmor_socket_connect(struct socket *sock, |
|
| 1057 |
- */ |
|
| 1058 |
- static int apparmor_socket_listen(struct socket *sock, int backlog) |
|
| 1059 |
- {
|
|
| 1060 |
-- AA_BUG(!sock); |
|
| 1061 |
-- AA_BUG(!sock->sk); |
|
| 1062 |
-- AA_BUG(in_interrupt()); |
|
| 1063 |
-- |
|
| 1064 |
-- return aa_sk_perm(OP_LISTEN, AA_MAY_LISTEN, sock->sk); |
|
| 1065 |
-+ return aa_sock_listen_perm(sock, backlog); |
|
| 1066 |
- } |
|
| 1067 |
- |
|
| 1068 |
- /** |
|
| 1069 |
-@@ -891,23 +958,7 @@ static int apparmor_socket_listen(struct socket *sock, int backlog) |
|
| 1070 |
- */ |
|
| 1071 |
- static int apparmor_socket_accept(struct socket *sock, struct socket *newsock) |
|
| 1072 |
- {
|
|
| 1073 |
-- AA_BUG(!sock); |
|
| 1074 |
-- AA_BUG(!sock->sk); |
|
| 1075 |
-- AA_BUG(!newsock); |
|
| 1076 |
-- AA_BUG(in_interrupt()); |
|
| 1077 |
-- |
|
| 1078 |
-- return aa_sk_perm(OP_ACCEPT, AA_MAY_ACCEPT, sock->sk); |
|
| 1079 |
--} |
|
| 1080 |
-- |
|
| 1081 |
--static int aa_sock_msg_perm(const char *op, u32 request, struct socket *sock, |
|
| 1082 |
-- struct msghdr *msg, int size) |
|
| 1083 |
--{
|
|
| 1084 |
-- AA_BUG(!sock); |
|
| 1085 |
-- AA_BUG(!sock->sk); |
|
| 1086 |
-- AA_BUG(!msg); |
|
| 1087 |
-- AA_BUG(in_interrupt()); |
|
| 1088 |
-- |
|
| 1089 |
-- return aa_sk_perm(op, request, sock->sk); |
|
| 1090 |
-+ return aa_sock_accept_perm(sock, newsock); |
|
| 1091 |
- } |
|
| 1092 |
- |
|
| 1093 |
- /** |
|
| 1094 |
-@@ -928,16 +979,6 @@ static int apparmor_socket_recvmsg(struct socket *sock, |
|
| 1095 |
- return aa_sock_msg_perm(OP_RECVMSG, AA_MAY_RECEIVE, sock, msg, size); |
|
| 1096 |
- } |
|
| 1097 |
- |
|
| 1098 |
--/* revaliation, get/set attr, shutdown */ |
|
| 1099 |
--static int aa_sock_perm(const char *op, u32 request, struct socket *sock) |
|
| 1100 |
--{
|
|
| 1101 |
-- AA_BUG(!sock); |
|
| 1102 |
-- AA_BUG(!sock->sk); |
|
| 1103 |
-- AA_BUG(in_interrupt()); |
|
| 1104 |
-- |
|
| 1105 |
-- return aa_sk_perm(op, request, sock->sk); |
|
| 1106 |
--} |
|
| 1107 |
-- |
|
| 1108 |
- /** |
|
| 1109 |
- * apparmor_socket_getsockname - check perms before getting the local address |
|
| 1110 |
- */ |
|
| 1111 |
-@@ -954,17 +995,6 @@ static int apparmor_socket_getpeername(struct socket *sock) |
|
| 1112 |
- return aa_sock_perm(OP_GETPEERNAME, AA_MAY_GETATTR, sock); |
|
| 1113 |
- } |
|
| 1114 |
- |
|
| 1115 |
--/* revaliation, get/set attr, opt */ |
|
| 1116 |
--static int aa_sock_opt_perm(const char *op, u32 request, struct socket *sock, |
|
| 1117 |
-- int level, int optname) |
|
| 1118 |
--{
|
|
| 1119 |
-- AA_BUG(!sock); |
|
| 1120 |
-- AA_BUG(!sock->sk); |
|
| 1121 |
-- AA_BUG(in_interrupt()); |
|
| 1122 |
-- |
|
| 1123 |
-- return aa_sk_perm(op, request, sock->sk); |
|
| 1124 |
--} |
|
| 1125 |
-- |
|
| 1126 |
- /** |
|
| 1127 |
- * apparmor_getsockopt - check perms before getting socket options |
|
| 1128 |
- */ |
|
| 1129 |
-@@ -1009,11 +1039,25 @@ static int apparmor_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) |
|
| 1130 |
- |
|
| 1131 |
- static struct aa_label *sk_peer_label(struct sock *sk) |
|
| 1132 |
- {
|
|
| 1133 |
-+ struct sock *peer_sk; |
|
| 1134 |
- struct aa_sk_ctx *ctx = SK_CTX(sk); |
|
| 1135 |
- |
|
| 1136 |
- if (ctx->peer) |
|
| 1137 |
- return ctx->peer; |
|
| 1138 |
- |
|
| 1139 |
-+ if (sk->sk_family != PF_UNIX) |
|
| 1140 |
-+ return ERR_PTR(-ENOPROTOOPT); |
|
| 1141 |
-+ |
|
| 1142 |
-+ /* check for sockpair peering which does not go through |
|
| 1143 |
-+ * security_unix_stream_connect |
|
| 1144 |
-+ */ |
|
| 1145 |
-+ peer_sk = unix_peer(sk); |
|
| 1146 |
-+ if (peer_sk) {
|
|
| 1147 |
-+ ctx = SK_CTX(peer_sk); |
|
| 1148 |
-+ if (ctx->label) |
|
| 1149 |
-+ return ctx->label; |
|
| 1150 |
-+ } |
|
| 1151 |
-+ |
|
| 1152 |
- return ERR_PTR(-ENOPROTOOPT); |
|
| 1153 |
- } |
|
| 1154 |
- |
|
| 1155 |
-@@ -1137,6 +1181,9 @@ static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = {
|
|
| 1156 |
- LSM_HOOK_INIT(sk_free_security, apparmor_sk_free_security), |
|
| 1157 |
- LSM_HOOK_INIT(sk_clone_security, apparmor_sk_clone_security), |
|
| 1158 |
- |
|
| 1159 |
-+ LSM_HOOK_INIT(unix_stream_connect, apparmor_unix_stream_connect), |
|
| 1160 |
-+ LSM_HOOK_INIT(unix_may_send, apparmor_unix_may_send), |
|
| 1161 |
-+ |
|
| 1162 |
- LSM_HOOK_INIT(socket_create, apparmor_socket_create), |
|
| 1163 |
- LSM_HOOK_INIT(socket_post_create, apparmor_socket_post_create), |
|
| 1164 |
- LSM_HOOK_INIT(socket_bind, apparmor_socket_bind), |
|
| 1165 |
-diff --git a/security/apparmor/net.c b/security/apparmor/net.c |
|
| 1166 |
-index 33d54435f8d6..dd1953b08e58 100644 |
|
| 1167 |
-+++ b/security/apparmor/net.c |
|
| 1168 |
-@@ -12,6 +12,7 @@ |
|
| 1169 |
- * License. |
|
| 1170 |
- */ |
|
| 1171 |
- |
|
| 1172 |
-+#include "include/af_unix.h" |
|
| 1173 |
- #include "include/apparmor.h" |
|
| 1174 |
- #include "include/audit.h" |
|
| 1175 |
- #include "include/context.h" |
|
| 1176 |
-@@ -24,6 +25,7 @@ |
|
| 1177 |
- |
|
| 1178 |
- struct aa_sfs_entry aa_sfs_entry_network[] = {
|
|
| 1179 |
- AA_SFS_FILE_STRING("af_mask", AA_SFS_AF_MASK),
|
|
| 1180 |
-+ AA_SFS_FILE_BOOLEAN("af_unix", 1),
|
|
| 1181 |
- { }
|
|
| 1182 |
- }; |
|
| 1183 |
- |
|
| 1184 |
-@@ -69,6 +71,36 @@ static const char * const net_mask_names[] = {
|
|
| 1185 |
- "unknown", |
|
| 1186 |
- }; |
|
| 1187 |
- |
|
| 1188 |
-+static void audit_unix_addr(struct audit_buffer *ab, const char *str, |
|
| 1189 |
-+ struct sockaddr_un *addr, int addrlen) |
|
| 1190 |
-+{
|
|
| 1191 |
-+ int len = unix_addr_len(addrlen); |
|
| 1192 |
-+ |
|
| 1193 |
-+ if (!addr || len <= 0) {
|
|
| 1194 |
-+ audit_log_format(ab, " %s=none", str); |
|
| 1195 |
-+ } else if (addr->sun_path[0]) {
|
|
| 1196 |
-+ audit_log_format(ab, " %s=", str); |
|
| 1197 |
-+ audit_log_untrustedstring(ab, addr->sun_path); |
|
| 1198 |
-+ } else {
|
|
| 1199 |
-+ audit_log_format(ab, " %s=\"@", str); |
|
| 1200 |
-+ if (audit_string_contains_control(&addr->sun_path[1], len - 1)) |
|
| 1201 |
-+ audit_log_n_hex(ab, &addr->sun_path[1], len - 1); |
|
| 1202 |
-+ else |
|
| 1203 |
-+ audit_log_format(ab, "%.*s", len - 1, |
|
| 1204 |
-+ &addr->sun_path[1]); |
|
| 1205 |
-+ audit_log_format(ab, "\""); |
|
| 1206 |
-+ } |
|
| 1207 |
-+} |
|
| 1208 |
-+ |
|
| 1209 |
-+static void audit_unix_sk_addr(struct audit_buffer *ab, const char *str, |
|
| 1210 |
-+ struct sock *sk) |
|
| 1211 |
-+{
|
|
| 1212 |
-+ struct unix_sock *u = unix_sk(sk); |
|
| 1213 |
-+ if (u && u->addr) |
|
| 1214 |
-+ audit_unix_addr(ab, str, u->addr->name, u->addr->len); |
|
| 1215 |
-+ else |
|
| 1216 |
-+ audit_unix_addr(ab, str, NULL, 0); |
|
| 1217 |
-+} |
|
| 1218 |
- |
|
| 1219 |
- /* audit callback for net specific fields */ |
|
| 1220 |
- void audit_net_cb(struct audit_buffer *ab, void *va) |
|
| 1221 |
-@@ -98,6 +130,23 @@ void audit_net_cb(struct audit_buffer *ab, void *va) |
|
| 1222 |
- net_mask_names, NET_PERMS_MASK); |
|
| 1223 |
- } |
|
| 1224 |
- } |
|
| 1225 |
-+ if (sa->u.net->family == AF_UNIX) {
|
|
| 1226 |
-+ if ((aad(sa)->request & ~NET_PEER_MASK) && aad(sa)->net.addr) |
|
| 1227 |
-+ audit_unix_addr(ab, "addr", |
|
| 1228 |
-+ unix_addr(aad(sa)->net.addr), |
|
| 1229 |
-+ aad(sa)->net.addrlen); |
|
| 1230 |
-+ else |
|
| 1231 |
-+ audit_unix_sk_addr(ab, "addr", sa->u.net->sk); |
|
| 1232 |
-+ if (aad(sa)->request & NET_PEER_MASK) {
|
|
| 1233 |
-+ if (aad(sa)->net.addr) |
|
| 1234 |
-+ audit_unix_addr(ab, "peer_addr", |
|
| 1235 |
-+ unix_addr(aad(sa)->net.addr), |
|
| 1236 |
-+ aad(sa)->net.addrlen); |
|
| 1237 |
-+ else |
|
| 1238 |
-+ audit_unix_sk_addr(ab, "peer_addr", |
|
| 1239 |
-+ aad(sa)->net.peer_sk); |
|
| 1240 |
-+ } |
|
| 1241 |
-+ } |
|
| 1242 |
- if (aad(sa)->peer) {
|
|
| 1243 |
- audit_log_format(ab, " peer="); |
|
| 1244 |
- aa_label_xaudit(ab, labels_ns(aad(sa)->label), aad(sa)->peer, |
|
| 1245 |
-@@ -172,6 +221,127 @@ int aa_sk_perm(const char *op, u32 request, struct sock *sk) |
|
| 1246 |
- return error; |
|
| 1247 |
- } |
|
| 1248 |
- |
|
| 1249 |
-+#define af_select(FAMILY, FN, DEF_FN) \ |
|
| 1250 |
-+({ \
|
|
| 1251 |
-+ int __e; \ |
|
| 1252 |
-+ switch ((FAMILY)) { \
|
|
| 1253 |
-+ case AF_UNIX: \ |
|
| 1254 |
-+ __e = aa_unix_ ## FN; \ |
|
| 1255 |
-+ break; \ |
|
| 1256 |
-+ default: \ |
|
| 1257 |
-+ __e = DEF_FN; \ |
|
| 1258 |
-+ } \ |
|
| 1259 |
-+ __e; \ |
|
| 1260 |
-+}) |
|
| 1261 |
-+ |
|
| 1262 |
-+/* TODO: push into lsm.c ???? */ |
|
| 1263 |
-+ |
|
| 1264 |
-+/* revaliation, get/set attr, shutdown */ |
|
| 1265 |
-+int aa_sock_perm(const char *op, u32 request, struct socket *sock) |
|
| 1266 |
-+{
|
|
| 1267 |
-+ AA_BUG(!sock); |
|
| 1268 |
-+ AA_BUG(!sock->sk); |
|
| 1269 |
-+ AA_BUG(in_interrupt()); |
|
| 1270 |
-+ |
|
| 1271 |
-+ return af_select(sock->sk->sk_family, |
|
| 1272 |
-+ sock_perm(op, request, sock), |
|
| 1273 |
-+ aa_sk_perm(op, request, sock->sk)); |
|
| 1274 |
-+} |
|
| 1275 |
-+ |
|
| 1276 |
-+int aa_sock_create_perm(struct aa_label *label, int family, int type, |
|
| 1277 |
-+ int protocol) |
|
| 1278 |
-+{
|
|
| 1279 |
-+ AA_BUG(!label); |
|
| 1280 |
-+ /* TODO: .... */ |
|
| 1281 |
-+ AA_BUG(in_interrupt()); |
|
| 1282 |
-+ |
|
| 1283 |
-+ return af_select(family, |
|
| 1284 |
-+ create_perm(label, family, type, protocol), |
|
| 1285 |
-+ aa_af_perm(label, OP_CREATE, AA_MAY_CREATE, family, |
|
| 1286 |
-+ type, protocol)); |
|
| 1287 |
-+} |
|
| 1288 |
-+ |
|
| 1289 |
-+int aa_sock_bind_perm(struct socket *sock, struct sockaddr *address, |
|
| 1290 |
-+ int addrlen) |
|
| 1291 |
-+{
|
|
| 1292 |
-+ AA_BUG(!sock); |
|
| 1293 |
-+ AA_BUG(!sock->sk); |
|
| 1294 |
-+ AA_BUG(!address); |
|
| 1295 |
-+ /* TODO: .... */ |
|
| 1296 |
-+ AA_BUG(in_interrupt()); |
|
| 1297 |
-+ |
|
| 1298 |
-+ return af_select(sock->sk->sk_family, |
|
| 1299 |
-+ bind_perm(sock, address, addrlen), |
|
| 1300 |
-+ aa_sk_perm(OP_BIND, AA_MAY_BIND, sock->sk)); |
|
| 1301 |
-+} |
|
| 1302 |
-+ |
|
| 1303 |
-+int aa_sock_connect_perm(struct socket *sock, struct sockaddr *address, |
|
| 1304 |
-+ int addrlen) |
|
| 1305 |
-+{
|
|
| 1306 |
-+ AA_BUG(!sock); |
|
| 1307 |
-+ AA_BUG(!sock->sk); |
|
| 1308 |
-+ AA_BUG(!address); |
|
| 1309 |
-+ /* TODO: .... */ |
|
| 1310 |
-+ AA_BUG(in_interrupt()); |
|
| 1311 |
-+ |
|
| 1312 |
-+ return af_select(sock->sk->sk_family, |
|
| 1313 |
-+ connect_perm(sock, address, addrlen), |
|
| 1314 |
-+ aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sock->sk)); |
|
| 1315 |
-+} |
|
| 1316 |
-+ |
|
| 1317 |
-+int aa_sock_listen_perm(struct socket *sock, int backlog) |
|
| 1318 |
-+{
|
|
| 1319 |
-+ AA_BUG(!sock); |
|
| 1320 |
-+ AA_BUG(!sock->sk); |
|
| 1321 |
-+ /* TODO: .... */ |
|
| 1322 |
-+ AA_BUG(in_interrupt()); |
|
| 1323 |
-+ |
|
| 1324 |
-+ return af_select(sock->sk->sk_family, |
|
| 1325 |
-+ listen_perm(sock, backlog), |
|
| 1326 |
-+ aa_sk_perm(OP_LISTEN, AA_MAY_LISTEN, sock->sk)); |
|
| 1327 |
-+} |
|
| 1328 |
-+ |
|
| 1329 |
-+/* ability of sock to connect, not peer address binding */ |
|
| 1330 |
-+int aa_sock_accept_perm(struct socket *sock, struct socket *newsock) |
|
| 1331 |
-+{
|
|
| 1332 |
-+ AA_BUG(!sock); |
|
| 1333 |
-+ AA_BUG(!sock->sk); |
|
| 1334 |
-+ AA_BUG(!newsock); |
|
| 1335 |
-+ /* TODO: .... */ |
|
| 1336 |
-+ AA_BUG(in_interrupt()); |
|
| 1337 |
-+ |
|
| 1338 |
-+ return af_select(sock->sk->sk_family, |
|
| 1339 |
-+ accept_perm(sock, newsock), |
|
| 1340 |
-+ aa_sk_perm(OP_ACCEPT, AA_MAY_ACCEPT, sock->sk)); |
|
| 1341 |
-+} |
|
| 1342 |
-+ |
|
| 1343 |
-+/* sendmsg, recvmsg */ |
|
| 1344 |
-+int aa_sock_msg_perm(const char *op, u32 request, struct socket *sock, |
|
| 1345 |
-+ struct msghdr *msg, int size) |
|
| 1346 |
-+{
|
|
| 1347 |
-+ AA_BUG(!sock); |
|
| 1348 |
-+ AA_BUG(!sock->sk); |
|
| 1349 |
-+ AA_BUG(!msg); |
|
| 1350 |
-+ /* TODO: .... */ |
|
| 1351 |
-+ AA_BUG(in_interrupt()); |
|
| 1352 |
-+ |
|
| 1353 |
-+ return af_select(sock->sk->sk_family, |
|
| 1354 |
-+ msg_perm(op, request, sock, msg, size), |
|
| 1355 |
-+ aa_sk_perm(op, request, sock->sk)); |
|
| 1356 |
-+} |
|
| 1357 |
-+ |
|
| 1358 |
-+/* revaliation, get/set attr, opt */ |
|
| 1359 |
-+int aa_sock_opt_perm(const char *op, u32 request, struct socket *sock, int level, |
|
| 1360 |
-+ int optname) |
|
| 1361 |
-+{
|
|
| 1362 |
-+ AA_BUG(!sock); |
|
| 1363 |
-+ AA_BUG(!sock->sk); |
|
| 1364 |
-+ AA_BUG(in_interrupt()); |
|
| 1365 |
-+ |
|
| 1366 |
-+ return af_select(sock->sk->sk_family, |
|
| 1367 |
-+ opt_perm(op, request, sock, level, optname), |
|
| 1368 |
-+ aa_sk_perm(op, request, sock->sk)); |
|
| 1369 |
-+} |
|
| 1370 |
- |
|
| 1371 |
- int aa_sock_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 1372 |
- struct socket *sock) |
|
| 1373 |
-@@ -180,5 +350,7 @@ int aa_sock_file_perm(struct aa_label *label, const char *op, u32 request, |
|
| 1374 |
- AA_BUG(!sock); |
|
| 1375 |
- AA_BUG(!sock->sk); |
|
| 1376 |
- |
|
| 1377 |
-- return aa_label_sk_perm(label, op, request, sock->sk); |
|
| 1378 |
-+ return af_select(sock->sk->sk_family, |
|
| 1379 |
-+ file_perm(label, op, request, sock), |
|
| 1380 |
-+ aa_label_sk_perm(label, op, request, sock->sk)); |
|
| 1381 |
- } |
|
| 1382 |
-2.14.1 |
|
| 1383 |
- |
| 1384 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,96 +0,0 @@ |
| 1 |
-From 6cf100df51539210b9115fe74f27ff5b139a5cfc Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Alexey Makhalov <amakhalov@vmware.com> |
|
| 3 |
-Date: Fri, 22 Dec 2017 15:54:02 -0800 |
|
| 4 |
-Subject: [PATCH] Allow some algo tests for FIPS |
|
| 5 |
- |
|
| 6 |
- crypto/testmgr.c | 10 ++++++++++ |
|
| 7 |
- 1 file changed, 10 insertions(+) |
|
| 8 |
- |
|
| 9 |
-diff --git a/crypto/testmgr.c b/crypto/testmgr.c |
|
| 10 |
-index 7125ba38..1729c52a 100644 |
|
| 11 |
-+++ b/crypto/testmgr.c |
|
| 12 |
-@@ -2357,6 +2357,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 13 |
- }, {
|
|
| 14 |
- .alg = "authenc(hmac(md5),ecb(cipher_null))", |
|
| 15 |
- .test = alg_test_aead, |
|
| 16 |
-+ .fips_allowed = 1, |
|
| 17 |
- .suite = {
|
|
| 18 |
- .aead = {
|
|
| 19 |
- .enc = __VECS(hmac_md5_ecb_cipher_null_enc_tv_template), |
|
| 20 |
-@@ -2375,6 +2376,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 21 |
- }, {
|
|
| 22 |
- .alg = "authenc(hmac(sha1),cbc(des))", |
|
| 23 |
- .test = alg_test_aead, |
|
| 24 |
-+ .fips_allowed = 1, |
|
| 25 |
- .suite = {
|
|
| 26 |
- .aead = {
|
|
| 27 |
- .enc = __VECS(hmac_sha1_des_cbc_enc_tv_temp) |
|
| 28 |
-@@ -2396,6 +2398,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 29 |
- }, {
|
|
| 30 |
- .alg = "authenc(hmac(sha1),ecb(cipher_null))", |
|
| 31 |
- .test = alg_test_aead, |
|
| 32 |
-+ .fips_allowed = 1, |
|
| 33 |
- .suite = {
|
|
| 34 |
- .aead = {
|
|
| 35 |
- .enc = __VECS(hmac_sha1_ecb_cipher_null_enc_tv_temp), |
|
| 36 |
-@@ -2435,6 +2438,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 37 |
- }, {
|
|
| 38 |
- .alg = "authenc(hmac(sha256),cbc(des))", |
|
| 39 |
- .test = alg_test_aead, |
|
| 40 |
-+ .fips_allowed = 1, |
|
| 41 |
- .suite = {
|
|
| 42 |
- .aead = {
|
|
| 43 |
- .enc = __VECS(hmac_sha256_des_cbc_enc_tv_temp) |
|
| 44 |
-@@ -2460,6 +2464,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 45 |
- }, {
|
|
| 46 |
- .alg = "authenc(hmac(sha384),cbc(des))", |
|
| 47 |
- .test = alg_test_aead, |
|
| 48 |
-+ .fips_allowed = 1, |
|
| 49 |
- .suite = {
|
|
| 50 |
- .aead = {
|
|
| 51 |
- .enc = __VECS(hmac_sha384_des_cbc_enc_tv_temp) |
|
| 52 |
-@@ -2494,6 +2499,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 53 |
- }, {
|
|
| 54 |
- .alg = "authenc(hmac(sha512),cbc(des))", |
|
| 55 |
- .test = alg_test_aead, |
|
| 56 |
-+ .fips_allowed = 1, |
|
| 57 |
- .suite = {
|
|
| 58 |
- .aead = {
|
|
| 59 |
- .enc = __VECS(hmac_sha512_des_cbc_enc_tv_temp) |
|
| 60 |
-@@ -3193,6 +3199,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 61 |
- .alg = "jitterentropy_rng", |
|
| 62 |
- .fips_allowed = 1, |
|
| 63 |
- .test = alg_test_null, |
|
| 64 |
-+ .fips_allowed = 1, |
|
| 65 |
- }, {
|
|
| 66 |
- .alg = "kw(aes)", |
|
| 67 |
- .test = alg_test_skcipher, |
|
| 68 |
-@@ -3373,6 +3380,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 69 |
- }, {
|
|
| 70 |
- .alg = "rfc4543(gcm(aes))", |
|
| 71 |
- .test = alg_test_aead, |
|
| 72 |
-+ .fips_allowed = 1, |
|
| 73 |
- .suite = {
|
|
| 74 |
- .aead = {
|
|
| 75 |
- .enc = __VECS(aes_gcm_rfc4543_enc_tv_template), |
|
| 76 |
-@@ -3391,6 +3399,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 77 |
- }, {
|
|
| 78 |
- .alg = "rfc7539esp(chacha20,poly1305)", |
|
| 79 |
- .test = alg_test_aead, |
|
| 80 |
-+ .fips_allowed = 1, |
|
| 81 |
- .suite = {
|
|
| 82 |
- .aead = {
|
|
| 83 |
- .enc = __VECS(rfc7539esp_enc_tv_template), |
|
| 84 |
-@@ -3587,6 +3596,7 @@ static const struct alg_test_desc alg_test_descs[] = {
|
|
| 85 |
- }, {
|
|
| 86 |
- .alg = "xts(twofish)", |
|
| 87 |
- .test = alg_test_skcipher, |
|
| 88 |
-+ .fips_allowed = 1, |
|
| 89 |
- .suite = {
|
|
| 90 |
- .cipher = {
|
|
| 91 |
- .enc = __VECS(tf_xts_enc_tv_template), |
|
| 92 |
-2.11.0 |
|
| 93 |
- |
| 94 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,102 +0,0 @@ |
| 1 |
-From: Serge Hallyn <serge.hallyn@canonical.com> |
|
| 2 |
-Date: Fri, 31 May 2013 19:12:12 +0000 (+0100) |
|
| 3 |
-Subject: add sysctl to disallow unprivileged CLONE_NEWUSER by default |
|
| 4 |
-Origin: http://kernel.ubuntu.com/git?p=serge%2Fubuntu-saucy.git;a=commit;h=5c847404dcb2e3195ad0057877e1422ae90892b8 |
|
| 5 |
- |
|
| 6 |
-add sysctl to disallow unprivileged CLONE_NEWUSER by default |
|
| 7 |
- |
|
| 8 |
-This is a short-term patch. Unprivileged use of CLONE_NEWUSER |
|
| 9 |
-is certainly an intended feature of user namespaces. However |
|
| 10 |
-for at least saucy we want to make sure that, if any security |
|
| 11 |
-issues are found, we have a fail-safe. |
|
| 12 |
- |
|
| 13 |
-Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> |
|
| 14 |
-[bwh: Remove unneeded binary sysctl bits] |
|
| 15 |
-[Srivatsa: Fix capability checks when running nested user namespaces by |
|
| 16 |
-using ns_capable() on the current task's user namespace.] |
|
| 17 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 18 |
- |
|
| 19 |
-diff --git a/kernel/fork.c b/kernel/fork.c |
|
| 20 |
-index 9321b1a..34d50a6 100644 |
|
| 21 |
-+++ b/kernel/fork.c |
|
| 22 |
-@@ -88,6 +88,11 @@ |
|
| 23 |
- |
|
| 24 |
- #define CREATE_TRACE_POINTS |
|
| 25 |
- #include <trace/events/task.h> |
|
| 26 |
-+#ifdef CONFIG_USER_NS |
|
| 27 |
-+extern int unprivileged_userns_clone; |
|
| 28 |
-+#else |
|
| 29 |
-+#define unprivileged_userns_clone 0 |
|
| 30 |
-+#endif |
|
| 31 |
- |
|
| 32 |
- /* |
|
| 33 |
- * Minimum number of threads to boot the kernel |
|
| 34 |
-@@ -1476,6 +1481,10 @@ static __latent_entropy struct task_struct *copy_process( |
|
| 35 |
- if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) |
|
| 36 |
- return ERR_PTR(-EINVAL); |
|
| 37 |
- |
|
| 38 |
-+ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) |
|
| 39 |
-+ if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN)) |
|
| 40 |
-+ return ERR_PTR(-EPERM); |
|
| 41 |
-+ |
|
| 42 |
- /* |
|
| 43 |
- * Thread groups must share signals as well, and detached threads |
|
| 44 |
- * can only be started up within the thread group. |
|
| 45 |
-@@ -2216,6 +2225,12 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) |
|
| 46 |
- if (unshare_flags & CLONE_NEWNS) |
|
| 47 |
- unshare_flags |= CLONE_FS; |
|
| 48 |
- |
|
| 49 |
-+ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
|
|
| 50 |
-+ err = -EPERM; |
|
| 51 |
-+ if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN)) |
|
| 52 |
-+ goto bad_unshare_out; |
|
| 53 |
-+ } |
|
| 54 |
-+ |
|
| 55 |
- err = check_unshare_flags(unshare_flags); |
|
| 56 |
- if (err) |
|
| 57 |
- goto bad_unshare_out; |
|
| 58 |
-diff --git a/kernel/sysctl.c b/kernel/sysctl.c |
|
| 59 |
-index 8dc9e80..0d91b8e 100644 |
|
| 60 |
-+++ b/kernel/sysctl.c |
|
| 61 |
-@@ -104,6 +104,9 @@ extern int core_uses_pid; |
|
| 62 |
- extern char core_pattern[]; |
|
| 63 |
- extern unsigned int core_pipe_limit; |
|
| 64 |
- #endif |
|
| 65 |
-+#ifdef CONFIG_USER_NS |
|
| 66 |
-+extern int unprivileged_userns_clone; |
|
| 67 |
-+#endif |
|
| 68 |
- extern int pid_max; |
|
| 69 |
- extern int pid_max_min, pid_max_max; |
|
| 70 |
- extern int percpu_pagelist_fraction; |
|
| 71 |
-@@ -504,6 +507,15 @@ static struct ctl_table kern_table[] = {
|
|
| 72 |
- .proc_handler = proc_dointvec, |
|
| 73 |
- }, |
|
| 74 |
- #endif |
|
| 75 |
-+#ifdef CONFIG_USER_NS |
|
| 76 |
-+ {
|
|
| 77 |
-+ .procname = "unprivileged_userns_clone", |
|
| 78 |
-+ .data = &unprivileged_userns_clone, |
|
| 79 |
-+ .maxlen = sizeof(int), |
|
| 80 |
-+ .mode = 0644, |
|
| 81 |
-+ .proc_handler = proc_dointvec, |
|
| 82 |
-+ }, |
|
| 83 |
-+#endif |
|
| 84 |
- #ifdef CONFIG_PROC_SYSCTL |
|
| 85 |
- {
|
|
| 86 |
- .procname = "tainted", |
|
| 87 |
-diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c |
|
| 88 |
-index 86b7854..4e2e171 100644 |
|
| 89 |
-+++ b/kernel/user_namespace.c |
|
| 90 |
-@@ -23,6 +23,9 @@ |
|
| 91 |
- #include <linux/projid.h> |
|
| 92 |
- #include <linux/fs_struct.h> |
|
| 93 |
- |
|
| 94 |
-+/* sysctl */ |
|
| 95 |
-+int unprivileged_userns_clone; |
|
| 96 |
-+ |
|
| 97 |
- static struct kmem_cache *user_ns_cachep __read_mostly; |
|
| 98 |
- static DEFINE_MUTEX(userns_state_mutex); |
|
| 99 |
- |
| ... | ... |
@@ -28,24 +28,24 @@ Reviewed-by: Frederick Lefebvre <fredlef@amazon.com> |
| 28 | 28 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 29 | 29 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 30 | 30 |
CR: https://cr.amazon.com/r/8209723/ |
| 31 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 31 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 32 | 32 |
--- |
| 33 | 33 |
kernel/watchdog.c | 28 ++++++++++++++++++++++++++++ |
| 34 | 34 |
1 file changed, 28 insertions(+) |
| 35 | 35 |
|
| 36 | 36 |
diff --git a/kernel/watchdog.c b/kernel/watchdog.c |
| 37 |
-index c8e06703e44c..2e4362e7ff1b 100644 |
|
| 37 |
+index 51f5a64..593d4dd 100644 |
|
| 38 | 38 |
--- a/kernel/watchdog.c |
| 39 | 39 |
+++ b/kernel/watchdog.c |
| 40 |
-@@ -25,6 +25,7 @@ |
|
| 41 |
- #include <linux/workqueue.h> |
|
| 40 |
+@@ -26,6 +26,7 @@ |
|
| 42 | 41 |
#include <linux/sched/clock.h> |
| 43 | 42 |
#include <linux/sched/debug.h> |
| 43 |
+ #include <linux/sched/isolation.h> |
|
| 44 | 44 |
+#include <linux/dmi.h> |
| 45 | 45 |
|
| 46 | 46 |
#include <asm/irq_regs.h> |
| 47 | 47 |
#include <linux/kvm_para.h> |
| 48 |
-@@ -97,6 +98,31 @@ __setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup);
|
|
| 48 |
+@@ -98,6 +99,31 @@ __setup("hardlockup_all_cpu_backtrace=", hardlockup_all_cpu_backtrace_setup);
|
|
| 49 | 49 |
# endif /* CONFIG_SMP */ |
| 50 | 50 |
#endif /* CONFIG_HARDLOCKUP_DETECTOR */ |
| 51 | 51 |
|
| ... | ... |
@@ -77,15 +77,15 @@ index c8e06703e44c..2e4362e7ff1b 100644 |
| 77 | 77 |
/* |
| 78 | 78 |
* These functions can be overridden if an architecture implements its |
| 79 | 79 |
* own hardlockup detector. |
| 80 |
-@@ -774,6 +800,8 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write, |
|
| 80 |
+@@ -775,6 +801,8 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write, |
|
| 81 | 81 |
|
| 82 | 82 |
void __init lockup_detector_init(void) |
| 83 | 83 |
{
|
| 84 | 84 |
+ dmi_check_system(watchdog_virt_dmi_table); |
| 85 | 85 |
+ |
| 86 |
- #ifdef CONFIG_NO_HZ_FULL |
|
| 87 |
- if (tick_nohz_full_enabled()) {
|
|
| 86 |
+ if (tick_nohz_full_enabled()) |
|
| 88 | 87 |
pr_info("Disabling watchdog on nohz_full cores by default\n");
|
| 88 |
+ |
|
| 89 | 89 |
-- |
| 90 | 90 |
2.14.4 |
| 91 | 91 |
|
| ... | ... |
@@ -19,7 +19,7 @@ Reviewed-by: Frederick Lefebvre <fredlef@amazon.com> |
| 19 | 19 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 20 | 20 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 21 | 21 |
CR: https://cr.amazon.com/r/8209723/ |
| 22 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 22 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 23 | 23 |
--- |
| 24 | 24 |
include/uapi/linux/ip.h | 2 +- |
| 25 | 25 |
1 file changed, 1 insertion(+), 1 deletion(-) |
| ... | ... |
@@ -18,24 +18,24 @@ Reviewed-by: Frederick Lefebvre <fredlef@amazon.com> |
| 18 | 18 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 19 | 19 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 20 | 20 |
CR: https://cr.amazon.com/r/8209723/ |
| 21 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 21 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 22 | 22 |
--- |
| 23 | 23 |
net/ipv4/tcp.c | 2 +- |
| 24 | 24 |
1 file changed, 1 insertion(+), 1 deletion(-) |
| 25 | 25 |
|
| 26 | 26 |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
| 27 |
-index 7462ec7587ce..c6cce1517a50 100644 |
|
| 27 |
+index 238a5c3..975aae9 100644 |
|
| 28 | 28 |
--- a/net/ipv4/tcp.c |
| 29 | 29 |
+++ b/net/ipv4/tcp.c |
| 30 |
-@@ -3544,7 +3544,7 @@ void __init tcp_init(void) |
|
| 30 |
+@@ -3857,7 +3857,7 @@ void __init tcp_init(void) |
|
| 31 | 31 |
max_rshare = min(6UL*1024*1024, limit); |
| 32 | 32 |
|
| 33 |
- sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; |
|
| 34 |
-- sysctl_tcp_wmem[1] = 16*1024; |
|
| 35 |
-+ sysctl_tcp_wmem[1] = 20*1024; |
|
| 36 |
- sysctl_tcp_wmem[2] = max(64*1024, max_wshare); |
|
| 33 |
+ init_net.ipv4.sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; |
|
| 34 |
+- init_net.ipv4.sysctl_tcp_wmem[1] = 16*1024; |
|
| 35 |
++ init_net.ipv4.sysctl_tcp_wmem[1] = 20*1024; |
|
| 36 |
+ init_net.ipv4.sysctl_tcp_wmem[2] = max(64*1024, max_wshare); |
|
| 37 | 37 |
|
| 38 |
- sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; |
|
| 38 |
+ init_net.ipv4.sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; |
|
| 39 | 39 |
-- |
| 40 | 40 |
2.14.4 |
| 41 | 41 |
|
| 42 | 42 |
deleted file mode 100644 |
| ... | ... |
@@ -1,64 +0,0 @@ |
| 1 |
-From 310c6f808e8c40afb84c8959a489aacc22fdf768 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 3 |
-Date: Tue, 19 Sep 2017 17:47:37 +0000 |
|
| 4 |
-Subject: nvme: update timeout module parameter type |
|
| 5 |
- |
|
| 6 |
-The underlying blk_mq_tag_set, and request timeout parameters support an |
|
| 7 |
-unsigned int. Extend the size of the nvme module parameters for io and |
|
| 8 |
-admin commands to match. |
|
| 9 |
- |
|
| 10 |
-Reviewed-by: Cristian Gafton <gafton@amazon.com> |
|
| 11 |
-Reviewed-by: Frederick Lefebvre <fredlef@amazon.com> |
|
| 12 |
-Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
|
| 13 |
-Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
|
| 14 |
-Signed-off-by: Marc Olson <marcolso@amazon.com> |
|
| 15 |
-Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 16 |
-CR: https://cr.amazon.com/r/8209723/ |
|
| 17 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 18 |
- drivers/nvme/host/core.c | 8 ++++---- |
|
| 19 |
- drivers/nvme/host/nvme.h | 4 ++-- |
|
| 20 |
- 2 files changed, 6 insertions(+), 6 deletions(-) |
|
| 21 |
- |
|
| 22 |
-diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c |
|
| 23 |
-index 3a63d58d2ca9..4ff673a8d95f 100644 |
|
| 24 |
-+++ b/drivers/nvme/host/core.c |
|
| 25 |
-@@ -34,13 +34,13 @@ |
|
| 26 |
- |
|
| 27 |
- #define NVME_MINORS (1U << MINORBITS) |
|
| 28 |
- |
|
| 29 |
--unsigned char admin_timeout = 60; |
|
| 30 |
--module_param(admin_timeout, byte, 0644); |
|
| 31 |
-+unsigned int admin_timeout = 60; |
|
| 32 |
-+module_param(admin_timeout, uint, 0644); |
|
| 33 |
- MODULE_PARM_DESC(admin_timeout, "timeout in seconds for admin commands"); |
|
| 34 |
- EXPORT_SYMBOL_GPL(admin_timeout); |
|
| 35 |
- |
|
| 36 |
--unsigned char nvme_io_timeout = 30; |
|
| 37 |
--module_param_named(io_timeout, nvme_io_timeout, byte, 0644); |
|
| 38 |
-+unsigned int nvme_io_timeout = 30; |
|
| 39 |
-+module_param_named(io_timeout, nvme_io_timeout, uint, 0644); |
|
| 40 |
- MODULE_PARM_DESC(io_timeout, "timeout in seconds for I/O"); |
|
| 41 |
- EXPORT_SYMBOL_GPL(nvme_io_timeout); |
|
| 42 |
- |
|
| 43 |
-diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h |
|
| 44 |
-index 7ef0a8e1c3e8..5b7ea2f07e7b 100644 |
|
| 45 |
-+++ b/drivers/nvme/host/nvme.h |
|
| 46 |
-@@ -21,10 +21,10 @@ |
|
| 47 |
- #include <linux/lightnvm.h> |
|
| 48 |
- #include <linux/sed-opal.h> |
|
| 49 |
- |
|
| 50 |
--extern unsigned char nvme_io_timeout; |
|
| 51 |
-+extern unsigned int nvme_io_timeout; |
|
| 52 |
- #define NVME_IO_TIMEOUT (nvme_io_timeout * HZ) |
|
| 53 |
- |
|
| 54 |
--extern unsigned char admin_timeout; |
|
| 55 |
-+extern unsigned int admin_timeout; |
|
| 56 |
- #define ADMIN_TIMEOUT (admin_timeout * HZ) |
|
| 57 |
- |
|
| 58 |
- #define NVME_DEFAULT_KATO 5 |
|
| 59 |
-2.14.4 |
|
| 60 |
- |
| ... | ... |
@@ -15,7 +15,7 @@ Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 15 | 15 |
Reviewed-by: Anchal Agarwal <anchalag@amazon.com> |
| 16 | 16 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 17 | 17 |
CR: https://cr.amazon.com/r/8244644/ |
| 18 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 18 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 19 | 19 |
--- |
| 20 | 20 |
drivers/Kconfig | 2 ++ |
| 21 | 21 |
drivers/Makefile | 3 +++ |
| ... | ... |
@@ -26,30 +26,30 @@ Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
| 26 | 26 |
create mode 100644 drivers/amazon/Makefile |
| 27 | 27 |
|
| 28 | 28 |
diff --git a/drivers/Kconfig b/drivers/Kconfig |
| 29 |
-index 1d7af3c2ff27..3c5ebdcea0e8 100644 |
|
| 29 |
+index 95b9ccc..9553a18 100644 |
|
| 30 | 30 |
--- a/drivers/Kconfig |
| 31 | 31 |
+++ b/drivers/Kconfig |
| 32 |
-@@ -209,4 +209,6 @@ source "drivers/tee/Kconfig" |
|
| 32 |
+@@ -217,4 +217,6 @@ source "drivers/siox/Kconfig" |
|
| 33 | 33 |
|
| 34 |
- source "drivers/mux/Kconfig" |
|
| 34 |
+ source "drivers/slimbus/Kconfig" |
|
| 35 | 35 |
|
| 36 | 36 |
+source "drivers/amazon/Kconfig" |
| 37 | 37 |
+ |
| 38 | 38 |
endmenu |
| 39 | 39 |
diff --git a/drivers/Makefile b/drivers/Makefile |
| 40 |
-index 5f5ccdbad21a..786e6c558881 100644 |
|
| 40 |
+index 24cd470..a7422af 100644 |
|
| 41 | 41 |
--- a/drivers/Makefile |
| 42 | 42 |
+++ b/drivers/Makefile |
| 43 |
-@@ -183,3 +183,6 @@ obj-$(CONFIG_FPGA) += fpga/ |
|
| 44 |
- obj-$(CONFIG_FSI) += fsi/ |
|
| 45 |
- obj-$(CONFIG_TEE) += tee/ |
|
| 43 |
+@@ -185,3 +185,6 @@ obj-$(CONFIG_TEE) += tee/ |
|
| 46 | 44 |
obj-$(CONFIG_MULTIPLEXER) += mux/ |
| 45 |
+ obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ |
|
| 46 |
+ obj-$(CONFIG_SIOX) += siox/ |
|
| 47 | 47 |
+ |
| 48 | 48 |
+# Amazon driver updates |
| 49 | 49 |
+obj-$(CONFIG_AMAZON_DRIVER_UPDATES) += amazon/ |
| 50 | 50 |
diff --git a/drivers/amazon/Kconfig b/drivers/amazon/Kconfig |
| 51 | 51 |
new file mode 100644 |
| 52 |
-index 000000000000..10ff3828e250 |
|
| 52 |
+index 0000000..10ff382 |
|
| 53 | 53 |
--- /dev/null |
| 54 | 54 |
+++ b/drivers/amazon/Kconfig |
| 55 | 55 |
@@ -0,0 +1,15 @@ |
| ... | ... |
@@ -70,7 +70,7 @@ index 000000000000..10ff3828e250 |
| 70 | 70 |
+endif # AMAZON_DRIVER_UPDATES |
| 71 | 71 |
diff --git a/drivers/amazon/Makefile b/drivers/amazon/Makefile |
| 72 | 72 |
new file mode 100644 |
| 73 |
-index 000000000000..6b4996dcbe52 |
|
| 73 |
+index 0000000..6b4996d |
|
| 74 | 74 |
--- /dev/null |
| 75 | 75 |
+++ b/drivers/amazon/Makefile |
| 76 | 76 |
@@ -0,0 +1,3 @@ |
| ... | ... |
@@ -14,7 +14,7 @@ Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 14 | 14 |
Reviewed-by: Anchal Agarwal <anchalag@amazon.com> |
| 15 | 15 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 16 | 16 |
CR: https://cr.amazon.com/r/8244644/ |
| 17 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 17 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 18 | 18 |
--- |
| 19 | 19 |
drivers/amazon/Makefile | 1 + |
| 20 | 20 |
drivers/amazon/net/Makefile | 3 +++ |
| ... | ... |
@@ -14,7 +14,7 @@ Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 14 | 14 |
Reviewed-by: Anchal Agarwal <anchalag@amazon.com> |
| 15 | 15 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 16 | 16 |
CR: https://cr.amazon.com/r/8244644/ |
| 17 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 17 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 18 | 18 |
--- |
| 19 | 19 |
drivers/amazon/Kconfig | 9 +++++++++ |
| 20 | 20 |
drivers/amazon/net/Makefile | 1 + |
| ... | ... |
@@ -7,7 +7,7 @@ Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 7 | 7 |
Reviewed-by: Anchal Agarwal <anchalag@amazon.com> |
| 8 | 8 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 9 | 9 |
CR: https://cr.amazon.com/r/8244644/ |
| 10 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 10 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 11 | 11 |
--- |
| 12 | 12 |
drivers/amazon/net/ena/Makefile | 11 + |
| 13 | 13 |
drivers/amazon/net/ena/ena_admin_defs.h | 1018 ++++++++ |
| ... | ... |
@@ -22,7 +22,7 @@ Reviewed-by: Sebastian Biemueller <sbiemue@amazon.com> |
| 22 | 22 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 23 | 23 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 24 | 24 |
CR: https://cr.amazon.com/r/8273194/ |
| 25 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 25 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 26 | 26 |
--- |
| 27 | 27 |
drivers/xen/manage.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 28 | 28 |
1 file changed, 58 insertions(+) |
| ... | ... |
@@ -15,7 +15,7 @@ Reviewed-by: Sebastian Biemueller <sbiemue@amazon.com> |
| 15 | 15 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 16 | 16 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 17 | 17 |
CR: https://cr.amazon.com/r/8273190/ |
| 18 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 18 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 19 | 19 |
--- |
| 20 | 20 |
drivers/xen/manage.c | 15 +++++++++++++++ |
| 21 | 21 |
include/xen/xen-ops.h | 4 ++++ |
| ... | ... |
@@ -23,7 +23,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 23 | 23 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 24 | 24 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 25 | 25 |
CR: https://cr.amazon.com/r/8273200/ |
| 26 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 26 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 27 | 27 |
--- |
| 28 | 28 |
drivers/xen/xenbus/xenbus_probe.c | 102 ++++++++++++++++++++++++++++++++------ |
| 29 | 29 |
include/xen/xenbus.h | 3 ++ |
| ... | ... |
@@ -22,7 +22,7 @@ Reviewed-by: Sebastian Biemueller <sbiemue@amazon.com> |
| 22 | 22 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 23 | 23 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 24 | 24 |
CR: https://cr.amazon.com/r/8273203/ |
| 25 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 25 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 26 | 26 |
--- |
| 27 | 27 |
arch/x86/xen/enlighten_hvm.c | 7 +++++++ |
| 28 | 28 |
arch/x86/xen/xen-ops.h | 1 + |
| ... | ... |
@@ -15,7 +15,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 15 | 15 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 16 | 16 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 17 | 17 |
CR: https://cr.amazon.com/r/8273204/ |
| 18 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 18 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 19 | 19 |
--- |
| 20 | 20 |
arch/x86/xen/enlighten_hvm.c | 1 + |
| 21 | 21 |
arch/x86/xen/suspend.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ |
| ... | ... |
@@ -49,7 +49,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 49 | 49 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 50 | 50 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 51 | 51 |
CR: https://cr.amazon.com/r/8297625/ |
| 52 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 52 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 53 | 53 |
--- |
| 54 | 54 |
drivers/block/xen-blkfront.c | 164 ++++++++++++++++++++++++++++++++++++++++--- |
| 55 | 55 |
1 file changed, 156 insertions(+), 8 deletions(-) |
| ... | ... |
@@ -24,7 +24,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 24 | 24 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 25 | 25 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 26 | 26 |
CR: https://cr.amazon.com/r/8297632 |
| 27 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 27 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 28 | 28 |
--- |
| 29 | 29 |
drivers/net/xen-netfront.c | 97 +++++++++++++++++++++++++++++++++++++++++++++- |
| 30 | 30 |
1 file changed, 96 insertions(+), 1 deletion(-) |
| ... | ... |
@@ -31,26 +31,27 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 31 | 31 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 32 | 32 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 33 | 33 |
CR: https://cr.amazon.com/r/8273209/ |
| 34 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 34 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 35 | 35 |
--- |
| 36 | 36 |
drivers/xen/time.c | 28 +++++++++++++++++++++++++++- |
| 37 | 37 |
include/xen/xen-ops.h | 2 ++ |
| 38 | 38 |
2 files changed, 29 insertions(+), 1 deletion(-) |
| 39 | 39 |
|
| 40 | 40 |
diff --git a/drivers/xen/time.c b/drivers/xen/time.c |
| 41 |
-index a63fedbdcbe9..94cc2b2733a6 100644 |
|
| 41 |
+index 3e741cd..896f231 100644 |
|
| 42 | 42 |
--- a/drivers/xen/time.c |
| 43 | 43 |
+++ b/drivers/xen/time.c |
| 44 |
-@@ -19,6 +19,8 @@ |
|
| 44 |
+@@ -23,6 +23,9 @@ static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate); |
|
| 45 |
+ |
|
| 46 |
+ static DEFINE_PER_CPU(u64[4], old_runstate_time); |
|
| 45 | 47 |
|
| 46 |
- /* runstate info updated by Xen */ |
|
| 47 |
- static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate); |
|
| 48 | 48 |
+static DEFINE_PER_CPU(u64, xen_prev_steal_clock); |
| 49 | 49 |
+static DEFINE_PER_CPU(u64, xen_steal_clock_offset); |
| 50 |
- |
|
| 50 |
++ |
|
| 51 | 51 |
/* return an consistent snapshot of 64-bit time/counter value */ |
| 52 | 52 |
static u64 get64(const u64 *p) |
| 53 |
-@@ -81,7 +83,7 @@ bool xen_vcpu_stolen(int vcpu) |
|
| 53 |
+ {
|
|
| 54 |
+@@ -149,7 +152,7 @@ bool xen_vcpu_stolen(int vcpu) |
|
| 54 | 55 |
return per_cpu(xen_runstate, vcpu).state == RUNSTATE_runnable; |
| 55 | 56 |
} |
| 56 | 57 |
|
| ... | ... |
@@ -59,7 +60,7 @@ index a63fedbdcbe9..94cc2b2733a6 100644 |
| 59 | 59 |
{
|
| 60 | 60 |
struct vcpu_runstate_info state; |
| 61 | 61 |
|
| 62 |
-@@ -89,6 +91,30 @@ u64 xen_steal_clock(int cpu) |
|
| 62 |
+@@ -157,6 +160,30 @@ u64 xen_steal_clock(int cpu) |
|
| 63 | 63 |
return state.time[RUNSTATE_runnable] + state.time[RUNSTATE_offline]; |
| 64 | 64 |
} |
| 65 | 65 |
|
| ... | ... |
@@ -91,11 +92,11 @@ index a63fedbdcbe9..94cc2b2733a6 100644 |
| 91 | 91 |
{
|
| 92 | 92 |
struct vcpu_register_runstate_memory_area area; |
| 93 | 93 |
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h |
| 94 |
-index 90c2b41eb4f3..ad4100683cf4 100644 |
|
| 94 |
+index d7503ec..cb98070 100644 |
|
| 95 | 95 |
--- a/include/xen/xen-ops.h |
| 96 | 96 |
+++ b/include/xen/xen-ops.h |
| 97 |
-@@ -35,6 +35,8 @@ void xen_setup_runstate_info(int cpu); |
|
| 98 |
- void xen_time_setup_guest(void); |
|
| 97 |
+@@ -36,6 +36,8 @@ void xen_time_setup_guest(void); |
|
| 98 |
+ void xen_manage_runstate_time(int action); |
|
| 99 | 99 |
void xen_get_runstate_snapshot(struct vcpu_runstate_info *res); |
| 100 | 100 |
u64 xen_steal_clock(int cpu); |
| 101 | 101 |
+void xen_save_steal_clock(int cpu); |
| ... | ... |
@@ -13,7 +13,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 13 | 13 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 14 | 14 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 15 | 15 |
CR: https://cr.amazon.com/r/8273212/ |
| 16 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 16 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 17 | 17 |
--- |
| 18 | 18 |
arch/x86/xen/suspend.c | 13 ++++++++++++- |
| 19 | 19 |
arch/x86/xen/time.c | 3 +++ |
| ... | ... |
@@ -12,7 +12,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 12 | 12 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 13 | 13 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 14 | 14 |
CR: https://cr.amazon.com/r/8273214/ |
| 15 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 15 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 16 | 16 |
--- |
| 17 | 17 |
drivers/xen/events/events_base.c | 12 ++++++++++++ |
| 18 | 18 |
include/xen/events.h | 1 + |
| ... | ... |
@@ -58,7 +58,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 58 | 58 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 59 | 59 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 60 | 60 |
CR: https://cr.amazon.com/r/8273217/ |
| 61 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 61 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 62 | 62 |
--- |
| 63 | 63 |
arch/x86/xen/suspend.c | 2 ++ |
| 64 | 64 |
1 file changed, 2 insertions(+) |
| ... | ... |
@@ -19,7 +19,7 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 19 | 19 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 20 | 20 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 21 | 21 |
CR: https://cr.amazon.com/r/8297650/ |
| 22 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 22 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 23 | 23 |
--- |
| 24 | 24 |
kernel/power/user.c | 6 +++++- |
| 25 | 25 |
1 file changed, 5 insertions(+), 1 deletion(-) |
| ... | ... |
@@ -26,28 +26,28 @@ Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 26 | 26 |
Reviewed-by: Munehisa Kamata <kamatam@amazon.com> |
| 27 | 27 |
Reviewed-by: Eduardo Valentin <eduval@amazon.com> |
| 28 | 28 |
CR: https://cr.amazon.com/r/8297651/ |
| 29 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 29 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 30 | 30 |
--- |
| 31 | 31 |
kernel/power/swap.c | 238 ++++++++++++++++++++++++++++++++++++++++++++-------- |
| 32 | 32 |
1 file changed, 203 insertions(+), 35 deletions(-) |
| 33 | 33 |
|
| 34 | 34 |
diff --git a/kernel/power/swap.c b/kernel/power/swap.c |
| 35 |
-index d7cdc426ee38..e21d587a8b16 100644 |
|
| 35 |
+index c2bcf97..854dd22 100644 |
|
| 36 | 36 |
--- a/kernel/power/swap.c |
| 37 | 37 |
+++ b/kernel/power/swap.c |
| 38 |
-@@ -60,6 +60,11 @@ static bool clean_pages_on_decompress; |
|
| 39 |
- |
|
| 38 |
+@@ -63,6 +63,11 @@ static bool clean_pages_on_decompress; |
|
| 40 | 39 |
#define MAP_PAGE_ENTRIES (PAGE_SIZE / sizeof(sector_t) - 1) |
| 41 | 40 |
|
| 42 |
-+/* |
|
| 41 |
+ /* |
|
| 43 | 42 |
+ * The number of pages in each BIO request |
| 44 | 43 |
+ */ |
| 45 | 44 |
+#define HIB_BIO_BATCH_SIZE 63u |
| 46 | 45 |
+ |
| 47 |
- /* |
|
| 46 |
++/* |
|
| 48 | 47 |
* Number of free pages that are not high. |
| 49 | 48 |
*/ |
| 50 |
-@@ -226,6 +231,7 @@ struct hib_bio_batch {
|
|
| 49 |
+ static inline unsigned long low_free_pages(void) |
|
| 50 |
+@@ -228,6 +233,7 @@ struct hib_bio_batch {
|
|
| 51 | 51 |
atomic_t count; |
| 52 | 52 |
wait_queue_head_t wait; |
| 53 | 53 |
blk_status_t error; |
| ... | ... |
@@ -55,7 +55,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 55 | 55 |
}; |
| 56 | 56 |
|
| 57 | 57 |
static void hib_init_batch(struct hib_bio_batch *hb) |
| 58 |
-@@ -233,25 +239,30 @@ static void hib_init_batch(struct hib_bio_batch *hb) |
|
| 58 |
+@@ -235,25 +241,30 @@ static void hib_init_batch(struct hib_bio_batch *hb) |
|
| 59 | 59 |
atomic_set(&hb->count, 0); |
| 60 | 60 |
init_waitqueue_head(&hb->wait); |
| 61 | 61 |
hb->error = BLK_STS_OK; |
| ... | ... |
@@ -65,7 +65,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 65 | 65 |
static void hib_end_io(struct bio *bio) |
| 66 | 66 |
{
|
| 67 | 67 |
struct hib_bio_batch *hb = bio->bi_private; |
| 68 |
-- struct page *page = bio->bi_io_vec[0].bv_page; |
|
| 68 |
+- struct page *page = bio_first_page_all(bio); |
|
| 69 | 69 |
- |
| 70 | 70 |
+ size_t i; |
| 71 | 71 |
+ |
| ... | ... |
@@ -80,22 +80,21 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 80 | 80 |
+ (unsigned long)page_address(page) + PAGE_SIZE); |
| 81 | 81 |
+ } |
| 82 | 82 |
if (bio->bi_status) {
|
| 83 |
- printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n", |
|
| 84 |
- MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), |
|
| 85 |
- (unsigned long long)bio->bi_iter.bi_sector); |
|
| 83 |
+ pr_alert("Read-error on swap-device (%u:%u:%Lu)\n",
|
|
| 84 |
+ MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), |
|
| 85 |
+ (unsigned long long)bio->bi_iter.bi_sector); |
|
| 86 | 86 |
} |
| 87 |
-- |
|
| 87 |
+ |
|
| 88 | 88 |
- if (bio_data_dir(bio) == WRITE) |
| 89 | 89 |
- put_page(page); |
| 90 | 90 |
- else if (clean_pages_on_read) |
| 91 | 91 |
- flush_icache_range((unsigned long)page_address(page), |
| 92 | 92 |
- (unsigned long)page_address(page) + PAGE_SIZE); |
| 93 | 93 |
- |
| 94 |
-+ |
|
| 95 | 94 |
if (bio->bi_status && !hb->error) |
| 96 | 95 |
hb->error = bio->bi_status; |
| 97 | 96 |
if (atomic_dec_and_test(&hb->count)) |
| 98 |
-@@ -260,6 +271,66 @@ static void hib_end_io(struct bio *bio) |
|
| 97 |
+@@ -262,6 +273,66 @@ static void hib_end_io(struct bio *bio) |
|
| 99 | 98 |
bio_put(bio); |
| 100 | 99 |
} |
| 101 | 100 |
|
| ... | ... |
@@ -162,16 +161,16 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 162 | 162 |
static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
| 163 | 163 |
struct hib_bio_batch *hb) |
| 164 | 164 |
{
|
| 165 |
-@@ -268,6 +339,8 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
|
| 165 |
+@@ -270,6 +341,8 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
|
| 166 | 166 |
int error = 0; |
| 167 | 167 |
|
| 168 |
- bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); |
|
| 168 |
+ bio = bio_alloc(GFP_NOIO | __GFP_HIGH, 1); |
|
| 169 | 169 |
+ if (!bio) |
| 170 | 170 |
+ return -ENOMEM; |
| 171 | 171 |
bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); |
| 172 | 172 |
bio_set_dev(bio, hib_resume_bdev); |
| 173 | 173 |
bio_set_op_attrs(bio, op, op_flags); |
| 174 |
-@@ -280,10 +353,7 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
|
| 174 |
+@@ -282,10 +355,7 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
|
| 175 | 175 |
} |
| 176 | 176 |
|
| 177 | 177 |
if (hb) {
|
| ... | ... |
@@ -183,7 +182,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 183 | 183 |
} else {
|
| 184 | 184 |
error = submit_bio_wait(bio); |
| 185 | 185 |
bio_put(bio); |
| 186 |
-@@ -294,6 +364,10 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
|
| 186 |
+@@ -296,6 +366,10 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
|
| 187 | 187 |
|
| 188 | 188 |
static blk_status_t hib_wait_io(struct hib_bio_batch *hb) |
| 189 | 189 |
{
|
| ... | ... |
@@ -194,7 +193,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 194 | 194 |
wait_event(hb->wait, atomic_read(&hb->count) == 0); |
| 195 | 195 |
return blk_status_to_errno(hb->error); |
| 196 | 196 |
} |
| 197 |
-@@ -396,6 +470,21 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb) |
|
| 197 |
+@@ -398,6 +472,21 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb) |
|
| 198 | 198 |
} else {
|
| 199 | 199 |
src = buf; |
| 200 | 200 |
} |
| ... | ... |
@@ -216,7 +215,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 216 | 216 |
return hib_submit_io(REQ_OP_WRITE, REQ_SYNC, offset, src, hb); |
| 217 | 217 |
} |
| 218 | 218 |
|
| 219 |
-@@ -1011,35 +1100,106 @@ static int get_swap_reader(struct swap_map_handle *handle, |
|
| 219 |
+@@ -1007,35 +1096,106 @@ static int get_swap_reader(struct swap_map_handle *handle, |
|
| 220 | 220 |
return 0; |
| 221 | 221 |
} |
| 222 | 222 |
|
| ... | ... |
@@ -342,7 +341,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 342 | 342 |
static int swap_reader_finish(struct swap_map_handle *handle) |
| 343 | 343 |
{
|
| 344 | 344 |
release_swap_reader(handle); |
| 345 |
-@@ -1300,8 +1460,13 @@ static int load_image_lzo(struct swap_map_handle *handle, |
|
| 345 |
+@@ -1292,8 +1452,13 @@ static int load_image_lzo(struct swap_map_handle *handle, |
|
| 346 | 346 |
goto out_finish; |
| 347 | 347 |
|
| 348 | 348 |
for(;;) {
|
| ... | ... |
@@ -358,7 +357,7 @@ index d7cdc426ee38..e21d587a8b16 100644 |
| 358 | 358 |
if (ret) {
|
| 359 | 359 |
/* |
| 360 | 360 |
* On real read error, finish. On end of data, |
| 361 |
-@@ -1315,7 +1480,10 @@ static int load_image_lzo(struct swap_map_handle *handle, |
|
| 361 |
+@@ -1307,7 +1472,10 @@ static int load_image_lzo(struct swap_map_handle *handle, |
|
| 362 | 362 |
break; |
| 363 | 363 |
} |
| 364 | 364 |
} |
| ... | ... |
@@ -48,16 +48,16 @@ Signed-off-by: Munehisa Kamata <kamatam@amazon.com> |
| 48 | 48 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 49 | 49 |
|
| 50 | 50 |
CR: https://cr.amazon.com/r/8309443 |
| 51 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 51 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 52 | 52 |
--- |
| 53 | 53 |
drivers/block/xen-blkfront.c | 334 ++++++++++++++++++++++++++++++++++--------- |
| 54 | 54 |
1 file changed, 268 insertions(+), 66 deletions(-) |
| 55 | 55 |
|
| 56 | 56 |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
| 57 |
-index e410535540f4..a5d0266ee1ba 100644 |
|
| 57 |
+index f6367d0..792e7d2 100644 |
|
| 58 | 58 |
--- a/drivers/block/xen-blkfront.c |
| 59 | 59 |
+++ b/drivers/block/xen-blkfront.c |
| 60 |
-@@ -156,6 +156,15 @@ MODULE_PARM_DESC(max_ring_page_order, "Maximum order of pages to be used for the |
|
| 60 |
+@@ -155,6 +155,15 @@ MODULE_PARM_DESC(max_ring_page_order, "Maximum order of pages to be used for the |
|
| 61 | 61 |
#define BLK_MAX_RING_SIZE \ |
| 62 | 62 |
__CONST_RING_SIZE(blkif, XEN_PAGE_SIZE * XENBUS_MAX_RING_GRANTS) |
| 63 | 63 |
|
| ... | ... |
@@ -73,7 +73,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 73 | 73 |
/* |
| 74 | 74 |
* ring-ref%u i=(-1UL) would take 11 characters + 'ring-ref' is 8, so 19 |
| 75 | 75 |
* characters are enough. Define to 20 to keep consistent with backend. |
| 76 |
-@@ -194,6 +203,12 @@ struct blkfront_ring_info {
|
|
| 76 |
+@@ -193,6 +202,12 @@ struct blkfront_ring_info {
|
|
| 77 | 77 |
*/ |
| 78 | 78 |
struct blkfront_info |
| 79 | 79 |
{
|
| ... | ... |
@@ -86,7 +86,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 86 | 86 |
struct mutex mutex; |
| 87 | 87 |
struct xenbus_device *xbdev; |
| 88 | 88 |
struct gendisk *gd; |
| 89 |
-@@ -265,6 +280,19 @@ static DEFINE_SPINLOCK(minor_lock); |
|
| 89 |
+@@ -264,6 +279,19 @@ static DEFINE_SPINLOCK(minor_lock); |
|
| 90 | 90 |
|
| 91 | 91 |
#define GREFS(_psegs) ((_psegs) * GRANTS_PER_PSEG) |
| 92 | 92 |
|
| ... | ... |
@@ -106,7 +106,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 106 | 106 |
static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo); |
| 107 | 107 |
static void blkfront_gather_backend_features(struct blkfront_info *info); |
| 108 | 108 |
static int negotiate_mq(struct blkfront_info *info); |
| 109 |
-@@ -895,6 +923,62 @@ static inline bool blkif_request_flush_invalid(struct request *req, |
|
| 109 |
+@@ -894,6 +922,62 @@ static inline bool blkif_request_flush_invalid(struct request *req, |
|
| 110 | 110 |
!info->feature_fua)); |
| 111 | 111 |
} |
| 112 | 112 |
|
| ... | ... |
@@ -169,7 +169,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 169 | 169 |
static blk_status_t blkif_queue_rq(struct blk_mq_hw_ctx *hctx, |
| 170 | 170 |
const struct blk_mq_queue_data *qd) |
| 171 | 171 |
{
|
| 172 |
-@@ -980,30 +1064,37 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size, |
|
| 172 |
+@@ -979,30 +1063,37 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size, |
|
| 173 | 173 |
struct request_queue *rq; |
| 174 | 174 |
struct blkfront_info *info = gd->private_data; |
| 175 | 175 |
|
| ... | ... |
@@ -231,7 +231,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 231 | 231 |
} |
| 232 | 232 |
|
| 233 | 233 |
rq->queuedata = info; |
| 234 |
-@@ -1202,21 +1293,29 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, |
|
| 234 |
+@@ -1201,21 +1292,29 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, |
|
| 235 | 235 |
static void xlvbd_release_gendisk(struct blkfront_info *info) |
| 236 | 236 |
{
|
| 237 | 237 |
unsigned int minor, nr_minors, i; |
| ... | ... |
@@ -268,7 +268,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 268 | 268 |
} |
| 269 | 269 |
|
| 270 | 270 |
del_gendisk(info->gd); |
| 271 |
-@@ -1226,7 +1325,8 @@ static void xlvbd_release_gendisk(struct blkfront_info *info) |
|
| 271 |
+@@ -1225,7 +1324,8 @@ static void xlvbd_release_gendisk(struct blkfront_info *info) |
|
| 272 | 272 |
xlbd_release_minors(minor, nr_minors); |
| 273 | 273 |
|
| 274 | 274 |
blk_cleanup_queue(info->rq); |
| ... | ... |
@@ -278,7 +278,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 278 | 278 |
info->rq = NULL; |
| 279 | 279 |
|
| 280 | 280 |
put_disk(info->gd); |
| 281 |
-@@ -1238,17 +1338,31 @@ static inline void kick_pending_request_queues_locked(struct blkfront_ring_info |
|
| 281 |
+@@ -1237,17 +1337,31 @@ static inline void kick_pending_request_queues_locked(struct blkfront_ring_info |
|
| 282 | 282 |
{
|
| 283 | 283 |
if (unlikely(rinfo->dev_info->connected == BLKIF_STATE_FREEZING)) |
| 284 | 284 |
return; |
| ... | ... |
@@ -313,7 +313,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 313 | 313 |
} |
| 314 | 314 |
|
| 315 | 315 |
static void blkif_restart_queue(struct work_struct *work) |
| 316 |
-@@ -1259,6 +1373,7 @@ static void blkif_restart_queue(struct work_struct *work) |
|
| 316 |
+@@ -1258,6 +1372,7 @@ static void blkif_restart_queue(struct work_struct *work) |
|
| 317 | 317 |
kick_pending_request_queues(rinfo); |
| 318 | 318 |
} |
| 319 | 319 |
|
| ... | ... |
@@ -321,7 +321,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 321 | 321 |
static void blkif_free_ring(struct blkfront_ring_info *rinfo) |
| 322 | 322 |
{
|
| 323 | 323 |
struct grant *persistent_gnt, *n; |
| 324 |
-@@ -1341,6 +1456,9 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) |
|
| 324 |
+@@ -1340,6 +1455,9 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) |
|
| 325 | 325 |
/* No more gnttab callback work. */ |
| 326 | 326 |
gnttab_cancel_free_callback(&rinfo->callback); |
| 327 | 327 |
|
| ... | ... |
@@ -331,7 +331,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 331 | 331 |
/* Flush gnttab callback work. Must be done with no locks held. */ |
| 332 | 332 |
flush_work(&rinfo->work); |
| 333 | 333 |
|
| 334 |
-@@ -1362,11 +1480,18 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) |
|
| 334 |
+@@ -1361,11 +1479,18 @@ static void blkif_free_ring(struct blkfront_ring_info *rinfo) |
|
| 335 | 335 |
static void blkif_free(struct blkfront_info *info, int suspend) |
| 336 | 336 |
{
|
| 337 | 337 |
/* Prevent new requests being issued until we fix things up. */ |
| ... | ... |
@@ -352,7 +352,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 352 | 352 |
|
| 353 | 353 |
__blkif_free(info); |
| 354 | 354 |
} |
| 355 |
-@@ -1577,13 +1702,17 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 355 |
+@@ -1576,13 +1701,17 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 356 | 356 |
unsigned long flags; |
| 357 | 357 |
struct blkfront_ring_info *rinfo = (struct blkfront_ring_info *)dev_id; |
| 358 | 358 |
struct blkfront_info *info = rinfo->dev_info; |
| ... | ... |
@@ -371,7 +371,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 371 | 371 |
again: |
| 372 | 372 |
rp = rinfo->ring.sring->rsp_prod; |
| 373 | 373 |
rmb(); /* Ensure we see queued responses up to 'rp'. */ |
| 374 |
-@@ -1623,9 +1752,9 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 374 |
+@@ -1622,9 +1751,9 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 375 | 375 |
} |
| 376 | 376 |
|
| 377 | 377 |
if (bret->status == BLKIF_RSP_OKAY) |
| ... | ... |
@@ -383,7 +383,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 383 | 383 |
|
| 384 | 384 |
switch (bret->operation) {
|
| 385 | 385 |
case BLKIF_OP_DISCARD: |
| 386 |
-@@ -1633,7 +1762,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 386 |
+@@ -1632,7 +1761,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 387 | 387 |
struct request_queue *rq = info->rq; |
| 388 | 388 |
printk(KERN_WARNING "blkfront: %s: %s op failed\n", |
| 389 | 389 |
info->gd->disk_name, op_name(bret->operation)); |
| ... | ... |
@@ -391,8 +391,8 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 391 | 391 |
+ BLKIF_REQ_PUT_ERROR_STATUS(req, error, BLK_STS_NOTSUPP); |
| 392 | 392 |
info->feature_discard = 0; |
| 393 | 393 |
info->feature_secdiscard = 0; |
| 394 |
- queue_flag_clear(QUEUE_FLAG_DISCARD, rq); |
|
| 395 |
-@@ -1645,17 +1774,19 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 394 |
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, rq); |
|
| 395 |
+@@ -1644,17 +1773,19 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 396 | 396 |
if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
|
| 397 | 397 |
printk(KERN_WARNING "blkfront: %s: %s op failed\n", |
| 398 | 398 |
info->gd->disk_name, op_name(bret->operation)); |
| ... | ... |
@@ -417,7 +417,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 417 | 417 |
info->feature_fua = 0; |
| 418 | 418 |
info->feature_flush = 0; |
| 419 | 419 |
xlvbd_flush(info); |
| 420 |
-@@ -1672,7 +1803,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 420 |
+@@ -1671,7 +1802,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 421 | 421 |
BUG(); |
| 422 | 422 |
} |
| 423 | 423 |
|
| ... | ... |
@@ -426,7 +426,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 426 | 426 |
} |
| 427 | 427 |
|
| 428 | 428 |
rinfo->ring.rsp_cons = i; |
| 429 |
-@@ -1687,7 +1818,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 429 |
+@@ -1686,7 +1817,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) |
|
| 430 | 430 |
|
| 431 | 431 |
kick_pending_request_queues_locked(rinfo); |
| 432 | 432 |
|
| ... | ... |
@@ -435,7 +435,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 435 | 435 |
|
| 436 | 436 |
return IRQ_HANDLED; |
| 437 | 437 |
} |
| 438 |
-@@ -1928,8 +2059,11 @@ static int negotiate_mq(struct blkfront_info *info) |
|
| 438 |
+@@ -1927,8 +2058,11 @@ static int negotiate_mq(struct blkfront_info *info) |
|
| 439 | 439 |
backend_max_queues = xenbus_read_unsigned(info->xbdev->otherend, |
| 440 | 440 |
"multi-queue-max-queues", 1); |
| 441 | 441 |
info->nr_rings = min(backend_max_queues, xen_blkif_max_queues); |
| ... | ... |
@@ -448,8 +448,8 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 448 | 448 |
+ if (!info->nr_rings || !blkfront_use_blk_mq) |
| 449 | 449 |
info->nr_rings = 1; |
| 450 | 450 |
|
| 451 |
- info->rinfo = kzalloc(sizeof(struct blkfront_ring_info) * info->nr_rings, GFP_KERNEL); |
|
| 452 |
-@@ -1946,7 +2080,8 @@ static int negotiate_mq(struct blkfront_info *info) |
|
| 451 |
+ info->rinfo = kcalloc(info->nr_rings, |
|
| 452 |
+@@ -1947,7 +2081,8 @@ static int negotiate_mq(struct blkfront_info *info) |
|
| 453 | 453 |
INIT_LIST_HEAD(&rinfo->grants); |
| 454 | 454 |
rinfo->dev_info = info; |
| 455 | 455 |
INIT_WORK(&rinfo->work, blkif_restart_queue); |
| ... | ... |
@@ -459,7 +459,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 459 | 459 |
} |
| 460 | 460 |
return 0; |
| 461 | 461 |
} |
| 462 |
-@@ -2047,6 +2182,10 @@ static int blkif_recover(struct blkfront_info *info) |
|
| 462 |
+@@ -2048,6 +2183,10 @@ static int blkif_recover(struct blkfront_info *info) |
|
| 463 | 463 |
} |
| 464 | 464 |
xenbus_switch_state(info->xbdev, XenbusStateConnected); |
| 465 | 465 |
|
| ... | ... |
@@ -470,7 +470,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 470 | 470 |
/* Now safe for us to use the shared ring */ |
| 471 | 471 |
info->connected = BLKIF_STATE_CONNECTED; |
| 472 | 472 |
|
| 473 |
-@@ -2055,20 +2194,34 @@ static int blkif_recover(struct blkfront_info *info) |
|
| 473 |
+@@ -2056,20 +2195,34 @@ static int blkif_recover(struct blkfront_info *info) |
|
| 474 | 474 |
|
| 475 | 475 |
rinfo = &info->rinfo[r_index]; |
| 476 | 476 |
/* Kick any other new requests queued since we resumed */ |
| ... | ... |
@@ -510,7 +510,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 510 | 510 |
|
| 511 | 511 |
while ((bio = bio_list_pop(&info->bio_list)) != NULL) {
|
| 512 | 512 |
/* Traverse the list of pending bios and re-queue them */ |
| 513 |
-@@ -2125,14 +2278,47 @@ static int blkfront_resume(struct xenbus_device *dev) |
|
| 513 |
+@@ -2126,14 +2279,47 @@ static int blkfront_resume(struct xenbus_device *dev) |
|
| 514 | 514 |
merge_bio.tail = shadow[j].request->biotail; |
| 515 | 515 |
bio_list_merge(&info->bio_list, &merge_bio); |
| 516 | 516 |
shadow[j].request->bio = NULL; |
| ... | ... |
@@ -560,7 +560,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 560 | 560 |
blk_mq_update_nr_hw_queues(&info->tag_set, info->nr_rings); |
| 561 | 561 |
|
| 562 | 562 |
/* |
| 563 |
-@@ -2485,6 +2671,8 @@ static void blkback_changed(struct xenbus_device *dev, |
|
| 563 |
+@@ -2489,6 +2675,8 @@ static void blkback_changed(struct xenbus_device *dev, |
|
| 564 | 564 |
case XenbusStateClosed: |
| 565 | 565 |
if (dev->state == XenbusStateClosed) {
|
| 566 | 566 |
if (info->connected == BLKIF_STATE_FREEZING) {
|
| ... | ... |
@@ -569,7 +569,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 569 | 569 |
__blkif_free(info); |
| 570 | 570 |
info->connected = BLKIF_STATE_FROZEN; |
| 571 | 571 |
complete(&info->wait_backend_disconnected); |
| 572 |
-@@ -2661,14 +2849,25 @@ static int blkfront_freeze(struct xenbus_device *dev) |
|
| 572 |
+@@ -2665,14 +2853,25 @@ static int blkfront_freeze(struct xenbus_device *dev) |
|
| 573 | 573 |
int err = 0; |
| 574 | 574 |
|
| 575 | 575 |
info->connected = BLKIF_STATE_FREEZING; |
| ... | ... |
@@ -601,7 +601,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 601 | 601 |
} |
| 602 | 602 |
|
| 603 | 603 |
for (i = 0; i < info->nr_rings; i++) {
|
| 604 |
-@@ -2680,7 +2879,8 @@ static int blkfront_freeze(struct xenbus_device *dev) |
|
| 604 |
+@@ -2684,7 +2883,8 @@ static int blkfront_freeze(struct xenbus_device *dev) |
|
| 605 | 605 |
rinfo = &info->rinfo[i]; |
| 606 | 606 |
ring = &rinfo->ring; |
| 607 | 607 |
|
| ... | ... |
@@ -611,7 +611,7 @@ index e410535540f4..a5d0266ee1ba 100644 |
| 611 | 611 |
|
| 612 | 612 |
ring_timeout = jiffies + |
| 613 | 613 |
msecs_to_jiffies(req_timeout_ms * RING_SIZE(ring)); |
| 614 |
-@@ -2734,7 +2934,9 @@ static int blkfront_restore(struct xenbus_device *dev) |
|
| 614 |
+@@ -2738,7 +2938,9 @@ static int blkfront_restore(struct xenbus_device *dev) |
|
| 615 | 615 |
err = talk_to_blkback(dev, info); |
| 616 | 616 |
if (err) |
| 617 | 617 |
goto out; |
| ... | ... |
@@ -25,27 +25,27 @@ Signed-off-by: Munehisa Kamata <kamatam@amazon.com> |
| 25 | 25 |
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 26 | 26 |
|
| 27 | 27 |
CR: https://cr.amazon.com/r/8309443 |
| 28 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 28 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 29 | 29 |
--- |
| 30 | 30 |
drivers/block/xen-blkfront.c | 26 ++++++++++++++++++-------- |
| 31 | 31 |
1 file changed, 18 insertions(+), 8 deletions(-) |
| 32 | 32 |
|
| 33 | 33 |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
| 34 |
-index a5d0266ee1ba..cdbc2baa67d5 100644 |
|
| 34 |
+index 792e7d2..23ebb7e 100644 |
|
| 35 | 35 |
--- a/drivers/block/xen-blkfront.c |
| 36 | 36 |
+++ b/drivers/block/xen-blkfront.c |
| 37 |
-@@ -142,6 +142,10 @@ static unsigned int xen_blkif_max_queues = 4; |
|
| 38 |
- module_param_named(max_queues, xen_blkif_max_queues, uint, S_IRUGO); |
|
| 37 |
+@@ -141,6 +141,10 @@ static unsigned int xen_blkif_max_queues = 4; |
|
| 38 |
+ module_param_named(max_queues, xen_blkif_max_queues, uint, 0444); |
|
| 39 | 39 |
MODULE_PARM_DESC(max_queues, "Maximum number of hardware queues/rings used per virtual disk"); |
| 40 | 40 |
|
| 41 | 41 |
+static unsigned int xen_blkif_feature_persistent = 1; |
| 42 |
-+module_param_named(persistent_grants, xen_blkif_feature_persistent, int, S_IRUGO); |
|
| 42 |
++module_param_named(persistent_grants, xen_blkif_feature_persistent, int, 0444); |
|
| 43 | 43 |
+MODULE_PARM_DESC(persistent_grants, "Enable persistent grant table references (default is 1)"); |
| 44 | 44 |
+ |
| 45 | 45 |
/* |
| 46 | 46 |
* Maximum order of pages to be used for the shared ring between front and |
| 47 | 47 |
* backend, 4KB page granularity is used. |
| 48 |
-@@ -2009,11 +2013,14 @@ static int talk_to_blkback(struct xenbus_device *dev, |
|
| 48 |
+@@ -2008,11 +2012,14 @@ static int talk_to_blkback(struct xenbus_device *dev, |
|
| 49 | 49 |
message = "writing protocol"; |
| 50 | 50 |
goto abort_transaction; |
| 51 | 51 |
} |
| ... | ... |
@@ -65,7 +65,7 @@ index a5d0266ee1ba..cdbc2baa67d5 100644 |
| 65 | 65 |
|
| 66 | 66 |
err = xenbus_transaction_end(xbt, 0); |
| 67 | 67 |
if (err) {
|
| 68 |
-@@ -2506,9 +2513,12 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) |
|
| 68 |
+@@ -2510,9 +2517,12 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) |
|
| 69 | 69 |
if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0)) |
| 70 | 70 |
blkfront_setup_discard(info); |
| 71 | 71 |
|
| 72 | 72 |
deleted file mode 100644 |
| ... | ... |
@@ -1,268 +0,0 @@ |
| 1 |
-From aa139d7cbc5f433aa740550ce7d574745ace4729 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Prarit Bhargava <prarit@redhat.com> |
|
| 3 |
-Date: Thu, 18 Jan 2018 10:09:51 -0500 |
|
| 4 |
-Subject: ACPI: SPCR: Make SPCR available to x86 |
|
| 5 |
- |
|
| 6 |
-SPCR is currently only enabled or ARM64 and x86 can use SPCR to setup |
|
| 7 |
-an early console. |
|
| 8 |
- |
|
| 9 |
-General fixes include updating Documentation & Kconfig (for x86), |
|
| 10 |
-updating comments, and changing parse_spcr() to acpi_parse_spcr(), |
|
| 11 |
-and earlycon_init_is_deferred to earlycon_acpi_spcr_enable to be |
|
| 12 |
-more descriptive. |
|
| 13 |
- |
|
| 14 |
-On x86, many systems have a valid SPCR table but the table version is |
|
| 15 |
-not 2 so the table version check must be a warning. |
|
| 16 |
- |
|
| 17 |
-On ARM64 when the kernel parameter earlycon is used both the early console |
|
| 18 |
-and console are enabled. On x86, only the earlycon should be enabled by |
|
| 19 |
-by default. Modify acpi_parse_spcr() to allow options for initializing |
|
| 20 |
-the early console and console separately. |
|
| 21 |
- |
|
| 22 |
-Signed-off-by: Prarit Bhargava <prarit@redhat.com> |
|
| 23 |
-Acked-by: Ingo Molnar <mingo@kernel.org> |
|
| 24 |
-Reviewed-by: Mark Salter <msalter@redhat.com> |
|
| 25 |
-Tested-by: Mark Salter <msalter@redhat.com> |
|
| 26 |
-Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
|
| 27 |
-Signed-off-by: Alakesh Haloi <alakeshh@amazon.com> |
|
| 28 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 29 |
- Documentation/admin-guide/kernel-parameters.txt | 9 +++++--- |
|
| 30 |
- arch/arm64/kernel/acpi.c | 4 ++-- |
|
| 31 |
- arch/x86/kernel/acpi/boot.c | 3 +++ |
|
| 32 |
- drivers/acpi/Kconfig | 7 +++++- |
|
| 33 |
- drivers/acpi/spcr.c | 29 +++++++++++++------------ |
|
| 34 |
- drivers/tty/serial/earlycon.c | 15 +++++-------- |
|
| 35 |
- include/linux/acpi.h | 7 ++++-- |
|
| 36 |
- include/linux/serial_core.h | 4 ++-- |
|
| 37 |
- 8 files changed, 44 insertions(+), 34 deletions(-) |
|
| 38 |
- |
|
| 39 |
-diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt |
|
| 40 |
-index 9841bad6f271..142f041261dc 100644 |
|
| 41 |
-+++ b/Documentation/admin-guide/kernel-parameters.txt |
|
| 42 |
-@@ -911,9 +911,12 @@ |
|
| 43 |
- |
|
| 44 |
- earlycon= [KNL] Output early console device and options. |
|
| 45 |
- |
|
| 46 |
-- When used with no options, the early console is |
|
| 47 |
-- determined by the stdout-path property in device |
|
| 48 |
-- tree's chosen node. |
|
| 49 |
-+ [ARM64] The early console is determined by the |
|
| 50 |
-+ stdout-path property in device tree's chosen node, |
|
| 51 |
-+ or determined by the ACPI SPCR table. |
|
| 52 |
-+ |
|
| 53 |
-+ [X86] When used with no options the early console is |
|
| 54 |
-+ determined by the ACPI SPCR table. |
|
| 55 |
- |
|
| 56 |
- cdns,<addr>[,options] |
|
| 57 |
- Start an early, polled-mode console on a Cadence |
|
| 58 |
-diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c |
|
| 59 |
-index b3162715ed78..2aa5609def27 100644 |
|
| 60 |
-+++ b/arch/arm64/kernel/acpi.c |
|
| 61 |
-@@ -230,10 +230,10 @@ void __init acpi_boot_table_init(void) |
|
| 62 |
- |
|
| 63 |
- done: |
|
| 64 |
- if (acpi_disabled) {
|
|
| 65 |
-- if (earlycon_init_is_deferred) |
|
| 66 |
-+ if (earlycon_acpi_spcr_enable) |
|
| 67 |
- early_init_dt_scan_chosen_stdout(); |
|
| 68 |
- } else {
|
|
| 69 |
-- parse_spcr(earlycon_init_is_deferred); |
|
| 70 |
-+ acpi_parse_spcr(earlycon_acpi_spcr_enable, true); |
|
| 71 |
- if (IS_ENABLED(CONFIG_ACPI_BGRT)) |
|
| 72 |
- acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); |
|
| 73 |
- } |
|
| 74 |
-diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c |
|
| 75 |
-index 6dda3595acf8..20cf94c58b84 100644 |
|
| 76 |
-+++ b/arch/x86/kernel/acpi/boot.c |
|
| 77 |
-@@ -36,6 +36,7 @@ |
|
| 78 |
- #include <linux/ioport.h> |
|
| 79 |
- #include <linux/pci.h> |
|
| 80 |
- #include <linux/efi-bgrt.h> |
|
| 81 |
-+#include <linux/serial_core.h> |
|
| 82 |
- |
|
| 83 |
- #include <asm/e820/api.h> |
|
| 84 |
- #include <asm/irqdomain.h> |
|
| 85 |
-@@ -1625,6 +1626,8 @@ int __init acpi_boot_init(void) |
|
| 86 |
- if (!acpi_noirq) |
|
| 87 |
- x86_init.pci.init = pci_acpi_init; |
|
| 88 |
- |
|
| 89 |
-+ /* Do not enable ACPI SPCR console by default */ |
|
| 90 |
-+ acpi_parse_spcr(earlycon_acpi_spcr_enable, false); |
|
| 91 |
- return 0; |
|
| 92 |
- } |
|
| 93 |
- |
|
| 94 |
-diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig |
|
| 95 |
-index 5b1938f4b626..0eaa8bbd8c99 100644 |
|
| 96 |
-+++ b/drivers/acpi/Kconfig |
|
| 97 |
-@@ -79,7 +79,12 @@ config ACPI_DEBUGGER_USER |
|
| 98 |
- endif |
|
| 99 |
- |
|
| 100 |
- config ACPI_SPCR_TABLE |
|
| 101 |
-- bool |
|
| 102 |
-+ bool "ACPI Serial Port Console Redirection Support" |
|
| 103 |
-+ default y if X86 |
|
| 104 |
-+ help |
|
| 105 |
-+ Enable support for Serial Port Console Redirection (SPCR) Table. |
|
| 106 |
-+ This table provides information about the configuration of the |
|
| 107 |
-+ earlycon console. |
|
| 108 |
- |
|
| 109 |
- config ACPI_SLEEP |
|
| 110 |
- bool |
|
| 111 |
-diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c |
|
| 112 |
-index 324b35bfe781..89e97d21a89c 100644 |
|
| 113 |
-+++ b/drivers/acpi/spcr.c |
|
| 114 |
-@@ -21,7 +21,7 @@ |
|
| 115 |
- * occasionally getting stuck as 1. To avoid the potential for a hang, check |
|
| 116 |
- * TXFE == 0 instead of BUSY == 1. This may not be suitable for all UART |
|
| 117 |
- * implementations, so only do so if an affected platform is detected in |
|
| 118 |
-- * parse_spcr(). |
|
| 119 |
-+ * acpi_parse_spcr(). |
|
| 120 |
- */ |
|
| 121 |
- bool qdf2400_e44_present; |
|
| 122 |
- EXPORT_SYMBOL(qdf2400_e44_present); |
|
| 123 |
-@@ -74,19 +74,21 @@ static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) |
|
| 124 |
- } |
|
| 125 |
- |
|
| 126 |
- /** |
|
| 127 |
-- * parse_spcr() - parse ACPI SPCR table and add preferred console |
|
| 128 |
-+ * acpi_parse_spcr() - parse ACPI SPCR table and add preferred console |
|
| 129 |
- * |
|
| 130 |
-- * @earlycon: set up earlycon for the console specified by the table |
|
| 131 |
-+ * @enable_earlycon: set up earlycon for the console specified by the table |
|
| 132 |
-+ * @enable_console: setup the console specified by the table. |
|
| 133 |
- * |
|
| 134 |
- * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be |
|
| 135 |
- * defined to parse ACPI SPCR table. As a result of the parsing preferred |
|
| 136 |
-- * console is registered and if @earlycon is true, earlycon is set up. |
|
| 137 |
-+ * console is registered and if @enable_earlycon is true, earlycon is set up. |
|
| 138 |
-+ * If @enable_console is true the system console is also configured. |
|
| 139 |
- * |
|
| 140 |
- * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called |
|
| 141 |
- * from arch initialization code as soon as the DT/ACPI decision is made. |
|
| 142 |
- * |
|
| 143 |
- */ |
|
| 144 |
--int __init parse_spcr(bool earlycon) |
|
| 145 |
-+int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) |
|
| 146 |
- {
|
|
| 147 |
- static char opts[64]; |
|
| 148 |
- struct acpi_table_spcr *table; |
|
| 149 |
-@@ -105,11 +107,8 @@ int __init parse_spcr(bool earlycon) |
|
| 150 |
- if (ACPI_FAILURE(status)) |
|
| 151 |
- return -ENOENT; |
|
| 152 |
- |
|
| 153 |
-- if (table->header.revision < 2) {
|
|
| 154 |
-- err = -ENOENT; |
|
| 155 |
-- pr_err("wrong table version\n");
|
|
| 156 |
-- goto done; |
|
| 157 |
-- } |
|
| 158 |
-+ if (table->header.revision < 2) |
|
| 159 |
-+ pr_info("SPCR table version %d\n", table->header.revision);
|
|
| 160 |
- |
|
| 161 |
- if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
|
|
| 162 |
- switch (ACPI_ACCESS_BIT_WIDTH(( |
|
| 163 |
-@@ -185,7 +184,7 @@ int __init parse_spcr(bool earlycon) |
|
| 164 |
- */ |
|
| 165 |
- if (qdf2400_erratum_44_present(&table->header)) {
|
|
| 166 |
- qdf2400_e44_present = true; |
|
| 167 |
-- if (earlycon) |
|
| 168 |
-+ if (enable_earlycon) |
|
| 169 |
- uart = "qdf2400_e44"; |
|
| 170 |
- } |
|
| 171 |
- |
|
| 172 |
-@@ -205,11 +204,13 @@ int __init parse_spcr(bool earlycon) |
|
| 173 |
- |
|
| 174 |
- pr_info("console: %s\n", opts);
|
|
| 175 |
- |
|
| 176 |
-- if (earlycon) |
|
| 177 |
-+ if (enable_earlycon) |
|
| 178 |
- setup_earlycon(opts); |
|
| 179 |
- |
|
| 180 |
-- err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); |
|
| 181 |
-- |
|
| 182 |
-+ if (enable_console) |
|
| 183 |
-+ err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); |
|
| 184 |
-+ else |
|
| 185 |
-+ err = 0; |
|
| 186 |
- done: |
|
| 187 |
- acpi_put_table((struct acpi_table_header *)table); |
|
| 188 |
- return err; |
|
| 189 |
-diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c |
|
| 190 |
-index ac667b47f199..360cfc31f882 100644 |
|
| 191 |
-+++ b/drivers/tty/serial/earlycon.c |
|
| 192 |
-@@ -202,25 +202,20 @@ int __init setup_earlycon(char *buf) |
|
| 193 |
- } |
|
| 194 |
- |
|
| 195 |
- /* |
|
| 196 |
-- * When CONFIG_ACPI_SPCR_TABLE is defined, "earlycon" without parameters in |
|
| 197 |
-- * command line does not start DT earlycon immediately, instead it defers |
|
| 198 |
-- * starting it until DT/ACPI decision is made. At that time if ACPI is enabled |
|
| 199 |
-- * call parse_spcr(), else call early_init_dt_scan_chosen_stdout() |
|
| 200 |
-+ * This defers the initialization of the early console until after ACPI has |
|
| 201 |
-+ * been initialized. |
|
| 202 |
- */ |
|
| 203 |
--bool earlycon_init_is_deferred __initdata; |
|
| 204 |
-+bool earlycon_acpi_spcr_enable __initdata; |
|
| 205 |
- |
|
| 206 |
- /* early_param wrapper for setup_earlycon() */ |
|
| 207 |
- static int __init param_setup_earlycon(char *buf) |
|
| 208 |
- {
|
|
| 209 |
- int err; |
|
| 210 |
- |
|
| 211 |
-- /* |
|
| 212 |
-- * Just 'earlycon' is a valid param for devicetree earlycons; |
|
| 213 |
-- * don't generate a warning from parse_early_params() in that case |
|
| 214 |
-- */ |
|
| 215 |
-+ /* Just 'earlycon' is a valid param for devicetree and ACPI SPCR. */ |
|
| 216 |
- if (!buf || !buf[0]) {
|
|
| 217 |
- if (IS_ENABLED(CONFIG_ACPI_SPCR_TABLE)) {
|
|
| 218 |
-- earlycon_init_is_deferred = true; |
|
| 219 |
-+ earlycon_acpi_spcr_enable = true; |
|
| 220 |
- return 0; |
|
| 221 |
- } else if (!buf) {
|
|
| 222 |
- return early_init_dt_scan_chosen_stdout(); |
|
| 223 |
-diff --git a/include/linux/acpi.h b/include/linux/acpi.h |
|
| 224 |
-index 13c105121a18..6a6931b7f36e 100644 |
|
| 225 |
-+++ b/include/linux/acpi.h |
|
| 226 |
-@@ -1242,9 +1242,12 @@ static inline bool acpi_has_watchdog(void) { return false; }
|
|
| 227 |
- |
|
| 228 |
- #ifdef CONFIG_ACPI_SPCR_TABLE |
|
| 229 |
- extern bool qdf2400_e44_present; |
|
| 230 |
--int parse_spcr(bool earlycon); |
|
| 231 |
-+int acpi_parse_spcr(bool enable_earlycon, bool enable_console); |
|
| 232 |
- #else |
|
| 233 |
--static inline int parse_spcr(bool earlycon) { return 0; }
|
|
| 234 |
-+static inline int acpi_parse_spcr(bool enable_earlycon, bool enable_console) |
|
| 235 |
-+{
|
|
| 236 |
-+ return 0; |
|
| 237 |
-+} |
|
| 238 |
- #endif |
|
| 239 |
- |
|
| 240 |
- #if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI) |
|
| 241 |
-diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h |
|
| 242 |
-index 868b60a79c0b..1dd91aaa0418 100644 |
|
| 243 |
-+++ b/include/linux/serial_core.h |
|
| 244 |
-@@ -384,10 +384,10 @@ extern int of_setup_earlycon(const struct earlycon_id *match, |
|
| 245 |
- const char *options); |
|
| 246 |
- |
|
| 247 |
- #ifdef CONFIG_SERIAL_EARLYCON |
|
| 248 |
--extern bool earlycon_init_is_deferred __initdata; |
|
| 249 |
-+extern bool earlycon_acpi_spcr_enable __initdata; |
|
| 250 |
- int setup_earlycon(char *buf); |
|
| 251 |
- #else |
|
| 252 |
--static const bool earlycon_init_is_deferred; |
|
| 253 |
-+static const bool earlycon_acpi_spcr_enable; |
|
| 254 |
- static inline int setup_earlycon(char *buf) { return 0; }
|
|
| 255 |
- #endif |
|
| 256 |
- |
|
| 257 |
-2.14.4 |
|
| 258 |
- |
| ... | ... |
@@ -17,7 +17,7 @@ Reviewed-by: Alakesh Haloi <alakeshh@amazon.com> |
| 17 | 17 |
Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 18 | 18 |
|
| 19 | 19 |
CR: https://cr.amazon.com/r/8361544/ |
| 20 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 20 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 21 | 21 |
--- |
| 22 | 22 |
drivers/xen/events/events_base.c | 13 ++++++++++--- |
| 23 | 23 |
1 file changed, 10 insertions(+), 3 deletions(-) |
| 24 | 24 |
deleted file mode 100644 |
| ... | ... |
@@ -1,130 +0,0 @@ |
| 1 |
-From e23ff4bb4f44617293c53a61ffc2a1612cb4ca37 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Juergen Gross <jgross@suse.com> |
|
| 3 |
-Date: Wed, 6 Sep 2017 19:36:24 +0200 |
|
| 4 |
-Subject: locking/paravirt: Use new static key for controlling call of |
|
| 5 |
- virt_spin_lock() |
|
| 6 |
- |
|
| 7 |
-There are cases where a guest tries to switch spinlocks to bare metal |
|
| 8 |
-behavior (e.g. by setting "xen_nopvspin" boot parameter). Today this |
|
| 9 |
-has the downside of falling back to unfair test and set scheme for |
|
| 10 |
-qspinlocks due to virt_spin_lock() detecting the virtualized |
|
| 11 |
-environment. |
|
| 12 |
- |
|
| 13 |
-Add a static key controlling whether virt_spin_lock() should be |
|
| 14 |
-called or not. When running on bare metal set the new key to false. |
|
| 15 |
- |
|
| 16 |
-Signed-off-by: Juergen Gross <jgross@suse.com> |
|
| 17 |
-Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> |
|
| 18 |
-Acked-by: Waiman Long <longman@redhat.com> |
|
| 19 |
-Cc: Linus Torvalds <torvalds@linux-foundation.org> |
|
| 20 |
-Cc: Peter Zijlstra <peterz@infradead.org> |
|
| 21 |
-Cc: Thomas Gleixner <tglx@linutronix.de> |
|
| 22 |
-Cc: akataria@vmware.com |
|
| 23 |
-Cc: boris.ostrovsky@oracle.com |
|
| 24 |
-Cc: chrisw@sous-sol.org |
|
| 25 |
-Cc: hpa@zytor.com |
|
| 26 |
-Cc: jeremy@goop.org |
|
| 27 |
-Cc: rusty@rustcorp.com.au |
|
| 28 |
-Cc: virtualization@lists.linux-foundation.org |
|
| 29 |
-Cc: xen-devel@lists.xenproject.org |
|
| 30 |
-Link: http://lkml.kernel.org/r/20170906173625.18158-2-jgross@suse.com |
|
| 31 |
-Signed-off-by: Ingo Molnar <mingo@kernel.org> |
|
| 32 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 33 |
-Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
|
| 34 |
-Signed-off-by: Eduardo Valentin <eduval@amazon.com> |
|
| 35 |
- |
|
| 36 |
-CR: https://cr.amazon.com/r/8321910/ |
|
| 37 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 38 |
- arch/x86/include/asm/qspinlock.h | 11 ++++++++++- |
|
| 39 |
- arch/x86/kernel/paravirt.c | 14 ++++++++++++-- |
|
| 40 |
- arch/x86/kernel/smpboot.c | 2 ++ |
|
| 41 |
- 3 files changed, 24 insertions(+), 3 deletions(-) |
|
| 42 |
- |
|
| 43 |
-diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h |
|
| 44 |
-index 9982dd96f093..5e16b5d40d32 100644 |
|
| 45 |
-+++ b/arch/x86/include/asm/qspinlock.h |
|
| 46 |
-@@ -2,6 +2,7 @@ |
|
| 47 |
- #ifndef _ASM_X86_QSPINLOCK_H |
|
| 48 |
- #define _ASM_X86_QSPINLOCK_H |
|
| 49 |
- |
|
| 50 |
-+#include <linux/jump_label.h> |
|
| 51 |
- #include <asm/cpufeature.h> |
|
| 52 |
- #include <asm-generic/qspinlock_types.h> |
|
| 53 |
- #include <asm/paravirt.h> |
|
| 54 |
-@@ -47,10 +48,14 @@ static inline void queued_spin_unlock(struct qspinlock *lock) |
|
| 55 |
- #endif |
|
| 56 |
- |
|
| 57 |
- #ifdef CONFIG_PARAVIRT |
|
| 58 |
-+DECLARE_STATIC_KEY_TRUE(virt_spin_lock_key); |
|
| 59 |
-+ |
|
| 60 |
-+void native_pv_lock_init(void) __init; |
|
| 61 |
-+ |
|
| 62 |
- #define virt_spin_lock virt_spin_lock |
|
| 63 |
- static inline bool virt_spin_lock(struct qspinlock *lock) |
|
| 64 |
- {
|
|
| 65 |
-- if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) |
|
| 66 |
-+ if (!static_branch_likely(&virt_spin_lock_key)) |
|
| 67 |
- return false; |
|
| 68 |
- |
|
| 69 |
- /* |
|
| 70 |
-@@ -66,6 +71,10 @@ static inline bool virt_spin_lock(struct qspinlock *lock) |
|
| 71 |
- |
|
| 72 |
- return true; |
|
| 73 |
- } |
|
| 74 |
-+#else |
|
| 75 |
-+static inline void native_pv_lock_init(void) |
|
| 76 |
-+{
|
|
| 77 |
-+} |
|
| 78 |
- #endif /* CONFIG_PARAVIRT */ |
|
| 79 |
- |
|
| 80 |
- #include <asm-generic/qspinlock.h> |
|
| 81 |
-diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c |
|
| 82 |
-index f3559b84cd75..930c88341e4e 100644 |
|
| 83 |
-+++ b/arch/x86/kernel/paravirt.c |
|
| 84 |
-@@ -121,8 +121,18 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target, |
|
| 85 |
- return 5; |
|
| 86 |
- } |
|
| 87 |
- |
|
| 88 |
--/* Neat trick to map patch type back to the call within the |
|
| 89 |
-- * corresponding structure. */ |
|
| 90 |
-+DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key); |
|
| 91 |
-+ |
|
| 92 |
-+void __init native_pv_lock_init(void) |
|
| 93 |
-+{
|
|
| 94 |
-+ if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) |
|
| 95 |
-+ static_branch_disable(&virt_spin_lock_key); |
|
| 96 |
-+} |
|
| 97 |
-+ |
|
| 98 |
-+/* |
|
| 99 |
-+ * Neat trick to map patch type back to the call within the |
|
| 100 |
-+ * corresponding structure. |
|
| 101 |
-+ */ |
|
| 102 |
- static void *get_call_destination(u8 type) |
|
| 103 |
- {
|
|
| 104 |
- struct paravirt_patch_template tmpl = {
|
|
| 105 |
-diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c |
|
| 106 |
-index 30447d210f37..9143f280f302 100644 |
|
| 107 |
-+++ b/arch/x86/kernel/smpboot.c |
|
| 108 |
-@@ -79,6 +79,7 @@ |
|
| 109 |
- #include <asm/misc.h> |
|
| 110 |
- #include <asm/spec-ctrl.h> |
|
| 111 |
- #include <asm/hw_irq.h> |
|
| 112 |
-+#include <asm/qspinlock.h> |
|
| 113 |
- |
|
| 114 |
- /* representing HT siblings of each logical CPU */ |
|
| 115 |
- DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); |
|
| 116 |
-@@ -1392,6 +1393,7 @@ void __init native_smp_prepare_boot_cpu(void) |
|
| 117 |
- /* already set me in cpu_online_mask in boot_cpu_init() */ |
|
| 118 |
- cpumask_set_cpu(me, cpu_callout_mask); |
|
| 119 |
- cpu_set_state_online(me); |
|
| 120 |
-+ native_pv_lock_init(); |
|
| 121 |
- } |
|
| 122 |
- |
|
| 123 |
- void __init native_smp_cpus_done(unsigned int max_cpus) |
|
| 124 |
-2.14.4 |
|
| 125 |
- |
| 126 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,215 +0,0 @@ |
| 1 |
-From a634a2708266c0e80fbfa04f7596dd9959286ff8 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Wanpeng Li <wanpengli@tencent.com> |
|
| 3 |
-Date: Tue, 13 Feb 2018 09:05:40 +0800 |
|
| 4 |
-Subject: KVM: Introduce paravirtualization hints and KVM_HINTS_DEDICATED |
|
| 5 |
-MIME-Version: 1.0 |
|
| 6 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 7 |
-Content-Transfer-Encoding: 8bit |
|
| 8 |
- |
|
| 9 |
-This patch introduces kvm_para_has_hint() to query for hints about |
|
| 10 |
-the configuration of the guests. The first hint KVM_HINTS_DEDICATED, |
|
| 11 |
-is set if the guest has dedicated physical CPUs for each vCPU (i.e. |
|
| 12 |
-pinning and no over-commitment). This allows optimizing spinlocks |
|
| 13 |
-and tells the guest to avoid PV TLB flush. |
|
| 14 |
- |
|
| 15 |
-Cc: Paolo Bonzini <pbonzini@redhat.com> |
|
| 16 |
-Cc: Radim Krčmář <rkrcmar@redhat.com> |
|
| 17 |
-Cc: Eduardo Habkost <ehabkost@redhat.com> |
|
| 18 |
-Signed-off-by: Wanpeng Li <wanpengli@tencent.com> |
|
| 19 |
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
|
| 20 |
-Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> |
|
| 21 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 22 |
-Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
|
| 23 |
-Signed-off-by: Eduardo Valentin <eduval@amazon.com> |
|
| 24 |
- |
|
| 25 |
-CR: https://cr.amazon.com/r/8321912/ |
|
| 26 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 27 |
- Documentation/virtual/kvm/cpuid.txt | 15 +++++++++++++-- |
|
| 28 |
- arch/mips/include/asm/kvm_para.h | 5 +++++ |
|
| 29 |
- arch/powerpc/include/asm/kvm_para.h | 5 +++++ |
|
| 30 |
- arch/s390/include/asm/kvm_para.h | 5 +++++ |
|
| 31 |
- arch/x86/include/asm/kvm_para.h | 6 ++++++ |
|
| 32 |
- arch/x86/include/uapi/asm/kvm_para.h | 8 ++++++-- |
|
| 33 |
- arch/x86/kernel/kvm.c | 5 +++++ |
|
| 34 |
- include/asm-generic/kvm_para.h | 5 +++++ |
|
| 35 |
- include/linux/kvm_para.h | 5 +++++ |
|
| 36 |
- 9 files changed, 55 insertions(+), 4 deletions(-) |
|
| 37 |
- |
|
| 38 |
-diff --git a/Documentation/virtual/kvm/cpuid.txt b/Documentation/virtual/kvm/cpuid.txt |
|
| 39 |
-index a81c97a4b4a5..f86dbbc4b423 100644 |
|
| 40 |
-+++ b/Documentation/virtual/kvm/cpuid.txt |
|
| 41 |
-@@ -23,8 +23,8 @@ This function queries the presence of KVM cpuid leafs. |
|
| 42 |
- |
|
| 43 |
- |
|
| 44 |
- function: define KVM_CPUID_FEATURES (0x40000001) |
|
| 45 |
--returns : ebx, ecx, edx = 0 |
|
| 46 |
-- eax = and OR'ed group of (1 << flag), where each flags is: |
|
| 47 |
-+returns : ebx, ecx |
|
| 48 |
-+ eax = an OR'ed group of (1 << flag), where each flags is: |
|
| 49 |
- |
|
| 50 |
- |
|
| 51 |
- flag || value || meaning |
|
| 52 |
-@@ -62,3 +62,14 @@ KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side |
|
| 53 |
- || || per-cpu warps are expected in |
|
| 54 |
- || || kvmclock. |
|
| 55 |
- ------------------------------------------------------------------------------ |
|
| 56 |
-+ |
|
| 57 |
-+ edx = an OR'ed group of (1 << flag), where each flags is: |
|
| 58 |
-+ |
|
| 59 |
-+ |
|
| 60 |
-+flag || value || meaning |
|
| 61 |
-+================================================================================== |
|
| 62 |
-+KVM_HINTS_DEDICATED || 0 || guest checks this feature bit to |
|
| 63 |
-+ || || determine if there is vCPU pinning |
|
| 64 |
-+ || || and there is no vCPU over-commitment, |
|
| 65 |
-+ || || allowing optimizations |
|
| 66 |
-+---------------------------------------------------------------------------------- |
|
| 67 |
-diff --git a/arch/mips/include/asm/kvm_para.h b/arch/mips/include/asm/kvm_para.h |
|
| 68 |
-index 60b1aa0b7014..b57e978b0946 100644 |
|
| 69 |
-+++ b/arch/mips/include/asm/kvm_para.h |
|
| 70 |
-@@ -94,6 +94,11 @@ static inline unsigned int kvm_arch_para_features(void) |
|
| 71 |
- return 0; |
|
| 72 |
- } |
|
| 73 |
- |
|
| 74 |
-+static inline unsigned int kvm_arch_para_hints(void) |
|
| 75 |
-+{
|
|
| 76 |
-+ return 0; |
|
| 77 |
-+} |
|
| 78 |
-+ |
|
| 79 |
- #ifdef CONFIG_MIPS_PARAVIRT |
|
| 80 |
- static inline bool kvm_para_available(void) |
|
| 81 |
- {
|
|
| 82 |
-diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h |
|
| 83 |
-index 336a91acb8b1..5ceb4efca65f 100644 |
|
| 84 |
-+++ b/arch/powerpc/include/asm/kvm_para.h |
|
| 85 |
-@@ -61,6 +61,11 @@ static inline unsigned int kvm_arch_para_features(void) |
|
| 86 |
- return r; |
|
| 87 |
- } |
|
| 88 |
- |
|
| 89 |
-+static inline unsigned int kvm_arch_para_hints(void) |
|
| 90 |
-+{
|
|
| 91 |
-+ return 0; |
|
| 92 |
-+} |
|
| 93 |
-+ |
|
| 94 |
- static inline bool kvm_check_and_clear_guest_paused(void) |
|
| 95 |
- {
|
|
| 96 |
- return false; |
|
| 97 |
-diff --git a/arch/s390/include/asm/kvm_para.h b/arch/s390/include/asm/kvm_para.h |
|
| 98 |
-index 41393052ac57..8c183c7f1e1b 100644 |
|
| 99 |
-+++ b/arch/s390/include/asm/kvm_para.h |
|
| 100 |
-@@ -198,6 +198,11 @@ static inline unsigned int kvm_arch_para_features(void) |
|
| 101 |
- return 0; |
|
| 102 |
- } |
|
| 103 |
- |
|
| 104 |
-+static inline unsigned int kvm_arch_para_hints(void) |
|
| 105 |
-+{
|
|
| 106 |
-+ return 0; |
|
| 107 |
-+} |
|
| 108 |
-+ |
|
| 109 |
- static inline bool kvm_check_and_clear_guest_paused(void) |
|
| 110 |
- {
|
|
| 111 |
- return false; |
|
| 112 |
-diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h |
|
| 113 |
-index c373e44049b1..f3191f2908a7 100644 |
|
| 114 |
-+++ b/arch/x86/include/asm/kvm_para.h |
|
| 115 |
-@@ -88,6 +88,7 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1, |
|
| 116 |
- #ifdef CONFIG_KVM_GUEST |
|
| 117 |
- bool kvm_para_available(void); |
|
| 118 |
- unsigned int kvm_arch_para_features(void); |
|
| 119 |
-+unsigned int kvm_arch_para_hints(void); |
|
| 120 |
- void __init kvm_guest_init(void); |
|
| 121 |
- void kvm_async_pf_task_wait(u32 token, int interrupt_kernel); |
|
| 122 |
- void kvm_async_pf_task_wake(u32 token); |
|
| 123 |
-@@ -117,6 +118,11 @@ static inline unsigned int kvm_arch_para_features(void) |
|
| 124 |
- return 0; |
|
| 125 |
- } |
|
| 126 |
- |
|
| 127 |
-+static inline unsigned int kvm_arch_para_hints(void) |
|
| 128 |
-+{
|
|
| 129 |
-+ return 0; |
|
| 130 |
-+} |
|
| 131 |
-+ |
|
| 132 |
- static inline u32 kvm_read_and_reset_pf_reason(void) |
|
| 133 |
- {
|
|
| 134 |
- return 0; |
|
| 135 |
-diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h |
|
| 136 |
-index 341db0462b85..745f25a3926b 100644 |
|
| 137 |
-+++ b/arch/x86/include/uapi/asm/kvm_para.h |
|
| 138 |
-@@ -10,8 +10,10 @@ |
|
| 139 |
- */ |
|
| 140 |
- #define KVM_CPUID_SIGNATURE 0x40000000 |
|
| 141 |
- |
|
| 142 |
--/* This CPUID returns a feature bitmap in eax. Before enabling a particular |
|
| 143 |
-- * paravirtualization, the appropriate feature bit should be checked. |
|
| 144 |
-+/* This CPUID returns two feature bitmaps in eax, edx. Before enabling |
|
| 145 |
-+ * a particular paravirtualization, the appropriate feature bit should |
|
| 146 |
-+ * be checked in eax. The performance hint feature bit should be checked |
|
| 147 |
-+ * in edx. |
|
| 148 |
- */ |
|
| 149 |
- #define KVM_CPUID_FEATURES 0x40000001 |
|
| 150 |
- #define KVM_FEATURE_CLOCKSOURCE 0 |
|
| 151 |
-@@ -27,6 +29,8 @@ |
|
| 152 |
- #define KVM_FEATURE_PV_UNHALT 7 |
|
| 153 |
- #define KVM_FEATURE_ASYNC_PF_VMEXIT 10 |
|
| 154 |
- |
|
| 155 |
-+#define KVM_HINTS_DEDICATED 0 |
|
| 156 |
-+ |
|
| 157 |
- /* The last 8 bits are used to indicate how to interpret the flags field |
|
| 158 |
- * in pvclock structure. If no bits are set, all flags are ignored. |
|
| 159 |
- */ |
|
| 160 |
-diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c |
|
| 161 |
-index 652bdd867782..7997f2a0d5f8 100644 |
|
| 162 |
-+++ b/arch/x86/kernel/kvm.c |
|
| 163 |
-@@ -539,6 +539,11 @@ unsigned int kvm_arch_para_features(void) |
|
| 164 |
- return cpuid_eax(kvm_cpuid_base() | KVM_CPUID_FEATURES); |
|
| 165 |
- } |
|
| 166 |
- |
|
| 167 |
-+unsigned int kvm_arch_para_hints(void) |
|
| 168 |
-+{
|
|
| 169 |
-+ return cpuid_edx(kvm_cpuid_base() | KVM_CPUID_FEATURES); |
|
| 170 |
-+} |
|
| 171 |
-+ |
|
| 172 |
- static uint32_t __init kvm_detect(void) |
|
| 173 |
- {
|
|
| 174 |
- return kvm_cpuid_base(); |
|
| 175 |
-diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h |
|
| 176 |
-index 18c6abe81fbd..728e5c5706c4 100644 |
|
| 177 |
-+++ b/include/asm-generic/kvm_para.h |
|
| 178 |
-@@ -19,6 +19,11 @@ static inline unsigned int kvm_arch_para_features(void) |
|
| 179 |
- return 0; |
|
| 180 |
- } |
|
| 181 |
- |
|
| 182 |
-+static inline unsigned int kvm_arch_para_hints(void) |
|
| 183 |
-+{
|
|
| 184 |
-+ return 0; |
|
| 185 |
-+} |
|
| 186 |
-+ |
|
| 187 |
- static inline bool kvm_para_available(void) |
|
| 188 |
- {
|
|
| 189 |
- return false; |
|
| 190 |
-diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h |
|
| 191 |
-index 51f6ef2c2ff4..f23b90b02898 100644 |
|
| 192 |
-+++ b/include/linux/kvm_para.h |
|
| 193 |
-@@ -9,4 +9,9 @@ static inline bool kvm_para_has_feature(unsigned int feature) |
|
| 194 |
- {
|
|
| 195 |
- return !!(kvm_arch_para_features() & (1UL << feature)); |
|
| 196 |
- } |
|
| 197 |
-+ |
|
| 198 |
-+static inline bool kvm_para_has_hint(unsigned int feature) |
|
| 199 |
-+{
|
|
| 200 |
-+ return !!(kvm_arch_para_hints() & (1UL << feature)); |
|
| 201 |
-+} |
|
| 202 |
- #endif /* __LINUX_KVM_PARA_H */ |
|
| 203 |
-2.14.4 |
|
| 204 |
- |
| 205 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,56 +0,0 @@ |
| 1 |
-From 648922c3a6ddef5fe5ce2677fa3d762574f0a446 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Wanpeng Li <wanpengli@tencent.com> |
|
| 3 |
-Date: Tue, 13 Feb 2018 09:05:41 +0800 |
|
| 4 |
-Subject: KVM: X86: Choose qspinlock when dedicated physical CPUs are available |
|
| 5 |
-MIME-Version: 1.0 |
|
| 6 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 7 |
-Content-Transfer-Encoding: 8bit |
|
| 8 |
- |
|
| 9 |
-Waiman Long mentioned that: |
|
| 10 |
-> Generally speaking, unfair lock performs well for VMs with a small |
|
| 11 |
-> number of vCPUs. Native qspinlock may perform better than pvqspinlock |
|
| 12 |
-> if there is vCPU pinning and there is no vCPU over-commitment. |
|
| 13 |
- |
|
| 14 |
-This patch uses the KVM_HINTS_DEDICATED performance hint, which is |
|
| 15 |
-provided by the hypervisor admin, to choose the qspinlock algorithm |
|
| 16 |
-when a dedicated physical CPU is available. |
|
| 17 |
- |
|
| 18 |
-PV_DEDICATED = 1, PV_UNHALT = anything: default is qspinlock |
|
| 19 |
-PV_DEDICATED = 0, PV_UNHALT = 1: default is Hybrid PV queued/unfair lock |
|
| 20 |
-PV_DEDICATED = 0, PV_UNHALT = 0: default is tas |
|
| 21 |
- |
|
| 22 |
-Cc: Paolo Bonzini <pbonzini@redhat.com> |
|
| 23 |
-Cc: Radim Krčmář <rkrcmar@redhat.com> |
|
| 24 |
-Cc: Eduardo Habkost <ehabkost@redhat.com> |
|
| 25 |
-Signed-off-by: Wanpeng Li <wanpengli@tencent.com> |
|
| 26 |
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
|
| 27 |
-Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> |
|
| 28 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 29 |
-Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
|
| 30 |
-Signed-off-by: Eduardo Valentin <eduval@amazon.com> |
|
| 31 |
- |
|
| 32 |
-CR: https://cr.amazon.com/r/8321913/ |
|
| 33 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 34 |
- arch/x86/kernel/kvm.c | 5 +++++ |
|
| 35 |
- 1 file changed, 5 insertions(+) |
|
| 36 |
- |
|
| 37 |
-diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c |
|
| 38 |
-index 7997f2a0d5f8..98f6201b816e 100644 |
|
| 39 |
-+++ b/arch/x86/kernel/kvm.c |
|
| 40 |
-@@ -651,6 +651,11 @@ void __init kvm_spinlock_init(void) |
|
| 41 |
- if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) |
|
| 42 |
- return; |
|
| 43 |
- |
|
| 44 |
-+ if (kvm_para_has_hint(KVM_HINTS_DEDICATED)) {
|
|
| 45 |
-+ static_branch_disable(&virt_spin_lock_key); |
|
| 46 |
-+ return; |
|
| 47 |
-+ } |
|
| 48 |
-+ |
|
| 49 |
- __pv_init_lock_hash(); |
|
| 50 |
- pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath; |
|
| 51 |
- pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock); |
|
| 52 |
-2.14.4 |
|
| 53 |
- |
| 54 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,87 +0,0 @@ |
| 1 |
-From 792a78c330d5869020a050c5e8f7b072658a8ebd Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Dou Liyang <douly.fnst@cn.fujitsu.com> |
|
| 3 |
-Date: Sat, 28 Oct 2017 14:06:44 +0800 |
|
| 4 |
-Subject: x86/paravirt: Set up the virt_spin_lock_key after static keys get |
|
| 5 |
- initialized |
|
| 6 |
- |
|
| 7 |
-Commit: |
|
| 8 |
- |
|
| 9 |
- 9043442b43b1 ("locking/paravirt: Use new static key for controlling call of virt_spin_lock()")
|
|
| 10 |
- |
|
| 11 |
-sets the static virt_spin_lock_key to a value before jump_label_init() |
|
| 12 |
-has been called, which will result in a WARN(). |
|
| 13 |
- |
|
| 14 |
-Reorder the initialization sequence: |
|
| 15 |
- |
|
| 16 |
- - Move the native_pv_lock_init() into native_smp_prepare_cpus() |
|
| 17 |
- - set the value in xen_init_lock_cpu() |
|
| 18 |
- |
|
| 19 |
-to avoid calling into the not yet initialized static keys subsystem. |
|
| 20 |
- |
|
| 21 |
-Suggested-by: Juergen Gross <jgross@suse.com> |
|
| 22 |
-Reported-by: Juergen Gross <jgross@suse.com> |
|
| 23 |
-Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com> |
|
| 24 |
-Reviewed-by: Juergen Gross <jgross@suse.com> |
|
| 25 |
-Acked-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 26 |
-Cc: Linus Torvalds <torvalds@linux-foundation.org> |
|
| 27 |
-Cc: Peter Zijlstra <peterz@infradead.org> |
|
| 28 |
-Cc: boris.ostrovsky@oracle.com |
|
| 29 |
-Cc: bp@suse.de |
|
| 30 |
-Cc: luto@kernel.org |
|
| 31 |
-Cc: vkuznets@redhat.com |
|
| 32 |
-Cc: xen-devel@lists.xenproject.org |
|
| 33 |
-Link: http://lkml.kernel.org/r/1509170804-3813-1-git-send-email-douly.fnst@cn.fujitsu.com |
|
| 34 |
-Signed-off-by: Ingo Molnar <mingo@kernel.org> |
|
| 35 |
-(cherry picked from commit ca5d376e17072c1b60c3fee66f3be58ef018952d) |
|
| 36 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 37 |
-Reviewed-by: Anchal Agarwal <anchalag@amazon.com> |
|
| 38 |
-Signed-off-by: Eduardo Valentin <eduval@amazon.com> |
|
| 39 |
- |
|
| 40 |
-CR: https://cr.amazon.com/r/8420107/ |
|
| 41 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 42 |
- arch/x86/kernel/smpboot.c | 3 ++- |
|
| 43 |
- arch/x86/xen/spinlock.c | 5 ++++- |
|
| 44 |
- 2 files changed, 6 insertions(+), 2 deletions(-) |
|
| 45 |
- |
|
| 46 |
-diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c |
|
| 47 |
-index 9143f280f302..6103b14d423a 100644 |
|
| 48 |
-+++ b/arch/x86/kernel/smpboot.c |
|
| 49 |
-@@ -1364,6 +1364,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) |
|
| 50 |
- pr_info("CPU0: ");
|
|
| 51 |
- print_cpu_info(&cpu_data(0)); |
|
| 52 |
- |
|
| 53 |
-+ native_pv_lock_init(); |
|
| 54 |
-+ |
|
| 55 |
- uv_system_init(); |
|
| 56 |
- |
|
| 57 |
- set_mtrr_aps_delayed_init(); |
|
| 58 |
-@@ -1393,7 +1395,6 @@ void __init native_smp_prepare_boot_cpu(void) |
|
| 59 |
- /* already set me in cpu_online_mask in boot_cpu_init() */ |
|
| 60 |
- cpumask_set_cpu(me, cpu_callout_mask); |
|
| 61 |
- cpu_set_state_online(me); |
|
| 62 |
-- native_pv_lock_init(); |
|
| 63 |
- } |
|
| 64 |
- |
|
| 65 |
- void __init native_smp_cpus_done(unsigned int max_cpus) |
|
| 66 |
-diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c |
|
| 67 |
-index 08324c64005d..247b99cb7ae0 100644 |
|
| 68 |
-+++ b/arch/x86/xen/spinlock.c |
|
| 69 |
-@@ -81,8 +81,11 @@ void xen_init_lock_cpu(int cpu) |
|
| 70 |
- int irq; |
|
| 71 |
- char *name; |
|
| 72 |
- |
|
| 73 |
-- if (!xen_pvspin) |
|
| 74 |
-+ if (!xen_pvspin) {
|
|
| 75 |
-+ if (cpu == 0) |
|
| 76 |
-+ static_branch_disable(&virt_spin_lock_key); |
|
| 77 |
- return; |
|
| 78 |
-+ } |
|
| 79 |
- |
|
| 80 |
- WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n", |
|
| 81 |
- cpu, per_cpu(lock_kicker_irq, cpu)); |
|
| 82 |
-2.14.4 |
|
| 83 |
- |
| 84 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,81 +0,0 @@ |
| 1 |
-From f9b65ff3019f43c3dd2e7bf033437048a0e3b38f Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Wanpeng Li <wanpengli@tencent.com> |
|
| 3 |
-Date: Sat, 24 Mar 2018 21:17:24 -0700 |
|
| 4 |
-Subject: KVM: X86: Fix setup the virt_spin_lock_key before static key get |
|
| 5 |
- initialized |
|
| 6 |
-MIME-Version: 1.0 |
|
| 7 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 8 |
-Content-Transfer-Encoding: 8bit |
|
| 9 |
- |
|
| 10 |
- static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init() |
|
| 11 |
- WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:161 static_key_disable_cpuslocked+0x61/0x80 |
|
| 12 |
- RIP: 0010:static_key_disable_cpuslocked+0x61/0x80 |
|
| 13 |
- Call Trace: |
|
| 14 |
- static_key_disable+0x16/0x20 |
|
| 15 |
- start_kernel+0x192/0x4b3 |
|
| 16 |
- secondary_startup_64+0xa5/0xb0 |
|
| 17 |
- |
|
| 18 |
-Qspinlock will be choosed when dedicated pCPUs are available, however, the |
|
| 19 |
-static virt_spin_lock_key is set in kvm_spinlock_init() before jump_label_init() |
|
| 20 |
-has been called, which will result in a WARN(). This patch fixes it by delaying |
|
| 21 |
-the virt_spin_lock_key setup to .smp_prepare_cpus(). |
|
| 22 |
- |
|
| 23 |
-Reported-by: Davidlohr Bueso <dbueso@suse.de> |
|
| 24 |
-Cc: Paolo Bonzini <pbonzini@redhat.com> |
|
| 25 |
-Cc: Radim Krčmář <rkrcmar@redhat.com> |
|
| 26 |
-Cc: Davidlohr Bueso <dbueso@suse.de> |
|
| 27 |
-Signed-off-by: Wanpeng Li <wanpengli@tencent.com> |
|
| 28 |
-Fixes: b2798ba0b876 ("KVM: X86: Choose qspinlock when dedicated physical CPUs are available")
|
|
| 29 |
-Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> |
|
| 30 |
-(cherry picked from commit 34226b6b70980a8f81fff3c09a2c889f77edeeff) |
|
| 31 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 32 |
-Reviewed-by: Anchal Agarwal <anchalag@amzon.com> |
|
| 33 |
-Signed-off-by: Eduardo Valentin <eduval@amazon.com> |
|
| 34 |
- |
|
| 35 |
-CR: https://cr.amazon.com/r/8420109/ |
|
| 36 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 37 |
- arch/x86/kernel/kvm.c | 12 +++++++++--- |
|
| 38 |
- 1 file changed, 9 insertions(+), 3 deletions(-) |
|
| 39 |
- |
|
| 40 |
-diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c |
|
| 41 |
-index 98f6201b816e..cc971abdde92 100644 |
|
| 42 |
-+++ b/arch/x86/kernel/kvm.c |
|
| 43 |
-@@ -427,6 +427,13 @@ void kvm_disable_steal_time(void) |
|
| 44 |
- } |
|
| 45 |
- |
|
| 46 |
- #ifdef CONFIG_SMP |
|
| 47 |
-+static void __init kvm_smp_prepare_cpus(unsigned int max_cpus) |
|
| 48 |
-+{
|
|
| 49 |
-+ native_smp_prepare_cpus(max_cpus); |
|
| 50 |
-+ if (kvm_para_has_hint(KVM_HINTS_DEDICATED)) |
|
| 51 |
-+ static_branch_disable(&virt_spin_lock_key); |
|
| 52 |
-+} |
|
| 53 |
-+ |
|
| 54 |
- static void __init kvm_smp_prepare_boot_cpu(void) |
|
| 55 |
- {
|
|
| 56 |
- kvm_guest_cpu_init(); |
|
| 57 |
-@@ -491,6 +498,7 @@ void __init kvm_guest_init(void) |
|
| 58 |
- kvm_setup_vsyscall_timeinfo(); |
|
| 59 |
- |
|
| 60 |
- #ifdef CONFIG_SMP |
|
| 61 |
-+ smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus; |
|
| 62 |
- smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu; |
|
| 63 |
- if (cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "x86/kvm:online", |
|
| 64 |
- kvm_cpu_online, kvm_cpu_down_prepare) < 0) |
|
| 65 |
-@@ -651,10 +659,8 @@ void __init kvm_spinlock_init(void) |
|
| 66 |
- if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT)) |
|
| 67 |
- return; |
|
| 68 |
- |
|
| 69 |
-- if (kvm_para_has_hint(KVM_HINTS_DEDICATED)) {
|
|
| 70 |
-- static_branch_disable(&virt_spin_lock_key); |
|
| 71 |
-+ if (kvm_para_has_hint(KVM_HINTS_DEDICATED)) |
|
| 72 |
- return; |
|
| 73 |
-- } |
|
| 74 |
- |
|
| 75 |
- __pv_init_lock_hash(); |
|
| 76 |
- pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath; |
|
| 77 |
-2.14.4 |
|
| 78 |
- |
| ... | ... |
@@ -37,7 +37,7 @@ negotiate_mq. Subsequent calls causes kernel panic |
| 37 | 37 |
Signed-off-by: Anchal Agarwal <anchalag@amazon.com> |
| 38 | 38 |
Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
| 39 | 39 |
Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
| 40 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 40 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 41 | 41 |
--- |
| 42 | 42 |
drivers/block/xen-blkfront.c | 5 ----- |
| 43 | 43 |
1 file changed, 5 deletions(-) |
| 44 | 44 |
deleted file mode 100644 |
| ... | ... |
@@ -1,54 +0,0 @@ |
| 1 |
-From e807e006512f8c07ec423641a22385437ca0e8fa Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Ross Lagerwall <ross.lagerwall@citrix.com> |
|
| 3 |
-Date: Thu, 21 Jun 2018 14:00:21 +0100 |
|
| 4 |
-Subject: xen-netfront: Update features after registering netdev |
|
| 5 |
- |
|
| 6 |
-Update the features after calling register_netdev() otherwise the |
|
| 7 |
-device features are not set up correctly and it not possible to change |
|
| 8 |
-the MTU of the device. After this change, the features reported by |
|
| 9 |
-ethtool match the device's features before the commit which introduced |
|
| 10 |
-the issue and it is possible to change the device's MTU. |
|
| 11 |
- |
|
| 12 |
-Fixes: f599c64fdf7d ("xen-netfront: Fix race between device setup and open")
|
|
| 13 |
-Reported-by: Liam Shepherd <liam@dancer.es> |
|
| 14 |
-Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> |
|
| 15 |
-Reviewed-by: Juergen Gross <jgross@suse.com> |
|
| 16 |
-Signed-off-by: David S. Miller <davem@davemloft.net> |
|
| 17 |
-Signed-off-by: Alakesh Haloi <alakeshh@amazon.com> |
|
| 18 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 19 |
-Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
|
| 20 |
-Reviewed-by: Anchal Agarwal <anchalag@amazon.com> |
|
| 21 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 22 |
- drivers/net/xen-netfront.c | 8 ++++---- |
|
| 23 |
- 1 file changed, 4 insertions(+), 4 deletions(-) |
|
| 24 |
- |
|
| 25 |
-diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c |
|
| 26 |
-index c2acad722946..e71acbe99004 100644 |
|
| 27 |
-+++ b/drivers/net/xen-netfront.c |
|
| 28 |
-@@ -2035,10 +2035,6 @@ static int xennet_connect(struct net_device *dev) |
|
| 29 |
- /* talk_to_netback() sets the correct number of queues */ |
|
| 30 |
- num_queues = dev->real_num_tx_queues; |
|
| 31 |
- |
|
| 32 |
-- rtnl_lock(); |
|
| 33 |
-- netdev_update_features(dev); |
|
| 34 |
-- rtnl_unlock(); |
|
| 35 |
-- |
|
| 36 |
- if (dev->reg_state == NETREG_UNINITIALIZED) {
|
|
| 37 |
- err = register_netdev(dev); |
|
| 38 |
- if (err) {
|
|
| 39 |
-@@ -2048,6 +2044,10 @@ static int xennet_connect(struct net_device *dev) |
|
| 40 |
- } |
|
| 41 |
- } |
|
| 42 |
- |
|
| 43 |
-+ rtnl_lock(); |
|
| 44 |
-+ netdev_update_features(dev); |
|
| 45 |
-+ rtnl_unlock(); |
|
| 46 |
-+ |
|
| 47 |
- /* |
|
| 48 |
- * All public and private state should now be sane. Get |
|
| 49 |
- * ready to start sending and receiving packets and give the driver |
|
| 50 |
-2.14.4 |
|
| 51 |
- |
| ... | ... |
@@ -45,7 +45,7 @@ Tested-by: Anchal Agarwal <anchalag@amazon.com> |
| 45 | 45 |
Signed-off-by: Eduardo Valentin <eduval@amazon.com> |
| 46 | 46 |
|
| 47 | 47 |
CR: https://cr.amazon.com/r/8440112/ |
| 48 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 48 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 49 | 49 |
--- |
| 50 | 50 |
arch/x86/kernel/tsc.c | 29 +++++++++++++++++++++++++++++ |
| 51 | 51 |
include/linux/sched/clock.h | 5 +++++ |
| 52 | 52 |
deleted file mode 100644 |
| ... | ... |
@@ -1,100 +0,0 @@ |
| 1 |
-From 68ddd43c41268d9dd2fc05787b480b43eb5fe883 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Christoph Hellwig <hch@lst.de> |
|
| 3 |
-Date: Fri, 12 Jan 2018 10:53:06 +0800 |
|
| 4 |
-Subject: blk-mq: simplify queue mapping & schedule with each possisble CPU |
|
| 5 |
- |
|
| 6 |
-The previous patch assigns interrupt vectors to all possible CPUs, so |
|
| 7 |
-now hctx can be mapped to possible CPUs, this patch applies this fact |
|
| 8 |
-to simplify queue mapping & schedule so that we don't need to handle |
|
| 9 |
-CPU hotplug for dealing with physical CPU plug & unplug. With this |
|
| 10 |
-simplication, we can work well on physical CPU plug & unplug, which |
|
| 11 |
-is a normal use case for VM at least. |
|
| 12 |
- |
|
| 13 |
-Make sure we allocate blk_mq_ctx structures for all possible CPUs, and |
|
| 14 |
-set hctx->numa_node for possible CPUs which are mapped to this hctx. And |
|
| 15 |
-only choose the online CPUs for schedule. |
|
| 16 |
- |
|
| 17 |
-Reported-by: Christian Borntraeger <borntraeger@de.ibm.com> |
|
| 18 |
-Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> |
|
| 19 |
-Tested-by: Stefan Haberland <sth@linux.vnet.ibm.com> |
|
| 20 |
-Cc: Thomas Gleixner <tglx@linutronix.de> |
|
| 21 |
-Signed-off-by: Christoph Hellwig <hch@lst.de> |
|
| 22 |
-Fixes: 4b855ad37194 ("blk-mq: Create hctx for each present CPU")
|
|
| 23 |
-(merged the three into one because any single one may not work, and fix |
|
| 24 |
-selecting online CPUs for scheduler) |
|
| 25 |
-Signed-off-by: Ming Lei <ming.lei@redhat.com> |
|
| 26 |
-Signed-off-by: Jens Axboe <axboe@kernel.dk> |
|
| 27 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 28 |
-Reviewed-by: Vallish Vaidyeshwara <vallish@amazon.com> |
|
| 29 |
-Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
|
| 30 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 31 |
- block/blk-mq.c | 19 ++++++++----------- |
|
| 32 |
- 1 file changed, 8 insertions(+), 11 deletions(-) |
|
| 33 |
- |
|
| 34 |
-diff --git a/block/blk-mq.c b/block/blk-mq.c |
|
| 35 |
-index 49979c095f31..ecbf9b5aeda5 100644 |
|
| 36 |
-+++ b/block/blk-mq.c |
|
| 37 |
-@@ -463,7 +463,7 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, |
|
| 38 |
- blk_queue_exit(q); |
|
| 39 |
- return ERR_PTR(-EXDEV); |
|
| 40 |
- } |
|
| 41 |
-- cpu = cpumask_first(alloc_data.hctx->cpumask); |
|
| 42 |
-+ cpu = cpumask_first_and(alloc_data.hctx->cpumask, cpu_online_mask); |
|
| 43 |
- alloc_data.ctx = __blk_mq_get_ctx(q, cpu); |
|
| 44 |
- |
|
| 45 |
- rq = blk_mq_get_request(q, NULL, op, &alloc_data); |
|
| 46 |
-@@ -1217,9 +1217,10 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx) |
|
| 47 |
- if (--hctx->next_cpu_batch <= 0) {
|
|
| 48 |
- int next_cpu; |
|
| 49 |
- |
|
| 50 |
-- next_cpu = cpumask_next(hctx->next_cpu, hctx->cpumask); |
|
| 51 |
-+ next_cpu = cpumask_next_and(hctx->next_cpu, hctx->cpumask, |
|
| 52 |
-+ cpu_online_mask); |
|
| 53 |
- if (next_cpu >= nr_cpu_ids) |
|
| 54 |
-- next_cpu = cpumask_first(hctx->cpumask); |
|
| 55 |
-+ next_cpu = cpumask_first_and(hctx->cpumask,cpu_online_mask); |
|
| 56 |
- |
|
| 57 |
- hctx->next_cpu = next_cpu; |
|
| 58 |
- hctx->next_cpu_batch = BLK_MQ_CPU_WORK_BATCH; |
|
| 59 |
-@@ -2085,16 +2086,11 @@ static void blk_mq_init_cpu_queues(struct request_queue *q, |
|
| 60 |
- INIT_LIST_HEAD(&__ctx->rq_list); |
|
| 61 |
- __ctx->queue = q; |
|
| 62 |
- |
|
| 63 |
-- /* If the cpu isn't present, the cpu is mapped to first hctx */ |
|
| 64 |
-- if (!cpu_present(i)) |
|
| 65 |
-- continue; |
|
| 66 |
-- |
|
| 67 |
-- hctx = blk_mq_map_queue(q, i); |
|
| 68 |
-- |
|
| 69 |
- /* |
|
| 70 |
- * Set local node, IFF we have more than one hw queue. If |
|
| 71 |
- * not, we remain on the home node of the device |
|
| 72 |
- */ |
|
| 73 |
-+ hctx = blk_mq_map_queue(q, i); |
|
| 74 |
- if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE) |
|
| 75 |
- hctx->numa_node = local_memory_node(cpu_to_node(i)); |
|
| 76 |
- } |
|
| 77 |
-@@ -2151,7 +2147,7 @@ static void blk_mq_map_swqueue(struct request_queue *q) |
|
| 78 |
- * |
|
| 79 |
- * If the cpu isn't present, the cpu is mapped to first hctx. |
|
| 80 |
- */ |
|
| 81 |
-- for_each_present_cpu(i) {
|
|
| 82 |
-+ for_each_possible_cpu(i) {
|
|
| 83 |
- hctx_idx = q->mq_map[i]; |
|
| 84 |
- /* unmapped hw queue can be remapped after CPU topo changed */ |
|
| 85 |
- if (!set->tags[hctx_idx] && |
|
| 86 |
-@@ -2205,7 +2201,8 @@ static void blk_mq_map_swqueue(struct request_queue *q) |
|
| 87 |
- /* |
|
| 88 |
- * Initialize batch roundrobin counts |
|
| 89 |
- */ |
|
| 90 |
-- hctx->next_cpu = cpumask_first(hctx->cpumask); |
|
| 91 |
-+ hctx->next_cpu = cpumask_first_and(hctx->cpumask, |
|
| 92 |
-+ cpu_online_mask); |
|
| 93 |
- hctx->next_cpu_batch = BLK_MQ_CPU_WORK_BATCH; |
|
| 94 |
- } |
|
| 95 |
- } |
|
| 96 |
-2.14.4 |
|
| 97 |
- |
| ... | ... |
@@ -47,16 +47,16 @@ Reviewed-by: Balbir Singh <sblbir@amazon.com> |
| 47 | 47 |
Reviewed-by: Frank van der Linden <fllinden@amazon.com> |
| 48 | 48 |
|
| 49 | 49 |
CR: https://cr.amazon.com/r/8514427/ |
| 50 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 50 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 51 | 51 |
--- |
| 52 | 52 |
block/blk-wbt.c | 57 +++++++++++++++++++++++++-------------------------------- |
| 53 | 53 |
1 file changed, 25 insertions(+), 32 deletions(-) |
| 54 | 54 |
|
| 55 | 55 |
diff --git a/block/blk-wbt.c b/block/blk-wbt.c |
| 56 |
-index 5c105514bca7..99f55ad2dd49 100644 |
|
| 56 |
+index 4f89b28..91f7f56 100644 |
|
| 57 | 57 |
--- a/block/blk-wbt.c |
| 58 | 58 |
+++ b/block/blk-wbt.c |
| 59 |
-@@ -157,7 +157,7 @@ void __wbt_done(struct rq_wb *rwb, enum wbt_flags wb_acct) |
|
| 59 |
+@@ -186,7 +186,7 @@ void __wbt_done(struct rq_wb *rwb, enum wbt_flags wb_acct) |
|
| 60 | 60 |
int diff = limit - inflight; |
| 61 | 61 |
|
| 62 | 62 |
if (!inflight || diff >= rwb->wb_background / 2) |
| ... | ... |
@@ -65,7 +65,7 @@ index 5c105514bca7..99f55ad2dd49 100644 |
| 65 | 65 |
} |
| 66 | 66 |
} |
| 67 | 67 |
|
| 68 |
-@@ -502,30 +502,6 @@ static inline unsigned int get_limit(struct rq_wb *rwb, unsigned long rw) |
|
| 68 |
+@@ -533,30 +533,6 @@ static inline unsigned int get_limit(struct rq_wb *rwb, unsigned long rw) |
|
| 69 | 69 |
return limit; |
| 70 | 70 |
} |
| 71 | 71 |
|
| ... | ... |
@@ -96,10 +96,10 @@ index 5c105514bca7..99f55ad2dd49 100644 |
| 96 | 96 |
/* |
| 97 | 97 |
* Block if we will exceed our limit, or if we are currently waiting for |
| 98 | 98 |
* the timer to kick off queuing again. |
| 99 |
-@@ -535,16 +511,32 @@ static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock) |
|
| 99 |
+@@ -567,16 +543,32 @@ static void __wbt_wait(struct rq_wb *rwb, enum wbt_flags wb_acct, |
|
| 100 | 100 |
__acquires(lock) |
| 101 | 101 |
{
|
| 102 |
- struct rq_wait *rqw = get_rq_wait(rwb, current_is_kswapd()); |
|
| 102 |
+ struct rq_wait *rqw = get_rq_wait(rwb, wb_acct); |
|
| 103 | 103 |
- DEFINE_WAIT(wait); |
| 104 | 104 |
+ DECLARE_WAITQUEUE(wait, current); |
| 105 | 105 |
|
| ... | ... |
@@ -111,14 +111,13 @@ index 5c105514bca7..99f55ad2dd49 100644 |
| 111 | 111 |
+ */ |
| 112 | 112 |
+ if (!rwb_enabled(rwb)) {
|
| 113 | 113 |
+ atomic_inc(&rqw->inflight); |
| 114 |
- return; |
|
| 115 |
-- |
|
| 114 |
++ return; |
|
| 116 | 115 |
+ } |
| 117 |
-+ |
|
| 116 |
++ |
|
| 118 | 117 |
+ if (!waitqueue_active(&rqw->wait) |
| 119 | 118 |
+ && atomic_inc_below(&rqw->inflight, get_limit(rwb, rw))) |
| 120 |
-+ return; |
|
| 121 |
-+ |
|
| 119 |
+ return; |
|
| 120 |
+ |
|
| 122 | 121 |
+ add_wait_queue_exclusive(&rqw->wait, &wait); |
| 123 | 122 |
do {
|
| 124 | 123 |
- prepare_to_wait_exclusive(&rqw->wait, &wait, |
| ... | ... |
@@ -135,7 +134,7 @@ index 5c105514bca7..99f55ad2dd49 100644 |
| 135 | 135 |
break; |
| 136 | 136 |
|
| 137 | 137 |
if (lock) {
|
| 138 |
-@@ -555,7 +547,8 @@ static void __wbt_wait(struct rq_wb *rwb, unsigned long rw, spinlock_t *lock) |
|
| 138 |
+@@ -587,7 +579,8 @@ static void __wbt_wait(struct rq_wb *rwb, enum wbt_flags wb_acct, |
|
| 139 | 139 |
io_schedule(); |
| 140 | 140 |
} while (1); |
| 141 | 141 |
|
| 142 | 142 |
deleted file mode 100644 |
| ... | ... |
@@ -1,94 +0,0 @@ |
| 1 |
-From d9f8a6ae7ca3af4ab931b4cb9e8d1fac3982d9ad Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Borislav Petkov <bp@suse.de> |
|
| 3 |
-Date: Thu, 17 May 2018 18:32:33 +0200 |
|
| 4 |
-Subject: x86/MCE/AMD: Read MCx_MISC block addresses on any CPU |
|
| 5 |
- |
|
| 6 |
-[upstream fbf96cf904dc154a28338fe68f72902e9af57afc] |
|
| 7 |
- |
|
| 8 |
-We used rdmsr_safe_on_cpu() to make sure we're reading the proper CPU's |
|
| 9 |
-MISC block addresses. However, that caused trouble with CPU hotplug due to |
|
| 10 |
-the _on_cpu() helper issuing an IPI while IRQs are disabled. |
|
| 11 |
- |
|
| 12 |
-But we don't have to do that: the block addresses are the same on any CPU |
|
| 13 |
-so we can read them on any CPU. (What practically happens is, we read them |
|
| 14 |
-on the BSP and cache them, and for later reads, we service them from the |
|
| 15 |
-cache). |
|
| 16 |
- |
|
| 17 |
-Suggested-by: Yazen Ghannam <Yazen.Ghannam@amd.com> |
|
| 18 |
-Signed-off-by: Borislav Petkov <bp@suse.de> |
|
| 19 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 20 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 21 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 22 |
- arch/x86/kernel/cpu/mcheck/mce_amd.c | 15 +++++++-------- |
|
| 23 |
- 1 file changed, 7 insertions(+), 8 deletions(-) |
|
| 24 |
- |
|
| 25 |
-diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
|
| 26 |
-index dbcb01006749..027aa4a9b928 100644 |
|
| 27 |
-+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
|
| 28 |
-@@ -434,8 +434,7 @@ static void deferred_error_interrupt_enable(struct cpuinfo_x86 *c) |
|
| 29 |
- wrmsr(MSR_CU_DEF_ERR, low, high); |
|
| 30 |
- } |
|
| 31 |
- |
|
| 32 |
--static u32 smca_get_block_address(unsigned int cpu, unsigned int bank, |
|
| 33 |
-- unsigned int block) |
|
| 34 |
-+static u32 smca_get_block_address(unsigned int bank, unsigned int block) |
|
| 35 |
- {
|
|
| 36 |
- u32 low, high; |
|
| 37 |
- u32 addr = 0; |
|
| 38 |
-@@ -454,13 +453,13 @@ static u32 smca_get_block_address(unsigned int cpu, unsigned int bank, |
|
| 39 |
- * For SMCA enabled processors, BLKPTR field of the first MISC register |
|
| 40 |
- * (MCx_MISC0) indicates presence of additional MISC regs set (MISC1-4). |
|
| 41 |
- */ |
|
| 42 |
-- if (rdmsr_safe_on_cpu(cpu, MSR_AMD64_SMCA_MCx_CONFIG(bank), &low, &high)) |
|
| 43 |
-+ if (rdmsr_safe(MSR_AMD64_SMCA_MCx_CONFIG(bank), &low, &high)) |
|
| 44 |
- goto out; |
|
| 45 |
- |
|
| 46 |
- if (!(low & MCI_CONFIG_MCAX)) |
|
| 47 |
- goto out; |
|
| 48 |
- |
|
| 49 |
-- if (!rdmsr_safe_on_cpu(cpu, MSR_AMD64_SMCA_MCx_MISC(bank), &low, &high) && |
|
| 50 |
-+ if (!rdmsr_safe(MSR_AMD64_SMCA_MCx_MISC(bank), &low, &high) && |
|
| 51 |
- (low & MASK_BLKPTR_LO)) |
|
| 52 |
- addr = MSR_AMD64_SMCA_MCx_MISCy(bank, block - 1); |
|
| 53 |
- |
|
| 54 |
-@@ -469,7 +468,7 @@ static u32 smca_get_block_address(unsigned int cpu, unsigned int bank, |
|
| 55 |
- return addr; |
|
| 56 |
- } |
|
| 57 |
- |
|
| 58 |
--static u32 get_block_address(unsigned int cpu, u32 current_addr, u32 low, u32 high, |
|
| 59 |
-+static u32 get_block_address(u32 current_addr, u32 low, u32 high, |
|
| 60 |
- unsigned int bank, unsigned int block) |
|
| 61 |
- {
|
|
| 62 |
- u32 addr = 0, offset = 0; |
|
| 63 |
-@@ -478,7 +477,7 @@ static u32 get_block_address(unsigned int cpu, u32 current_addr, u32 low, u32 hi |
|
| 64 |
- return addr; |
|
| 65 |
- |
|
| 66 |
- if (mce_flags.smca) |
|
| 67 |
-- return smca_get_block_address(cpu, bank, block); |
|
| 68 |
-+ return smca_get_block_address(bank, block); |
|
| 69 |
- |
|
| 70 |
- /* Fall back to method we used for older processors: */ |
|
| 71 |
- switch (block) {
|
|
| 72 |
-@@ -556,7 +555,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c) |
|
| 73 |
- smca_configure(bank, cpu); |
|
| 74 |
- |
|
| 75 |
- for (block = 0; block < NR_BLOCKS; ++block) {
|
|
| 76 |
-- address = get_block_address(cpu, address, low, high, bank, block); |
|
| 77 |
-+ address = get_block_address(address, low, high, bank, block); |
|
| 78 |
- if (!address) |
|
| 79 |
- break; |
|
| 80 |
- |
|
| 81 |
-@@ -1173,7 +1172,7 @@ static int allocate_threshold_blocks(unsigned int cpu, unsigned int bank, |
|
| 82 |
- if (err) |
|
| 83 |
- goto out_free; |
|
| 84 |
- recurse: |
|
| 85 |
-- address = get_block_address(cpu, address, low, high, bank, ++block); |
|
| 86 |
-+ address = get_block_address(address, low, high, bank, ++block); |
|
| 87 |
- if (!address) |
|
| 88 |
- return 0; |
|
| 89 |
- |
|
| 90 |
-2.14.4 |
|
| 91 |
- |
| 92 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,77 +0,0 @@ |
| 1 |
-From aae3361dd62c8d7e2043fdeaf1554e1ce1c06c3d Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 3 |
-Date: Fri, 1 Jun 2018 10:59:19 -0400 |
|
| 4 |
-Subject: x86/bugs: Add AMD's variant of SSB_NO |
|
| 5 |
- |
|
| 6 |
-[upstream 24809860012e0130fbafe536709e08a22b3e959e] |
|
| 7 |
- |
|
| 8 |
-The AMD document outlining the SSBD handling |
|
| 9 |
-124441_AMD64_SpeculativeStoreBypassDisable_Whitepaper_final.pdf |
|
| 10 |
-mentions that the CPUID 8000_0008.EBX[26] will mean that the |
|
| 11 |
-speculative store bypass disable is no longer needed. |
|
| 12 |
- |
|
| 13 |
-A copy of this document is available at: |
|
| 14 |
- https://bugzilla.kernel.org/show_bug.cgi?id=199889 |
|
| 15 |
- |
|
| 16 |
-Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 17 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 18 |
-Cc: Tom Lendacky <thomas.lendacky@amd.com> |
|
| 19 |
-Cc: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> |
|
| 20 |
-Cc: kvm@vger.kernel.org |
|
| 21 |
-Cc: andrew.cooper3@citrix.com |
|
| 22 |
-Cc: Andy Lutomirski <luto@kernel.org> |
|
| 23 |
-Cc: "H. Peter Anvin" <hpa@zytor.com> |
|
| 24 |
-Cc: Borislav Petkov <bp@suse.de> |
|
| 25 |
-Cc: David Woodhouse <dwmw@amazon.co.uk> |
|
| 26 |
-Link: https://lkml.kernel.org/r/20180601145921.9500-2-konrad.wilk@oracle.com |
|
| 27 |
- |
|
| 28 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 29 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 30 |
- arch/x86/include/asm/cpufeatures.h | 1 + |
|
| 31 |
- arch/x86/kernel/cpu/common.c | 3 ++- |
|
| 32 |
- arch/x86/kvm/cpuid.c | 2 +- |
|
| 33 |
- 3 files changed, 4 insertions(+), 2 deletions(-) |
|
| 34 |
- |
|
| 35 |
-diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h |
|
| 36 |
-index 8418462298e7..4c1d67c31bd4 100644 |
|
| 37 |
-+++ b/arch/x86/include/asm/cpufeatures.h |
|
| 38 |
-@@ -284,6 +284,7 @@ |
|
| 39 |
- #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ |
|
| 40 |
- #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */ |
|
| 41 |
- #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ |
|
| 42 |
-+#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */ |
|
| 43 |
- |
|
| 44 |
- /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ |
|
| 45 |
- #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ |
|
| 46 |
-diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c |
|
| 47 |
-index dd02ee4fa8cd..1673a95bdced 100644 |
|
| 48 |
-+++ b/arch/x86/kernel/cpu/common.c |
|
| 49 |
-@@ -957,7 +957,8 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) |
|
| 50 |
- rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); |
|
| 51 |
- |
|
| 52 |
- if (!x86_match_cpu(cpu_no_spec_store_bypass) && |
|
| 53 |
-- !(ia32_cap & ARCH_CAP_SSB_NO)) |
|
| 54 |
-+ !(ia32_cap & ARCH_CAP_SSB_NO) && |
|
| 55 |
-+ !cpu_has(c, X86_FEATURE_AMD_SSB_NO)) |
|
| 56 |
- setup_force_cpu_bug(X86_BUG_SPEC_STORE_BYPASS); |
|
| 57 |
- |
|
| 58 |
- if (x86_match_cpu(cpu_no_speculation)) |
|
| 59 |
-diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c |
|
| 60 |
-index d1f5c744142b..95a98397beca 100644 |
|
| 61 |
-+++ b/arch/x86/kvm/cpuid.c |
|
| 62 |
-@@ -367,7 +367,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, |
|
| 63 |
- |
|
| 64 |
- /* cpuid 0x80000008.ebx */ |
|
| 65 |
- const u32 kvm_cpuid_8000_0008_ebx_x86_features = |
|
| 66 |
-- F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD); |
|
| 67 |
-+ F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD) | F(AMD_SSB_NO); |
|
| 68 |
- |
|
| 69 |
- /* cpuid 0xC0000001.edx */ |
|
| 70 |
- const u32 kvm_cpuid_C000_0001_edx_x86_features = |
|
| 71 |
-2.14.4 |
|
| 72 |
- |
| 73 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,171 +0,0 @@ |
| 1 |
-From 9e2dec84e79230156a2b515e2400edd9a9fdcf8a Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 3 |
-Date: Fri, 1 Jun 2018 10:59:20 -0400 |
|
| 4 |
-Subject: x86/bugs: Add AMD's SPEC_CTRL MSR usage |
|
| 5 |
-MIME-Version: 1.0 |
|
| 6 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 7 |
-Content-Transfer-Encoding: 8bit |
|
| 8 |
- |
|
| 9 |
-[upstream 6ac2f49edb1ef5446089c7c660017732886d62d6] |
|
| 10 |
- |
|
| 11 |
-The AMD document outlining the SSBD handling |
|
| 12 |
-124441_AMD64_SpeculativeStoreBypassDisable_Whitepaper_final.pdf |
|
| 13 |
-mentions that if CPUID 8000_0008.EBX[24] is set we should be using |
|
| 14 |
-the SPEC_CTRL MSR (0x48) over the VIRT SPEC_CTRL MSR (0xC001_011f) |
|
| 15 |
-for speculative store bypass disable. |
|
| 16 |
- |
|
| 17 |
-This in effect means we should clear the X86_FEATURE_VIRT_SSBD |
|
| 18 |
-flag so that we would prefer the SPEC_CTRL MSR. |
|
| 19 |
- |
|
| 20 |
-See the document titled: |
|
| 21 |
- 124441_AMD64_SpeculativeStoreBypassDisable_Whitepaper_final.pdf |
|
| 22 |
- |
|
| 23 |
-A copy of this document is available at |
|
| 24 |
- https://bugzilla.kernel.org/show_bug.cgi?id=199889 |
|
| 25 |
- |
|
| 26 |
-Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 27 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 28 |
-Cc: Tom Lendacky <thomas.lendacky@amd.com> |
|
| 29 |
-Cc: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com> |
|
| 30 |
-Cc: kvm@vger.kernel.org |
|
| 31 |
-Cc: KarimAllah Ahmed <karahmed@amazon.de> |
|
| 32 |
-Cc: andrew.cooper3@citrix.com |
|
| 33 |
-Cc: Joerg Roedel <joro@8bytes.org> |
|
| 34 |
-Cc: Radim Krčmář <rkrcmar@redhat.com> |
|
| 35 |
-Cc: Andy Lutomirski <luto@kernel.org> |
|
| 36 |
-Cc: "H. Peter Anvin" <hpa@zytor.com> |
|
| 37 |
-Cc: Paolo Bonzini <pbonzini@redhat.com> |
|
| 38 |
-Cc: Borislav Petkov <bp@suse.de> |
|
| 39 |
-Cc: David Woodhouse <dwmw@amazon.co.uk> |
|
| 40 |
-Cc: Kees Cook <keescook@chromium.org> |
|
| 41 |
-Link: https://lkml.kernel.org/r/20180601145921.9500-3-konrad.wilk@oracle.com |
|
| 42 |
- |
|
| 43 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 44 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 45 |
- arch/x86/include/asm/cpufeatures.h | 1 + |
|
| 46 |
- arch/x86/kernel/cpu/bugs.c | 12 +++++++----- |
|
| 47 |
- arch/x86/kernel/cpu/common.c | 6 ++++++ |
|
| 48 |
- arch/x86/kvm/cpuid.c | 10 ++++++++-- |
|
| 49 |
- arch/x86/kvm/svm.c | 8 +++++--- |
|
| 50 |
- 5 files changed, 27 insertions(+), 10 deletions(-) |
|
| 51 |
- |
|
| 52 |
-diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h |
|
| 53 |
-index 4c1d67c31bd4..6396d0f048b1 100644 |
|
| 54 |
-+++ b/arch/x86/include/asm/cpufeatures.h |
|
| 55 |
-@@ -283,6 +283,7 @@ |
|
| 56 |
- #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */ |
|
| 57 |
- #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ |
|
| 58 |
- #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */ |
|
| 59 |
-+#define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */ |
|
| 60 |
- #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ |
|
| 61 |
- #define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */ |
|
| 62 |
- |
|
| 63 |
-diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c |
|
| 64 |
-index d07addb99b71..4a8a441d9aa4 100644 |
|
| 65 |
-+++ b/arch/x86/kernel/cpu/bugs.c |
|
| 66 |
-@@ -516,18 +516,20 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) |
|
| 67 |
- if (mode == SPEC_STORE_BYPASS_DISABLE) {
|
|
| 68 |
- setup_force_cpu_cap(X86_FEATURE_SPEC_STORE_BYPASS_DISABLE); |
|
| 69 |
- /* |
|
| 70 |
-- * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD uses |
|
| 71 |
-- * a completely different MSR and bit dependent on family. |
|
| 72 |
-+ * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD may |
|
| 73 |
-+ * use a completely different MSR and bit dependent on family. |
|
| 74 |
- */ |
|
| 75 |
- switch (boot_cpu_data.x86_vendor) {
|
|
| 76 |
- case X86_VENDOR_INTEL: |
|
| 77 |
-+ case X86_VENDOR_AMD: |
|
| 78 |
-+ if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) {
|
|
| 79 |
-+ x86_amd_ssb_disable(); |
|
| 80 |
-+ break; |
|
| 81 |
-+ } |
|
| 82 |
- x86_spec_ctrl_base |= SPEC_CTRL_SSBD; |
|
| 83 |
- x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; |
|
| 84 |
- wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); |
|
| 85 |
- break; |
|
| 86 |
-- case X86_VENDOR_AMD: |
|
| 87 |
-- x86_amd_ssb_disable(); |
|
| 88 |
-- break; |
|
| 89 |
- } |
|
| 90 |
- } |
|
| 91 |
- |
|
| 92 |
-diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c |
|
| 93 |
-index 1673a95bdced..b8de3d545d9a 100644 |
|
| 94 |
-+++ b/arch/x86/kernel/cpu/common.c |
|
| 95 |
-@@ -760,6 +760,12 @@ static void init_speculation_control(struct cpuinfo_x86 *c) |
|
| 96 |
- set_cpu_cap(c, X86_FEATURE_STIBP); |
|
| 97 |
- set_cpu_cap(c, X86_FEATURE_MSR_SPEC_CTRL); |
|
| 98 |
- } |
|
| 99 |
-+ |
|
| 100 |
-+ if (cpu_has(c, X86_FEATURE_AMD_SSBD)) {
|
|
| 101 |
-+ set_cpu_cap(c, X86_FEATURE_SSBD); |
|
| 102 |
-+ set_cpu_cap(c, X86_FEATURE_MSR_SPEC_CTRL); |
|
| 103 |
-+ clear_cpu_cap(c, X86_FEATURE_VIRT_SSBD); |
|
| 104 |
-+ } |
|
| 105 |
- } |
|
| 106 |
- |
|
| 107 |
- void get_cpu_cap(struct cpuinfo_x86 *c) |
|
| 108 |
-diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c |
|
| 109 |
-index 95a98397beca..bbcd69c76d96 100644 |
|
| 110 |
-+++ b/arch/x86/kvm/cpuid.c |
|
| 111 |
-@@ -367,7 +367,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, |
|
| 112 |
- |
|
| 113 |
- /* cpuid 0x80000008.ebx */ |
|
| 114 |
- const u32 kvm_cpuid_8000_0008_ebx_x86_features = |
|
| 115 |
-- F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD) | F(AMD_SSB_NO); |
|
| 116 |
-+ F(AMD_IBPB) | F(AMD_IBRS) | F(AMD_SSBD) | F(VIRT_SSBD) | |
|
| 117 |
-+ F(AMD_SSB_NO); |
|
| 118 |
- |
|
| 119 |
- /* cpuid 0xC0000001.edx */ |
|
| 120 |
- const u32 kvm_cpuid_C000_0001_edx_x86_features = |
|
| 121 |
-@@ -649,7 +650,12 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, |
|
| 122 |
- entry->ebx |= F(VIRT_SSBD); |
|
| 123 |
- entry->ebx &= kvm_cpuid_8000_0008_ebx_x86_features; |
|
| 124 |
- cpuid_mask(&entry->ebx, CPUID_8000_0008_EBX); |
|
| 125 |
-- if (boot_cpu_has(X86_FEATURE_LS_CFG_SSBD)) |
|
| 126 |
-+ /* |
|
| 127 |
-+ * The preference is to use SPEC CTRL MSR instead of the |
|
| 128 |
-+ * VIRT_SPEC MSR. |
|
| 129 |
-+ */ |
|
| 130 |
-+ if (boot_cpu_has(X86_FEATURE_LS_CFG_SSBD) && |
|
| 131 |
-+ !boot_cpu_has(X86_FEATURE_AMD_SSBD)) |
|
| 132 |
- entry->ebx |= F(VIRT_SSBD); |
|
| 133 |
- break; |
|
| 134 |
- } |
|
| 135 |
-diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c |
|
| 136 |
-index 282bbcbf3b6a..6fa8e94b5208 100644 |
|
| 137 |
-+++ b/arch/x86/kvm/svm.c |
|
| 138 |
-@@ -3644,7 +3644,8 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) |
|
| 139 |
- break; |
|
| 140 |
- case MSR_IA32_SPEC_CTRL: |
|
| 141 |
- if (!msr_info->host_initiated && |
|
| 142 |
-- !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS)) |
|
| 143 |
-+ !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS) && |
|
| 144 |
-+ !guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD)) |
|
| 145 |
- return 1; |
|
| 146 |
- |
|
| 147 |
- msr_info->data = svm->spec_ctrl; |
|
| 148 |
-@@ -3749,11 +3750,12 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) |
|
| 149 |
- break; |
|
| 150 |
- case MSR_IA32_SPEC_CTRL: |
|
| 151 |
- if (!msr->host_initiated && |
|
| 152 |
-- !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS)) |
|
| 153 |
-+ !guest_cpuid_has(vcpu, X86_FEATURE_AMD_IBRS) && |
|
| 154 |
-+ !guest_cpuid_has(vcpu, X86_FEATURE_AMD_SSBD)) |
|
| 155 |
- return 1; |
|
| 156 |
- |
|
| 157 |
- /* The STIBP bit doesn't fault even if it's not advertised */ |
|
| 158 |
-- if (data & ~(SPEC_CTRL_IBRS | SPEC_CTRL_STIBP)) |
|
| 159 |
-+ if (data & ~(SPEC_CTRL_IBRS | SPEC_CTRL_STIBP | SPEC_CTRL_SSBD)) |
|
| 160 |
- return 1; |
|
| 161 |
- |
|
| 162 |
- svm->spec_ctrl = data; |
|
| 163 |
-2.14.4 |
|
| 164 |
- |
| 165 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,58 +0,0 @@ |
| 1 |
-From 1727c9e846c6643481877728ff9c14e329582124 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 3 |
-Date: Fri, 1 Jun 2018 10:59:21 -0400 |
|
| 4 |
-Subject: x86/bugs: Switch the selection of mitigation from CPU vendor to CPU |
|
| 5 |
- features |
|
| 6 |
- |
|
| 7 |
-[Upstream 108fab4b5c8f12064ef86e02cb0459992affb30f] |
|
| 8 |
- |
|
| 9 |
-Both AMD and Intel can have SPEC_CTRL_MSR for SSBD. |
|
| 10 |
- |
|
| 11 |
-However AMD also has two more other ways of doing it - which |
|
| 12 |
-are !SPEC_CTRL MSR ways. |
|
| 13 |
- |
|
| 14 |
-Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 15 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 16 |
-Cc: Kees Cook <keescook@chromium.org> |
|
| 17 |
-Cc: kvm@vger.kernel.org |
|
| 18 |
-Cc: KarimAllah Ahmed <karahmed@amazon.de> |
|
| 19 |
-Cc: andrew.cooper3@citrix.com |
|
| 20 |
-Cc: "H. Peter Anvin" <hpa@zytor.com> |
|
| 21 |
-Cc: Borislav Petkov <bp@suse.de> |
|
| 22 |
-Cc: David Woodhouse <dwmw@amazon.co.uk> |
|
| 23 |
-Link: https://lkml.kernel.org/r/20180601145921.9500-4-konrad.wilk@oracle.com |
|
| 24 |
- |
|
| 25 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 26 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 27 |
- arch/x86/kernel/cpu/bugs.c | 11 +++-------- |
|
| 28 |
- 1 file changed, 3 insertions(+), 8 deletions(-) |
|
| 29 |
- |
|
| 30 |
-diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c |
|
| 31 |
-index 4a8a441d9aa4..d97a79cb3edf 100644 |
|
| 32 |
-+++ b/arch/x86/kernel/cpu/bugs.c |
|
| 33 |
-@@ -519,17 +519,12 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) |
|
| 34 |
- * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD may |
|
| 35 |
- * use a completely different MSR and bit dependent on family. |
|
| 36 |
- */ |
|
| 37 |
-- switch (boot_cpu_data.x86_vendor) {
|
|
| 38 |
-- case X86_VENDOR_INTEL: |
|
| 39 |
-- case X86_VENDOR_AMD: |
|
| 40 |
-- if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) {
|
|
| 41 |
-- x86_amd_ssb_disable(); |
|
| 42 |
-- break; |
|
| 43 |
-- } |
|
| 44 |
-+ if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) |
|
| 45 |
-+ x86_amd_ssb_disable(); |
|
| 46 |
-+ else {
|
|
| 47 |
- x86_spec_ctrl_base |= SPEC_CTRL_SSBD; |
|
| 48 |
- x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; |
|
| 49 |
- wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); |
|
| 50 |
-- break; |
|
| 51 |
- } |
|
| 52 |
- } |
|
| 53 |
- |
|
| 54 |
-2.14.4 |
|
| 55 |
- |
| 56 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,44 +0,0 @@ |
| 1 |
-From 218cdd0fb39599e8c2652711ebc803e807cb46af Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Borislav Petkov <bp@suse.de> |
|
| 3 |
-Date: Fri, 27 Apr 2018 16:34:36 -0500 |
|
| 4 |
-Subject: x86/CPU: Rename intel_cacheinfo.c to cacheinfo.c |
|
| 5 |
- |
|
| 6 |
-[upstream 1d200c078d0e3e49e2995b9d25fef8926d491f4f] |
|
| 7 |
- |
|
| 8 |
-Since this file contains general cache-related information for x86, |
|
| 9 |
-rename the file to a more generic name. |
|
| 10 |
- |
|
| 11 |
-Signed-off-by: Borislav Petkov <bp@suse.de> |
|
| 12 |
-Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 13 |
-Signed-off-by: Borislav Petkov <bp@suse.de> |
|
| 14 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 15 |
-Link: http://lkml.kernel.org/r/1524864877-111962-4-git-send-email-suravee.suthikulpanit@amd.com |
|
| 16 |
- |
|
| 17 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 18 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 19 |
- arch/x86/kernel/cpu/Makefile | 2 +- |
|
| 20 |
- arch/x86/kernel/cpu/{intel_cacheinfo.c => cacheinfo.c} | 0
|
|
| 21 |
- 2 files changed, 1 insertion(+), 1 deletion(-) |
|
| 22 |
- rename arch/x86/kernel/cpu/{intel_cacheinfo.c => cacheinfo.c} (100%)
|
|
| 23 |
- |
|
| 24 |
-diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile |
|
| 25 |
-index 570e8bb1f386..32591f21fb28 100644 |
|
| 26 |
-+++ b/arch/x86/kernel/cpu/Makefile |
|
| 27 |
-@@ -17,7 +17,7 @@ KCOV_INSTRUMENT_perf_event.o := n |
|
| 28 |
- nostackp := $(call cc-option, -fno-stack-protector) |
|
| 29 |
- CFLAGS_common.o := $(nostackp) |
|
| 30 |
- |
|
| 31 |
--obj-y := intel_cacheinfo.o scattered.o topology.o |
|
| 32 |
-+obj-y := cacheinfo.o scattered.o topology.o |
|
| 33 |
- obj-y += common.o |
|
| 34 |
- obj-y += rdrand.o |
|
| 35 |
- obj-y += match.o |
|
| 36 |
-diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c |
|
| 37 |
-similarity index 100% |
|
| 38 |
-rename from arch/x86/kernel/cpu/intel_cacheinfo.c |
|
| 39 |
-rename to arch/x86/kernel/cpu/cacheinfo.c |
|
| 40 |
-2.14.4 |
|
| 41 |
- |
| 42 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,132 +0,0 @@ |
| 1 |
-From 341c8b7c886eec3c5aa4cef1132fa02588ffe52a Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 3 |
-Date: Fri, 27 Apr 2018 16:34:37 -0500 |
|
| 4 |
-Subject: x86/CPU/AMD: Calculate last level cache ID from number of sharing |
|
| 5 |
- threads |
|
| 6 |
- |
|
| 7 |
-[upstream 68091ee7ac3c1a8786fe1bebbd616b14236efb99] |
|
| 8 |
- |
|
| 9 |
-Last Level Cache ID can be calculated from the number of threads sharing |
|
| 10 |
-the cache, which is available from CPUID Fn0x8000001D (Cache Properties). |
|
| 11 |
-This is used to left-shift the APIC ID to derive LLC ID. |
|
| 12 |
- |
|
| 13 |
-Therefore, default to this method unless the APIC ID enumeration does not |
|
| 14 |
-follow the scheme. |
|
| 15 |
- |
|
| 16 |
-Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 17 |
-Signed-off-by: Borislav Petkov <bp@suse.de> |
|
| 18 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 19 |
-Link: http://lkml.kernel.org/r/1524864877-111962-5-git-send-email-suravee.suthikulpanit@amd.com |
|
| 20 |
- |
|
| 21 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 22 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 23 |
- arch/x86/include/asm/cacheinfo.h | 7 +++++++ |
|
| 24 |
- arch/x86/kernel/cpu/amd.c | 19 +++---------------- |
|
| 25 |
- arch/x86/kernel/cpu/cacheinfo.c | 39 +++++++++++++++++++++++++++++++++++++++ |
|
| 26 |
- 3 files changed, 49 insertions(+), 16 deletions(-) |
|
| 27 |
- create mode 100644 arch/x86/include/asm/cacheinfo.h |
|
| 28 |
- |
|
| 29 |
-diff --git a/arch/x86/include/asm/cacheinfo.h b/arch/x86/include/asm/cacheinfo.h |
|
| 30 |
-new file mode 100644 |
|
| 31 |
-index 000000000000..e958e28f7ab5 |
|
| 32 |
-+++ b/arch/x86/include/asm/cacheinfo.h |
|
| 33 |
-@@ -0,0 +1,7 @@ |
|
| 34 |
-+/* SPDX-License-Identifier: GPL-2.0 */ |
|
| 35 |
-+#ifndef _ASM_X86_CACHEINFO_H |
|
| 36 |
-+#define _ASM_X86_CACHEINFO_H |
|
| 37 |
-+ |
|
| 38 |
-+void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id); |
|
| 39 |
-+ |
|
| 40 |
-+#endif /* _ASM_X86_CACHEINFO_H */ |
|
| 41 |
-diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
|
| 42 |
-index dda741bd5789..027dd745d5e1 100644 |
|
| 43 |
-+++ b/arch/x86/kernel/cpu/amd.c |
|
| 44 |
-@@ -9,6 +9,7 @@ |
|
| 45 |
- #include <linux/random.h> |
|
| 46 |
- #include <asm/processor.h> |
|
| 47 |
- #include <asm/apic.h> |
|
| 48 |
-+#include <asm/cacheinfo.h> |
|
| 49 |
- #include <asm/cpu.h> |
|
| 50 |
- #include <asm/spec-ctrl.h> |
|
| 51 |
- #include <asm/smp.h> |
|
| 52 |
-@@ -350,22 +351,8 @@ static void amd_get_topology(struct cpuinfo_x86 *c) |
|
| 53 |
- c->x86_max_cores /= smp_num_siblings; |
|
| 54 |
- } |
|
| 55 |
- |
|
| 56 |
-- /* |
|
| 57 |
-- * We may have multiple LLCs if L3 caches exist, so check if we |
|
| 58 |
-- * have an L3 cache by looking at the L3 cache CPUID leaf. |
|
| 59 |
-- */ |
|
| 60 |
-- if (cpuid_edx(0x80000006)) {
|
|
| 61 |
-- if (c->x86 == 0x17) {
|
|
| 62 |
-- /* |
|
| 63 |
-- * LLC is at the core complex level. |
|
| 64 |
-- * Core complex id is ApicId[3]. |
|
| 65 |
-- */ |
|
| 66 |
-- per_cpu(cpu_llc_id, cpu) = c->apicid >> 3; |
|
| 67 |
-- } else {
|
|
| 68 |
-- /* LLC is at the node level. */ |
|
| 69 |
-- per_cpu(cpu_llc_id, cpu) = node_id; |
|
| 70 |
-- } |
|
| 71 |
-- } |
|
| 72 |
-+ cacheinfo_amd_init_llc_id(c, cpu, node_id); |
|
| 73 |
-+ |
|
| 74 |
- } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) {
|
|
| 75 |
- u64 value; |
|
| 76 |
- |
|
| 77 |
-diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c |
|
| 78 |
-index 54d04d574148..a2e03c9401a1 100644 |
|
| 79 |
-+++ b/arch/x86/kernel/cpu/cacheinfo.c |
|
| 80 |
-@@ -637,6 +637,45 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c) |
|
| 81 |
- return i; |
|
| 82 |
- } |
|
| 83 |
- |
|
| 84 |
-+void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) |
|
| 85 |
-+{
|
|
| 86 |
-+ /* |
|
| 87 |
-+ * We may have multiple LLCs if L3 caches exist, so check if we |
|
| 88 |
-+ * have an L3 cache by looking at the L3 cache CPUID leaf. |
|
| 89 |
-+ */ |
|
| 90 |
-+ if (!cpuid_edx(0x80000006)) |
|
| 91 |
-+ return; |
|
| 92 |
-+ |
|
| 93 |
-+ if (c->x86 < 0x17) {
|
|
| 94 |
-+ /* LLC is at the node level. */ |
|
| 95 |
-+ per_cpu(cpu_llc_id, cpu) = node_id; |
|
| 96 |
-+ } else if (c->x86 == 0x17 && |
|
| 97 |
-+ c->x86_model >= 0 && c->x86_model <= 0x1F) {
|
|
| 98 |
-+ /* |
|
| 99 |
-+ * LLC is at the core complex level. |
|
| 100 |
-+ * Core complex ID is ApicId[3] for these processors. |
|
| 101 |
-+ */ |
|
| 102 |
-+ per_cpu(cpu_llc_id, cpu) = c->apicid >> 3; |
|
| 103 |
-+ } else {
|
|
| 104 |
-+ /* |
|
| 105 |
-+ * LLC ID is calculated from the number of threads sharing the |
|
| 106 |
-+ * cache. |
|
| 107 |
-+ * */ |
|
| 108 |
-+ u32 eax, ebx, ecx, edx, num_sharing_cache = 0; |
|
| 109 |
-+ u32 llc_index = find_num_cache_leaves(c) - 1; |
|
| 110 |
-+ |
|
| 111 |
-+ cpuid_count(0x8000001d, llc_index, &eax, &ebx, &ecx, &edx); |
|
| 112 |
-+ if (eax) |
|
| 113 |
-+ num_sharing_cache = ((eax >> 14) & 0xfff) + 1; |
|
| 114 |
-+ |
|
| 115 |
-+ if (num_sharing_cache) {
|
|
| 116 |
-+ int bits = get_count_order(num_sharing_cache) - 1; |
|
| 117 |
-+ |
|
| 118 |
-+ per_cpu(cpu_llc_id, cpu) = c->apicid >> bits; |
|
| 119 |
-+ } |
|
| 120 |
-+ } |
|
| 121 |
-+} |
|
| 122 |
-+ |
|
| 123 |
- void init_amd_cacheinfo(struct cpuinfo_x86 *c) |
|
| 124 |
- {
|
|
| 125 |
- |
|
| 126 |
-2.14.4 |
|
| 127 |
- |
| 128 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,43 +0,0 @@ |
| 1 |
-From b26dea8f92ac2b9224a2b7f6b0c3362fa172e031 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 3 |
-Date: Wed, 13 Jun 2018 13:43:10 -0500 |
|
| 4 |
-Subject: x86/CPU/AMD: Fix LLC ID bit-shift calculation |
|
| 5 |
- |
|
| 6 |
-[upstream 964d978433a4b9aa1368ff71227ca0027dd1e32f] |
|
| 7 |
- |
|
| 8 |
-The current logic incorrectly calculates the LLC ID from the APIC ID. |
|
| 9 |
- |
|
| 10 |
-Unless specified otherwise, the LLC ID should be calculated by removing |
|
| 11 |
-the Core and Thread ID bits from the least significant end of the APIC |
|
| 12 |
-ID. For more info, see "ApicId Enumeration Requirements" in any Fam17h |
|
| 13 |
-PPR document. |
|
| 14 |
- |
|
| 15 |
-[ bp: Improve commit message. ] |
|
| 16 |
- |
|
| 17 |
-Fixes: 68091ee7ac3c ("Calculate last level cache ID from number of sharing threads")
|
|
| 18 |
-Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 19 |
-Signed-off-by: Borislav Petkov <bp@suse.de> |
|
| 20 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 21 |
-Link: http://lkml.kernel.org/r/1528915390-30533-1-git-send-email-suravee.suthikulpanit@amd.com |
|
| 22 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 23 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 24 |
- arch/x86/kernel/cpu/cacheinfo.c | 2 +- |
|
| 25 |
- 1 file changed, 1 insertion(+), 1 deletion(-) |
|
| 26 |
- |
|
| 27 |
-diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c |
|
| 28 |
-index a2e03c9401a1..42577fd1d0fd 100644 |
|
| 29 |
-+++ b/arch/x86/kernel/cpu/cacheinfo.c |
|
| 30 |
-@@ -669,7 +669,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) |
|
| 31 |
- num_sharing_cache = ((eax >> 14) & 0xfff) + 1; |
|
| 32 |
- |
|
| 33 |
- if (num_sharing_cache) {
|
|
| 34 |
-- int bits = get_count_order(num_sharing_cache) - 1; |
|
| 35 |
-+ int bits = get_count_order(num_sharing_cache); |
|
| 36 |
- |
|
| 37 |
- per_cpu(cpu_llc_id, cpu) = c->apicid >> bits; |
|
| 38 |
- } |
|
| 39 |
-2.14.4 |
|
| 40 |
- |
| 41 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,44 +0,0 @@ |
| 1 |
-From 7c3d10de188eb3fecaabe7d19b84e73d55903db4 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Tom Lendacky <thomas.lendacky@amd.com> |
|
| 3 |
-Date: Mon, 2 Jul 2018 16:35:53 -0500 |
|
| 4 |
-Subject: x86/bugs: Update when to check for the LS_CFG SSBD mitigation |
|
| 5 |
- |
|
| 6 |
-[upstream 845d382bb15c6e7dc5026c0ff919c5b13fc7e11b] |
|
| 7 |
- |
|
| 8 |
-If either the X86_FEATURE_AMD_SSBD or X86_FEATURE_VIRT_SSBD features are |
|
| 9 |
-present, then there is no need to perform the check for the LS_CFG SSBD |
|
| 10 |
-mitigation support. |
|
| 11 |
- |
|
| 12 |
-Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> |
|
| 13 |
-Cc: Borislav Petkov <bpetkov@suse.de> |
|
| 14 |
-Cc: David Woodhouse <dwmw@amazon.co.uk> |
|
| 15 |
-Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 16 |
-Cc: Linus Torvalds <torvalds@linux-foundation.org> |
|
| 17 |
-Cc: Peter Zijlstra <peterz@infradead.org> |
|
| 18 |
-Cc: Thomas Gleixner <tglx@linutronix.de> |
|
| 19 |
-Link: http://lkml.kernel.org/r/20180702213553.29202.21089.stgit@tlendack-t1.amdoffice.net |
|
| 20 |
-Signed-off-by: Ingo Molnar <mingo@kernel.org> |
|
| 21 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 22 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 23 |
- arch/x86/kernel/cpu/amd.c | 4 +++- |
|
| 24 |
- 1 file changed, 3 insertions(+), 1 deletion(-) |
|
| 25 |
- |
|
| 26 |
-diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
|
| 27 |
-index 027dd745d5e1..f7b82a1da693 100644 |
|
| 28 |
-+++ b/arch/x86/kernel/cpu/amd.c |
|
| 29 |
-@@ -541,7 +541,9 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) |
|
| 30 |
- nodes_per_socket = ((value >> 3) & 7) + 1; |
|
| 31 |
- } |
|
| 32 |
- |
|
| 33 |
-- if (c->x86 >= 0x15 && c->x86 <= 0x17) {
|
|
| 34 |
-+ if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) && |
|
| 35 |
-+ !boot_cpu_has(X86_FEATURE_VIRT_SSBD) && |
|
| 36 |
-+ c->x86 >= 0x15 && c->x86 <= 0x17) {
|
|
| 37 |
- unsigned int bit; |
|
| 38 |
- |
|
| 39 |
- switch (c->x86) {
|
|
| 40 |
-2.14.4 |
|
| 41 |
- |
| 42 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,61 +0,0 @@ |
| 1 |
-From 8863c3ae3e94cab32a3393af35e0b6d2f1058faf Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Tom Lendacky <thomas.lendacky@amd.com> |
|
| 3 |
-Date: Mon, 2 Jul 2018 16:36:02 -0500 |
|
| 4 |
-Subject: x86/bugs: Fix the AMD SSBD usage of the SPEC_CTRL MSR |
|
| 5 |
- |
|
| 6 |
-[upstream 612bc3b3d4be749f73a513a17d9b3ee1330d3487] |
|
| 7 |
- |
|
| 8 |
-On AMD, the presence of the MSR_SPEC_CTRL feature does not imply that the |
|
| 9 |
-SSBD mitigation support should use the SPEC_CTRL MSR. Other features could |
|
| 10 |
-have caused the MSR_SPEC_CTRL feature to be set, while a different SSBD |
|
| 11 |
-mitigation option is in place. |
|
| 12 |
- |
|
| 13 |
-Update the SSBD support to check for the actual SSBD features that will |
|
| 14 |
-use the SPEC_CTRL MSR. |
|
| 15 |
- |
|
| 16 |
-Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> |
|
| 17 |
-Cc: Borislav Petkov <bpetkov@suse.de> |
|
| 18 |
-Cc: David Woodhouse <dwmw@amazon.co.uk> |
|
| 19 |
-Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
|
| 20 |
-Cc: Linus Torvalds <torvalds@linux-foundation.org> |
|
| 21 |
-Cc: Peter Zijlstra <peterz@infradead.org> |
|
| 22 |
-Cc: Thomas Gleixner <tglx@linutronix.de> |
|
| 23 |
-Fixes: 6ac2f49edb1e ("x86/bugs: Add AMD's SPEC_CTRL MSR usage")
|
|
| 24 |
-Link: http://lkml.kernel.org/r/20180702213602.29202.33151.stgit@tlendack-t1.amdoffice.net |
|
| 25 |
-Signed-off-by: Ingo Molnar <mingo@kernel.org> |
|
| 26 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 27 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 28 |
- arch/x86/kernel/cpu/bugs.c | 8 +++++--- |
|
| 29 |
- 1 file changed, 5 insertions(+), 3 deletions(-) |
|
| 30 |
- |
|
| 31 |
-diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c |
|
| 32 |
-index d97a79cb3edf..79ac182c9170 100644 |
|
| 33 |
-+++ b/arch/x86/kernel/cpu/bugs.c |
|
| 34 |
-@@ -165,7 +165,8 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest) |
|
| 35 |
- guestval |= guest_spec_ctrl & x86_spec_ctrl_mask; |
|
| 36 |
- |
|
| 37 |
- /* SSBD controlled in MSR_SPEC_CTRL */ |
|
| 38 |
-- if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD)) |
|
| 39 |
-+ if (static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) || |
|
| 40 |
-+ static_cpu_has(X86_FEATURE_AMD_SSBD)) |
|
| 41 |
- hostval |= ssbd_tif_to_spec_ctrl(ti->flags); |
|
| 42 |
- |
|
| 43 |
- if (hostval != guestval) {
|
|
| 44 |
-@@ -519,9 +520,10 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) |
|
| 45 |
- * Intel uses the SPEC CTRL MSR Bit(2) for this, while AMD may |
|
| 46 |
- * use a completely different MSR and bit dependent on family. |
|
| 47 |
- */ |
|
| 48 |
-- if (!static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) |
|
| 49 |
-+ if (!static_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) && |
|
| 50 |
-+ !static_cpu_has(X86_FEATURE_AMD_SSBD)) {
|
|
| 51 |
- x86_amd_ssb_disable(); |
|
| 52 |
-- else {
|
|
| 53 |
-+ } else {
|
|
| 54 |
- x86_spec_ctrl_base |= SPEC_CTRL_SSBD; |
|
| 55 |
- x86_spec_ctrl_mask |= SPEC_CTRL_SSBD; |
|
| 56 |
- wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); |
|
| 57 |
-2.14.4 |
|
| 58 |
- |
| 59 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,44 +0,0 @@ |
| 1 |
-From 7960ee2865a2a33b7aac8a27751e1468ec804fda Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Calvin Walton <calvin.walton@kepstin.ca> |
|
| 3 |
-Date: Fri, 27 Jul 2018 07:50:53 -0400 |
|
| 4 |
-Subject: tools/power turbostat: Read extended processor family from CPUID |
|
| 5 |
- |
|
| 6 |
-[upstream 5aa3d1a20a233d4a5f1ec3d62da3f19d9afea682] |
|
| 7 |
- |
|
| 8 |
-This fixes the reported family on modern AMD processors (e.g. Ryzen, |
|
| 9 |
-which is family 0x17). Previously these processors all showed up as |
|
| 10 |
-family 0xf. |
|
| 11 |
- |
|
| 12 |
-See the document |
|
| 13 |
-https://support.amd.com/TechDocs/56255_OSRR.pdf |
|
| 14 |
-section CPUID_Fn00000001_EAX for how to calculate the family |
|
| 15 |
-from the BaseFamily and ExtFamily values. |
|
| 16 |
- |
|
| 17 |
-This matches the code in arch/x86/lib/cpu.c |
|
| 18 |
- |
|
| 19 |
-Signed-off-by: Calvin Walton <calvin.walton@kepstin.ca> |
|
| 20 |
-Signed-off-by: Len Brown <len.brown@intel.com> |
|
| 21 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 22 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 23 |
- tools/power/x86/turbostat/turbostat.c | 4 +++- |
|
| 24 |
- 1 file changed, 3 insertions(+), 1 deletion(-) |
|
| 25 |
- |
|
| 26 |
-diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c |
|
| 27 |
-index bd9c6b31a504..ed024deed36f 100644 |
|
| 28 |
-+++ b/tools/power/x86/turbostat/turbostat.c |
|
| 29 |
-@@ -4031,7 +4031,9 @@ void process_cpuid() |
|
| 30 |
- family = (fms >> 8) & 0xf; |
|
| 31 |
- model = (fms >> 4) & 0xf; |
|
| 32 |
- stepping = fms & 0xf; |
|
| 33 |
-- if (family == 6 || family == 0xf) |
|
| 34 |
-+ if (family == 0xf) |
|
| 35 |
-+ family += (fms >> 20) & 0xff; |
|
| 36 |
-+ if (family >= 6) |
|
| 37 |
- model += ((fms >> 16) & 0xf) << 4; |
|
| 38 |
- |
|
| 39 |
- if (!quiet) {
|
|
| 40 |
-2.14.4 |
|
| 41 |
- |
| 42 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,128 +0,0 @@ |
| 1 |
-From a5426f5e440b4829beec03e706ed87c9fb70001d Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 3 |
-Date: Thu, 7 Sep 2017 02:20:05 -0500 |
|
| 4 |
-Subject: sched/topology: Introduce NUMA identity node sched domain |
|
| 5 |
- |
|
| 6 |
-[upstream 051f3ca02e46432c0965e8948f00c07d8a2f09c0] |
|
| 7 |
- |
|
| 8 |
-On AMD Family17h-based (EPYC) system, a logical NUMA node can contain |
|
| 9 |
-upto 8 cores (16 threads) with the following topology. |
|
| 10 |
- |
|
| 11 |
- ---------------------------- |
|
| 12 |
- C0 | T0 T1 | || | T0 T1 | C4 |
|
| 13 |
- --------| || |-------- |
|
| 14 |
- C1 | T0 T1 | L3 || L3 | T0 T1 | C5 |
|
| 15 |
- --------| || |-------- |
|
| 16 |
- C2 | T0 T1 | #0 || #1 | T0 T1 | C6 |
|
| 17 |
- --------| || |-------- |
|
| 18 |
- C3 | T0 T1 | || | T0 T1 | C7 |
|
| 19 |
- ---------------------------- |
|
| 20 |
- |
|
| 21 |
-Here, there are 2 last-level (L3) caches per logical NUMA node. |
|
| 22 |
-A socket can contain upto 4 NUMA nodes, and a system can support |
|
| 23 |
-upto 2 sockets. With full system configuration, current scheduler |
|
| 24 |
-creates 4 sched domains: |
|
| 25 |
- |
|
| 26 |
- domain0 SMT (span a core) |
|
| 27 |
- domain1 MC (span a last-level-cache) |
|
| 28 |
- domain2 NUMA (span a socket: 4 nodes) |
|
| 29 |
- domain3 NUMA (span a system: 8 nodes) |
|
| 30 |
- |
|
| 31 |
-Note that there is no domain to represent cpus spaning a logical |
|
| 32 |
-NUMA node. With this hierarchy of sched domains, the scheduler does |
|
| 33 |
-not balance properly in the following cases: |
|
| 34 |
- |
|
| 35 |
-Case1: |
|
| 36 |
- |
|
| 37 |
- When running 8 tasks, a properly balanced system should |
|
| 38 |
- schedule a task per logical NUMA node. This is not the case for |
|
| 39 |
- the current scheduler. |
|
| 40 |
- |
|
| 41 |
-Case2: |
|
| 42 |
- |
|
| 43 |
- In some cases, threads are scheduled on the same cpu, while other |
|
| 44 |
- cpus are idle. This results in run-to-run inconsistency. For example: |
|
| 45 |
- |
|
| 46 |
- taskset -c 0-7 sysbench --num-threads=8 --test=cpu \ |
|
| 47 |
- --cpu-max-prime=100000 run |
|
| 48 |
- |
|
| 49 |
-Total execution time ranges from 25.1s to 33.5s depending on threads |
|
| 50 |
-placement, where 25.1s is when all 8 threads are balanced properly |
|
| 51 |
-on 8 cpus. |
|
| 52 |
- |
|
| 53 |
-Introducing NUMA identity node sched domain, which is based on how |
|
| 54 |
-SRAT/SLIT table define a logical NUMA node. This results in the following |
|
| 55 |
-hierarchy of sched domains on the same system described above. |
|
| 56 |
- |
|
| 57 |
- domain0 SMT (span a core) |
|
| 58 |
- domain1 MC (span a last-level-cache) |
|
| 59 |
- domain2 NODE (span a logical NUMA node) |
|
| 60 |
- domain3 NUMA (span a socket: 4 nodes) |
|
| 61 |
- domain4 NUMA (span a system: 8 nodes) |
|
| 62 |
- |
|
| 63 |
-This fixes the improper load balancing cases mentioned above. |
|
| 64 |
- |
|
| 65 |
-Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 66 |
-Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> |
|
| 67 |
-Cc: Linus Torvalds <torvalds@linux-foundation.org> |
|
| 68 |
-Cc: Mike Galbraith <efault@gmx.de> |
|
| 69 |
-Cc: Peter Zijlstra <peterz@infradead.org> |
|
| 70 |
-Cc: Thomas Gleixner <tglx@linutronix.de> |
|
| 71 |
-Cc: bp@suse.de |
|
| 72 |
-Link: http://lkml.kernel.org/r/1504768805-46716-1-git-send-email-suravee.suthikulpanit@amd.com |
|
| 73 |
-Signed-off-by: Ingo Molnar <mingo@kernel.org> |
|
| 74 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 75 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 76 |
- kernel/sched/topology.c | 18 +++++++++++++++--- |
|
| 77 |
- 1 file changed, 15 insertions(+), 3 deletions(-) |
|
| 78 |
- |
|
| 79 |
-diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c |
|
| 80 |
-index 659e075ef70b..b961a6d52d72 100644 |
|
| 81 |
-+++ b/kernel/sched/topology.c |
|
| 82 |
-@@ -1351,6 +1351,10 @@ void sched_init_numa(void) |
|
| 83 |
- if (!sched_domains_numa_distance) |
|
| 84 |
- return; |
|
| 85 |
- |
|
| 86 |
-+ /* Includes NUMA identity node at level 0. */ |
|
| 87 |
-+ sched_domains_numa_distance[level++] = curr_distance; |
|
| 88 |
-+ sched_domains_numa_levels = level; |
|
| 89 |
-+ |
|
| 90 |
- /* |
|
| 91 |
- * O(nr_nodes^2) deduplicating selection sort -- in order to find the |
|
| 92 |
- * unique distances in the node_distance() table. |
|
| 93 |
-@@ -1398,8 +1402,7 @@ void sched_init_numa(void) |
|
| 94 |
- return; |
|
| 95 |
- |
|
| 96 |
- /* |
|
| 97 |
-- * 'level' contains the number of unique distances, excluding the |
|
| 98 |
-- * identity distance node_distance(i,i). |
|
| 99 |
-+ * 'level' contains the number of unique distances |
|
| 100 |
- * |
|
| 101 |
- * The sched_domains_numa_distance[] array includes the actual distance |
|
| 102 |
- * numbers. |
|
| 103 |
-@@ -1460,10 +1463,19 @@ void sched_init_numa(void) |
|
| 104 |
- for (i = 0; sched_domain_topology[i].mask; i++) |
|
| 105 |
- tl[i] = sched_domain_topology[i]; |
|
| 106 |
- |
|
| 107 |
-+ /* |
|
| 108 |
-+ * Add the NUMA identity distance, aka single NODE. |
|
| 109 |
-+ */ |
|
| 110 |
-+ tl[i++] = (struct sched_domain_topology_level){
|
|
| 111 |
-+ .mask = sd_numa_mask, |
|
| 112 |
-+ .numa_level = 0, |
|
| 113 |
-+ SD_INIT_NAME(NODE) |
|
| 114 |
-+ }; |
|
| 115 |
-+ |
|
| 116 |
- /* |
|
| 117 |
- * .. and append 'j' levels of NUMA goodness. |
|
| 118 |
- */ |
|
| 119 |
-- for (j = 0; j < level; i++, j++) {
|
|
| 120 |
-+ for (j = 1; j < level; i++, j++) {
|
|
| 121 |
- tl[i] = (struct sched_domain_topology_level){
|
|
| 122 |
- .mask = sd_numa_mask, |
|
| 123 |
- .sd_flags = cpu_numa_flags, |
|
| 124 |
-2.14.4 |
|
| 125 |
- |
| 126 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,125 +0,0 @@ |
| 1 |
-From 872e2b4ee94397d174d6b184c687f088d2079773 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 3 |
-Date: Fri, 27 Apr 2018 16:48:01 -0500 |
|
| 4 |
-Subject: x86/CPU/AMD: Derive CPU topology from CPUID function 0xB when |
|
| 5 |
- available |
|
| 6 |
- |
|
| 7 |
-[upstream 3986a0a805e668a63fac0ca2cdfa8db951f87c4b with changes |
|
| 8 |
-after 4.14.62 rebase and backport of 95f3d39ccf7aaea79d1ffdac1c887c2e100ec1b6 |
|
| 9 |
-was broken for this patch series] |
|
| 10 |
- |
|
| 11 |
-Derive topology information from Extended Topology Enumeration (CPUID |
|
| 12 |
-function 0xB) when the information is available. |
|
| 13 |
- |
|
| 14 |
-Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
|
| 15 |
-Signed-off-by: Borislav Petkov <bp@suse.de> |
|
| 16 |
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
|
| 17 |
-Link: http://lkml.kernel.org/r/1524865681-112110-3-git-send-email-suravee.suthikulpanit@amd.com |
|
| 18 |
- |
|
| 19 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 20 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 21 |
- arch/x86/include/asm/processor.h | 1 - |
|
| 22 |
- arch/x86/kernel/cpu/amd.c | 11 ++++++++++- |
|
| 23 |
- arch/x86/kernel/cpu/cpu.h | 1 + |
|
| 24 |
- arch/x86/kernel/cpu/topology.c | 5 +++-- |
|
| 25 |
- 4 files changed, 14 insertions(+), 4 deletions(-) |
|
| 26 |
- |
|
| 27 |
-diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h |
|
| 28 |
-index 0e856c0628b3..eabee637dcd5 100644 |
|
| 29 |
-+++ b/arch/x86/include/asm/processor.h |
|
| 30 |
-@@ -197,7 +197,6 @@ extern u32 get_scattered_cpuid_leaf(unsigned int level, |
|
| 31 |
- extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
|
| 32 |
- extern void init_amd_cacheinfo(struct cpuinfo_x86 *c); |
|
| 33 |
- |
|
| 34 |
--extern void detect_extended_topology(struct cpuinfo_x86 *c); |
|
| 35 |
- extern void detect_ht(struct cpuinfo_x86 *c); |
|
| 36 |
- |
|
| 37 |
- #ifdef CONFIG_X86_32 |
|
| 38 |
-diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c |
|
| 39 |
-index f7b82a1da693..3d7fa07b69bb 100644 |
|
| 40 |
-+++ b/arch/x86/kernel/cpu/amd.c |
|
| 41 |
-@@ -335,6 +335,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c) |
|
| 42 |
- |
|
| 43 |
- /* get information required for multi-node processors */ |
|
| 44 |
- if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
|
|
| 45 |
-+ int err; |
|
| 46 |
- u32 eax, ebx, ecx, edx; |
|
| 47 |
- |
|
| 48 |
- cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); |
|
| 49 |
-@@ -351,6 +352,14 @@ static void amd_get_topology(struct cpuinfo_x86 *c) |
|
| 50 |
- c->x86_max_cores /= smp_num_siblings; |
|
| 51 |
- } |
|
| 52 |
- |
|
| 53 |
-+ /* |
|
| 54 |
-+ * In case leaf B is available, use it to derive |
|
| 55 |
-+ * topology information. |
|
| 56 |
-+ */ |
|
| 57 |
-+ err = detect_extended_topology(c); |
|
| 58 |
-+ if (!err) |
|
| 59 |
-+ c->x86_coreid_bits = get_count_order(c->x86_max_cores); |
|
| 60 |
-+ |
|
| 61 |
- cacheinfo_amd_init_llc_id(c, cpu, node_id); |
|
| 62 |
- |
|
| 63 |
- } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) {
|
|
| 64 |
-@@ -385,7 +394,6 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c) |
|
| 65 |
- c->phys_proc_id = c->initial_apicid >> bits; |
|
| 66 |
- /* use socket ID also for last level cache */ |
|
| 67 |
- per_cpu(cpu_llc_id, cpu) = c->phys_proc_id; |
|
| 68 |
-- amd_get_topology(c); |
|
| 69 |
- } |
|
| 70 |
- |
|
| 71 |
- u16 amd_get_nb_id(int cpu) |
|
| 72 |
-@@ -827,6 +835,7 @@ static void init_amd(struct cpuinfo_x86 *c) |
|
| 73 |
- cpu_detect_cache_sizes(c); |
|
| 74 |
- |
|
| 75 |
- amd_detect_cmp(c); |
|
| 76 |
-+ amd_get_topology(c); |
|
| 77 |
- srat_detect_node(c); |
|
| 78 |
- |
|
| 79 |
- init_amd_cacheinfo(c); |
|
| 80 |
-diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h |
|
| 81 |
-index cca588407dca..e62e851cae69 100644 |
|
| 82 |
-+++ b/arch/x86/kernel/cpu/cpu.h |
|
| 83 |
-@@ -48,6 +48,7 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[], |
|
| 84 |
- extern void get_cpu_cap(struct cpuinfo_x86 *c); |
|
| 85 |
- extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c); |
|
| 86 |
- extern int detect_extended_topology_early(struct cpuinfo_x86 *c); |
|
| 87 |
-+extern int detect_extended_topology(struct cpuinfo_x86 *c); |
|
| 88 |
- extern int detect_ht_early(struct cpuinfo_x86 *c); |
|
| 89 |
- |
|
| 90 |
- unsigned int aperfmperf_get_khz(int cpu); |
|
| 91 |
-diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c |
|
| 92 |
-index 19c6e800e816..99312d144419 100644 |
|
| 93 |
-+++ b/arch/x86/kernel/cpu/topology.c |
|
| 94 |
-@@ -59,7 +59,7 @@ int detect_extended_topology_early(struct cpuinfo_x86 *c) |
|
| 95 |
- * exists, use it for populating initial_apicid and cpu topology |
|
| 96 |
- * detection. |
|
| 97 |
- */ |
|
| 98 |
--void detect_extended_topology(struct cpuinfo_x86 *c) |
|
| 99 |
-+int detect_extended_topology(struct cpuinfo_x86 *c) |
|
| 100 |
- {
|
|
| 101 |
- #ifdef CONFIG_SMP |
|
| 102 |
- unsigned int eax, ebx, ecx, edx, sub_index; |
|
| 103 |
-@@ -67,7 +67,7 @@ void detect_extended_topology(struct cpuinfo_x86 *c) |
|
| 104 |
- unsigned int core_select_mask, core_level_siblings; |
|
| 105 |
- |
|
| 106 |
- if (detect_extended_topology_early(c) < 0) |
|
| 107 |
-- return; |
|
| 108 |
-+ return -1; |
|
| 109 |
- |
|
| 110 |
- /* |
|
| 111 |
- * Populate HT related information from sub-leaf level 0. |
|
| 112 |
-@@ -104,4 +104,5 @@ void detect_extended_topology(struct cpuinfo_x86 *c) |
|
| 113 |
- |
|
| 114 |
- c->x86_max_cores = (core_level_siblings / smp_num_siblings); |
|
| 115 |
- #endif |
|
| 116 |
-+ return 0; |
|
| 117 |
- } |
|
| 118 |
-2.14.4 |
|
| 119 |
- |
| 120 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,78 +0,0 @@ |
| 1 |
-From 24d9badf7fa725ed95711fda1d04d9349a8f8262 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Shrikrishna Khare <skhare@vmware.com> |
|
| 3 |
-Date: Thu, 30 Nov 2017 10:29:51 -0800 |
|
| 4 |
-Subject: vmxnet3: increase default rx ring sizes |
|
| 5 |
- |
|
| 6 |
-There are several reasons for increasing the receive ring sizes: |
|
| 7 |
- |
|
| 8 |
-1. The original ring size of 256 was chosen about 10 years ago when |
|
| 9 |
-vmxnet3 was first created. At that time, 10Gbps Ethernet was not prevalent |
|
| 10 |
-and servers were dominated by 1Gbps Ethernet. Now 10Gbps is common place, |
|
| 11 |
-and higher bandwidth links -- 25Gbps, 40Gbps, 50Gbps -- are starting |
|
| 12 |
-to appear. 256 Rx ring entries are simply not enough to keep up with |
|
| 13 |
-higher link speed when there is a burst of network frames coming from |
|
| 14 |
-these high speed links. Even with full MTU size frames, they are gone |
|
| 15 |
-in a short time. It is also more common to have a mix of frame sizes, |
|
| 16 |
-and more likely bi-modal distribution of frame sizes so the average frame |
|
| 17 |
-size is not close to full MTU. If we consider average frame size of 800B, |
|
| 18 |
-1024 frames that come in a burst takes ~0.65 ms to arrive at 10Gbps. With |
|
| 19 |
-256 entires, it takes ~0.16 ms to arrive at 10Gbps. At 25Gbps or 40Gbps, |
|
| 20 |
-this time is reduced accordingly. |
|
| 21 |
- |
|
| 22 |
-2. On a hypervisor where there are many VMs and CPU is over committed, |
|
| 23 |
-i.e. the number of VCPUs is more than the number of VCPUs, each PCPU is |
|
| 24 |
-in effect time shared between multiple VMs/VCPUs. The time granularity at |
|
| 25 |
-which this multiplexing occurs is typically coarser than between processes |
|
| 26 |
-on a guest OS. Trying to time slice more finely is not efficient, for |
|
| 27 |
-example, if memory cache is barely warmed up when switching from one VM |
|
| 28 |
-to another occurs. This CPU overcommit adds delay to when the driver |
|
| 29 |
-in a VM can service incoming packets. Whether CPU is over committed |
|
| 30 |
-really depends on customer workloads. For certain situations, it is very |
|
| 31 |
-common. For example, workloads of desktop VMs and product testing setups. |
|
| 32 |
-Consolidation and sharing is what drives efficiency of a customer setup |
|
| 33 |
-for such workloads. In these situations, the raw network bandwidth may |
|
| 34 |
-not be very high, but the delays between when a VM is running or not |
|
| 35 |
-running can also be relatively long. |
|
| 36 |
- |
|
| 37 |
-Signed-off-by: Shrikrishna Khare <skhare@vmware.com> |
|
| 38 |
-Acked-by: Jin Heo <heoj@vmware.com> |
|
| 39 |
-Acked-by: Guolin Yang <gyang@vmware.com> |
|
| 40 |
-Acked-by: Boon Ang <bang@vmware.com> |
|
| 41 |
-Signed-off-by: David S. Miller <davem@davemloft.net> |
|
| 42 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 43 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 44 |
- drivers/net/vmxnet3/vmxnet3_int.h | 8 ++++---- |
|
| 45 |
- 1 file changed, 4 insertions(+), 4 deletions(-) |
|
| 46 |
- |
|
| 47 |
-diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h |
|
| 48 |
-index 9c51b8be0038..5ba222920e80 100644 |
|
| 49 |
-+++ b/drivers/net/vmxnet3/vmxnet3_int.h |
|
| 50 |
-@@ -69,10 +69,10 @@ |
|
| 51 |
- /* |
|
| 52 |
- * Version numbers |
|
| 53 |
- */ |
|
| 54 |
--#define VMXNET3_DRIVER_VERSION_STRING "1.4.a.0-k" |
|
| 55 |
-+#define VMXNET3_DRIVER_VERSION_STRING "1.4.11.0-k" |
|
| 56 |
- |
|
| 57 |
- /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */ |
|
| 58 |
--#define VMXNET3_DRIVER_VERSION_NUM 0x01040a00 |
|
| 59 |
-+#define VMXNET3_DRIVER_VERSION_NUM 0x01040b00 |
|
| 60 |
- |
|
| 61 |
- #if defined(CONFIG_PCI_MSI) |
|
| 62 |
- /* RSS only makes sense if MSI-X is supported. */ |
|
| 63 |
-@@ -416,8 +416,8 @@ struct vmxnet3_adapter {
|
|
| 64 |
- |
|
| 65 |
- /* must be a multiple of VMXNET3_RING_SIZE_ALIGN */ |
|
| 66 |
- #define VMXNET3_DEF_TX_RING_SIZE 512 |
|
| 67 |
--#define VMXNET3_DEF_RX_RING_SIZE 256 |
|
| 68 |
--#define VMXNET3_DEF_RX_RING2_SIZE 128 |
|
| 69 |
-+#define VMXNET3_DEF_RX_RING_SIZE 1024 |
|
| 70 |
-+#define VMXNET3_DEF_RX_RING2_SIZE 256 |
|
| 71 |
- |
|
| 72 |
- #define VMXNET3_DEF_RXDATA_DESC_SIZE 128 |
|
| 73 |
- |
|
| 74 |
-2.14.4 |
|
| 75 |
- |
| 76 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,147 +0,0 @@ |
| 1 |
-From 8c80979e069759cda64e098912aa0c58448fab9e Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Benjamin Poirier <bpoirier@suse.com> |
|
| 3 |
-Date: Tue, 6 Mar 2018 10:55:52 +0900 |
|
| 4 |
-Subject: Revert "e1000e: Separate signaling for link check/link up" |
|
| 5 |
- |
|
| 6 |
-This reverts commit 19110cfbb34d4af0cdfe14cd243f3b09dc95b013. |
|
| 7 |
-This reverts commit 4110e02eb45ea447ec6f5459c9934de0a273fb91. |
|
| 8 |
-This reverts commit d3604515c9eda464a92e8e67aae82dfe07fe3c98. |
|
| 9 |
- |
|
| 10 |
-Commit 19110cfbb34d ("e1000e: Separate signaling for link check/link up")
|
|
| 11 |
-changed what happens to the link status when there is an error which |
|
| 12 |
-happens after "get_link_status = false" in the copper check_for_link |
|
| 13 |
-callbacks. Previously, such an error would be ignored and the link |
|
| 14 |
-considered up. After that commit, any error implies that the link is down. |
|
| 15 |
- |
|
| 16 |
-Revert commit 19110cfbb34d ("e1000e: Separate signaling for link check/link
|
|
| 17 |
-up") and its followups. After reverting, the race condition described in |
|
| 18 |
-the log of commit 19110cfbb34d is reintroduced. It may still be triggered |
|
| 19 |
-by LSC events but this should keep the link down in case the link is |
|
| 20 |
-electrically unstable, as discussed. The race may no longer be |
|
| 21 |
-triggered by RXO events because commit 4aea7a5c5e94 ("e1000e: Avoid
|
|
| 22 |
-receiver overrun interrupt bursts") restored reading icr in the Other |
|
| 23 |
-handler. |
|
| 24 |
- |
|
| 25 |
-Link: https://lkml.org/lkml/2018/3/1/789 |
|
| 26 |
-Signed-off-by: Benjamin Poirier <bpoirier@suse.com> |
|
| 27 |
-Acked-by: Alexander Duyck <alexander.h.duyck@intel.com> |
|
| 28 |
-Tested-by: Aaron Brown <aaron.f.brown@intel.com> |
|
| 29 |
-Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
|
| 30 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 31 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 32 |
- drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 ++++--------- |
|
| 33 |
- drivers/net/ethernet/intel/e1000e/mac.c | 13 ++++--------- |
|
| 34 |
- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- |
|
| 35 |
- 3 files changed, 9 insertions(+), 19 deletions(-) |
|
| 36 |
- |
|
| 37 |
-diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
|
| 38 |
-index ff308b05d68c..d6d4ed7acf03 100644 |
|
| 39 |
-+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
|
| 40 |
-@@ -1367,9 +1367,6 @@ static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) |
|
| 41 |
- * Checks to see of the link status of the hardware has changed. If a |
|
| 42 |
- * change in link status has been detected, then we read the PHY registers |
|
| 43 |
- * to get the current speed/duplex if link exists. |
|
| 44 |
-- * |
|
| 45 |
-- * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link |
|
| 46 |
-- * up). |
|
| 47 |
- **/ |
|
| 48 |
- static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 49 |
- {
|
|
| 50 |
-@@ -1385,7 +1382,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 51 |
- * Change or Rx Sequence Error interrupt. |
|
| 52 |
- */ |
|
| 53 |
- if (!mac->get_link_status) |
|
| 54 |
-- return 1; |
|
| 55 |
-+ return 0; |
|
| 56 |
- |
|
| 57 |
- /* First we want to see if the MII Status Register reports |
|
| 58 |
- * link. If so, then we want to get the current speed/duplex |
|
| 59 |
-@@ -1602,7 +1599,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 60 |
- * we have already determined whether we have link or not. |
|
| 61 |
- */ |
|
| 62 |
- if (!mac->autoneg) |
|
| 63 |
-- return 1; |
|
| 64 |
-+ return -E1000_ERR_CONFIG; |
|
| 65 |
- |
|
| 66 |
- /* Auto-Neg is enabled. Auto Speed Detection takes care |
|
| 67 |
- * of MAC speed/duplex configuration. So we only need to |
|
| 68 |
-@@ -1616,12 +1613,10 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 69 |
- * different link partner. |
|
| 70 |
- */ |
|
| 71 |
- ret_val = e1000e_config_fc_after_link_up(hw); |
|
| 72 |
-- if (ret_val) {
|
|
| 73 |
-+ if (ret_val) |
|
| 74 |
- e_dbg("Error configuring flow control\n");
|
|
| 75 |
-- return ret_val; |
|
| 76 |
-- } |
|
| 77 |
- |
|
| 78 |
-- return 1; |
|
| 79 |
-+ return ret_val; |
|
| 80 |
- } |
|
| 81 |
- |
|
| 82 |
- static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) |
|
| 83 |
-diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c |
|
| 84 |
-index db735644b312..b322011ec282 100644 |
|
| 85 |
-+++ b/drivers/net/ethernet/intel/e1000e/mac.c |
|
| 86 |
-@@ -410,9 +410,6 @@ void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw) |
|
| 87 |
- * Checks to see of the link status of the hardware has changed. If a |
|
| 88 |
- * change in link status has been detected, then we read the PHY registers |
|
| 89 |
- * to get the current speed/duplex if link exists. |
|
| 90 |
-- * |
|
| 91 |
-- * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link |
|
| 92 |
-- * up). |
|
| 93 |
- **/ |
|
| 94 |
- s32 e1000e_check_for_copper_link(struct e1000_hw *hw) |
|
| 95 |
- {
|
|
| 96 |
-@@ -426,7 +423,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) |
|
| 97 |
- * Change or Rx Sequence Error interrupt. |
|
| 98 |
- */ |
|
| 99 |
- if (!mac->get_link_status) |
|
| 100 |
-- return 1; |
|
| 101 |
-+ return 0; |
|
| 102 |
- |
|
| 103 |
- /* First we want to see if the MII Status Register reports |
|
| 104 |
- * link. If so, then we want to get the current speed/duplex |
|
| 105 |
-@@ -450,7 +447,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) |
|
| 106 |
- * we have already determined whether we have link or not. |
|
| 107 |
- */ |
|
| 108 |
- if (!mac->autoneg) |
|
| 109 |
-- return 1; |
|
| 110 |
-+ return -E1000_ERR_CONFIG; |
|
| 111 |
- |
|
| 112 |
- /* Auto-Neg is enabled. Auto Speed Detection takes care |
|
| 113 |
- * of MAC speed/duplex configuration. So we only need to |
|
| 114 |
-@@ -464,12 +461,10 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) |
|
| 115 |
- * different link partner. |
|
| 116 |
- */ |
|
| 117 |
- ret_val = e1000e_config_fc_after_link_up(hw); |
|
| 118 |
-- if (ret_val) {
|
|
| 119 |
-+ if (ret_val) |
|
| 120 |
- e_dbg("Error configuring flow control\n");
|
|
| 121 |
-- return ret_val; |
|
| 122 |
-- } |
|
| 123 |
- |
|
| 124 |
-- return 1; |
|
| 125 |
-+ return ret_val; |
|
| 126 |
- } |
|
| 127 |
- |
|
| 128 |
- /** |
|
| 129 |
-diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c |
|
| 130 |
-index 6265ce8915b6..1cef262e5716 100644 |
|
| 131 |
-+++ b/drivers/net/ethernet/intel/e1000e/netdev.c |
|
| 132 |
-@@ -5100,7 +5100,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter) |
|
| 133 |
- case e1000_media_type_copper: |
|
| 134 |
- if (hw->mac.get_link_status) {
|
|
| 135 |
- ret_val = hw->mac.ops.check_for_link(hw); |
|
| 136 |
-- link_active = ret_val > 0; |
|
| 137 |
-+ link_active = !hw->mac.get_link_status; |
|
| 138 |
- } else {
|
|
| 139 |
- link_active = true; |
|
| 140 |
- } |
|
| 141 |
-2.14.4 |
|
| 142 |
- |
| 143 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,208 +0,0 @@ |
| 1 |
-From c683403ea4b9123164f063faece099b855a68e22 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Benjamin Poirier <bpoirier@suse.com> |
|
| 3 |
-Date: Tue, 6 Mar 2018 10:55:53 +0900 |
|
| 4 |
-Subject: e1000e: Fix link check race condition |
|
| 5 |
- |
|
| 6 |
-Alex reported the following race condition: |
|
| 7 |
- |
|
| 8 |
-/* link goes up... interrupt... schedule watchdog */ |
|
| 9 |
-\ e1000_watchdog_task |
|
| 10 |
- \ e1000e_has_link |
|
| 11 |
- \ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link |
|
| 12 |
- \ e1000e_phy_has_link_generic(..., &link) |
|
| 13 |
- link = true |
|
| 14 |
- |
|
| 15 |
- /* link goes down... interrupt */ |
|
| 16 |
- \ e1000_msix_other |
|
| 17 |
- hw->mac.get_link_status = true |
|
| 18 |
- |
|
| 19 |
- /* link is up */ |
|
| 20 |
- mac->get_link_status = false |
|
| 21 |
- |
|
| 22 |
- link_active = true |
|
| 23 |
- /* link_active is true, wrongly, and stays so because |
|
| 24 |
- * get_link_status is false */ |
|
| 25 |
- |
|
| 26 |
-Avoid this problem by making sure that we don't set get_link_status = false |
|
| 27 |
-after having checked the link. |
|
| 28 |
- |
|
| 29 |
-It seems this problem has been present since the introduction of e1000e. |
|
| 30 |
- |
|
| 31 |
-Link: https://lkml.org/lkml/2018/1/29/338 |
|
| 32 |
-Reported-by: Alexander Duyck <alexander.duyck@gmail.com> |
|
| 33 |
-Signed-off-by: Benjamin Poirier <bpoirier@suse.com> |
|
| 34 |
-Acked-by: Alexander Duyck <alexander.h.duyck@intel.com> |
|
| 35 |
-Tested-by: Aaron Brown <aaron.f.brown@intel.com> |
|
| 36 |
-Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
|
| 37 |
-Signed-off-by: Balbir Singh <sblbir@amazon.com> |
|
| 38 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 39 |
- drivers/net/ethernet/intel/e1000e/ich8lan.c | 31 ++++++++++++++++------------- |
|
| 40 |
- drivers/net/ethernet/intel/e1000e/mac.c | 14 ++++++------- |
|
| 41 |
- 2 files changed, 24 insertions(+), 21 deletions(-) |
|
| 42 |
- |
|
| 43 |
-diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
|
| 44 |
-index d6d4ed7acf03..1dddfb7b2de6 100644 |
|
| 45 |
-+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
|
| 46 |
-@@ -1383,6 +1383,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 47 |
- */ |
|
| 48 |
- if (!mac->get_link_status) |
|
| 49 |
- return 0; |
|
| 50 |
-+ mac->get_link_status = false; |
|
| 51 |
- |
|
| 52 |
- /* First we want to see if the MII Status Register reports |
|
| 53 |
- * link. If so, then we want to get the current speed/duplex |
|
| 54 |
-@@ -1390,12 +1391,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 55 |
- */ |
|
| 56 |
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); |
|
| 57 |
- if (ret_val) |
|
| 58 |
-- return ret_val; |
|
| 59 |
-+ goto out; |
|
| 60 |
- |
|
| 61 |
- if (hw->mac.type == e1000_pchlan) {
|
|
| 62 |
- ret_val = e1000_k1_gig_workaround_hv(hw, link); |
|
| 63 |
- if (ret_val) |
|
| 64 |
-- return ret_val; |
|
| 65 |
-+ goto out; |
|
| 66 |
- } |
|
| 67 |
- |
|
| 68 |
- /* When connected at 10Mbps half-duplex, some parts are excessively |
|
| 69 |
-@@ -1428,7 +1429,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 70 |
- |
|
| 71 |
- ret_val = hw->phy.ops.acquire(hw); |
|
| 72 |
- if (ret_val) |
|
| 73 |
-- return ret_val; |
|
| 74 |
-+ goto out; |
|
| 75 |
- |
|
| 76 |
- if (hw->mac.type == e1000_pch2lan) |
|
| 77 |
- emi_addr = I82579_RX_CONFIG; |
|
| 78 |
-@@ -1450,7 +1451,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 79 |
- hw->phy.ops.release(hw); |
|
| 80 |
- |
|
| 81 |
- if (ret_val) |
|
| 82 |
-- return ret_val; |
|
| 83 |
-+ goto out; |
|
| 84 |
- |
|
| 85 |
- if (hw->mac.type >= e1000_pch_spt) {
|
|
| 86 |
- u16 data; |
|
| 87 |
-@@ -1459,14 +1460,14 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 88 |
- if (speed == SPEED_1000) {
|
|
| 89 |
- ret_val = hw->phy.ops.acquire(hw); |
|
| 90 |
- if (ret_val) |
|
| 91 |
-- return ret_val; |
|
| 92 |
-+ goto out; |
|
| 93 |
- |
|
| 94 |
- ret_val = e1e_rphy_locked(hw, |
|
| 95 |
- PHY_REG(776, 20), |
|
| 96 |
- &data); |
|
| 97 |
- if (ret_val) {
|
|
| 98 |
- hw->phy.ops.release(hw); |
|
| 99 |
-- return ret_val; |
|
| 100 |
-+ goto out; |
|
| 101 |
- } |
|
| 102 |
- |
|
| 103 |
- ptr_gap = (data & (0x3FF << 2)) >> 2; |
|
| 104 |
-@@ -1480,18 +1481,18 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 105 |
- } |
|
| 106 |
- hw->phy.ops.release(hw); |
|
| 107 |
- if (ret_val) |
|
| 108 |
-- return ret_val; |
|
| 109 |
-+ goto out; |
|
| 110 |
- } else {
|
|
| 111 |
- ret_val = hw->phy.ops.acquire(hw); |
|
| 112 |
- if (ret_val) |
|
| 113 |
-- return ret_val; |
|
| 114 |
-+ goto out; |
|
| 115 |
- |
|
| 116 |
- ret_val = e1e_wphy_locked(hw, |
|
| 117 |
- PHY_REG(776, 20), |
|
| 118 |
- 0xC023); |
|
| 119 |
- hw->phy.ops.release(hw); |
|
| 120 |
- if (ret_val) |
|
| 121 |
-- return ret_val; |
|
| 122 |
-+ goto out; |
|
| 123 |
- |
|
| 124 |
- } |
|
| 125 |
- } |
|
| 126 |
-@@ -1518,7 +1519,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 127 |
- (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3)) {
|
|
| 128 |
- ret_val = e1000_k1_workaround_lpt_lp(hw, link); |
|
| 129 |
- if (ret_val) |
|
| 130 |
-- return ret_val; |
|
| 131 |
-+ goto out; |
|
| 132 |
- } |
|
| 133 |
- if (hw->mac.type >= e1000_pch_lpt) {
|
|
| 134 |
- /* Set platform power management values for |
|
| 135 |
-@@ -1526,7 +1527,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 136 |
- */ |
|
| 137 |
- ret_val = e1000_platform_pm_pch_lpt(hw, link); |
|
| 138 |
- if (ret_val) |
|
| 139 |
-- return ret_val; |
|
| 140 |
-+ goto out; |
|
| 141 |
- } |
|
| 142 |
- |
|
| 143 |
- /* Clear link partner's EEE ability */ |
|
| 144 |
-@@ -1549,9 +1550,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 145 |
- } |
|
| 146 |
- |
|
| 147 |
- if (!link) |
|
| 148 |
-- return 0; /* No link detected */ |
|
| 149 |
-- |
|
| 150 |
-- mac->get_link_status = false; |
|
| 151 |
-+ goto out; |
|
| 152 |
- |
|
| 153 |
- switch (hw->mac.type) {
|
|
| 154 |
- case e1000_pch2lan: |
|
| 155 |
-@@ -1617,6 +1616,10 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
|
| 156 |
- e_dbg("Error configuring flow control\n");
|
|
| 157 |
- |
|
| 158 |
- return ret_val; |
|
| 159 |
-+ |
|
| 160 |
-+out: |
|
| 161 |
-+ mac->get_link_status = true; |
|
| 162 |
-+ return ret_val; |
|
| 163 |
- } |
|
| 164 |
- |
|
| 165 |
- static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) |
|
| 166 |
-diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c |
|
| 167 |
-index b322011ec282..5bdc3a2d4fd7 100644 |
|
| 168 |
-+++ b/drivers/net/ethernet/intel/e1000e/mac.c |
|
| 169 |
-@@ -424,19 +424,15 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) |
|
| 170 |
- */ |
|
| 171 |
- if (!mac->get_link_status) |
|
| 172 |
- return 0; |
|
| 173 |
-+ mac->get_link_status = false; |
|
| 174 |
- |
|
| 175 |
- /* First we want to see if the MII Status Register reports |
|
| 176 |
- * link. If so, then we want to get the current speed/duplex |
|
| 177 |
- * of the PHY. |
|
| 178 |
- */ |
|
| 179 |
- ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); |
|
| 180 |
-- if (ret_val) |
|
| 181 |
-- return ret_val; |
|
| 182 |
-- |
|
| 183 |
-- if (!link) |
|
| 184 |
-- return 0; /* No link detected */ |
|
| 185 |
-- |
|
| 186 |
-- mac->get_link_status = false; |
|
| 187 |
-+ if (ret_val || !link) |
|
| 188 |
-+ goto out; |
|
| 189 |
- |
|
| 190 |
- /* Check if there was DownShift, must be checked |
|
| 191 |
- * immediately after link-up |
|
| 192 |
-@@ -465,6 +461,10 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) |
|
| 193 |
- e_dbg("Error configuring flow control\n");
|
|
| 194 |
- |
|
| 195 |
- return ret_val; |
|
| 196 |
-+ |
|
| 197 |
-+out: |
|
| 198 |
-+ mac->get_link_status = true; |
|
| 199 |
-+ return ret_val; |
|
| 200 |
- } |
|
| 201 |
- |
|
| 202 |
- /** |
|
| 203 |
-2.14.4 |
|
| 204 |
- |
| ... | ... |
@@ -15,7 +15,7 @@ options, the introduction of new one-byte options can still |
| 15 | 15 |
confuse this code without the additional checks. |
| 16 | 16 |
|
| 17 | 17 |
Signed-off-by: Stefan Nuernberger <snu@amazon.com> |
| 18 |
-Signed-off-by: Srivatsa S. Bhat <srivatsa@csail.mit.edu> |
|
| 18 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 19 | 19 |
--- |
| 20 | 20 |
net/ipv4/cipso_ipv4.c | 10 ++++++++-- |
| 21 | 21 |
1 file changed, 8 insertions(+), 2 deletions(-) |
| 22 | 22 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,1730 @@ |
| 0 |
+From 31351959d9e0e4352e3c81653a7fb37cfe2bf4a7 Mon Sep 17 00:00:00 2001 |
|
| 1 |
+From: "Srivatsa S. Bhat (VMware)" <srivatsa@csail.mit.edu> |
|
| 2 |
+Date: Tue, 23 Oct 2018 11:32:06 -0700 |
|
| 3 |
+Subject: [PATCH] Amazon ENA driver: Update to version 1.6.0 |
|
| 4 |
+ |
|
| 5 |
+... to get it to build with linux kernel version 4.18.9 |
|
| 6 |
+ |
|
| 7 |
+Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> |
|
| 8 |
+--- |
|
| 9 |
+ drivers/amazon/net/ena/ena_admin_defs.h | 62 ++++- |
|
| 10 |
+ drivers/amazon/net/ena/ena_com.c | 98 +++++--- |
|
| 11 |
+ drivers/amazon/net/ena/ena_com.h | 3 + |
|
| 12 |
+ drivers/amazon/net/ena/ena_eth_com.c | 50 +--- |
|
| 13 |
+ drivers/amazon/net/ena/ena_eth_com.h | 45 +++- |
|
| 14 |
+ drivers/amazon/net/ena/ena_ethtool.c | 8 +- |
|
| 15 |
+ drivers/amazon/net/ena/ena_netdev.c | 410 ++++++++++++++++++-------------- |
|
| 16 |
+ drivers/amazon/net/ena/ena_netdev.h | 28 ++- |
|
| 17 |
+ drivers/amazon/net/ena/ena_sysfs.c | 6 - |
|
| 18 |
+ drivers/amazon/net/ena/kcompat.h | 126 ++++++---- |
|
| 19 |
+ 10 files changed, 519 insertions(+), 317 deletions(-) |
|
| 20 |
+ |
|
| 21 |
+diff --git a/drivers/amazon/net/ena/ena_admin_defs.h b/drivers/amazon/net/ena/ena_admin_defs.h |
|
| 22 |
+index 4532e57..e7968e9 100644 |
|
| 23 |
+--- a/drivers/amazon/net/ena/ena_admin_defs.h |
|
| 24 |
+@@ -72,6 +72,8 @@ enum ena_admin_aq_feature_id {
|
|
| 25 |
+ |
|
| 26 |
+ ENA_ADMIN_HW_HINTS = 3, |
|
| 27 |
+ |
|
| 28 |
++ ENA_ADMIN_MAX_QUEUES_EXT = 7, |
|
| 29 |
++ |
|
| 30 |
+ ENA_ADMIN_RSS_HASH_FUNCTION = 10, |
|
| 31 |
+ |
|
| 32 |
+ ENA_ADMIN_STATELESS_OFFLOAD_CONFIG = 11, |
|
| 33 |
+@@ -456,7 +458,13 @@ struct ena_admin_get_set_feature_common_desc {
|
|
| 34 |
+ /* as appears in ena_admin_aq_feature_id */ |
|
| 35 |
+ u8 feature_id; |
|
| 36 |
+ |
|
| 37 |
+- u16 reserved16; |
|
| 38 |
++ /* The driver specifies the max feature version it supports and the |
|
| 39 |
++ * device responsds with the correct feature version. This field is |
|
| 40 |
++ * zero based |
|
| 41 |
++ */ |
|
| 42 |
++ u8 feature_version; |
|
| 43 |
++ |
|
| 44 |
++ u8 reserved8; |
|
| 45 |
+ }; |
|
| 46 |
+ |
|
| 47 |
+ struct ena_admin_device_attr_feature_desc {
|
|
| 48 |
+@@ -483,6 +491,34 @@ struct ena_admin_device_attr_feature_desc {
|
|
| 49 |
+ u32 max_mtu; |
|
| 50 |
+ }; |
|
| 51 |
+ |
|
| 52 |
++struct ena_admin_queue_ext_feature_fields {
|
|
| 53 |
++ u32 max_tx_sq_num; |
|
| 54 |
++ |
|
| 55 |
++ u32 max_tx_cq_num; |
|
| 56 |
++ |
|
| 57 |
++ u32 max_rx_sq_num; |
|
| 58 |
++ |
|
| 59 |
++ u32 max_rx_cq_num; |
|
| 60 |
++ |
|
| 61 |
++ u32 max_tx_sq_depth; |
|
| 62 |
++ |
|
| 63 |
++ u32 max_tx_cq_depth; |
|
| 64 |
++ |
|
| 65 |
++ u32 max_rx_sq_depth; |
|
| 66 |
++ |
|
| 67 |
++ u32 max_rx_cq_depth; |
|
| 68 |
++ |
|
| 69 |
++ u32 max_tx_header_size; |
|
| 70 |
++ |
|
| 71 |
++ /* Maximum Descriptors number, including meta descriptor, allowed for |
|
| 72 |
++ * a single Tx packet |
|
| 73 |
++ */ |
|
| 74 |
++ u16 max_per_packet_tx_descs; |
|
| 75 |
++ |
|
| 76 |
++ /* Maximum Descriptors number allowed for a single Rx packet */ |
|
| 77 |
++ u16 max_per_packet_rx_descs; |
|
| 78 |
++}; |
|
| 79 |
++ |
|
| 80 |
+ struct ena_admin_queue_feature_desc {
|
|
| 81 |
+ /* including LLQs */ |
|
| 82 |
+ u32 max_sq_num; |
|
| 83 |
+@@ -727,7 +763,14 @@ struct ena_admin_host_info {
|
|
| 84 |
+ u32 driver_version; |
|
| 85 |
+ |
|
| 86 |
+ /* features bitmap */ |
|
| 87 |
+- u32 supported_network_features[4]; |
|
| 88 |
++ u32 supported_network_features[2]; |
|
| 89 |
++ |
|
| 90 |
++ u32 reserved; |
|
| 91 |
++ |
|
| 92 |
++ /* Number of CPUs */ |
|
| 93 |
++ u16 num_cpus; |
|
| 94 |
++ |
|
| 95 |
++ u16 reserved_2; |
|
| 96 |
+ }; |
|
| 97 |
+ |
|
| 98 |
+ struct ena_admin_rss_ind_table_entry {
|
|
| 99 |
+@@ -792,6 +835,19 @@ struct ena_admin_get_feat_cmd {
|
|
| 100 |
+ u32 raw[11]; |
|
| 101 |
+ }; |
|
| 102 |
+ |
|
| 103 |
++struct ena_admin_queue_ext_feature_desc {
|
|
| 104 |
++ /* version */ |
|
| 105 |
++ u8 version; |
|
| 106 |
++ |
|
| 107 |
++ u8 reserved1[3]; |
|
| 108 |
++ |
|
| 109 |
++ union {
|
|
| 110 |
++ struct ena_admin_queue_ext_feature_fields max_queue_ext; |
|
| 111 |
++ |
|
| 112 |
++ u32 raw[10]; |
|
| 113 |
++ }; |
|
| 114 |
++}; |
|
| 115 |
++ |
|
| 116 |
+ struct ena_admin_get_feat_resp {
|
|
| 117 |
+ struct ena_admin_acq_common_desc acq_common_desc; |
|
| 118 |
+ |
|
| 119 |
+@@ -802,6 +858,8 @@ struct ena_admin_get_feat_resp {
|
|
| 120 |
+ |
|
| 121 |
+ struct ena_admin_queue_feature_desc max_queue; |
|
| 122 |
+ |
|
| 123 |
++ struct ena_admin_queue_ext_feature_desc max_queue_ext; |
|
| 124 |
++ |
|
| 125 |
+ struct ena_admin_feature_aenq_desc aenq; |
|
| 126 |
+ |
|
| 127 |
+ struct ena_admin_get_feature_link_desc link; |
|
| 128 |
+diff --git a/drivers/amazon/net/ena/ena_com.c b/drivers/amazon/net/ena/ena_com.c |
|
| 129 |
+index 2480863..856c20b 100644 |
|
| 130 |
+--- a/drivers/amazon/net/ena/ena_com.c |
|
| 131 |
+@@ -317,7 +317,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(struct ena_com_admin_queue |
|
| 132 |
+ cmd_size_in_bytes, |
|
| 133 |
+ comp, |
|
| 134 |
+ comp_size_in_bytes); |
|
| 135 |
+- if (unlikely(IS_ERR(comp_ctx))) |
|
| 136 |
++ if (IS_ERR(comp_ctx)) |
|
| 137 |
+ admin_queue->running_state = false; |
|
| 138 |
+ spin_unlock_irqrestore(&admin_queue->q_lock, flags); |
|
| 139 |
+ |
|
| 140 |
+@@ -333,6 +333,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, |
|
| 141 |
+ |
|
| 142 |
+ memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); |
|
| 143 |
+ |
|
| 144 |
++ io_sq->dma_addr_bits = ena_dev->dma_addr_bits; |
|
| 145 |
+ io_sq->desc_entry_size = |
|
| 146 |
+ (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? |
|
| 147 |
+ sizeof(struct ena_eth_io_tx_desc) : |
|
| 148 |
+@@ -460,12 +461,12 @@ static void ena_com_handle_admin_completion(struct ena_com_admin_queue *admin_qu |
|
| 149 |
+ cqe = &admin_queue->cq.entries[head_masked]; |
|
| 150 |
+ |
|
| 151 |
+ /* Go over all the completions */ |
|
| 152 |
+- while ((cqe->acq_common_descriptor.flags & |
|
| 153 |
++ while ((READ_ONCE(cqe->acq_common_descriptor.flags) & |
|
| 154 |
+ ENA_ADMIN_ACQ_COMMON_DESC_PHASE_MASK) == phase) {
|
|
| 155 |
+ /* Do not read the rest of the completion entry before the |
|
| 156 |
+ * phase bit was validated |
|
| 157 |
+ */ |
|
| 158 |
+- rmb(); |
|
| 159 |
++ dma_rmb(); |
|
| 160 |
+ ena_com_handle_single_admin_completion(admin_queue, cqe); |
|
| 161 |
+ |
|
| 162 |
+ head_masked++; |
|
| 163 |
+@@ -628,15 +629,10 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset) |
|
| 164 |
+ mmio_read_reg |= mmio_read->seq_num & |
|
| 165 |
+ ENA_REGS_MMIO_REG_READ_REQ_ID_MASK; |
|
| 166 |
+ |
|
| 167 |
+- /* make sure read_resp->req_id get updated before the hw can write |
|
| 168 |
+- * there |
|
| 169 |
+- */ |
|
| 170 |
+- wmb(); |
|
| 171 |
+- |
|
| 172 |
+ writel(mmio_read_reg, ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); |
|
| 173 |
+ |
|
| 174 |
+ for (i = 0; i < timeout; i++) {
|
|
| 175 |
+- if (read_resp->req_id == mmio_read->seq_num) |
|
| 176 |
++ if (READ_ONCE(read_resp->req_id) == mmio_read->seq_num) |
|
| 177 |
+ break; |
|
| 178 |
+ |
|
| 179 |
+ udelay(1); |
|
| 180 |
+@@ -788,7 +784,8 @@ static int ena_com_get_feature_ex(struct ena_com_dev *ena_dev, |
|
| 181 |
+ struct ena_admin_get_feat_resp *get_resp, |
|
| 182 |
+ enum ena_admin_aq_feature_id feature_id, |
|
| 183 |
+ dma_addr_t control_buf_dma_addr, |
|
| 184 |
+- u32 control_buff_size) |
|
| 185 |
++ u32 control_buff_size, |
|
| 186 |
++ u8 feature_ver) |
|
| 187 |
+ {
|
|
| 188 |
+ struct ena_com_admin_queue *admin_queue; |
|
| 189 |
+ struct ena_admin_get_feat_cmd get_cmd; |
|
| 190 |
+@@ -819,7 +816,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev *ena_dev, |
|
| 191 |
+ } |
|
| 192 |
+ |
|
| 193 |
+ get_cmd.control_buffer.length = control_buff_size; |
|
| 194 |
+- |
|
| 195 |
++ get_cmd.feat_common.feature_version = feature_ver; |
|
| 196 |
+ get_cmd.feat_common.feature_id = feature_id; |
|
| 197 |
+ |
|
| 198 |
+ ret = ena_com_execute_admin_command(admin_queue, |
|
| 199 |
+@@ -839,13 +836,15 @@ static int ena_com_get_feature_ex(struct ena_com_dev *ena_dev, |
|
| 200 |
+ |
|
| 201 |
+ static int ena_com_get_feature(struct ena_com_dev *ena_dev, |
|
| 202 |
+ struct ena_admin_get_feat_resp *get_resp, |
|
| 203 |
+- enum ena_admin_aq_feature_id feature_id) |
|
| 204 |
++ enum ena_admin_aq_feature_id feature_id, |
|
| 205 |
++ u8 feature_ver) |
|
| 206 |
+ {
|
|
| 207 |
+ return ena_com_get_feature_ex(ena_dev, |
|
| 208 |
+ get_resp, |
|
| 209 |
+ feature_id, |
|
| 210 |
+ 0, |
|
| 211 |
+- 0); |
|
| 212 |
++ 0, |
|
| 213 |
++ feature_ver); |
|
| 214 |
+ } |
|
| 215 |
+ |
|
| 216 |
+ static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) |
|
| 217 |
+@@ -905,7 +904,7 @@ static int ena_com_indirect_table_allocate(struct ena_com_dev *ena_dev, |
|
| 218 |
+ int ret; |
|
| 219 |
+ |
|
| 220 |
+ ret = ena_com_get_feature(ena_dev, &get_resp, |
|
| 221 |
+- ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG); |
|
| 222 |
++ ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); |
|
| 223 |
+ if (unlikely(ret)) |
|
| 224 |
+ return ret; |
|
| 225 |
+ |
|
| 226 |
+@@ -1136,7 +1135,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue, |
|
| 227 |
+ |
|
| 228 |
+ comp_ctx = ena_com_submit_admin_cmd(admin_queue, cmd, cmd_size, |
|
| 229 |
+ comp, comp_size); |
|
| 230 |
+- if (unlikely(IS_ERR(comp_ctx))) {
|
|
| 231 |
++ if (IS_ERR(comp_ctx)) {
|
|
| 232 |
+ if (comp_ctx == ERR_PTR(-ENODEV)) |
|
| 233 |
+ pr_debug("Failed to submit command [%ld]\n",
|
|
| 234 |
+ PTR_ERR(comp_ctx)); |
|
| 235 |
+@@ -1325,7 +1324,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) |
|
| 236 |
+ struct ena_admin_get_feat_resp get_resp; |
|
| 237 |
+ int ret; |
|
| 238 |
+ |
|
| 239 |
+- ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG); |
|
| 240 |
++ ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); |
|
| 241 |
+ if (ret) {
|
|
| 242 |
+ pr_info("Can't get aenq configuration\n");
|
|
| 243 |
+ return ret; |
|
| 244 |
+@@ -1698,7 +1697,7 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_dev, u16 qid) |
|
| 245 |
+ int ena_com_get_link_params(struct ena_com_dev *ena_dev, |
|
| 246 |
+ struct ena_admin_get_feat_resp *resp) |
|
| 247 |
+ {
|
|
| 248 |
+- return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG); |
|
| 249 |
++ return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG, 0); |
|
| 250 |
+ } |
|
| 251 |
+ |
|
| 252 |
+ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, |
|
| 253 |
+@@ -1708,7 +1707,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, |
|
| 254 |
+ int rc; |
|
| 255 |
+ |
|
| 256 |
+ rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 257 |
+- ENA_ADMIN_DEVICE_ATTRIBUTES); |
|
| 258 |
++ ENA_ADMIN_DEVICE_ATTRIBUTES, 0); |
|
| 259 |
+ if (rc) |
|
| 260 |
+ return rc; |
|
| 261 |
+ |
|
| 262 |
+@@ -1716,17 +1715,34 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, |
|
| 263 |
+ sizeof(get_resp.u.dev_attr)); |
|
| 264 |
+ ena_dev->supported_features = get_resp.u.dev_attr.supported_features; |
|
| 265 |
+ |
|
| 266 |
+- rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 267 |
+- ENA_ADMIN_MAX_QUEUES_NUM); |
|
| 268 |
+- if (rc) |
|
| 269 |
+- return rc; |
|
| 270 |
++ if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) {
|
|
| 271 |
++ rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 272 |
++ ENA_ADMIN_MAX_QUEUES_EXT, |
|
| 273 |
++ ENA_FEATURE_MAX_QUEUE_EXT_VER); |
|
| 274 |
++ if (rc) |
|
| 275 |
++ return rc; |
|
| 276 |
+ |
|
| 277 |
+- memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, |
|
| 278 |
+- sizeof(get_resp.u.max_queue)); |
|
| 279 |
+- ena_dev->tx_max_header_size = get_resp.u.max_queue.max_header_size; |
|
| 280 |
++ if (get_resp.u.max_queue_ext.version != ENA_FEATURE_MAX_QUEUE_EXT_VER) |
|
| 281 |
++ return -EINVAL; |
|
| 282 |
++ |
|
| 283 |
++ memcpy(&get_feat_ctx->max_queue_ext, &get_resp.u.max_queue_ext, |
|
| 284 |
++ sizeof(get_resp.u.max_queue_ext)); |
|
| 285 |
++ ena_dev->tx_max_header_size = |
|
| 286 |
++ get_resp.u.max_queue_ext.max_queue_ext.max_tx_header_size; |
|
| 287 |
++ } else {
|
|
| 288 |
++ rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 289 |
++ ENA_ADMIN_MAX_QUEUES_NUM, 0); |
|
| 290 |
++ memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, |
|
| 291 |
++ sizeof(get_resp.u.max_queue)); |
|
| 292 |
++ ena_dev->tx_max_header_size = |
|
| 293 |
++ get_resp.u.max_queue.max_header_size; |
|
| 294 |
++ |
|
| 295 |
++ if (rc) |
|
| 296 |
++ return rc; |
|
| 297 |
++ } |
|
| 298 |
+ |
|
| 299 |
+ rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 300 |
+- ENA_ADMIN_AENQ_CONFIG); |
|
| 301 |
++ ENA_ADMIN_AENQ_CONFIG, 0); |
|
| 302 |
+ if (rc) |
|
| 303 |
+ return rc; |
|
| 304 |
+ |
|
| 305 |
+@@ -1734,7 +1750,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, |
|
| 306 |
+ sizeof(get_resp.u.aenq)); |
|
| 307 |
+ |
|
| 308 |
+ rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 309 |
+- ENA_ADMIN_STATELESS_OFFLOAD_CONFIG); |
|
| 310 |
++ ENA_ADMIN_STATELESS_OFFLOAD_CONFIG, 0); |
|
| 311 |
+ if (rc) |
|
| 312 |
+ return rc; |
|
| 313 |
+ |
|
| 314 |
+@@ -1744,7 +1760,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, |
|
| 315 |
+ /* Driver hints isn't mandatory admin command. So in case the |
|
| 316 |
+ * command isn't supported set driver hints to 0 |
|
| 317 |
+ */ |
|
| 318 |
+- rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_HW_HINTS); |
|
| 319 |
++ rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_HW_HINTS, 0); |
|
| 320 |
+ |
|
| 321 |
+ if (!rc) |
|
| 322 |
+ memcpy(&get_feat_ctx->hw_hints, &get_resp.u.hw_hints, |
|
| 323 |
+@@ -1796,8 +1812,13 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev, void *data) |
|
| 324 |
+ aenq_common = &aenq_e->aenq_common_desc; |
|
| 325 |
+ |
|
| 326 |
+ /* Go over all the events */ |
|
| 327 |
+- while ((aenq_common->flags & ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == |
|
| 328 |
+- phase) {
|
|
| 329 |
++ while ((READ_ONCE(aenq_common->flags) & |
|
| 330 |
++ ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) {
|
|
| 331 |
++ /* Make sure the phase bit (ownership) is as expected before |
|
| 332 |
++ * reading the rest of the descriptor. |
|
| 333 |
++ */ |
|
| 334 |
++ dma_rmb(); |
|
| 335 |
++ |
|
| 336 |
+ pr_debug("AENQ! Group[%x] Syndrom[%x] timestamp: [%llus]\n",
|
|
| 337 |
+ aenq_common->group, aenq_common->syndrom, |
|
| 338 |
+ (u64)aenq_common->timestamp_low + |
|
| 339 |
+@@ -1829,7 +1850,8 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev, void *data) |
|
| 340 |
+ |
|
| 341 |
+ /* write the aenq doorbell after all AENQ descriptors were read */ |
|
| 342 |
+ mb(); |
|
| 343 |
+- writel((u32)aenq->head, dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); |
|
| 344 |
++ writel_relaxed((u32)aenq->head, dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); |
|
| 345 |
++ mmiowb(); |
|
| 346 |
+ } |
|
| 347 |
+ |
|
| 348 |
+ int ena_com_dev_reset(struct ena_com_dev *ena_dev, |
|
| 349 |
+@@ -1975,7 +1997,7 @@ int ena_com_get_offload_settings(struct ena_com_dev *ena_dev, |
|
| 350 |
+ struct ena_admin_get_feat_resp resp; |
|
| 351 |
+ |
|
| 352 |
+ ret = ena_com_get_feature(ena_dev, &resp, |
|
| 353 |
+- ENA_ADMIN_STATELESS_OFFLOAD_CONFIG); |
|
| 354 |
++ ENA_ADMIN_STATELESS_OFFLOAD_CONFIG, 0); |
|
| 355 |
+ if (unlikely(ret)) {
|
|
| 356 |
+ pr_err("Failed to get offload capabilities %d\n", ret);
|
|
| 357 |
+ return ret; |
|
| 358 |
+@@ -2004,7 +2026,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_dev) |
|
| 359 |
+ |
|
| 360 |
+ /* Validate hash function is supported */ |
|
| 361 |
+ ret = ena_com_get_feature(ena_dev, &get_resp, |
|
| 362 |
+- ENA_ADMIN_RSS_HASH_FUNCTION); |
|
| 363 |
++ ENA_ADMIN_RSS_HASH_FUNCTION, 0); |
|
| 364 |
+ if (unlikely(ret)) |
|
| 365 |
+ return ret; |
|
| 366 |
+ |
|
| 367 |
+@@ -2064,7 +2086,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev, |
|
| 368 |
+ rc = ena_com_get_feature_ex(ena_dev, &get_resp, |
|
| 369 |
+ ENA_ADMIN_RSS_HASH_FUNCTION, |
|
| 370 |
+ rss->hash_key_dma_addr, |
|
| 371 |
+- sizeof(*rss->hash_key)); |
|
| 372 |
++ sizeof(*rss->hash_key), 0); |
|
| 373 |
+ if (unlikely(rc)) |
|
| 374 |
+ return rc; |
|
| 375 |
+ |
|
| 376 |
+@@ -2115,7 +2137,7 @@ int ena_com_get_hash_function(struct ena_com_dev *ena_dev, |
|
| 377 |
+ rc = ena_com_get_feature_ex(ena_dev, &get_resp, |
|
| 378 |
+ ENA_ADMIN_RSS_HASH_FUNCTION, |
|
| 379 |
+ rss->hash_key_dma_addr, |
|
| 380 |
+- sizeof(*rss->hash_key)); |
|
| 381 |
++ sizeof(*rss->hash_key), 0); |
|
| 382 |
+ if (unlikely(rc)) |
|
| 383 |
+ return rc; |
|
| 384 |
+ |
|
| 385 |
+@@ -2140,7 +2162,7 @@ int ena_com_get_hash_ctrl(struct ena_com_dev *ena_dev, |
|
| 386 |
+ rc = ena_com_get_feature_ex(ena_dev, &get_resp, |
|
| 387 |
+ ENA_ADMIN_RSS_HASH_INPUT, |
|
| 388 |
+ rss->hash_ctrl_dma_addr, |
|
| 389 |
+- sizeof(*rss->hash_ctrl)); |
|
| 390 |
++ sizeof(*rss->hash_ctrl), 0); |
|
| 391 |
+ if (unlikely(rc)) |
|
| 392 |
+ return rc; |
|
| 393 |
+ |
|
| 394 |
+@@ -2376,7 +2398,7 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena_dev, u32 *ind_tbl) |
|
| 395 |
+ rc = ena_com_get_feature_ex(ena_dev, &get_resp, |
|
| 396 |
+ ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, |
|
| 397 |
+ rss->rss_ind_tbl_dma_addr, |
|
| 398 |
+- tbl_size); |
|
| 399 |
++ tbl_size, 0); |
|
| 400 |
+ if (unlikely(rc)) |
|
| 401 |
+ return rc; |
|
| 402 |
+ |
|
| 403 |
+@@ -2586,7 +2608,7 @@ int ena_com_init_interrupt_moderation(struct ena_com_dev *ena_dev) |
|
| 404 |
+ int rc; |
|
| 405 |
+ |
|
| 406 |
+ rc = ena_com_get_feature(ena_dev, &get_resp, |
|
| 407 |
+- ENA_ADMIN_INTERRUPT_MODERATION); |
|
| 408 |
++ ENA_ADMIN_INTERRUPT_MODERATION, 0); |
|
| 409 |
+ |
|
| 410 |
+ if (rc) {
|
|
| 411 |
+ if (rc == -EOPNOTSUPP) {
|
|
| 412 |
+diff --git a/drivers/amazon/net/ena/ena_com.h b/drivers/amazon/net/ena/ena_com.h |
|
| 413 |
+index bd9c001..d0a2e3c 100644 |
|
| 414 |
+--- a/drivers/amazon/net/ena/ena_com.h |
|
| 415 |
+@@ -99,6 +99,8 @@ |
|
| 416 |
+ |
|
| 417 |
+ #define ENA_HW_HINTS_NO_TIMEOUT 0xFFFF |
|
| 418 |
+ |
|
| 419 |
++#define ENA_FEATURE_MAX_QUEUE_EXT_VER 1 |
|
| 420 |
++ |
|
| 421 |
+ enum ena_intr_moder_level {
|
|
| 422 |
+ ENA_INTR_MODER_LOWEST = 0, |
|
| 423 |
+ ENA_INTR_MODER_LOW, |
|
| 424 |
+@@ -342,6 +344,7 @@ struct ena_com_dev {
|
|
| 425 |
+ |
|
| 426 |
+ struct ena_com_dev_get_features_ctx {
|
|
| 427 |
+ struct ena_admin_queue_feature_desc max_queues; |
|
| 428 |
++ struct ena_admin_queue_ext_feature_desc max_queue_ext; |
|
| 429 |
+ struct ena_admin_device_attr_feature_desc dev_attr; |
|
| 430 |
+ struct ena_admin_feature_aenq_desc aenq; |
|
| 431 |
+ struct ena_admin_feature_offload_desc offload; |
|
| 432 |
+diff --git a/drivers/amazon/net/ena/ena_eth_com.c b/drivers/amazon/net/ena/ena_eth_com.c |
|
| 433 |
+index 582ea54..2fa032b 100644 |
|
| 434 |
+--- a/drivers/amazon/net/ena/ena_eth_com.c |
|
| 435 |
+@@ -51,16 +51,12 @@ static inline struct ena_eth_io_rx_cdesc_base *ena_com_get_next_rx_cdesc( |
|
| 436 |
+ if (desc_phase != expected_phase) |
|
| 437 |
+ return NULL; |
|
| 438 |
+ |
|
| 439 |
+- return cdesc; |
|
| 440 |
+-} |
|
| 441 |
+- |
|
| 442 |
+-static inline void ena_com_cq_inc_head(struct ena_com_io_cq *io_cq) |
|
| 443 |
+-{
|
|
| 444 |
+- io_cq->head++; |
|
| 445 |
++ /* Make sure we read the rest of the descriptor after the phase bit |
|
| 446 |
++ * has been read |
|
| 447 |
++ */ |
|
| 448 |
++ dma_rmb(); |
|
| 449 |
+ |
|
| 450 |
+- /* Switch phase bit in case of wrap around */ |
|
| 451 |
+- if (unlikely((io_cq->head & (io_cq->q_depth - 1)) == 0)) |
|
| 452 |
+- io_cq->phase ^= 1; |
|
| 453 |
++ return cdesc; |
|
| 454 |
+ } |
|
| 455 |
+ |
|
| 456 |
+ static inline void *get_sq_desc(struct ena_com_io_sq *io_sq) |
|
| 457 |
+@@ -472,47 +468,13 @@ int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq, |
|
| 458 |
+ return 0; |
|
| 459 |
+ } |
|
| 460 |
+ |
|
| 461 |
+-int ena_com_tx_comp_req_id_get(struct ena_com_io_cq *io_cq, u16 *req_id) |
|
| 462 |
+-{
|
|
| 463 |
+- u8 expected_phase, cdesc_phase; |
|
| 464 |
+- struct ena_eth_io_tx_cdesc *cdesc; |
|
| 465 |
+- u16 masked_head; |
|
| 466 |
+- |
|
| 467 |
+- masked_head = io_cq->head & (io_cq->q_depth - 1); |
|
| 468 |
+- expected_phase = io_cq->phase; |
|
| 469 |
+- |
|
| 470 |
+- cdesc = (struct ena_eth_io_tx_cdesc *) |
|
| 471 |
+- ((uintptr_t)io_cq->cdesc_addr.virt_addr + |
|
| 472 |
+- (masked_head * io_cq->cdesc_entry_size_in_bytes)); |
|
| 473 |
+- |
|
| 474 |
+- /* When the current completion descriptor phase isn't the same as the |
|
| 475 |
+- * expected, it mean that the device still didn't update |
|
| 476 |
+- * this completion. |
|
| 477 |
+- */ |
|
| 478 |
+- cdesc_phase = READ_ONCE(cdesc->flags) & ENA_ETH_IO_TX_CDESC_PHASE_MASK; |
|
| 479 |
+- if (cdesc_phase != expected_phase) |
|
| 480 |
+- return -EAGAIN; |
|
| 481 |
+- |
|
| 482 |
+- if (unlikely(cdesc->req_id >= io_cq->q_depth)) {
|
|
| 483 |
+- pr_err("Invalid req id %d\n", cdesc->req_id);
|
|
| 484 |
+- return -EINVAL; |
|
| 485 |
+- } |
|
| 486 |
+- |
|
| 487 |
+- ena_com_cq_inc_head(io_cq); |
|
| 488 |
+- |
|
| 489 |
+- *req_id = READ_ONCE(cdesc->req_id); |
|
| 490 |
+- |
|
| 491 |
+- return 0; |
|
| 492 |
+-} |
|
| 493 |
+- |
|
| 494 |
+ bool ena_com_cq_empty(struct ena_com_io_cq *io_cq) |
|
| 495 |
+ {
|
|
| 496 |
+ struct ena_eth_io_rx_cdesc_base *cdesc; |
|
| 497 |
+ |
|
| 498 |
+ cdesc = ena_com_get_next_rx_cdesc(io_cq); |
|
| 499 |
+- if(cdesc) |
|
| 500 |
++ if (cdesc) |
|
| 501 |
+ return false; |
|
| 502 |
+ else |
|
| 503 |
+ return true; |
|
| 504 |
+ } |
|
| 505 |
+- |
|
| 506 |
+diff --git a/drivers/amazon/net/ena/ena_eth_com.h b/drivers/amazon/net/ena/ena_eth_com.h |
|
| 507 |
+index 2f76572..ed3a8752 100644 |
|
| 508 |
+--- a/drivers/amazon/net/ena/ena_eth_com.h |
|
| 509 |
+@@ -86,8 +86,6 @@ int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq, |
|
| 510 |
+ struct ena_com_buf *ena_buf, |
|
| 511 |
+ u16 req_id); |
|
| 512 |
+ |
|
| 513 |
+-int ena_com_tx_comp_req_id_get(struct ena_com_io_cq *io_cq, u16 *req_id); |
|
| 514 |
+- |
|
| 515 |
+ bool ena_com_cq_empty(struct ena_com_io_cq *io_cq); |
|
| 516 |
+ |
|
| 517 |
+ static inline void ena_com_unmask_intr(struct ena_com_io_cq *io_cq, |
|
| 518 |
+@@ -159,4 +157,47 @@ static inline void ena_com_comp_ack(struct ena_com_io_sq *io_sq, u16 elem) |
|
| 519 |
+ io_sq->next_to_comp += elem; |
|
| 520 |
+ } |
|
| 521 |
+ |
|
| 522 |
++static inline void ena_com_cq_inc_head(struct ena_com_io_cq *io_cq) |
|
| 523 |
++{
|
|
| 524 |
++ io_cq->head++; |
|
| 525 |
++ |
|
| 526 |
++ /* Switch phase bit in case of wrap around */ |
|
| 527 |
++ if (unlikely((io_cq->head & (io_cq->q_depth - 1)) == 0)) |
|
| 528 |
++ io_cq->phase ^= 1; |
|
| 529 |
++} |
|
| 530 |
++ |
|
| 531 |
++static inline int ena_com_tx_comp_req_id_get(struct ena_com_io_cq *io_cq, u16 *req_id) |
|
| 532 |
++{
|
|
| 533 |
++ u8 expected_phase, cdesc_phase; |
|
| 534 |
++ struct ena_eth_io_tx_cdesc *cdesc; |
|
| 535 |
++ u16 masked_head; |
|
| 536 |
++ |
|
| 537 |
++ masked_head = io_cq->head & (io_cq->q_depth - 1); |
|
| 538 |
++ expected_phase = io_cq->phase; |
|
| 539 |
++ |
|
| 540 |
++ cdesc = (struct ena_eth_io_tx_cdesc *) |
|
| 541 |
++ ((uintptr_t)io_cq->cdesc_addr.virt_addr + |
|
| 542 |
++ (masked_head * io_cq->cdesc_entry_size_in_bytes)); |
|
| 543 |
++ |
|
| 544 |
++ /* When the current completion descriptor phase isn't the same as the |
|
| 545 |
++ * expected, it mean that the device still didn't update |
|
| 546 |
++ * this completion. |
|
| 547 |
++ */ |
|
| 548 |
++ cdesc_phase = READ_ONCE(cdesc->flags) & ENA_ETH_IO_TX_CDESC_PHASE_MASK; |
|
| 549 |
++ if (cdesc_phase != expected_phase) |
|
| 550 |
++ return -EAGAIN; |
|
| 551 |
++ |
|
| 552 |
++ dma_rmb(); |
|
| 553 |
++ if (unlikely(cdesc->req_id >= io_cq->q_depth)) {
|
|
| 554 |
++ pr_err("Invalid req id %d\n", cdesc->req_id);
|
|
| 555 |
++ return -EINVAL; |
|
| 556 |
++ } |
|
| 557 |
++ |
|
| 558 |
++ ena_com_cq_inc_head(io_cq); |
|
| 559 |
++ |
|
| 560 |
++ *req_id = READ_ONCE(cdesc->req_id); |
|
| 561 |
++ |
|
| 562 |
++ return 0; |
|
| 563 |
++} |
|
| 564 |
++ |
|
| 565 |
+ #endif /* ENA_ETH_COM_H_ */ |
|
| 566 |
+diff --git a/drivers/amazon/net/ena/ena_ethtool.c b/drivers/amazon/net/ena/ena_ethtool.c |
|
| 567 |
+index fcd002f..3fdf7b2 100644 |
|
| 568 |
+--- a/drivers/amazon/net/ena/ena_ethtool.c |
|
| 569 |
+@@ -960,8 +960,8 @@ static void ena_dump_stats_ex(struct ena_adapter *adapter, u8 *buf) |
|
| 570 |
+ return; |
|
| 571 |
+ } |
|
| 572 |
+ |
|
| 573 |
+- strings_buf = devm_kzalloc(&adapter->pdev->dev, |
|
| 574 |
+- strings_num * ETH_GSTRING_LEN, |
|
| 575 |
++ strings_buf = devm_kcalloc(&adapter->pdev->dev, |
|
| 576 |
++ ETH_GSTRING_LEN, strings_num, |
|
| 577 |
+ GFP_ATOMIC); |
|
| 578 |
+ if (!strings_buf) {
|
|
| 579 |
+ netif_err(adapter, drv, netdev, |
|
| 580 |
+@@ -969,8 +969,8 @@ static void ena_dump_stats_ex(struct ena_adapter *adapter, u8 *buf) |
|
| 581 |
+ return; |
|
| 582 |
+ } |
|
| 583 |
+ |
|
| 584 |
+- data_buf = devm_kzalloc(&adapter->pdev->dev, |
|
| 585 |
+- strings_num * sizeof(u64), |
|
| 586 |
++ data_buf = devm_kcalloc(&adapter->pdev->dev, |
|
| 587 |
++ strings_num, sizeof(u64), |
|
| 588 |
+ GFP_ATOMIC); |
|
| 589 |
+ if (!data_buf) {
|
|
| 590 |
+ netif_err(adapter, drv, netdev, |
|
| 591 |
+diff --git a/drivers/amazon/net/ena/ena_netdev.c b/drivers/amazon/net/ena/ena_netdev.c |
|
| 592 |
+index 4f82a3d..095c218 100644 |
|
| 593 |
+--- a/drivers/amazon/net/ena/ena_netdev.c |
|
| 594 |
+@@ -72,6 +72,10 @@ static int debug = -1; |
|
| 595 |
+ module_param(debug, int, 0); |
|
| 596 |
+ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); |
|
| 597 |
+ |
|
| 598 |
++static int rx_queue_size = ENA_DEFAULT_RING_SIZE; |
|
| 599 |
++module_param(rx_queue_size, int, S_IRUGO); |
|
| 600 |
++MODULE_PARM_DESC(rx_queue_size, "Rx queue size. The size should be a power of 2. Max value is 8K\n"); |
|
| 601 |
++ |
|
| 602 |
+ static struct ena_aenq_handlers aenq_handlers; |
|
| 603 |
+ |
|
| 604 |
+ static struct workqueue_struct *ena_wq; |
|
| 605 |
+@@ -80,8 +84,12 @@ MODULE_DEVICE_TABLE(pci, ena_pci_tbl); |
|
| 606 |
+ |
|
| 607 |
+ static int ena_rss_init_default(struct ena_adapter *adapter); |
|
| 608 |
+ static void check_for_admin_com_state(struct ena_adapter *adapter); |
|
| 609 |
+-static void ena_destroy_device(struct ena_adapter *adapter); |
|
| 610 |
++static void ena_destroy_device(struct ena_adapter *adapter, bool graceful); |
|
| 611 |
+ static int ena_restore_device(struct ena_adapter *adapter); |
|
| 612 |
++static int ena_calc_io_queue_num(struct pci_dev *pdev, |
|
| 613 |
++ struct ena_com_dev *ena_dev, |
|
| 614 |
++ struct ena_com_dev_get_features_ctx *get_feat_ctx); |
|
| 615 |
++static int ena_calc_queue_size(struct ena_calc_queue_size_ctx *ctx); |
|
| 616 |
+ |
|
| 617 |
+ static void ena_tx_timeout(struct net_device *dev) |
|
| 618 |
+ {
|
|
| 619 |
+@@ -480,7 +488,7 @@ static inline int ena_alloc_rx_page(struct ena_ring *rx_ring, |
|
| 620 |
+ return -ENOMEM; |
|
| 621 |
+ } |
|
| 622 |
+ |
|
| 623 |
+- dma = dma_map_page(rx_ring->dev, page, 0, PAGE_SIZE, |
|
| 624 |
++ dma = dma_map_page(rx_ring->dev, page, 0, ENA_PAGE_SIZE, |
|
| 625 |
+ DMA_FROM_DEVICE); |
|
| 626 |
+ if (unlikely(dma_mapping_error(rx_ring->dev, dma))) {
|
|
| 627 |
+ u64_stats_update_begin(&rx_ring->syncp); |
|
| 628 |
+@@ -497,7 +505,7 @@ static inline int ena_alloc_rx_page(struct ena_ring *rx_ring, |
|
| 629 |
+ rx_info->page_offset = 0; |
|
| 630 |
+ ena_buf = &rx_info->ena_buf; |
|
| 631 |
+ ena_buf->paddr = dma; |
|
| 632 |
+- ena_buf->len = PAGE_SIZE; |
|
| 633 |
++ ena_buf->len = ENA_PAGE_SIZE; |
|
| 634 |
+ |
|
| 635 |
+ return 0; |
|
| 636 |
+ } |
|
| 637 |
+@@ -514,7 +522,7 @@ static void ena_free_rx_page(struct ena_ring *rx_ring, |
|
| 638 |
+ return; |
|
| 639 |
+ } |
|
| 640 |
+ |
|
| 641 |
+- dma_unmap_page(rx_ring->dev, ena_buf->paddr, PAGE_SIZE, |
|
| 642 |
++ dma_unmap_page(rx_ring->dev, ena_buf->paddr, ENA_PAGE_SIZE, |
|
| 643 |
+ DMA_FROM_DEVICE); |
|
| 644 |
+ |
|
| 645 |
+ __free_page(page); |
|
| 646 |
+@@ -541,7 +549,11 @@ static int ena_refill_rx_bufs(struct ena_ring *rx_ring, u32 num) |
|
| 647 |
+ |
|
| 648 |
+ |
|
| 649 |
+ rc = ena_alloc_rx_page(rx_ring, rx_info, |
|
| 650 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) |
|
| 651 |
++ GFP_ATOMIC | __GFP_COMP); |
|
| 652 |
++#else |
|
| 653 |
+ __GFP_COLD | GFP_ATOMIC | __GFP_COMP); |
|
| 654 |
++#endif |
|
| 655 |
+ if (unlikely(rc < 0)) {
|
|
| 656 |
+ netif_warn(rx_ring->adapter, rx_err, rx_ring->netdev, |
|
| 657 |
+ "failed to alloc buffer for rx queue %d\n", |
|
| 658 |
+@@ -570,13 +582,9 @@ static int ena_refill_rx_bufs(struct ena_ring *rx_ring, u32 num) |
|
| 659 |
+ rx_ring->qid, i, num); |
|
| 660 |
+ } |
|
| 661 |
+ |
|
| 662 |
+- if (likely(i)) {
|
|
| 663 |
+- /* Add memory barrier to make sure the desc were written before |
|
| 664 |
+- * issue a doorbell |
|
| 665 |
+- */ |
|
| 666 |
+- wmb(); |
|
| 667 |
++ /* ena_com_write_sq_doorbell issues a wmb() */ |
|
| 668 |
++ if (likely(i)) |
|
| 669 |
+ ena_com_write_sq_doorbell(rx_ring->ena_com_io_sq); |
|
| 670 |
+- } |
|
| 671 |
+ |
|
| 672 |
+ rx_ring->next_to_use = next_to_use; |
|
| 673 |
+ |
|
| 674 |
+@@ -944,10 +952,10 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring, |
|
| 675 |
+ do {
|
|
| 676 |
+ dma_unmap_page(rx_ring->dev, |
|
| 677 |
+ dma_unmap_addr(&rx_info->ena_buf, paddr), |
|
| 678 |
+- PAGE_SIZE, DMA_FROM_DEVICE); |
|
| 679 |
++ ENA_PAGE_SIZE, DMA_FROM_DEVICE); |
|
| 680 |
+ |
|
| 681 |
+ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, rx_info->page, |
|
| 682 |
+- rx_info->page_offset, len, PAGE_SIZE); |
|
| 683 |
++ rx_info->page_offset, len, ENA_PAGE_SIZE); |
|
| 684 |
+ |
|
| 685 |
+ netif_dbg(rx_ring->adapter, rx_status, rx_ring->netdev, |
|
| 686 |
+ "rx skb updated. len %d. data_len %d\n", |
|
| 687 |
+@@ -1169,7 +1177,9 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi, |
|
| 688 |
+ rx_ring->next_to_clean = next_to_clean; |
|
| 689 |
+ |
|
| 690 |
+ refill_required = ena_com_sq_empty_space(rx_ring->ena_com_io_sq); |
|
| 691 |
+- refill_threshold = rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER; |
|
| 692 |
++ refill_threshold = |
|
| 693 |
++ min_t(int, rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER, |
|
| 694 |
++ ENA_RX_REFILL_THRESH_PACKET); |
|
| 695 |
+ |
|
| 696 |
+ /* Optimization, try to batch new rx buffers */ |
|
| 697 |
+ if (refill_required > refill_threshold) {
|
|
| 698 |
+@@ -1353,16 +1363,17 @@ static irqreturn_t ena_intr_msix_io(int irq, void *data) |
|
| 699 |
+ {
|
|
| 700 |
+ struct ena_napi *ena_napi = data; |
|
| 701 |
+ |
|
| 702 |
++ ena_napi->tx_ring->first_interrupt = true; |
|
| 703 |
++ ena_napi->rx_ring->first_interrupt = true; |
|
| 704 |
++ |
|
| 705 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) |
|
| 706 |
+ napi_schedule_irqoff(&ena_napi->napi); |
|
| 707 |
+ #else |
|
| 708 |
++ smp_mb__before_atomic(); |
|
| 709 |
+ atomic_set(&ena_napi->unmask_interrupt, 1); |
|
| 710 |
+ napi_schedule_irqoff(&ena_napi->napi); |
|
| 711 |
+ #endif |
|
| 712 |
+ |
|
| 713 |
+- ena_napi->tx_ring->first_interrupt = true; |
|
| 714 |
+- ena_napi->rx_ring->first_interrupt = true; |
|
| 715 |
+- |
|
| 716 |
+ return IRQ_HANDLED; |
|
| 717 |
+ } |
|
| 718 |
+ |
|
| 719 |
+@@ -2042,7 +2053,7 @@ static int ena_close(struct net_device *netdev) |
|
| 720 |
+ "Destroy failure, restarting device\n"); |
|
| 721 |
+ ena_dump_stats_to_dmesg(adapter); |
|
| 722 |
+ /* rtnl lock already obtained in dev_ioctl() layer */ |
|
| 723 |
+- ena_destroy_device(adapter); |
|
| 724 |
++ ena_destroy_device(adapter, false); |
|
| 725 |
+ ena_restore_device(adapter); |
|
| 726 |
+ } |
|
| 727 |
+ |
|
| 728 |
+@@ -2253,12 +2264,6 @@ static netdev_tx_t ena_start_xmit(struct sk_buff *skb, struct net_device *dev) |
|
| 729 |
+ tx_ring->next_to_use = ENA_TX_RING_IDX_NEXT(next_to_use, |
|
| 730 |
+ tx_ring->ring_size); |
|
| 731 |
+ |
|
| 732 |
+- /* This WMB is aimed to: |
|
| 733 |
+- * 1 - perform smp barrier before reading next_to_completion |
|
| 734 |
+- * 2 - make sure the desc were written before trigger DB |
|
| 735 |
+- */ |
|
| 736 |
+- wmb(); |
|
| 737 |
+- |
|
| 738 |
+ /* stop the queue when no more space available, the packet can have up |
|
| 739 |
+ * to sgl_size + 2. one for the meta descriptor and one for header |
|
| 740 |
+ * (if the header is larger than tx_max_header_size). |
|
| 741 |
+@@ -2277,10 +2282,11 @@ static netdev_tx_t ena_start_xmit(struct sk_buff *skb, struct net_device *dev) |
|
| 742 |
+ * stop the queue but meanwhile clean_tx_irq updates |
|
| 743 |
+ * next_to_completion and terminates. |
|
| 744 |
+ * The queue will remain stopped forever. |
|
| 745 |
+- * To solve this issue this function perform rmb, check |
|
| 746 |
+- * the wakeup condition and wake up the queue if needed. |
|
| 747 |
++ * To solve this issue add a mb() to make sure that |
|
| 748 |
++ * netif_tx_stop_queue() write is vissible before checking if |
|
| 749 |
++ * there is additional space in the queue. |
|
| 750 |
+ */ |
|
| 751 |
+- smp_rmb(); |
|
| 752 |
++ smp_mb(); |
|
| 753 |
+ |
|
| 754 |
+ if (ena_com_sq_empty_space(tx_ring->ena_com_io_sq) |
|
| 755 |
+ > ENA_TX_WAKEUP_THRESH) {
|
|
| 756 |
+@@ -2294,7 +2300,9 @@ static netdev_tx_t ena_start_xmit(struct sk_buff *skb, struct net_device *dev) |
|
| 757 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) |
|
| 758 |
+ if (netif_xmit_stopped(txq) || !skb->xmit_more) {
|
|
| 759 |
+ #endif |
|
| 760 |
+- /* trigger the dma engine */ |
|
| 761 |
++ /* trigger the dma engine. ena_com_write_sq_doorbell() |
|
| 762 |
++ * has a mb |
|
| 763 |
++ */ |
|
| 764 |
+ ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq); |
|
| 765 |
+ u64_stats_update_begin(&tx_ring->syncp); |
|
| 766 |
+ tx_ring->tx_stats.doorbells++; |
|
| 767 |
+@@ -2357,9 +2365,14 @@ static void ena_netpoll(struct net_device *netdev) |
|
| 768 |
+ } |
|
| 769 |
+ #endif /* CONFIG_NET_POLL_CONTROLLER */ |
|
| 770 |
+ |
|
| 771 |
+-#ifdef HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK |
|
| 772 |
++#ifdef HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V2 |
|
| 773 |
++static u16 ena_select_queue(struct net_device *dev, struct sk_buff *skb, |
|
| 774 |
++ struct net_device *sb_dev, |
|
| 775 |
++ select_queue_fallback_t fallback) |
|
| 776 |
++#elif defined HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V1 |
|
| 777 |
+ static u16 ena_select_queue(struct net_device *dev, struct sk_buff *skb, |
|
| 778 |
+- void *accel_priv, select_queue_fallback_t fallback) |
|
| 779 |
++ void *accel_priv, |
|
| 780 |
++ select_queue_fallback_t fallback) |
|
| 781 |
+ #elif defined HAVE_NDO_SELECT_QUEUE_ACCEL |
|
| 782 |
+ /* Return subqueue id on this core (one per core). */ |
|
| 783 |
+ static u16 ena_select_queue(struct net_device *dev, struct sk_buff *skb, |
|
| 784 |
+@@ -2376,13 +2389,15 @@ static u16 ena_select_queue(struct net_device *dev, struct sk_buff *skb) |
|
| 785 |
+ if (skb_rx_queue_recorded(skb)) |
|
| 786 |
+ qid = skb_get_rx_queue(skb); |
|
| 787 |
+ else |
|
| 788 |
+-#if (defined HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK) |
|
| 789 |
++#if (defined HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V2) |
|
| 790 |
++ qid = fallback(dev, skb, NULL); |
|
| 791 |
++#elif (defined HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V1) |
|
| 792 |
+ qid = fallback(dev, skb); |
|
| 793 |
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) |
|
| 794 |
+ qid = __netdev_pick_tx(dev, skb); |
|
| 795 |
+ #else |
|
| 796 |
+ qid = skb_tx_hash(dev, skb); |
|
| 797 |
+-#endif /* HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK */ |
|
| 798 |
++#endif /* HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V2 */ |
|
| 799 |
+ |
|
| 800 |
+ return qid; |
|
| 801 |
+ } |
|
| 802 |
+@@ -2434,6 +2449,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev) |
|
| 803 |
+ (DRV_MODULE_VER_MAJOR) | |
|
| 804 |
+ (DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) | |
|
| 805 |
+ (DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT); |
|
| 806 |
++ host_info->num_cpus = num_online_cpus(); |
|
| 807 |
+ |
|
| 808 |
+ rc = ena_com_set_host_attributes(ena_dev); |
|
| 809 |
+ if (rc) {
|
|
| 810 |
+@@ -2489,7 +2505,7 @@ static void ena_config_debug_area(struct ena_adapter *adapter) |
|
| 811 |
+ } |
|
| 812 |
+ |
|
| 813 |
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) |
|
| 814 |
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) |
|
| 815 |
++#ifdef NDO_GET_STATS_64_V2 |
|
| 816 |
+ static void ena_get_stats64(struct net_device *netdev, |
|
| 817 |
+ struct rtnl_link_stats64 *stats) |
|
| 818 |
+ #else |
|
| 819 |
+@@ -2504,7 +2520,7 @@ static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev, |
|
| 820 |
+ int i; |
|
| 821 |
+ |
|
| 822 |
+ if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags)) |
|
| 823 |
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) |
|
| 824 |
++#ifdef NDO_GET_STATS_64_V2 |
|
| 825 |
+ return; |
|
| 826 |
+ #else |
|
| 827 |
+ return NULL; |
|
| 828 |
+@@ -2555,7 +2571,7 @@ static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev, |
|
| 829 |
+ |
|
| 830 |
+ stats->rx_errors = 0; |
|
| 831 |
+ stats->tx_errors = 0; |
|
| 832 |
+-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)) |
|
| 833 |
++#ifndef NDO_GET_STATS_64_V2 |
|
| 834 |
+ return stats; |
|
| 835 |
+ #endif |
|
| 836 |
+ } |
|
| 837 |
+@@ -2685,13 +2701,6 @@ static int ena_device_validate_params(struct ena_adapter *adapter, |
|
| 838 |
+ return -EINVAL; |
|
| 839 |
+ } |
|
| 840 |
+ |
|
| 841 |
+- if ((get_feat_ctx->max_queues.max_cq_num < adapter->num_queues) || |
|
| 842 |
+- (get_feat_ctx->max_queues.max_sq_num < adapter->num_queues)) {
|
|
| 843 |
+- netif_err(adapter, drv, netdev, |
|
| 844 |
+- "Error, device doesn't support enough queues\n"); |
|
| 845 |
+- return -EINVAL; |
|
| 846 |
+- } |
|
| 847 |
+- |
|
| 848 |
+ if (get_feat_ctx->dev_attr.max_mtu < netdev->mtu) {
|
|
| 849 |
+ netif_err(adapter, drv, netdev, |
|
| 850 |
+ "Error, device max mtu is smaller than netdev MTU\n"); |
|
| 851 |
+@@ -2839,12 +2848,15 @@ static int ena_enable_msix_and_set_admin_interrupts(struct ena_adapter *adapter, |
|
| 852 |
+ return rc; |
|
| 853 |
+ } |
|
| 854 |
+ |
|
| 855 |
+-static void ena_destroy_device(struct ena_adapter *adapter) |
|
| 856 |
++static void ena_destroy_device(struct ena_adapter *adapter, bool graceful) |
|
| 857 |
+ {
|
|
| 858 |
+ struct net_device *netdev = adapter->netdev; |
|
| 859 |
+ struct ena_com_dev *ena_dev = adapter->ena_dev; |
|
| 860 |
+ bool dev_up; |
|
| 861 |
+ |
|
| 862 |
++ if (!test_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags)) |
|
| 863 |
++ return; |
|
| 864 |
++ |
|
| 865 |
+ netif_carrier_off(netdev); |
|
| 866 |
+ |
|
| 867 |
+ del_timer_sync(&adapter->timer_service); |
|
| 868 |
+@@ -2853,7 +2865,8 @@ static void ena_destroy_device(struct ena_adapter *adapter) |
|
| 869 |
+ adapter->dev_up_before_reset = dev_up; |
|
| 870 |
+ |
|
| 871 |
+ ena_sysfs_terminate(&adapter->pdev->dev); |
|
| 872 |
+- ena_com_set_admin_running_state(ena_dev, false); |
|
| 873 |
++ if (!graceful) |
|
| 874 |
++ ena_com_set_admin_running_state(ena_dev, false); |
|
| 875 |
+ |
|
| 876 |
+ if (test_bit(ENA_FLAG_DEV_UP, &adapter->flags)) |
|
| 877 |
+ ena_down(adapter); |
|
| 878 |
+@@ -2881,12 +2894,67 @@ static void ena_destroy_device(struct ena_adapter *adapter) |
|
| 879 |
+ adapter->reset_reason = ENA_REGS_RESET_NORMAL; |
|
| 880 |
+ |
|
| 881 |
+ clear_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 882 |
++ clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); |
|
| 883 |
++} |
|
| 884 |
++ |
|
| 885 |
++static int ena_handle_updated_queues(struct ena_adapter *adapter, |
|
| 886 |
++ struct ena_com_dev_get_features_ctx *get_feat_ctx) |
|
| 887 |
++{
|
|
| 888 |
++ struct ena_com_dev *ena_dev = adapter->ena_dev; |
|
| 889 |
++ struct pci_dev *pdev = adapter->pdev; |
|
| 890 |
++ struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 };
|
|
| 891 |
++ bool are_queues_changed = false; |
|
| 892 |
++ int io_queue_num, rc; |
|
| 893 |
++ |
|
| 894 |
++ calc_queue_ctx.ena_dev = ena_dev; |
|
| 895 |
++ calc_queue_ctx.get_feat_ctx = get_feat_ctx; |
|
| 896 |
++ calc_queue_ctx.pdev = pdev; |
|
| 897 |
++ |
|
| 898 |
++ io_queue_num = ena_calc_io_queue_num(pdev, ena_dev, get_feat_ctx); |
|
| 899 |
++ rc = ena_calc_queue_size(&calc_queue_ctx); |
|
| 900 |
++ if (unlikely(rc || (io_queue_num <= 0))) |
|
| 901 |
++ return -EFAULT; |
|
| 902 |
++ |
|
| 903 |
++ if (unlikely(adapter->tx_ring_size > calc_queue_ctx.tx_queue_size || |
|
| 904 |
++ adapter->rx_ring_size > calc_queue_ctx.rx_queue_size)) {
|
|
| 905 |
++ dev_err(&pdev->dev, |
|
| 906 |
++ "Not enough resources to allocate requested queue sizes (TX,RX)=(%d,%d), falling back to queue sizes (TX,RX)=(%d,%d)\n", |
|
| 907 |
++ adapter->tx_ring_size, |
|
| 908 |
++ adapter->rx_ring_size, |
|
| 909 |
++ calc_queue_ctx.tx_queue_size, |
|
| 910 |
++ calc_queue_ctx.rx_queue_size); |
|
| 911 |
++ adapter->tx_ring_size = calc_queue_ctx.tx_queue_size; |
|
| 912 |
++ adapter->rx_ring_size = calc_queue_ctx.rx_queue_size; |
|
| 913 |
++ adapter->max_tx_sgl_size = calc_queue_ctx.max_tx_sgl_size; |
|
| 914 |
++ adapter->max_rx_sgl_size = calc_queue_ctx.max_rx_sgl_size; |
|
| 915 |
++ are_queues_changed = true; |
|
| 916 |
++ } |
|
| 917 |
++ |
|
| 918 |
++ if (unlikely(adapter->num_queues > io_queue_num)) {
|
|
| 919 |
++ dev_err(&pdev->dev, |
|
| 920 |
++ "Not enough resources to allocate %d queues, falling back to %d queues\n", |
|
| 921 |
++ adapter->num_queues, io_queue_num); |
|
| 922 |
++ adapter->num_queues = io_queue_num; |
|
| 923 |
++ ena_com_rss_destroy(ena_dev); |
|
| 924 |
++ rc = ena_rss_init_default(adapter); |
|
| 925 |
++ if (unlikely(rc && (rc != -EOPNOTSUPP))) {
|
|
| 926 |
++ dev_err(&pdev->dev, "Cannot init RSS rc: %d\n", rc); |
|
| 927 |
++ return rc; |
|
| 928 |
++ } |
|
| 929 |
++ are_queues_changed = true; |
|
| 930 |
++ } |
|
| 931 |
++ |
|
| 932 |
++ if (unlikely(are_queues_changed)) |
|
| 933 |
++ ena_init_io_rings(adapter); |
|
| 934 |
++ |
|
| 935 |
++ return 0; |
|
| 936 |
+ } |
|
| 937 |
+ |
|
| 938 |
+ static int ena_restore_device(struct ena_adapter *adapter) |
|
| 939 |
+ {
|
|
| 940 |
+ struct ena_com_dev_get_features_ctx get_feat_ctx; |
|
| 941 |
+ struct ena_com_dev *ena_dev = adapter->ena_dev; |
|
| 942 |
++ struct net_device *netdev = adapter->netdev; |
|
| 943 |
+ struct pci_dev *pdev = adapter->pdev; |
|
| 944 |
+ bool wd_state; |
|
| 945 |
+ int rc; |
|
| 946 |
+@@ -2905,10 +2973,14 @@ static int ena_restore_device(struct ena_adapter *adapter) |
|
| 947 |
+ goto err_device_destroy; |
|
| 948 |
+ } |
|
| 949 |
+ |
|
| 950 |
++ rc = ena_handle_updated_queues(adapter, &get_feat_ctx); |
|
| 951 |
++ if (rc) |
|
| 952 |
++ goto err_device_destroy; |
|
| 953 |
++ |
|
| 954 |
+ clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags); |
|
| 955 |
+ /* Make sure we don't have a race with AENQ Links state handler */ |
|
| 956 |
+ if (test_bit(ENA_FLAG_LINK_UP, &adapter->flags)) |
|
| 957 |
+- netif_carrier_on(adapter->netdev); |
|
| 958 |
++ netif_carrier_on(netdev); |
|
| 959 |
+ |
|
| 960 |
+ rc = ena_enable_msix_and_set_admin_interrupts(adapter, |
|
| 961 |
+ adapter->num_queues); |
|
| 962 |
+@@ -2923,13 +2995,14 @@ static int ena_restore_device(struct ena_adapter *adapter) |
|
| 963 |
+ } |
|
| 964 |
+ /* If the interface was up before the reset bring it up */ |
|
| 965 |
+ if (adapter->dev_up_before_reset) {
|
|
| 966 |
+- rc = ena_up(adapter); |
|
| 967 |
++ rc = ena_open(netdev); |
|
| 968 |
+ if (rc) {
|
|
| 969 |
+ dev_err(&pdev->dev, "Failed to create I/O queues\n"); |
|
| 970 |
+ goto err_sysfs_terminate; |
|
| 971 |
+ } |
|
| 972 |
+ } |
|
| 973 |
+ |
|
| 974 |
++ set_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); |
|
| 975 |
+ mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); |
|
| 976 |
+ dev_err(&pdev->dev, "Device reset completed successfully\n"); |
|
| 977 |
+ |
|
| 978 |
+@@ -2962,7 +3035,7 @@ static void ena_fw_reset_device(struct work_struct *work) |
|
| 979 |
+ return; |
|
| 980 |
+ } |
|
| 981 |
+ rtnl_lock(); |
|
| 982 |
+- ena_destroy_device(adapter); |
|
| 983 |
++ ena_destroy_device(adapter, false); |
|
| 984 |
+ ena_restore_device(adapter); |
|
| 985 |
+ rtnl_unlock(); |
|
| 986 |
+ } |
|
| 987 |
+@@ -2979,19 +3052,20 @@ static int check_for_rx_interrupt_queue(struct ena_adapter *adapter, |
|
| 988 |
+ rx_ring->no_interrupt_event_cnt++; |
|
| 989 |
+ |
|
| 990 |
+ if (rx_ring->no_interrupt_event_cnt == ENA_MAX_NO_INTERRUPT_ITERATIONS) {
|
|
| 991 |
+- netif_err(adapter, rx_err, adapter->netdev, |
|
| 992 |
+- "Potential MSIX issue on Rx side Queue = %d. Reset the device\n", |
|
| 993 |
+- rx_ring->qid); |
|
| 994 |
+- adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; |
|
| 995 |
+- set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 996 |
+- return -EIO; |
|
| 997 |
++ netif_err(adapter, rx_err, adapter->netdev, |
|
| 998 |
++ "Potential MSIX issue on Rx side Queue = %d. Reset the device\n", |
|
| 999 |
++ rx_ring->qid); |
|
| 1000 |
++ adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; |
|
| 1001 |
++ smp_mb__before_atomic(); |
|
| 1002 |
++ set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 1003 |
++ return -EIO; |
|
| 1004 |
+ } |
|
| 1005 |
+ |
|
| 1006 |
+ return 0; |
|
| 1007 |
+ } |
|
| 1008 |
+ |
|
| 1009 |
+ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, |
|
| 1010 |
+- struct ena_ring *tx_ring) |
|
| 1011 |
++ struct ena_ring *tx_ring) |
|
| 1012 |
+ {
|
|
| 1013 |
+ struct ena_tx_buffer *tx_buf; |
|
| 1014 |
+ unsigned long last_jiffies; |
|
| 1015 |
+@@ -3007,14 +3081,17 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, |
|
| 1016 |
+ continue; |
|
| 1017 |
+ |
|
| 1018 |
+ if (unlikely(!tx_ring->first_interrupt && time_is_before_jiffies(last_jiffies + |
|
| 1019 |
+- 2 * adapter->missing_tx_completion_to))) {
|
|
| 1020 |
+- /* If after graceful period interrupt is still not received, we schedule a reset*/ |
|
| 1021 |
+- netif_err(adapter, tx_err, adapter->netdev, |
|
| 1022 |
+- "Potential MSIX issue on Tx side Queue = %d. Reset the device\n", |
|
| 1023 |
+- tx_ring->qid); |
|
| 1024 |
+- adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; |
|
| 1025 |
+- set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 1026 |
+- return -EIO; |
|
| 1027 |
++ 2 * adapter->missing_tx_completion_to))) {
|
|
| 1028 |
++ /* If after graceful period interrupt is still not |
|
| 1029 |
++ * received, we schedule a reset |
|
| 1030 |
++ */ |
|
| 1031 |
++ netif_err(adapter, tx_err, adapter->netdev, |
|
| 1032 |
++ "Potential MSIX issue on Tx side Queue = %d. Reset the device\n", |
|
| 1033 |
++ tx_ring->qid); |
|
| 1034 |
++ adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; |
|
| 1035 |
++ smp_mb__before_atomic(); |
|
| 1036 |
++ set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 1037 |
++ return -EIO; |
|
| 1038 |
+ } |
|
| 1039 |
+ |
|
| 1040 |
+ if (unlikely(time_is_before_jiffies(last_jiffies + |
|
| 1041 |
+@@ -3223,9 +3300,15 @@ static void ena_update_host_info(struct ena_admin_host_info *host_info, |
|
| 1042 |
+ (netdev->features & GENMASK_ULL(63, 32)) >> 32; |
|
| 1043 |
+ } |
|
| 1044 |
+ |
|
| 1045 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) |
|
| 1046 |
++static void ena_timer_service(struct timer_list *t) |
|
| 1047 |
++{
|
|
| 1048 |
++ struct ena_adapter *adapter = from_timer(adapter, t, timer_service); |
|
| 1049 |
++#else |
|
| 1050 |
+ static void ena_timer_service(unsigned long data) |
|
| 1051 |
+ {
|
|
| 1052 |
+ struct ena_adapter *adapter = (struct ena_adapter *)data; |
|
| 1053 |
++#endif |
|
| 1054 |
+ u8 *debug_area = adapter->ena_dev->host_attr.debug_area_virt_addr; |
|
| 1055 |
+ struct ena_admin_host_info *host_info = |
|
| 1056 |
+ adapter->ena_dev->host_attr.host_info; |
|
| 1057 |
+@@ -3260,28 +3343,28 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, |
|
| 1058 |
+ struct ena_com_dev *ena_dev, |
|
| 1059 |
+ struct ena_com_dev_get_features_ctx *get_feat_ctx) |
|
| 1060 |
+ {
|
|
| 1061 |
+- int io_sq_num, io_queue_num; |
|
| 1062 |
+- |
|
| 1063 |
+- /* In case of LLQ use the llq number in the get feature cmd */ |
|
| 1064 |
+- if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) {
|
|
| 1065 |
+- io_sq_num = get_feat_ctx->max_queues.max_llq_num; |
|
| 1066 |
++ int io_sq_num, io_cq_num, io_queue_num; |
|
| 1067 |
+ |
|
| 1068 |
+- if (io_sq_num == 0) {
|
|
| 1069 |
+- dev_err(&pdev->dev, |
|
| 1070 |
+- "Trying to use LLQ but llq_num is 0. Fall back into regular queues\n"); |
|
| 1071 |
++ /* Regular queues capabilities */ |
|
| 1072 |
++ if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) {
|
|
| 1073 |
++ struct ena_admin_queue_ext_feature_fields *max_queue_ext = |
|
| 1074 |
++ &get_feat_ctx->max_queue_ext.max_queue_ext; |
|
| 1075 |
++ io_sq_num = max_queue_ext->max_rx_sq_num; |
|
| 1076 |
++ io_sq_num = min_t(int, io_sq_num, max_queue_ext->max_tx_sq_num); |
|
| 1077 |
+ |
|
| 1078 |
+- ena_dev->tx_mem_queue_type = |
|
| 1079 |
+- ENA_ADMIN_PLACEMENT_POLICY_HOST; |
|
| 1080 |
+- io_sq_num = get_feat_ctx->max_queues.max_sq_num; |
|
| 1081 |
+- } |
|
| 1082 |
++ io_cq_num = max_queue_ext->max_rx_cq_num; |
|
| 1083 |
++ io_cq_num = min_t(int, io_cq_num, max_queue_ext->max_tx_cq_num); |
|
| 1084 |
+ } else {
|
|
| 1085 |
+- io_sq_num = get_feat_ctx->max_queues.max_sq_num; |
|
| 1086 |
++ struct ena_admin_queue_feature_desc *max_queues = |
|
| 1087 |
++ &get_feat_ctx->max_queues; |
|
| 1088 |
++ io_sq_num = max_queues->max_sq_num; |
|
| 1089 |
++ io_cq_num = max_queues->max_cq_num; |
|
| 1090 |
+ } |
|
| 1091 |
+ |
|
| 1092 |
+ io_queue_num = min_t(int, num_online_cpus(), ENA_MAX_NUM_IO_QUEUES); |
|
| 1093 |
+ io_queue_num = min_t(int, io_queue_num, io_sq_num); |
|
| 1094 |
+- io_queue_num = min_t(int, io_queue_num, |
|
| 1095 |
+- get_feat_ctx->max_queues.max_cq_num); |
|
| 1096 |
++ io_queue_num = min_t(int, io_queue_num, io_cq_num); |
|
| 1097 |
++ |
|
| 1098 |
+ /* 1 IRQ for for mgmnt and 1 IRQs for each IO direction */ |
|
| 1099 |
+ io_queue_num = min_t(int, io_queue_num, pci_msix_vec_count(pdev) - 1); |
|
| 1100 |
+ if (unlikely(!io_queue_num)) {
|
|
| 1101 |
+@@ -3295,15 +3378,8 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev, |
|
| 1102 |
+ static void ena_set_push_mode(struct pci_dev *pdev, struct ena_com_dev *ena_dev, |
|
| 1103 |
+ struct ena_com_dev_get_features_ctx *get_feat_ctx) |
|
| 1104 |
+ {
|
|
| 1105 |
+- bool has_mem_bar; |
|
| 1106 |
+- |
|
| 1107 |
+- has_mem_bar = pci_select_bars(pdev, IORESOURCE_MEM) & BIT(ENA_MEM_BAR); |
|
| 1108 |
+- |
|
| 1109 |
+- /* Enable push mode if device supports LLQ */ |
|
| 1110 |
+- if (has_mem_bar && (get_feat_ctx->max_queues.max_llq_num > 0)) |
|
| 1111 |
+- ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_DEV; |
|
| 1112 |
+- else |
|
| 1113 |
+- ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; |
|
| 1114 |
++ /* This driver version doesn't support LLQ */ |
|
| 1115 |
++ ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; |
|
| 1116 |
+ } |
|
| 1117 |
+ |
|
| 1118 |
+ static void ena_set_dev_offloads(struct ena_com_dev_get_features_ctx *feat, |
|
| 1119 |
+@@ -3442,36 +3518,51 @@ static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev) |
|
| 1120 |
+ pci_release_selected_regions(pdev, release_bars); |
|
| 1121 |
+ } |
|
| 1122 |
+ |
|
| 1123 |
+-static int ena_calc_queue_size(struct pci_dev *pdev, |
|
| 1124 |
+- struct ena_com_dev *ena_dev, |
|
| 1125 |
+- u16 *max_tx_sgl_size, |
|
| 1126 |
+- u16 *max_rx_sgl_size, |
|
| 1127 |
+- struct ena_com_dev_get_features_ctx *get_feat_ctx) |
|
| 1128 |
+-{
|
|
| 1129 |
+- u32 queue_size = ENA_DEFAULT_RING_SIZE; |
|
| 1130 |
+- |
|
| 1131 |
+- queue_size = min_t(u32, queue_size, |
|
| 1132 |
+- get_feat_ctx->max_queues.max_cq_depth); |
|
| 1133 |
+- queue_size = min_t(u32, queue_size, |
|
| 1134 |
+- get_feat_ctx->max_queues.max_sq_depth); |
|
| 1135 |
+- |
|
| 1136 |
+- if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) |
|
| 1137 |
+- queue_size = min_t(u32, queue_size, |
|
| 1138 |
+- get_feat_ctx->max_queues.max_llq_depth); |
|
| 1139 |
+- |
|
| 1140 |
+- queue_size = rounddown_pow_of_two(queue_size); |
|
| 1141 |
+- |
|
| 1142 |
+- if (unlikely(!queue_size)) {
|
|
| 1143 |
+- dev_err(&pdev->dev, "Invalid queue size\n"); |
|
| 1144 |
++static int ena_calc_queue_size(struct ena_calc_queue_size_ctx *ctx) |
|
| 1145 |
++{
|
|
| 1146 |
++ u32 tx_queue_size = ENA_DEFAULT_RING_SIZE; |
|
| 1147 |
++ |
|
| 1148 |
++ if (ctx->ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) {
|
|
| 1149 |
++ struct ena_admin_queue_ext_feature_fields *max_queue_ext = |
|
| 1150 |
++ &ctx->get_feat_ctx->max_queue_ext.max_queue_ext; |
|
| 1151 |
++ rx_queue_size = min_t(u32, rx_queue_size, |
|
| 1152 |
++ max_queue_ext->max_rx_cq_depth); |
|
| 1153 |
++ rx_queue_size = min_t(u32, rx_queue_size, |
|
| 1154 |
++ max_queue_ext->max_rx_sq_depth); |
|
| 1155 |
++ tx_queue_size = min_t(u32, tx_queue_size, |
|
| 1156 |
++ max_queue_ext->max_tx_cq_depth); |
|
| 1157 |
++ tx_queue_size = min_t(u32, tx_queue_size, |
|
| 1158 |
++ max_queue_ext->max_tx_sq_depth); |
|
| 1159 |
++ ctx->max_rx_sgl_size = min_t(u16, ENA_PKT_MAX_BUFS, |
|
| 1160 |
++ max_queue_ext->max_per_packet_rx_descs); |
|
| 1161 |
++ ctx->max_tx_sgl_size = min_t(u16, ENA_PKT_MAX_BUFS, |
|
| 1162 |
++ max_queue_ext->max_per_packet_tx_descs); |
|
| 1163 |
++ } else {
|
|
| 1164 |
++ struct ena_admin_queue_feature_desc *max_queues = |
|
| 1165 |
++ &ctx->get_feat_ctx->max_queues; |
|
| 1166 |
++ rx_queue_size = min_t(u32, rx_queue_size, |
|
| 1167 |
++ max_queues->max_cq_depth); |
|
| 1168 |
++ rx_queue_size = min_t(u32, rx_queue_size, |
|
| 1169 |
++ max_queues->max_sq_depth); |
|
| 1170 |
++ tx_queue_size = rx_queue_size; |
|
| 1171 |
++ ctx->max_tx_sgl_size = min_t(u16, ENA_PKT_MAX_BUFS, |
|
| 1172 |
++ max_queues->max_packet_tx_descs); |
|
| 1173 |
++ ctx->max_rx_sgl_size = min_t(u16, ENA_PKT_MAX_BUFS, |
|
| 1174 |
++ max_queues->max_packet_rx_descs); |
|
| 1175 |
++ } |
|
| 1176 |
++ |
|
| 1177 |
++ tx_queue_size = rounddown_pow_of_two(tx_queue_size); |
|
| 1178 |
++ rx_queue_size = rounddown_pow_of_two(rx_queue_size); |
|
| 1179 |
++ |
|
| 1180 |
++ if (unlikely(!rx_queue_size || !tx_queue_size)) {
|
|
| 1181 |
++ dev_err(&ctx->pdev->dev, "Invalid queue size\n"); |
|
| 1182 |
+ return -EFAULT; |
|
| 1183 |
+ } |
|
| 1184 |
+ |
|
| 1185 |
+- *max_tx_sgl_size = min_t(u16, ENA_PKT_MAX_BUFS, |
|
| 1186 |
+- get_feat_ctx->max_queues.max_packet_tx_descs); |
|
| 1187 |
+- *max_rx_sgl_size = min_t(u16, ENA_PKT_MAX_BUFS, |
|
| 1188 |
+- get_feat_ctx->max_queues.max_packet_rx_descs); |
|
| 1189 |
++ ctx->rx_queue_size = rx_queue_size; |
|
| 1190 |
++ ctx->tx_queue_size = tx_queue_size; |
|
| 1191 |
+ |
|
| 1192 |
+- return queue_size; |
|
| 1193 |
++ return 0; |
|
| 1194 |
+ } |
|
| 1195 |
+ |
|
| 1196 |
+ /* ena_probe - Device Initialization Routine |
|
| 1197 |
+@@ -3487,15 +3578,13 @@ static int ena_calc_queue_size(struct pci_dev *pdev, |
|
| 1198 |
+ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
|
| 1199 |
+ {
|
|
| 1200 |
+ struct ena_com_dev_get_features_ctx get_feat_ctx; |
|
| 1201 |
++ struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 };
|
|
| 1202 |
+ static int version_printed; |
|
| 1203 |
+ struct net_device *netdev; |
|
| 1204 |
+ struct ena_adapter *adapter; |
|
| 1205 |
+ struct ena_com_dev *ena_dev = NULL; |
|
| 1206 |
+ static int adapters_found; |
|
| 1207 |
+ int io_queue_num, bars, rc; |
|
| 1208 |
+- int queue_size; |
|
| 1209 |
+- u16 tx_sgl_size = 0; |
|
| 1210 |
+- u16 rx_sgl_size = 0; |
|
| 1211 |
+ bool wd_state; |
|
| 1212 |
+ |
|
| 1213 |
+ dev_dbg(&pdev->dev, "%s\n", __func__); |
|
| 1214 |
+@@ -3556,20 +3645,25 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
|
| 1215 |
+ } |
|
| 1216 |
+ } |
|
| 1217 |
+ |
|
| 1218 |
++ calc_queue_ctx.ena_dev = ena_dev; |
|
| 1219 |
++ calc_queue_ctx.get_feat_ctx = &get_feat_ctx; |
|
| 1220 |
++ calc_queue_ctx.pdev = pdev; |
|
| 1221 |
++ |
|
| 1222 |
+ /* initial Tx interrupt delay, Assumes 1 usec granularity. |
|
| 1223 |
+ * Updated during device initialization with the real granularity |
|
| 1224 |
+ */ |
|
| 1225 |
+ ena_dev->intr_moder_tx_interval = ENA_INTR_INITIAL_TX_INTERVAL_USECS; |
|
| 1226 |
+ io_queue_num = ena_calc_io_queue_num(pdev, ena_dev, &get_feat_ctx); |
|
| 1227 |
+- queue_size = ena_calc_queue_size(pdev, ena_dev, &tx_sgl_size, |
|
| 1228 |
+- &rx_sgl_size, &get_feat_ctx); |
|
| 1229 |
+- if ((queue_size <= 0) || (io_queue_num <= 0)) {
|
|
| 1230 |
++ rc = ena_calc_queue_size(&calc_queue_ctx); |
|
| 1231 |
++ if (rc || (io_queue_num <= 0)) {
|
|
| 1232 |
+ rc = -EFAULT; |
|
| 1233 |
+ goto err_device_destroy; |
|
| 1234 |
+ } |
|
| 1235 |
+ |
|
| 1236 |
+- dev_info(&pdev->dev, "creating %d io queues. queue size: %d\n", |
|
| 1237 |
+- io_queue_num, queue_size); |
|
| 1238 |
++ dev_info(&pdev->dev, "creating %d io queues. rx queue size: %d tx queue size %d\n", |
|
| 1239 |
++ io_queue_num, |
|
| 1240 |
++ calc_queue_ctx.rx_queue_size, |
|
| 1241 |
++ calc_queue_ctx.tx_queue_size); |
|
| 1242 |
+ |
|
| 1243 |
+ /* dev zeroed in init_etherdev */ |
|
| 1244 |
+ netdev = alloc_etherdev_mq(sizeof(struct ena_adapter), io_queue_num); |
|
| 1245 |
+@@ -3593,11 +3687,10 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
|
| 1246 |
+ adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); |
|
| 1247 |
+ adapter->reset_reason = ENA_REGS_RESET_NORMAL; |
|
| 1248 |
+ |
|
| 1249 |
+- adapter->tx_ring_size = queue_size; |
|
| 1250 |
+- adapter->rx_ring_size = queue_size; |
|
| 1251 |
+- |
|
| 1252 |
+- adapter->max_tx_sgl_size = tx_sgl_size; |
|
| 1253 |
+- adapter->max_rx_sgl_size = rx_sgl_size; |
|
| 1254 |
++ adapter->tx_ring_size = calc_queue_ctx.tx_queue_size; |
|
| 1255 |
++ adapter->rx_ring_size = calc_queue_ctx.rx_queue_size; |
|
| 1256 |
++ adapter->max_tx_sgl_size = calc_queue_ctx.max_tx_sgl_size; |
|
| 1257 |
++ adapter->max_rx_sgl_size = calc_queue_ctx.max_rx_sgl_size; |
|
| 1258 |
+ |
|
| 1259 |
+ adapter->num_queues = io_queue_num; |
|
| 1260 |
+ adapter->last_monitored_tx_qid = 0; |
|
| 1261 |
+@@ -3649,14 +3742,14 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
|
| 1262 |
+ |
|
| 1263 |
+ memcpy(adapter->netdev->perm_addr, adapter->mac_addr, netdev->addr_len); |
|
| 1264 |
+ |
|
| 1265 |
++ netif_carrier_off(netdev); |
|
| 1266 |
++ |
|
| 1267 |
+ rc = register_netdev(netdev); |
|
| 1268 |
+ if (rc) {
|
|
| 1269 |
+ dev_err(&pdev->dev, "Cannot register net device\n"); |
|
| 1270 |
+ goto err_rss; |
|
| 1271 |
+ } |
|
| 1272 |
+ |
|
| 1273 |
+- netif_carrier_off(netdev); |
|
| 1274 |
+- |
|
| 1275 |
+ INIT_WORK(&adapter->reset_task, ena_fw_reset_device); |
|
| 1276 |
+ |
|
| 1277 |
+ adapter->last_keep_alive_jiffies = jiffies; |
|
| 1278 |
+@@ -3666,8 +3759,12 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
|
| 1279 |
+ |
|
| 1280 |
+ ena_update_hints(adapter, &get_feat_ctx.hw_hints); |
|
| 1281 |
+ |
|
| 1282 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) |
|
| 1283 |
++ timer_setup(&adapter->timer_service, ena_timer_service, 0); |
|
| 1284 |
++#else |
|
| 1285 |
+ setup_timer(&adapter->timer_service, ena_timer_service, |
|
| 1286 |
+ (unsigned long)adapter); |
|
| 1287 |
++#endif |
|
| 1288 |
+ mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); |
|
| 1289 |
+ |
|
| 1290 |
+ dev_info(&pdev->dev, "%s found at mem %lx, mac addr %pM Queues %d\n", |
|
| 1291 |
+@@ -3707,34 +3804,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
|
| 1292 |
+ } |
|
| 1293 |
+ |
|
| 1294 |
+ /*****************************************************************************/ |
|
| 1295 |
+-#ifdef HAVE_SRIOV_CONFIGURE |
|
| 1296 |
+-static int ena_sriov_configure(struct pci_dev *dev, int numvfs) |
|
| 1297 |
+-{
|
|
| 1298 |
+- int rc; |
|
| 1299 |
+- |
|
| 1300 |
+- if (numvfs > 0) {
|
|
| 1301 |
+- rc = pci_enable_sriov(dev, numvfs); |
|
| 1302 |
+- if (rc != 0) {
|
|
| 1303 |
+- dev_err(&dev->dev, |
|
| 1304 |
+- "pci_enable_sriov failed to enable: %d vfs with the error: %d\n", |
|
| 1305 |
+- numvfs, rc); |
|
| 1306 |
+- return rc; |
|
| 1307 |
+- } |
|
| 1308 |
+- |
|
| 1309 |
+- return numvfs; |
|
| 1310 |
+- } |
|
| 1311 |
+- |
|
| 1312 |
+- if (numvfs == 0) {
|
|
| 1313 |
+- pci_disable_sriov(dev); |
|
| 1314 |
+- return 0; |
|
| 1315 |
+- } |
|
| 1316 |
+- |
|
| 1317 |
+- return -EINVAL; |
|
| 1318 |
+-} |
|
| 1319 |
+-#endif /* HAVE_SRIOV_CONFIGURE */ |
|
| 1320 |
+- |
|
| 1321 |
+-/*****************************************************************************/ |
|
| 1322 |
+-/*****************************************************************************/ |
|
| 1323 |
+ |
|
| 1324 |
+ /* ena_remove - Device Removal Routine |
|
| 1325 |
+ * @pdev: PCI device information struct |
|
| 1326 |
+@@ -3757,31 +3826,24 @@ static void ena_remove(struct pci_dev *pdev) |
|
| 1327 |
+ netdev->rx_cpu_rmap = NULL; |
|
| 1328 |
+ } |
|
| 1329 |
+ #endif /* CONFIG_RFS_ACCEL */ |
|
| 1330 |
+- |
|
| 1331 |
+- unregister_netdev(netdev); |
|
| 1332 |
+- ena_sysfs_terminate(&pdev->dev); |
|
| 1333 |
+ del_timer_sync(&adapter->timer_service); |
|
| 1334 |
+ |
|
| 1335 |
+ cancel_work_sync(&adapter->reset_task); |
|
| 1336 |
+ |
|
| 1337 |
+- /* Reset the device only if the device is running. */ |
|
| 1338 |
+- if (test_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags)) |
|
| 1339 |
+- ena_com_dev_reset(ena_dev, adapter->reset_reason); |
|
| 1340 |
++ unregister_netdev(netdev); |
|
| 1341 |
+ |
|
| 1342 |
+- ena_free_mgmnt_irq(adapter); |
|
| 1343 |
++ /* If the device is running then we want to make sure the device will be |
|
| 1344 |
++ * reset to make sure no more events will be issued by the device. |
|
| 1345 |
++ */ |
|
| 1346 |
++ if (test_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags)) |
|
| 1347 |
++ set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 1348 |
+ |
|
| 1349 |
+- ena_disable_msix(adapter); |
|
| 1350 |
++ rtnl_lock(); |
|
| 1351 |
++ ena_destroy_device(adapter, true); |
|
| 1352 |
++ rtnl_unlock(); |
|
| 1353 |
+ |
|
| 1354 |
+ free_netdev(netdev); |
|
| 1355 |
+ |
|
| 1356 |
+- ena_com_mmio_reg_read_request_destroy(ena_dev); |
|
| 1357 |
+- |
|
| 1358 |
+- ena_com_abort_admin_commands(ena_dev); |
|
| 1359 |
+- |
|
| 1360 |
+- ena_com_wait_for_abort_completion(ena_dev); |
|
| 1361 |
+- |
|
| 1362 |
+- ena_com_admin_destroy(ena_dev); |
|
| 1363 |
+- |
|
| 1364 |
+ ena_com_rss_destroy(ena_dev); |
|
| 1365 |
+ |
|
| 1366 |
+ ena_com_delete_debug_area(ena_dev); |
|
| 1367 |
+@@ -3816,7 +3878,7 @@ static int ena_suspend(struct pci_dev *pdev, pm_message_t state) |
|
| 1368 |
+ "ignoring device reset request as the device is being suspended\n"); |
|
| 1369 |
+ clear_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags); |
|
| 1370 |
+ } |
|
| 1371 |
+- ena_destroy_device(adapter); |
|
| 1372 |
++ ena_destroy_device(adapter, true); |
|
| 1373 |
+ rtnl_unlock(); |
|
| 1374 |
+ return 0; |
|
| 1375 |
+ } |
|
| 1376 |
+@@ -3850,9 +3912,9 @@ static struct pci_driver ena_pci_driver = {
|
|
| 1377 |
+ .suspend = ena_suspend, |
|
| 1378 |
+ .resume = ena_resume, |
|
| 1379 |
+ #endif |
|
| 1380 |
+-#ifdef HAVE_SRIOV_CONFIGURE |
|
| 1381 |
+- .sriov_configure = ena_sriov_configure, |
|
| 1382 |
+-#endif /* HAVE_SRIOV_CONFIGURE */ |
|
| 1383 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0) |
|
| 1384 |
++ .sriov_configure = pci_sriov_configure_simple, |
|
| 1385 |
++#endif |
|
| 1386 |
+ }; |
|
| 1387 |
+ |
|
| 1388 |
+ static int __init ena_init(void) |
|
| 1389 |
+diff --git a/drivers/amazon/net/ena/ena_netdev.h b/drivers/amazon/net/ena/ena_netdev.h |
|
| 1390 |
+index e806e05..f7048ca 100644 |
|
| 1391 |
+--- a/drivers/amazon/net/ena/ena_netdev.h |
|
| 1392 |
+@@ -46,7 +46,7 @@ |
|
| 1393 |
+ #include "ena_eth_com.h" |
|
| 1394 |
+ |
|
| 1395 |
+ #define DRV_MODULE_VER_MAJOR 1 |
|
| 1396 |
+-#define DRV_MODULE_VER_MINOR 5 |
|
| 1397 |
++#define DRV_MODULE_VER_MINOR 6 |
|
| 1398 |
+ #define DRV_MODULE_VER_SUBMINOR 0 |
|
| 1399 |
+ |
|
| 1400 |
+ #define DRV_MODULE_NAME "ena" |
|
| 1401 |
+@@ -97,10 +97,11 @@ |
|
| 1402 |
+ */ |
|
| 1403 |
+ #define ENA_TX_POLL_BUDGET_DIVIDER 4 |
|
| 1404 |
+ |
|
| 1405 |
+-/* Refill Rx queue when number of available descriptors is below |
|
| 1406 |
+- * QUEUE_SIZE / ENA_RX_REFILL_THRESH_DIVIDER |
|
| 1407 |
++/* Refill Rx queue when number of required descriptors is above |
|
| 1408 |
++ * QUEUE_SIZE / ENA_RX_REFILL_THRESH_DIVIDER or ENA_RX_REFILL_THRESH_PACKET |
|
| 1409 |
+ */ |
|
| 1410 |
+ #define ENA_RX_REFILL_THRESH_DIVIDER 8 |
|
| 1411 |
++#define ENA_RX_REFILL_THRESH_PACKET 256 |
|
| 1412 |
+ |
|
| 1413 |
+ /* Number of queues to check for missing queues per timer service */ |
|
| 1414 |
+ #define ENA_MONITORED_TX_QUEUES 4 |
|
| 1415 |
+@@ -147,6 +148,16 @@ struct ena_napi {
|
|
| 1416 |
+ u32 qid; |
|
| 1417 |
+ }; |
|
| 1418 |
+ |
|
| 1419 |
++struct ena_calc_queue_size_ctx {
|
|
| 1420 |
++ struct ena_com_dev_get_features_ctx *get_feat_ctx; |
|
| 1421 |
++ struct ena_com_dev *ena_dev; |
|
| 1422 |
++ struct pci_dev *pdev; |
|
| 1423 |
++ u16 rx_queue_size; |
|
| 1424 |
++ u16 tx_queue_size; |
|
| 1425 |
++ u16 max_tx_sgl_size; |
|
| 1426 |
++ u16 max_rx_sgl_size; |
|
| 1427 |
++}; |
|
| 1428 |
++ |
|
| 1429 |
+ struct ena_tx_buffer {
|
|
| 1430 |
+ struct sk_buff *skb; |
|
| 1431 |
+ /* num of ena desc for this specific skb |
|
| 1432 |
+@@ -481,4 +492,15 @@ static inline bool ena_bp_disable(struct ena_ring *rx_ring) |
|
| 1433 |
+ } |
|
| 1434 |
+ #endif /* ENA_BUSY_POLL_SUPPORT */ |
|
| 1435 |
+ |
|
| 1436 |
++/* The ENA buffer length fields is 16 bit long. So when PAGE_SIZE == 64kB the |
|
| 1437 |
++ * driver passas 0. |
|
| 1438 |
++ * Since the max packet size the ENA handles is ~9kB limit the buffer length to |
|
| 1439 |
++ * 16kB. |
|
| 1440 |
++ */ |
|
| 1441 |
++#if PAGE_SIZE > SZ_16K |
|
| 1442 |
++#define ENA_PAGE_SIZE SZ_16K |
|
| 1443 |
++#else |
|
| 1444 |
++#define ENA_PAGE_SIZE PAGE_SIZE |
|
| 1445 |
++#endif |
|
| 1446 |
++ |
|
| 1447 |
+ #endif /* !(ENA_H) */ |
|
| 1448 |
+diff --git a/drivers/amazon/net/ena/ena_sysfs.c b/drivers/amazon/net/ena/ena_sysfs.c |
|
| 1449 |
+index b8aa538..bea5637 100644 |
|
| 1450 |
+--- a/drivers/amazon/net/ena/ena_sysfs.c |
|
| 1451 |
+@@ -46,7 +46,6 @@ struct dev_ext_ena_attribute {
|
|
| 1452 |
+ |
|
| 1453 |
+ #define to_ext_attr(x) container_of(x, struct dev_ext_ena_attribute, attr) |
|
| 1454 |
+ |
|
| 1455 |
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) |
|
| 1456 |
+ static ssize_t ena_store_rx_copybreak(struct device *dev, |
|
| 1457 |
+ struct device_attribute *attr, |
|
| 1458 |
+ const char *buf, size_t len) |
|
| 1459 |
+@@ -85,7 +84,6 @@ static ssize_t ena_show_rx_copybreak(struct device *dev, |
|
| 1460 |
+ |
|
| 1461 |
+ static DEVICE_ATTR(rx_copybreak, S_IRUGO | S_IWUSR, ena_show_rx_copybreak, |
|
| 1462 |
+ ena_store_rx_copybreak); |
|
| 1463 |
+-#endif /* kernel version < 3.18 */ |
|
| 1464 |
+ |
|
| 1465 |
+ |
|
| 1466 |
+ /* adaptive interrupt moderation */ |
|
| 1467 |
+@@ -215,10 +213,8 @@ int ena_sysfs_init(struct device *dev) |
|
| 1468 |
+ struct ena_adapter *adapter = dev_get_drvdata(dev); |
|
| 1469 |
+ |
|
| 1470 |
+ |
|
| 1471 |
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) |
|
| 1472 |
+ if (device_create_file(dev, &dev_attr_rx_copybreak)) |
|
| 1473 |
+ dev_err(dev, "failed to create rx_copybreak sysfs entry"); |
|
| 1474 |
+-#endif |
|
| 1475 |
+ |
|
| 1476 |
+ if (ena_com_interrupt_moderation_supported(adapter->ena_dev)) {
|
|
| 1477 |
+ if (device_create_file(dev, |
|
| 1478 |
+@@ -253,9 +249,7 @@ void ena_sysfs_terminate(struct device *dev) |
|
| 1479 |
+ struct ena_adapter *adapter = dev_get_drvdata(dev); |
|
| 1480 |
+ int i; |
|
| 1481 |
+ |
|
| 1482 |
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) |
|
| 1483 |
+ device_remove_file(dev, &dev_attr_rx_copybreak); |
|
| 1484 |
+-#endif |
|
| 1485 |
+ if (ena_com_interrupt_moderation_supported(adapter->ena_dev)) {
|
|
| 1486 |
+ for (i = 0; i < ARRAY_SIZE(dev_attr_intr_moderation); i++) |
|
| 1487 |
+ sysfs_remove_file(&dev->kobj, |
|
| 1488 |
+diff --git a/drivers/amazon/net/ena/kcompat.h b/drivers/amazon/net/ena/kcompat.h |
|
| 1489 |
+index a945574..9766629 100644 |
|
| 1490 |
+--- a/drivers/amazon/net/ena/kcompat.h |
|
| 1491 |
+@@ -76,12 +76,16 @@ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
|
| 1492 |
+ #include <linux/sizes.h> |
|
| 1493 |
+ #endif |
|
| 1494 |
+ |
|
| 1495 |
++#ifndef SZ_256 |
|
| 1496 |
++#define SZ_256 0x0000100 |
|
| 1497 |
++#endif |
|
| 1498 |
++ |
|
| 1499 |
+ #ifndef SZ_4K |
|
| 1500 |
+ #define SZ_4K 0x00001000 |
|
| 1501 |
+ #endif |
|
| 1502 |
+ |
|
| 1503 |
+-#ifndef SZ_256 |
|
| 1504 |
+-#define SZ_256 0x0000100 |
|
| 1505 |
++#ifndef SZ_16K |
|
| 1506 |
++#define SZ_16K 0x00004000 |
|
| 1507 |
+ #endif |
|
| 1508 |
+ |
|
| 1509 |
+ #ifdef HAVE_POLL_CONTROLLER |
|
| 1510 |
+@@ -200,6 +204,12 @@ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
|
| 1511 |
+ #define HAVE_RHEL6_ETHTOOL_OPS_EXT_STRUCT |
|
| 1512 |
+ #endif /* RHEL >= 6.4 && RHEL < 7.0 */ |
|
| 1513 |
+ |
|
| 1514 |
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) || \ |
|
| 1515 |
++ (RHEL_RELEASE_CODE && \ |
|
| 1516 |
++ RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5))) |
|
| 1517 |
++#define NDO_GET_STATS_64_V2 |
|
| 1518 |
++#endif |
|
| 1519 |
++ |
|
| 1520 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) || \ |
|
| 1521 |
+ (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,5)) |
|
| 1522 |
+ #include <net/busy_poll.h> |
|
| 1523 |
+@@ -331,35 +341,30 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) |
|
| 1524 |
+ return index % n_rx_rings; |
|
| 1525 |
+ } |
|
| 1526 |
+ #endif |
|
| 1527 |
+-#else /* >= 3.8.0 */ |
|
| 1528 |
+-#ifndef HAVE_SRIOV_CONFIGURE |
|
| 1529 |
+-#define HAVE_SRIOV_CONFIGURE |
|
| 1530 |
+-#endif |
|
| 1531 |
+ #endif /* >= 3.8.0 */ |
|
| 1532 |
+ |
|
| 1533 |
+-/*****************************************************************************/ |
|
| 1534 |
+-#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) ) |
|
| 1535 |
+-#if RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,2)) |
|
| 1536 |
+-#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK |
|
| 1537 |
+-#endif |
|
| 1538 |
+-#endif |
|
| 1539 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) |
|
| 1540 |
++#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V2 |
|
| 1541 |
++#else |
|
| 1542 |
+ |
|
| 1543 |
+-/*****************************************************************************/ |
|
| 1544 |
+-#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) ) |
|
| 1545 |
+-#if ( SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0)) |
|
| 1546 |
+-#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK |
|
| 1547 |
++#if ((LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) && \ |
|
| 1548 |
++ RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,2))) || \ |
|
| 1549 |
++ (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) && \ |
|
| 1550 |
++ SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0)) || \ |
|
| 1551 |
++ (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))) |
|
| 1552 |
++#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V1 |
|
| 1553 |
+ #endif |
|
| 1554 |
+-#endif /* >= 3.12.0 */ |
|
| 1555 |
+ |
|
| 1556 |
+-/*****************************************************************************/ |
|
| 1557 |
+-#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) ) |
|
| 1558 |
+-#if (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,24)) |
|
| 1559 |
+-#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK |
|
| 1560 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) |
|
| 1561 |
++#if UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,24) |
|
| 1562 |
++#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK_V1 |
|
| 1563 |
+ #else |
|
| 1564 |
+ #define HAVE_NDO_SELECT_QUEUE_ACCEL |
|
| 1565 |
+ #endif |
|
| 1566 |
+-#else |
|
| 1567 |
++#endif /* >= 3.13 */ |
|
| 1568 |
++#endif /* < 4.19 */ |
|
| 1569 |
+ |
|
| 1570 |
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) |
|
| 1571 |
+ #if BITS_PER_LONG == 32 && defined(CONFIG_SMP) |
|
| 1572 |
+ # define u64_stats_init(syncp) seqcount_init(syncp.seq) |
|
| 1573 |
+ #else |
|
| 1574 |
+@@ -369,15 +374,22 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) |
|
| 1575 |
+ #if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0)) && \ |
|
| 1576 |
+ !(RHEL_RELEASE_CODE && ((RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,8) && \ |
|
| 1577 |
+ (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0))) \ |
|
| 1578 |
+- || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,1)))) |
|
| 1579 |
++ || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,1)))) && \ |
|
| 1580 |
++ !defined(UEK3_RELEASE) |
|
| 1581 |
+ static inline void reinit_completion(struct completion *x) |
|
| 1582 |
+ {
|
|
| 1583 |
+ x->done = 0; |
|
| 1584 |
+ } |
|
| 1585 |
+ #endif /* SLE 12 */ |
|
| 1586 |
+ |
|
| 1587 |
+-#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,0)) && \ |
|
| 1588 |
+- !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0))) |
|
| 1589 |
++#endif /* < 3.13.0 */ |
|
| 1590 |
++ |
|
| 1591 |
++#if (( LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) ) && \ |
|
| 1592 |
++ (!(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,0) && \ |
|
| 1593 |
++ RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(7,0))) \ |
|
| 1594 |
++ && !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0))&& \ |
|
| 1595 |
++ !defined(UEK3_RELEASE))) || \ |
|
| 1596 |
++ (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE < UBUNTU_VERSION(3,13,0,30)) |
|
| 1597 |
+ static inline int pci_enable_msix_range(struct pci_dev *dev, |
|
| 1598 |
+ struct msix_entry *entries, |
|
| 1599 |
+ int minvec, |
|
| 1600 |
+@@ -404,12 +416,20 @@ static inline int pci_enable_msix_range(struct pci_dev *dev, |
|
| 1601 |
+ } |
|
| 1602 |
+ #endif |
|
| 1603 |
+ |
|
| 1604 |
+-#endif /* >= 3.13.0 */ |
|
| 1605 |
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && \ |
|
| 1606 |
++ !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,1)) |
|
| 1607 |
++static inline void *devm_kcalloc(struct device *dev, |
|
| 1608 |
++ size_t n, size_t size, gfp_t flags) |
|
| 1609 |
++{
|
|
| 1610 |
++ return devm_kzalloc(dev, n * size, flags | __GFP_ZERO); |
|
| 1611 |
++} |
|
| 1612 |
++#endif |
|
| 1613 |
+ |
|
| 1614 |
+ /*****************************************************************************/ |
|
| 1615 |
+ #if (( LINUX_VERSION_CODE < KERNEL_VERSION(3,13,8) ) && \ |
|
| 1616 |
+- !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,4)) && \ |
|
| 1617 |
+- !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0))) |
|
| 1618 |
++ !RHEL_RELEASE_CODE && \ |
|
| 1619 |
++ !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0))) || \ |
|
| 1620 |
++ (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE < UBUNTU_VERSION(3,13,0,30)) |
|
| 1621 |
+ enum pkt_hash_types {
|
|
| 1622 |
+ PKT_HASH_TYPE_NONE, /* Undefined type */ |
|
| 1623 |
+ PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */ |
|
| 1624 |
+@@ -426,14 +446,10 @@ static inline void skb_set_hash(struct sk_buff *skb, __u32 hash, |
|
| 1625 |
+ #endif |
|
| 1626 |
+ |
|
| 1627 |
+ /*****************************************************************************/ |
|
| 1628 |
+-#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) ) |
|
| 1629 |
+-/* for ndo_dfwd_ ops add_station, del_station and _start_xmit */ |
|
| 1630 |
+-#define HAVE_NDO_SELECT_QUEUE_ACCEL_FALLBACK |
|
| 1631 |
+-#else |
|
| 1632 |
+-#if !(RHEL_RELEASE_CODE && ((RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,4) \ |
|
| 1633 |
+- && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,1)) \ |
|
| 1634 |
+- || RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0))) && \ |
|
| 1635 |
+- !(UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,105)) |
|
| 1636 |
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) |
|
| 1637 |
++#if !(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(7,0) && \ |
|
| 1638 |
++ RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(6,6)) \ |
|
| 1639 |
++ && !(UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,105)) |
|
| 1640 |
+ static inline int pci_msix_vec_count(struct pci_dev *dev) |
|
| 1641 |
+ {
|
|
| 1642 |
+ int pos; |
|
| 1643 |
+@@ -461,11 +477,10 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src) |
|
| 1644 |
+ #endif |
|
| 1645 |
+ |
|
| 1646 |
+ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) || \ |
|
| 1647 |
+- (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE > UBUNTU_VERSION(3,13,0,24))) || \ |
|
| 1648 |
++ (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,30))) || \ |
|
| 1649 |
+ (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0)) || \ |
|
| 1650 |
+- (RHEL_RELEASE_CODE && ((RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,4) \ |
|
| 1651 |
+- && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,2)) \ |
|
| 1652 |
+- || RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0))) |
|
| 1653 |
++ (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(7,0) \ |
|
| 1654 |
++ && RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(7,1)) |
|
| 1655 |
+ #else |
|
| 1656 |
+ static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp, |
|
| 1657 |
+ unsigned int start) |
|
| 1658 |
+@@ -480,6 +495,13 @@ static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync |
|
| 1659 |
+ |
|
| 1660 |
+ #endif |
|
| 1661 |
+ |
|
| 1662 |
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) && \ |
|
| 1663 |
++ !(RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,1)))) |
|
| 1664 |
++ |
|
| 1665 |
++#define smp_mb__before_atomic() smp_mb() |
|
| 1666 |
++ |
|
| 1667 |
++#endif |
|
| 1668 |
++ |
|
| 1669 |
+ /*****************************************************************************/ |
|
| 1670 |
+ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) ) |
|
| 1671 |
+ #undef GENMASK |
|
| 1672 |
+@@ -489,11 +511,21 @@ static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync |
|
| 1673 |
+ #endif |
|
| 1674 |
+ /*****************************************************************************/ |
|
| 1675 |
+ |
|
| 1676 |
++#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) ) |
|
| 1677 |
++ |
|
| 1678 |
++#ifndef dma_rmb |
|
| 1679 |
++#define dma_rmb rmb |
|
| 1680 |
++#endif |
|
| 1681 |
++ |
|
| 1682 |
++#ifndef writel_relaxed |
|
| 1683 |
++#define writel_relaxed writel |
|
| 1684 |
++#endif |
|
| 1685 |
++ |
|
| 1686 |
++#endif |
|
| 1687 |
++ |
|
| 1688 |
+ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) ) \ |
|
| 1689 |
+ || (SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(12,0,0)) \ |
|
| 1690 |
+- || (RHEL_RELEASE_CODE && ((RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,4) \ |
|
| 1691 |
+- && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,1)) \ |
|
| 1692 |
+- || RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0))) |
|
| 1693 |
++ || (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE != RHEL_RELEASE_VERSION(7,0)) |
|
| 1694 |
+ #else |
|
| 1695 |
+ static inline void netdev_rss_key_fill(void *buffer, size_t len) |
|
| 1696 |
+ {
|
|
| 1697 |
+@@ -536,7 +568,8 @@ static inline void napi_complete_done(struct napi_struct *n, int work_done) |
|
| 1698 |
+ |
|
| 1699 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) \ |
|
| 1700 |
+ || (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE >= UBUNTU_VERSION(3,13,0,126)) && \ |
|
| 1701 |
+- (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE < UBUNTU_VERSION(3,14,0,0)) |
|
| 1702 |
++ (UBUNTU_VERSION_CODE && UBUNTU_VERSION_CODE < UBUNTU_VERSION(3,14,0,0)) \ |
|
| 1703 |
++ || (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5)) |
|
| 1704 |
+ |
|
| 1705 |
+ #else |
|
| 1706 |
+ |
|
| 1707 |
+@@ -567,4 +600,9 @@ static inline void __iomem *devm_ioremap_wc(struct device *dev, |
|
| 1708 |
+ } |
|
| 1709 |
+ #endif |
|
| 1710 |
+ |
|
| 1711 |
++#if RHEL_RELEASE_CODE && \ |
|
| 1712 |
++ RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(7,5) |
|
| 1713 |
++#define ndo_change_mtu ndo_change_mtu_rh74 |
|
| 1714 |
++#endif |
|
| 1715 |
++ |
|
| 1716 |
+ #endif /* _KCOMPAT_H_ */ |
|
| 1717 |
+-- |
|
| 1718 |
+2.7.4 |
|
| 1719 |
+ |
| ... | ... |
@@ -1,6 +1,10 @@ |
| 1 | 1 |
# |
| 2 | 2 |
# Automatically generated file; DO NOT EDIT. |
| 3 |
-# Linux/x86 4.14.67 Kernel Configuration |
|
| 3 |
+# Linux/x86 4.18.9 Kernel Configuration |
|
| 4 |
+# |
|
| 5 |
+ |
|
| 6 |
+# |
|
| 7 |
+# Compiler: gcc (GCC) 7.3.0 |
|
| 4 | 8 |
# |
| 5 | 9 |
CONFIG_64BIT=y |
| 6 | 10 |
CONFIG_X86_64=y |
| ... | ... |
@@ -15,8 +19,6 @@ CONFIG_ARCH_MMAP_RND_BITS_MIN=28 |
| 15 | 15 |
CONFIG_ARCH_MMAP_RND_BITS_MAX=32 |
| 16 | 16 |
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 |
| 17 | 17 |
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 |
| 18 |
-CONFIG_NEED_DMA_MAP_STATE=y |
|
| 19 |
-CONFIG_NEED_SG_DMA_LENGTH=y |
|
| 20 | 18 |
CONFIG_GENERIC_ISA_DMA=y |
| 21 | 19 |
CONFIG_GENERIC_BUG=y |
| 22 | 20 |
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y |
| ... | ... |
@@ -26,6 +28,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
| 26 | 26 |
CONFIG_GENERIC_CALIBRATE_DELAY=y |
| 27 | 27 |
CONFIG_ARCH_HAS_CPU_RELAX=y |
| 28 | 28 |
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y |
| 29 |
+CONFIG_ARCH_HAS_FILTER_PGPROT=y |
|
| 29 | 30 |
CONFIG_HAVE_SETUP_PER_CPU_AREA=y |
| 30 | 31 |
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y |
| 31 | 32 |
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y |
| ... | ... |
@@ -41,8 +44,11 @@ CONFIG_HAVE_INTEL_TXT=y |
| 41 | 41 |
CONFIG_X86_64_SMP=y |
| 42 | 42 |
CONFIG_ARCH_SUPPORTS_UPROBES=y |
| 43 | 43 |
CONFIG_FIX_EARLYCON_MEM=y |
| 44 |
+CONFIG_DYNAMIC_PHYSICAL_MASK=y |
|
| 44 | 45 |
CONFIG_PGTABLE_LEVELS=4 |
| 45 |
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
|
| 46 |
+CONFIG_CC_IS_GCC=y |
|
| 47 |
+CONFIG_GCC_VERSION=70300 |
|
| 48 |
+CONFIG_CLANG_VERSION=0 |
|
| 46 | 49 |
CONFIG_IRQ_WORK=y |
| 47 | 50 |
CONFIG_BUILDTIME_EXTABLE_SORT=y |
| 48 | 51 |
CONFIG_THREAD_INFO_IN_TASK=y |
| ... | ... |
@@ -51,7 +57,6 @@ CONFIG_THREAD_INFO_IN_TASK=y |
| 51 | 51 |
# General setup |
| 52 | 52 |
# |
| 53 | 53 |
CONFIG_INIT_ENV_ARG_LIMIT=32 |
| 54 |
-CONFIG_CROSS_COMPILE="" |
|
| 55 | 54 |
# CONFIG_COMPILE_TEST is not set |
| 56 | 55 |
CONFIG_LOCALVERSION="-aws" |
| 57 | 56 |
# CONFIG_LOCALVERSION_AUTO is not set |
| ... | ... |
@@ -74,7 +79,6 @@ CONFIG_SYSVIPC_SYSCTL=y |
| 74 | 74 |
CONFIG_POSIX_MQUEUE=y |
| 75 | 75 |
CONFIG_POSIX_MQUEUE_SYSCTL=y |
| 76 | 76 |
# CONFIG_CROSS_MEMORY_ATTACH is not set |
| 77 |
-CONFIG_FHANDLE=y |
|
| 78 | 77 |
CONFIG_USELIB=y |
| 79 | 78 |
CONFIG_AUDIT=y |
| 80 | 79 |
CONFIG_HAVE_ARCH_AUDITSYSCALL=y |
| ... | ... |
@@ -94,7 +98,8 @@ CONFIG_IRQ_DOMAIN=y |
| 94 | 94 |
CONFIG_IRQ_DOMAIN_HIERARCHY=y |
| 95 | 95 |
CONFIG_GENERIC_MSI_IRQ=y |
| 96 | 96 |
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y |
| 97 |
-# CONFIG_IRQ_DOMAIN_DEBUG is not set |
|
| 97 |
+CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y |
|
| 98 |
+CONFIG_GENERIC_IRQ_RESERVATION_MODE=y |
|
| 98 | 99 |
CONFIG_IRQ_FORCED_THREADING=y |
| 99 | 100 |
CONFIG_SPARSE_IRQ=y |
| 100 | 101 |
# CONFIG_GENERIC_IRQ_DEBUGFS is not set |
| ... | ... |
@@ -130,6 +135,7 @@ CONFIG_TASKSTATS=y |
| 130 | 130 |
CONFIG_TASK_DELAY_ACCT=y |
| 131 | 131 |
CONFIG_TASK_XACCT=y |
| 132 | 132 |
CONFIG_TASK_IO_ACCOUNTING=y |
| 133 |
+CONFIG_CPU_ISOLATION=y |
|
| 133 | 134 |
|
| 134 | 135 |
# |
| 135 | 136 |
# RCU Subsystem |
| ... | ... |
@@ -138,7 +144,6 @@ CONFIG_TREE_RCU=y |
| 138 | 138 |
# CONFIG_RCU_EXPERT is not set |
| 139 | 139 |
CONFIG_SRCU=y |
| 140 | 140 |
CONFIG_TREE_SRCU=y |
| 141 |
-# CONFIG_TASKS_RCU is not set |
|
| 142 | 141 |
CONFIG_RCU_STALL_COMMON=y |
| 143 | 142 |
CONFIG_RCU_NEED_SEGCBLIST=y |
| 144 | 143 |
CONFIG_BUILD_BIN2C=y |
| ... | ... |
@@ -176,7 +181,6 @@ CONFIG_CGROUP_CPUACCT=y |
| 176 | 176 |
CONFIG_CGROUP_PERF=y |
| 177 | 177 |
# CONFIG_CGROUP_DEBUG is not set |
| 178 | 178 |
CONFIG_SOCK_CGROUP_DATA=y |
| 179 |
-# CONFIG_CHECKPOINT_RESTORE is not set |
|
| 180 | 179 |
CONFIG_NAMESPACES=y |
| 181 | 180 |
CONFIG_UTS_NS=y |
| 182 | 181 |
CONFIG_IPC_NS=y |
| ... | ... |
@@ -208,11 +212,8 @@ CONFIG_MULTIUSER=y |
| 208 | 208 |
CONFIG_SGETMASK_SYSCALL=y |
| 209 | 209 |
CONFIG_SYSFS_SYSCALL=y |
| 210 | 210 |
# CONFIG_SYSCTL_SYSCALL is not set |
| 211 |
+CONFIG_FHANDLE=y |
|
| 211 | 212 |
CONFIG_POSIX_TIMERS=y |
| 212 |
-CONFIG_KALLSYMS=y |
|
| 213 |
-CONFIG_KALLSYMS_ALL=y |
|
| 214 |
-CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y |
|
| 215 |
-CONFIG_KALLSYMS_BASE_RELATIVE=y |
|
| 216 | 213 |
CONFIG_PRINTK=y |
| 217 | 214 |
CONFIG_PRINTK_NMI=y |
| 218 | 215 |
CONFIG_BUG=y |
| ... | ... |
@@ -225,13 +226,20 @@ CONFIG_EPOLL=y |
| 225 | 225 |
CONFIG_SIGNALFD=y |
| 226 | 226 |
CONFIG_TIMERFD=y |
| 227 | 227 |
CONFIG_EVENTFD=y |
| 228 |
-# CONFIG_BPF_SYSCALL is not set |
|
| 229 | 228 |
CONFIG_SHMEM=y |
| 230 | 229 |
CONFIG_AIO=y |
| 231 | 230 |
CONFIG_ADVISE_SYSCALLS=y |
| 232 |
-# CONFIG_USERFAULTFD is not set |
|
| 233 |
-CONFIG_PCI_QUIRKS=y |
|
| 234 | 231 |
CONFIG_MEMBARRIER=y |
| 232 |
+# CONFIG_CHECKPOINT_RESTORE is not set |
|
| 233 |
+CONFIG_KALLSYMS=y |
|
| 234 |
+CONFIG_KALLSYMS_ALL=y |
|
| 235 |
+CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y |
|
| 236 |
+CONFIG_KALLSYMS_BASE_RELATIVE=y |
|
| 237 |
+# CONFIG_BPF_SYSCALL is not set |
|
| 238 |
+# CONFIG_USERFAULTFD is not set |
|
| 239 |
+CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y |
|
| 240 |
+CONFIG_RSEQ=y |
|
| 241 |
+# CONFIG_DEBUG_RSEQ is not set |
|
| 235 | 242 |
# CONFIG_EMBEDDED is not set |
| 236 | 243 |
CONFIG_HAVE_PERF_EVENTS=y |
| 237 | 244 |
# CONFIG_PC104 is not set |
| ... | ... |
@@ -267,7 +275,6 @@ CONFIG_JUMP_LABEL=y |
| 267 | 267 |
# CONFIG_STATIC_KEYS_SELFTEST is not set |
| 268 | 268 |
CONFIG_OPTPROBES=y |
| 269 | 269 |
CONFIG_UPROBES=y |
| 270 |
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set |
|
| 271 | 270 |
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y |
| 272 | 271 |
CONFIG_ARCH_USE_BUILTIN_BSWAP=y |
| 273 | 272 |
CONFIG_KRETPROBES=y |
| ... | ... |
@@ -277,16 +284,18 @@ CONFIG_HAVE_KPROBES=y |
| 277 | 277 |
CONFIG_HAVE_KRETPROBES=y |
| 278 | 278 |
CONFIG_HAVE_OPTPROBES=y |
| 279 | 279 |
CONFIG_HAVE_KPROBES_ON_FTRACE=y |
| 280 |
+CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y |
|
| 280 | 281 |
CONFIG_HAVE_NMI=y |
| 281 | 282 |
CONFIG_HAVE_ARCH_TRACEHOOK=y |
| 282 | 283 |
CONFIG_HAVE_DMA_CONTIGUOUS=y |
| 283 | 284 |
CONFIG_GENERIC_SMP_IDLE_THREAD=y |
| 284 | 285 |
CONFIG_ARCH_HAS_FORTIFY_SOURCE=y |
| 285 | 286 |
CONFIG_ARCH_HAS_SET_MEMORY=y |
| 287 |
+CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y |
|
| 286 | 288 |
CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y |
| 287 | 289 |
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y |
| 290 |
+CONFIG_HAVE_RSEQ=y |
|
| 288 | 291 |
CONFIG_HAVE_CLK=y |
| 289 |
-CONFIG_HAVE_DMA_API_DEBUG=y |
|
| 290 | 292 |
CONFIG_HAVE_HW_BREAKPOINT=y |
| 291 | 293 |
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y |
| 292 | 294 |
CONFIG_HAVE_USER_RETURN_NOTIFIER=y |
| ... | ... |
@@ -296,6 +305,7 @@ CONFIG_HAVE_PERF_REGS=y |
| 296 | 296 |
CONFIG_HAVE_PERF_USER_STACK_DUMP=y |
| 297 | 297 |
CONFIG_HAVE_ARCH_JUMP_LABEL=y |
| 298 | 298 |
CONFIG_HAVE_RCU_TABLE_FREE=y |
| 299 |
+CONFIG_HAVE_RCU_TABLE_INVALIDATE=y |
|
| 299 | 300 |
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y |
| 300 | 301 |
CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y |
| 301 | 302 |
CONFIG_HAVE_CMPXCHG_LOCAL=y |
| ... | ... |
@@ -304,14 +314,13 @@ CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y |
| 304 | 304 |
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y |
| 305 | 305 |
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y |
| 306 | 306 |
CONFIG_SECCOMP_FILTER=y |
| 307 |
+CONFIG_PLUGIN_HOSTCC="g++" |
|
| 307 | 308 |
CONFIG_HAVE_GCC_PLUGINS=y |
| 308 | 309 |
# CONFIG_GCC_PLUGINS is not set |
| 309 |
-CONFIG_HAVE_CC_STACKPROTECTOR=y |
|
| 310 |
-CONFIG_CC_STACKPROTECTOR=y |
|
| 311 |
-# CONFIG_CC_STACKPROTECTOR_NONE is not set |
|
| 312 |
-CONFIG_CC_STACKPROTECTOR_REGULAR=y |
|
| 313 |
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set |
|
| 314 |
-CONFIG_THIN_ARCHIVES=y |
|
| 310 |
+CONFIG_HAVE_STACKPROTECTOR=y |
|
| 311 |
+CONFIG_CC_HAS_STACKPROTECTOR_NONE=y |
|
| 312 |
+CONFIG_STACKPROTECTOR=y |
|
| 313 |
+# CONFIG_STACKPROTECTOR_STRONG is not set |
|
| 315 | 314 |
CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y |
| 316 | 315 |
CONFIG_HAVE_CONTEXT_TRACKING=y |
| 317 | 316 |
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y |
| ... | ... |
@@ -333,15 +342,11 @@ CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y |
| 333 | 333 |
CONFIG_HAVE_COPY_THREAD_TLS=y |
| 334 | 334 |
CONFIG_HAVE_STACK_VALIDATION=y |
| 335 | 335 |
CONFIG_HAVE_RELIABLE_STACKTRACE=y |
| 336 |
-# CONFIG_HAVE_ARCH_HASH is not set |
|
| 337 |
-# CONFIG_ISA_BUS_API is not set |
|
| 338 | 336 |
CONFIG_OLD_SIGSUSPEND3=y |
| 339 | 337 |
CONFIG_COMPAT_OLD_SIGACTION=y |
| 340 |
-# CONFIG_CPU_NO_EFFICIENT_FFS is not set |
|
| 338 |
+CONFIG_COMPAT_32BIT_TIME=y |
|
| 341 | 339 |
CONFIG_HAVE_ARCH_VMAP_STACK=y |
| 342 | 340 |
CONFIG_VMAP_STACK=y |
| 343 |
-# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set |
|
| 344 |
-# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set |
|
| 345 | 341 |
CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y |
| 346 | 342 |
CONFIG_STRICT_KERNEL_RWX=y |
| 347 | 343 |
CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y |
| ... | ... |
@@ -354,8 +359,6 @@ CONFIG_ARCH_HAS_REFCOUNT=y |
| 354 | 354 |
# |
| 355 | 355 |
# CONFIG_GCOV_KERNEL is not set |
| 356 | 356 |
CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y |
| 357 |
-# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set |
|
| 358 |
-CONFIG_SLABINFO=y |
|
| 359 | 357 |
CONFIG_RT_MUTEXES=y |
| 360 | 358 |
CONFIG_BASE_SMALL=0 |
| 361 | 359 |
CONFIG_MODULES=y |
| ... | ... |
@@ -448,6 +451,9 @@ CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y |
| 448 | 448 |
CONFIG_QUEUED_SPINLOCKS=y |
| 449 | 449 |
CONFIG_ARCH_USE_QUEUED_RWLOCKS=y |
| 450 | 450 |
CONFIG_QUEUED_RWLOCKS=y |
| 451 |
+CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y |
|
| 452 |
+CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y |
|
| 453 |
+CONFIG_CC_HAS_SANE_STACKPROTECTOR=y |
|
| 451 | 454 |
CONFIG_FREEZER=y |
| 452 | 455 |
|
| 453 | 456 |
# |
| ... | ... |
@@ -456,7 +462,6 @@ CONFIG_FREEZER=y |
| 456 | 456 |
CONFIG_ZONE_DMA=y |
| 457 | 457 |
CONFIG_SMP=y |
| 458 | 458 |
CONFIG_X86_FEATURE_NAMES=y |
| 459 |
-CONFIG_X86_FAST_FEATURE_TESTS=y |
|
| 460 | 459 |
CONFIG_X86_X2APIC=y |
| 461 | 460 |
CONFIG_X86_MPPARSE=y |
| 462 | 461 |
# CONFIG_GOLDFISH is not set |
| ... | ... |
@@ -488,6 +493,7 @@ CONFIG_KVM_GUEST=y |
| 488 | 488 |
# CONFIG_KVM_DEBUG_FS is not set |
| 489 | 489 |
CONFIG_PARAVIRT_TIME_ACCOUNTING=y |
| 490 | 490 |
CONFIG_PARAVIRT_CLOCK=y |
| 491 |
+# CONFIG_JAILHOUSE_GUEST is not set |
|
| 491 | 492 |
CONFIG_NO_BOOTMEM=y |
| 492 | 493 |
# CONFIG_MK8 is not set |
| 493 | 494 |
# CONFIG_MPSC is not set |
| ... | ... |
@@ -510,9 +516,10 @@ CONFIG_HPET_EMULATE_RTC=y |
| 510 | 510 |
CONFIG_DMI=y |
| 511 | 511 |
CONFIG_GART_IOMMU=y |
| 512 | 512 |
# CONFIG_CALGARY_IOMMU is not set |
| 513 |
-CONFIG_SWIOTLB=y |
|
| 514 |
-CONFIG_IOMMU_HELPER=y |
|
| 515 | 513 |
CONFIG_MAXSMP=y |
| 514 |
+CONFIG_NR_CPUS_RANGE_BEGIN=8192 |
|
| 515 |
+CONFIG_NR_CPUS_RANGE_END=8192 |
|
| 516 |
+CONFIG_NR_CPUS_DEFAULT=8192 |
|
| 516 | 517 |
CONFIG_NR_CPUS=8192 |
| 517 | 518 |
CONFIG_SCHED_SMT=y |
| 518 | 519 |
CONFIG_SCHED_MC=y |
| ... | ... |
@@ -538,7 +545,6 @@ CONFIG_PERF_EVENTS_INTEL_UNCORE=y |
| 538 | 538 |
# CONFIG_PERF_EVENTS_INTEL_RAPL is not set |
| 539 | 539 |
# CONFIG_PERF_EVENTS_INTEL_CSTATE is not set |
| 540 | 540 |
# CONFIG_PERF_EVENTS_AMD_POWER is not set |
| 541 |
-# CONFIG_VM86 is not set |
|
| 542 | 541 |
CONFIG_X86_VSYSCALL_EMULATION=y |
| 543 | 542 |
CONFIG_I8K=m |
| 544 | 543 |
CONFIG_MICROCODE=y |
| ... | ... |
@@ -548,8 +554,6 @@ CONFIG_MICROCODE_OLD_INTERFACE=y |
| 548 | 548 |
CONFIG_X86_MSR=y |
| 549 | 549 |
CONFIG_X86_CPUID=y |
| 550 | 550 |
# CONFIG_X86_5LEVEL is not set |
| 551 |
-CONFIG_ARCH_PHYS_ADDR_T_64BIT=y |
|
| 552 |
-CONFIG_ARCH_DMA_ADDR_T_64BIT=y |
|
| 553 | 551 |
CONFIG_X86_DIRECT_GBPAGES=y |
| 554 | 552 |
CONFIG_ARCH_HAS_MEM_ENCRYPT=y |
| 555 | 553 |
CONFIG_AMD_MEM_ENCRYPT=y |
| ... | ... |
@@ -617,7 +621,6 @@ CONFIG_ZSMALLOC=m |
| 617 | 617 |
# CONFIG_PGTABLE_MAPPING is not set |
| 618 | 618 |
CONFIG_ZSMALLOC_STAT=y |
| 619 | 619 |
CONFIG_GENERIC_EARLY_IOREMAP=y |
| 620 |
-CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y |
|
| 621 | 620 |
# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set |
| 622 | 621 |
# CONFIG_IDLE_PAGE_TRACKING is not set |
| 623 | 622 |
CONFIG_ARCH_HAS_ZONE_DEVICE=y |
| ... | ... |
@@ -625,6 +628,8 @@ CONFIG_ARCH_HAS_ZONE_DEVICE=y |
| 625 | 625 |
CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y |
| 626 | 626 |
CONFIG_ARCH_HAS_PKEYS=y |
| 627 | 627 |
# CONFIG_PERCPU_STATS is not set |
| 628 |
+# CONFIG_GUP_BENCHMARK is not set |
|
| 629 |
+CONFIG_ARCH_HAS_PTE_SPECIAL=y |
|
| 628 | 630 |
# CONFIG_X86_PMEM_LEGACY is not set |
| 629 | 631 |
CONFIG_X86_CHECK_BIOS_CORRUPTION=y |
| 630 | 632 |
CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y |
| ... | ... |
@@ -637,6 +642,7 @@ CONFIG_X86_PAT=y |
| 637 | 637 |
CONFIG_ARCH_USES_PG_UNCACHED=y |
| 638 | 638 |
CONFIG_ARCH_RANDOM=y |
| 639 | 639 |
CONFIG_X86_SMAP=y |
| 640 |
+CONFIG_X86_INTEL_UMIP=y |
|
| 640 | 641 |
# CONFIG_X86_INTEL_MPX is not set |
| 641 | 642 |
CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y |
| 642 | 643 |
# CONFIG_EFI is not set |
| ... | ... |
@@ -659,7 +665,6 @@ CONFIG_HOTPLUG_CPU=y |
| 659 | 659 |
# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set |
| 660 | 660 |
# CONFIG_DEBUG_HOTPLUG_CPU0 is not set |
| 661 | 661 |
# CONFIG_COMPAT_VDSO is not set |
| 662 |
-# CONFIG_LEGACY_VSYSCALL_NATIVE is not set |
|
| 663 | 662 |
CONFIG_LEGACY_VSYSCALL_EMULATE=y |
| 664 | 663 |
# CONFIG_LEGACY_VSYSCALL_NONE is not set |
| 665 | 664 |
# CONFIG_CMDLINE_BOOL is not set |
| ... | ... |
@@ -692,6 +697,7 @@ CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y |
| 692 | 692 |
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y |
| 693 | 693 |
# CONFIG_ACPI_DEBUGGER is not set |
| 694 | 694 |
CONFIG_ACPI_SPCR_TABLE=y |
| 695 |
+CONFIG_ACPI_LPIT=y |
|
| 695 | 696 |
CONFIG_ACPI_SLEEP=y |
| 696 | 697 |
CONFIG_ACPI_PROCFS_POWER=y |
| 697 | 698 |
# CONFIG_ACPI_REV_OVERRIDE_POSSIBLE is not set |
| ... | ... |
@@ -701,6 +707,7 @@ CONFIG_ACPI_BATTERY=m |
| 701 | 701 |
CONFIG_ACPI_BUTTON=m |
| 702 | 702 |
CONFIG_ACPI_VIDEO=m |
| 703 | 703 |
# CONFIG_ACPI_FAN is not set |
| 704 |
+# CONFIG_ACPI_TAD is not set |
|
| 704 | 705 |
# CONFIG_ACPI_DOCK is not set |
| 705 | 706 |
CONFIG_ACPI_CPU_FREQ_PSS=y |
| 706 | 707 |
CONFIG_ACPI_PROCESSOR_CSTATE=y |
| ... | ... |
@@ -711,12 +718,10 @@ CONFIG_ACPI_HOTPLUG_CPU=y |
| 711 | 711 |
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m |
| 712 | 712 |
CONFIG_ACPI_THERMAL=m |
| 713 | 713 |
CONFIG_ACPI_NUMA=y |
| 714 |
-# CONFIG_ACPI_CUSTOM_DSDT is not set |
|
| 715 | 714 |
CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y |
| 716 | 715 |
CONFIG_ACPI_TABLE_UPGRADE=y |
| 717 | 716 |
# CONFIG_ACPI_DEBUG is not set |
| 718 | 717 |
CONFIG_ACPI_PCI_SLOT=y |
| 719 |
-CONFIG_X86_PM_TIMER=y |
|
| 720 | 718 |
CONFIG_ACPI_CONTAINER=y |
| 721 | 719 |
CONFIG_ACPI_HOTPLUG_MEMORY=y |
| 722 | 720 |
CONFIG_ACPI_HOTPLUG_IOAPIC=y |
| ... | ... |
@@ -732,6 +737,7 @@ CONFIG_HAVE_ACPI_APEI_NMI=y |
| 732 | 732 |
CONFIG_ACPI_EXTLOG=m |
| 733 | 733 |
# CONFIG_PMIC_OPREGION is not set |
| 734 | 734 |
# CONFIG_ACPI_CONFIGFS is not set |
| 735 |
+CONFIG_X86_PM_TIMER=y |
|
| 735 | 736 |
# CONFIG_SFI is not set |
| 736 | 737 |
|
| 737 | 738 |
# |
| ... | ... |
@@ -769,7 +775,6 @@ CONFIG_X86_ACPI_CPUFREQ=m |
| 769 | 769 |
# |
| 770 | 770 |
# shared options |
| 771 | 771 |
# |
| 772 |
-# CONFIG_X86_SPEEDSTEP_LIB is not set |
|
| 773 | 772 |
|
| 774 | 773 |
# |
| 775 | 774 |
# CPU Idle |
| ... | ... |
@@ -777,7 +782,6 @@ CONFIG_X86_ACPI_CPUFREQ=m |
| 777 | 777 |
CONFIG_CPU_IDLE=y |
| 778 | 778 |
CONFIG_CPU_IDLE_GOV_LADDER=y |
| 779 | 779 |
CONFIG_CPU_IDLE_GOV_MENU=y |
| 780 |
-# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set |
|
| 781 | 780 |
CONFIG_INTEL_IDLE=y |
| 782 | 781 |
|
| 783 | 782 |
# |
| ... | ... |
@@ -788,6 +792,7 @@ CONFIG_PCI_DIRECT=y |
| 788 | 788 |
CONFIG_PCI_MMCONFIG=y |
| 789 | 789 |
CONFIG_PCI_XEN=y |
| 790 | 790 |
CONFIG_PCI_DOMAINS=y |
| 791 |
+CONFIG_MMCONF_FAM10H=y |
|
| 791 | 792 |
# CONFIG_PCI_CNB20LE_QUIRK is not set |
| 792 | 793 |
CONFIG_PCIEPORTBUS=y |
| 793 | 794 |
CONFIG_HOTPLUG_PCI_PCIE=y |
| ... | ... |
@@ -799,16 +804,15 @@ CONFIG_PCIEASPM_DEFAULT=y |
| 799 | 799 |
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set |
| 800 | 800 |
# CONFIG_PCIEASPM_PERFORMANCE is not set |
| 801 | 801 |
CONFIG_PCIE_PME=y |
| 802 |
-# CONFIG_PCIE_DPC is not set |
|
| 803 | 802 |
# CONFIG_PCIE_PTM is not set |
| 804 |
-CONFIG_PCI_BUS_ADDR_T_64BIT=y |
|
| 805 | 803 |
CONFIG_PCI_MSI=y |
| 806 | 804 |
CONFIG_PCI_MSI_IRQ_DOMAIN=y |
| 805 |
+CONFIG_PCI_QUIRKS=y |
|
| 807 | 806 |
# CONFIG_PCI_DEBUG is not set |
| 808 | 807 |
# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set |
| 809 | 808 |
CONFIG_PCI_STUB=m |
| 809 |
+# CONFIG_PCI_PF_STUB is not set |
|
| 810 | 810 |
CONFIG_XEN_PCIDEV_FRONTEND=y |
| 811 |
-CONFIG_HT_IRQ=y |
|
| 812 | 811 |
CONFIG_PCI_ATS=y |
| 813 | 812 |
CONFIG_PCI_LOCKLESS_CONFIG=y |
| 814 | 813 |
CONFIG_PCI_IOV=y |
| ... | ... |
@@ -822,19 +826,23 @@ CONFIG_HOTPLUG_PCI_ACPI_IBM=m |
| 822 | 822 |
CONFIG_HOTPLUG_PCI_CPCI=y |
| 823 | 823 |
# CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set |
| 824 | 824 |
CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m |
| 825 |
-CONFIG_HOTPLUG_PCI_SHPC=m |
|
| 825 |
+CONFIG_HOTPLUG_PCI_SHPC=y |
|
| 826 | 826 |
|
| 827 | 827 |
# |
| 828 |
-# DesignWare PCI Core Support |
|
| 828 |
+# PCI controller drivers |
|
| 829 | 829 |
# |
| 830 |
-# CONFIG_PCIE_DW_PLAT is not set |
|
| 831 | 830 |
|
| 832 | 831 |
# |
| 833 |
-# PCI host controller drivers |
|
| 832 |
+# Cadence PCIe controllers support |
|
| 834 | 833 |
# |
| 835 | 834 |
# CONFIG_VMD is not set |
| 836 | 835 |
|
| 837 | 836 |
# |
| 837 |
+# DesignWare PCI Core Support |
|
| 838 |
+# |
|
| 839 |
+# CONFIG_PCIE_DW_PLAT_HOST is not set |
|
| 840 |
+ |
|
| 841 |
+# |
|
| 838 | 842 |
# PCI Endpoint |
| 839 | 843 |
# |
| 840 | 844 |
# CONFIG_PCI_ENDPOINT is not set |
| ... | ... |
@@ -858,7 +866,6 @@ CONFIG_COMPAT_BINFMT_ELF=y |
| 858 | 858 |
CONFIG_ELFCORE=y |
| 859 | 859 |
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y |
| 860 | 860 |
CONFIG_BINFMT_SCRIPT=y |
| 861 |
-# CONFIG_HAVE_AOUT is not set |
|
| 862 | 861 |
CONFIG_BINFMT_MISC=m |
| 863 | 862 |
CONFIG_COREDUMP=y |
| 864 | 863 |
CONFIG_IA32_EMULATION=y |
| ... | ... |
@@ -881,6 +888,7 @@ CONFIG_PACKET_DIAG=m |
| 881 | 881 |
CONFIG_UNIX=y |
| 882 | 882 |
CONFIG_UNIX_DIAG=m |
| 883 | 883 |
CONFIG_TLS=m |
| 884 |
+# CONFIG_TLS_DEVICE is not set |
|
| 884 | 885 |
CONFIG_XFRM=y |
| 885 | 886 |
CONFIG_XFRM_OFFLOAD=y |
| 886 | 887 |
CONFIG_XFRM_ALGO=m |
| ... | ... |
@@ -906,6 +914,7 @@ CONFIG_NET_IPGRE_DEMUX=m |
| 906 | 906 |
CONFIG_NET_IP_TUNNEL=m |
| 907 | 907 |
CONFIG_NET_IPGRE=m |
| 908 | 908 |
CONFIG_NET_IPGRE_BROADCAST=y |
| 909 |
+CONFIG_IP_MROUTE_COMMON=y |
|
| 909 | 910 |
CONFIG_IP_MROUTE=y |
| 910 | 911 |
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y |
| 911 | 912 |
CONFIG_IP_PIMSM_V1=y |
| ... | ... |
@@ -994,12 +1003,15 @@ CONFIG_BRIDGE_NETFILTER=m |
| 994 | 994 |
# |
| 995 | 995 |
CONFIG_NETFILTER_INGRESS=y |
| 996 | 996 |
CONFIG_NETFILTER_NETLINK=m |
| 997 |
+CONFIG_NETFILTER_FAMILY_BRIDGE=y |
|
| 998 |
+CONFIG_NETFILTER_FAMILY_ARP=y |
|
| 997 | 999 |
CONFIG_NETFILTER_NETLINK_ACCT=m |
| 998 | 1000 |
CONFIG_NETFILTER_NETLINK_QUEUE=m |
| 999 | 1001 |
CONFIG_NETFILTER_NETLINK_LOG=m |
| 1000 | 1002 |
CONFIG_NF_CONNTRACK=m |
| 1001 | 1003 |
CONFIG_NF_LOG_COMMON=m |
| 1002 | 1004 |
CONFIG_NF_LOG_NETDEV=m |
| 1005 |
+CONFIG_NETFILTER_CONNCOUNT=m |
|
| 1003 | 1006 |
CONFIG_NF_CONNTRACK_MARK=y |
| 1004 | 1007 |
CONFIG_NF_CONNTRACK_SECMARK=y |
| 1005 | 1008 |
CONFIG_NF_CONNTRACK_ZONES=y |
| ... | ... |
@@ -1037,20 +1049,17 @@ CONFIG_NF_NAT_FTP=m |
| 1037 | 1037 |
CONFIG_NF_NAT_IRC=m |
| 1038 | 1038 |
CONFIG_NF_NAT_SIP=m |
| 1039 | 1039 |
CONFIG_NF_NAT_TFTP=m |
| 1040 |
-CONFIG_NF_NAT_REDIRECT=m |
|
| 1040 |
+CONFIG_NF_NAT_REDIRECT=y |
|
| 1041 | 1041 |
CONFIG_NETFILTER_SYNPROXY=m |
| 1042 |
+CONFIG_NF_OSF=m |
|
| 1042 | 1043 |
CONFIG_NF_TABLES=m |
| 1043 |
-CONFIG_NF_TABLES_INET=m |
|
| 1044 |
-CONFIG_NF_TABLES_NETDEV=m |
|
| 1045 |
-CONFIG_NFT_EXTHDR=m |
|
| 1046 |
-CONFIG_NFT_META=m |
|
| 1047 |
-CONFIG_NFT_RT=m |
|
| 1044 |
+# CONFIG_NF_TABLES_SET is not set |
|
| 1045 |
+CONFIG_NF_TABLES_INET=y |
|
| 1046 |
+CONFIG_NF_TABLES_NETDEV=y |
|
| 1048 | 1047 |
# CONFIG_NFT_NUMGEN is not set |
| 1049 | 1048 |
CONFIG_NFT_CT=m |
| 1050 |
-CONFIG_NFT_SET_RBTREE=m |
|
| 1051 |
-CONFIG_NFT_SET_HASH=m |
|
| 1052 |
-CONFIG_NFT_SET_BITMAP=m |
|
| 1053 | 1049 |
CONFIG_NFT_COUNTER=m |
| 1050 |
+# CONFIG_NFT_CONNLIMIT is not set |
|
| 1054 | 1051 |
CONFIG_NFT_LOG=m |
| 1055 | 1052 |
CONFIG_NFT_LIMIT=m |
| 1056 | 1053 |
CONFIG_NFT_MASQ=m |
| ... | ... |
@@ -1065,10 +1074,12 @@ CONFIG_NFT_COMPAT=m |
| 1065 | 1065 |
CONFIG_NFT_HASH=m |
| 1066 | 1066 |
CONFIG_NFT_FIB=m |
| 1067 | 1067 |
CONFIG_NFT_FIB_INET=m |
| 1068 |
+# CONFIG_NFT_SOCKET is not set |
|
| 1068 | 1069 |
# CONFIG_NF_DUP_NETDEV is not set |
| 1069 | 1070 |
# CONFIG_NFT_DUP_NETDEV is not set |
| 1070 | 1071 |
# CONFIG_NFT_FWD_NETDEV is not set |
| 1071 | 1072 |
CONFIG_NFT_FIB_NETDEV=m |
| 1073 |
+# CONFIG_NF_FLOW_TABLE is not set |
|
| 1072 | 1074 |
CONFIG_NETFILTER_XTABLES=m |
| 1073 | 1075 |
|
| 1074 | 1076 |
# |
| ... | ... |
@@ -1202,6 +1213,7 @@ CONFIG_IP_VS_LBLC=m |
| 1202 | 1202 |
CONFIG_IP_VS_LBLCR=m |
| 1203 | 1203 |
CONFIG_IP_VS_DH=m |
| 1204 | 1204 |
CONFIG_IP_VS_SH=m |
| 1205 |
+# CONFIG_IP_VS_MH is not set |
|
| 1205 | 1206 |
CONFIG_IP_VS_SED=m |
| 1206 | 1207 |
CONFIG_IP_VS_NQ=m |
| 1207 | 1208 |
|
| ... | ... |
@@ -1211,6 +1223,11 @@ CONFIG_IP_VS_NQ=m |
| 1211 | 1211 |
CONFIG_IP_VS_SH_TAB_BITS=8 |
| 1212 | 1212 |
|
| 1213 | 1213 |
# |
| 1214 |
+# IPVS MH scheduler |
|
| 1215 |
+# |
|
| 1216 |
+CONFIG_IP_VS_MH_TAB_INDEX=12 |
|
| 1217 |
+ |
|
| 1218 |
+# |
|
| 1214 | 1219 |
# IPVS application helper |
| 1215 | 1220 |
# |
| 1216 | 1221 |
CONFIG_IP_VS_FTP=m |
| ... | ... |
@@ -1223,19 +1240,20 @@ CONFIG_IP_VS_PE_SIP=m |
| 1223 | 1223 |
CONFIG_NF_DEFRAG_IPV4=m |
| 1224 | 1224 |
CONFIG_NF_CONNTRACK_IPV4=m |
| 1225 | 1225 |
CONFIG_NF_SOCKET_IPV4=m |
| 1226 |
-CONFIG_NF_TABLES_IPV4=m |
|
| 1226 |
+CONFIG_NF_TPROXY_IPV4=m |
|
| 1227 |
+CONFIG_NF_TABLES_IPV4=y |
|
| 1227 | 1228 |
CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 1228 | 1229 |
CONFIG_NFT_REJECT_IPV4=m |
| 1229 | 1230 |
CONFIG_NFT_DUP_IPV4=m |
| 1230 | 1231 |
CONFIG_NFT_FIB_IPV4=m |
| 1231 |
-CONFIG_NF_TABLES_ARP=m |
|
| 1232 |
+CONFIG_NF_TABLES_ARP=y |
|
| 1232 | 1233 |
CONFIG_NF_DUP_IPV4=m |
| 1233 | 1234 |
CONFIG_NF_LOG_ARP=m |
| 1234 | 1235 |
CONFIG_NF_LOG_IPV4=m |
| 1235 | 1236 |
CONFIG_NF_REJECT_IPV4=m |
| 1236 | 1237 |
CONFIG_NF_NAT_IPV4=m |
| 1237 | 1238 |
CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 1238 |
-CONFIG_NF_NAT_MASQUERADE_IPV4=m |
|
| 1239 |
+CONFIG_NF_NAT_MASQUERADE_IPV4=y |
|
| 1239 | 1240 |
CONFIG_NFT_MASQ_IPV4=m |
| 1240 | 1241 |
CONFIG_NFT_REDIR_IPV4=m |
| 1241 | 1242 |
CONFIG_NF_NAT_SNMP_BASIC=m |
| ... | ... |
@@ -1270,7 +1288,8 @@ CONFIG_IP_NF_ARP_MANGLE=m |
| 1270 | 1270 |
CONFIG_NF_DEFRAG_IPV6=m |
| 1271 | 1271 |
CONFIG_NF_CONNTRACK_IPV6=m |
| 1272 | 1272 |
CONFIG_NF_SOCKET_IPV6=m |
| 1273 |
-CONFIG_NF_TABLES_IPV6=m |
|
| 1273 |
+CONFIG_NF_TPROXY_IPV6=m |
|
| 1274 |
+CONFIG_NF_TABLES_IPV6=y |
|
| 1274 | 1275 |
CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 1275 | 1276 |
CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 1276 | 1277 |
CONFIG_NFT_MASQ_IPV6=m |
| ... | ... |
@@ -1282,7 +1301,7 @@ CONFIG_NF_DUP_IPV6=m |
| 1282 | 1282 |
CONFIG_NF_REJECT_IPV6=m |
| 1283 | 1283 |
CONFIG_NF_LOG_IPV6=m |
| 1284 | 1284 |
CONFIG_NF_NAT_IPV6=m |
| 1285 |
-CONFIG_NF_NAT_MASQUERADE_IPV6=m |
|
| 1285 |
+CONFIG_NF_NAT_MASQUERADE_IPV6=y |
|
| 1286 | 1286 |
CONFIG_IP6_NF_IPTABLES=m |
| 1287 | 1287 |
CONFIG_IP6_NF_MATCH_AH=m |
| 1288 | 1288 |
CONFIG_IP6_NF_MATCH_EUI64=m |
| ... | ... |
@@ -1293,6 +1312,7 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m |
| 1293 | 1293 |
CONFIG_IP6_NF_MATCH_MH=m |
| 1294 | 1294 |
CONFIG_IP6_NF_MATCH_RPFILTER=m |
| 1295 | 1295 |
CONFIG_IP6_NF_MATCH_RT=m |
| 1296 |
+# CONFIG_IP6_NF_MATCH_SRH is not set |
|
| 1296 | 1297 |
CONFIG_IP6_NF_TARGET_HL=m |
| 1297 | 1298 |
CONFIG_IP6_NF_FILTER=m |
| 1298 | 1299 |
CONFIG_IP6_NF_TARGET_REJECT=m |
| ... | ... |
@@ -1303,8 +1323,7 @@ CONFIG_IP6_NF_SECURITY=m |
| 1303 | 1303 |
CONFIG_IP6_NF_NAT=m |
| 1304 | 1304 |
CONFIG_IP6_NF_TARGET_MASQUERADE=m |
| 1305 | 1305 |
CONFIG_IP6_NF_TARGET_NPT=m |
| 1306 |
-CONFIG_NF_TABLES_BRIDGE=m |
|
| 1307 |
-CONFIG_NFT_BRIDGE_META=m |
|
| 1306 |
+CONFIG_NF_TABLES_BRIDGE=y |
|
| 1308 | 1307 |
CONFIG_NFT_BRIDGE_REJECT=m |
| 1309 | 1308 |
CONFIG_NF_LOG_BRIDGE=m |
| 1310 | 1309 |
CONFIG_BRIDGE_NF_EBTABLES=m |
| ... | ... |
@@ -1328,6 +1347,7 @@ CONFIG_BRIDGE_EBT_REDIRECT=m |
| 1328 | 1328 |
CONFIG_BRIDGE_EBT_SNAT=m |
| 1329 | 1329 |
CONFIG_BRIDGE_EBT_LOG=m |
| 1330 | 1330 |
CONFIG_BRIDGE_EBT_NFLOG=m |
| 1331 |
+# CONFIG_BPFILTER is not set |
|
| 1331 | 1332 |
CONFIG_IP_DCCP=m |
| 1332 | 1333 |
CONFIG_INET_DCCP_DIAG=m |
| 1333 | 1334 |
|
| ... | ... |
@@ -1343,9 +1363,7 @@ CONFIG_IP_DCCP_TFRC_LIB=y |
| 1343 | 1343 |
# DCCP Kernel Hacking |
| 1344 | 1344 |
# |
| 1345 | 1345 |
# CONFIG_IP_DCCP_DEBUG is not set |
| 1346 |
-CONFIG_NET_DCCPPROBE=m |
|
| 1347 | 1346 |
CONFIG_IP_SCTP=m |
| 1348 |
-# CONFIG_NET_SCTPPROBE is not set |
|
| 1349 | 1347 |
# CONFIG_SCTP_DBG_OBJCNT is not set |
| 1350 | 1348 |
# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5 is not set |
| 1351 | 1349 |
CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1=y |
| ... | ... |
@@ -1359,6 +1377,7 @@ CONFIG_RDS_TCP=m |
| 1359 | 1359 |
# CONFIG_RDS_DEBUG is not set |
| 1360 | 1360 |
CONFIG_TIPC=m |
| 1361 | 1361 |
CONFIG_TIPC_MEDIA_UDP=y |
| 1362 |
+# CONFIG_TIPC_DIAG is not set |
|
| 1362 | 1363 |
# CONFIG_ATM is not set |
| 1363 | 1364 |
# CONFIG_L2TP is not set |
| 1364 | 1365 |
CONFIG_STP=m |
| ... | ... |
@@ -1375,7 +1394,6 @@ CONFIG_VLAN_8021Q_MVRP=y |
| 1375 | 1375 |
# CONFIG_DECNET is not set |
| 1376 | 1376 |
CONFIG_LLC=m |
| 1377 | 1377 |
# CONFIG_LLC2 is not set |
| 1378 |
-# CONFIG_IPX is not set |
|
| 1379 | 1378 |
# CONFIG_ATALK is not set |
| 1380 | 1379 |
# CONFIG_X25 is not set |
| 1381 | 1380 |
# CONFIG_LAPB is not set |
| ... | ... |
@@ -1397,6 +1415,7 @@ CONFIG_NET_SCH_SFB=m |
| 1397 | 1397 |
CONFIG_NET_SCH_SFQ=m |
| 1398 | 1398 |
CONFIG_NET_SCH_TEQL=m |
| 1399 | 1399 |
CONFIG_NET_SCH_TBF=m |
| 1400 |
+# CONFIG_NET_SCH_CBS is not set |
|
| 1400 | 1401 |
CONFIG_NET_SCH_GRED=m |
| 1401 | 1402 |
CONFIG_NET_SCH_DSMARK=m |
| 1402 | 1403 |
CONFIG_NET_SCH_NETEM=m |
| ... | ... |
@@ -1439,6 +1458,7 @@ CONFIG_NET_EMATCH_U32=m |
| 1439 | 1439 |
CONFIG_NET_EMATCH_META=m |
| 1440 | 1440 |
CONFIG_NET_EMATCH_TEXT=m |
| 1441 | 1441 |
CONFIG_NET_EMATCH_IPSET=m |
| 1442 |
+# CONFIG_NET_EMATCH_IPT is not set |
|
| 1442 | 1443 |
CONFIG_NET_CLS_ACT=y |
| 1443 | 1444 |
CONFIG_NET_ACT_POLICE=m |
| 1444 | 1445 |
CONFIG_NET_ACT_GACT=m |
| ... | ... |
@@ -1467,6 +1487,7 @@ CONFIG_OPENVSWITCH_GRE=m |
| 1467 | 1467 |
CONFIG_OPENVSWITCH_VXLAN=m |
| 1468 | 1468 |
CONFIG_OPENVSWITCH_GENEVE=m |
| 1469 | 1469 |
CONFIG_VSOCKETS=m |
| 1470 |
+# CONFIG_VSOCKETS_DIAG is not set |
|
| 1470 | 1471 |
CONFIG_VMWARE_VMCI_VSOCKETS=m |
| 1471 | 1472 |
CONFIG_VIRTIO_VSOCKETS=m |
| 1472 | 1473 |
CONFIG_VIRTIO_VSOCKETS_COMMON=m |
| ... | ... |
@@ -1476,10 +1497,10 @@ CONFIG_MPLS=y |
| 1476 | 1476 |
CONFIG_NET_MPLS_GSO=m |
| 1477 | 1477 |
CONFIG_MPLS_ROUTING=m |
| 1478 | 1478 |
CONFIG_MPLS_IPTUNNEL=m |
| 1479 |
-# CONFIG_NET_NSH is not set |
|
| 1479 |
+CONFIG_NET_NSH=m |
|
| 1480 | 1480 |
CONFIG_HSR=m |
| 1481 | 1481 |
# CONFIG_NET_SWITCHDEV is not set |
| 1482 |
-# CONFIG_NET_L3_MASTER_DEV is not set |
|
| 1482 |
+CONFIG_NET_L3_MASTER_DEV=y |
|
| 1483 | 1483 |
# CONFIG_NET_NCSI is not set |
| 1484 | 1484 |
CONFIG_RPS=y |
| 1485 | 1485 |
CONFIG_RFS_ACCEL=y |
| ... | ... |
@@ -1495,14 +1516,13 @@ CONFIG_NET_FLOW_LIMIT=y |
| 1495 | 1495 |
# Network testing |
| 1496 | 1496 |
# |
| 1497 | 1497 |
# CONFIG_NET_PKTGEN is not set |
| 1498 |
-# CONFIG_NET_TCPPROBE is not set |
|
| 1499 | 1498 |
# CONFIG_NET_DROP_MONITOR is not set |
| 1500 | 1499 |
# CONFIG_HAMRADIO is not set |
| 1501 | 1500 |
# CONFIG_CAN is not set |
| 1502 | 1501 |
# CONFIG_BT is not set |
| 1503 | 1502 |
# CONFIG_AF_RXRPC is not set |
| 1504 | 1503 |
# CONFIG_AF_KCM is not set |
| 1505 |
-# CONFIG_STREAM_PARSER is not set |
|
| 1504 |
+CONFIG_STREAM_PARSER=m |
|
| 1506 | 1505 |
CONFIG_FIB_RULES=y |
| 1507 | 1506 |
# CONFIG_WIRELESS is not set |
| 1508 | 1507 |
# CONFIG_WIMAX is not set |
| ... | ... |
@@ -1525,6 +1545,7 @@ CONFIG_DST_CACHE=y |
| 1525 | 1525 |
CONFIG_GRO_CELLS=y |
| 1526 | 1526 |
# CONFIG_NET_DEVLINK is not set |
| 1527 | 1527 |
CONFIG_MAY_USE_DEVLINK=y |
| 1528 |
+CONFIG_FAILOVER=m |
|
| 1528 | 1529 |
CONFIG_HAVE_EBPF_JIT=y |
| 1529 | 1530 |
|
| 1530 | 1531 |
# |
| ... | ... |
@@ -1540,8 +1561,11 @@ CONFIG_DEVTMPFS=y |
| 1540 | 1540 |
CONFIG_DEVTMPFS_MOUNT=y |
| 1541 | 1541 |
CONFIG_STANDALONE=y |
| 1542 | 1542 |
CONFIG_PREVENT_FIRMWARE_BUILD=y |
| 1543 |
+ |
|
| 1544 |
+# |
|
| 1545 |
+# Firmware loader |
|
| 1546 |
+# |
|
| 1543 | 1547 |
CONFIG_FW_LOADER=y |
| 1544 |
-# CONFIG_FIRMWARE_IN_KERNEL is not set |
|
| 1545 | 1548 |
CONFIG_EXTRA_FIRMWARE="" |
| 1546 | 1549 |
CONFIG_FW_LOADER_USER_HELPER=y |
| 1547 | 1550 |
# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set |
| ... | ... |
@@ -1551,7 +1575,6 @@ CONFIG_ALLOW_DEV_COREDUMP=y |
| 1551 | 1551 |
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set |
| 1552 | 1552 |
# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set |
| 1553 | 1553 |
CONFIG_SYS_HYPERVISOR=y |
| 1554 |
-# CONFIG_GENERIC_CPU_DEVICES is not set |
|
| 1555 | 1554 |
CONFIG_GENERIC_CPU_AUTOPROBE=y |
| 1556 | 1555 |
CONFIG_GENERIC_CPU_VULNERABILITIES=y |
| 1557 | 1556 |
CONFIG_REGMAP=y |
| ... | ... |
@@ -1578,12 +1601,13 @@ CONFIG_PNPACPI=y |
| 1578 | 1578 |
CONFIG_BLK_DEV=y |
| 1579 | 1579 |
CONFIG_BLK_DEV_NULL_BLK=m |
| 1580 | 1580 |
# CONFIG_BLK_DEV_FD is not set |
| 1581 |
+CONFIG_CDROM=m |
|
| 1581 | 1582 |
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set |
| 1582 | 1583 |
CONFIG_ZRAM=m |
| 1583 | 1584 |
# CONFIG_ZRAM_WRITEBACK is not set |
| 1585 |
+# CONFIG_ZRAM_MEMORY_TRACKING is not set |
|
| 1584 | 1586 |
# CONFIG_BLK_DEV_DAC960 is not set |
| 1585 | 1587 |
# CONFIG_BLK_DEV_UMEM is not set |
| 1586 |
-# CONFIG_BLK_DEV_COW_COMMON is not set |
|
| 1587 | 1588 |
CONFIG_BLK_DEV_LOOP=m |
| 1588 | 1589 |
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 |
| 1589 | 1590 |
CONFIG_BLK_DEV_CRYPTOLOOP=m |
| ... | ... |
@@ -1595,7 +1619,6 @@ CONFIG_BLK_DEV_NBD=m |
| 1595 | 1595 |
CONFIG_BLK_DEV_RAM=m |
| 1596 | 1596 |
CONFIG_BLK_DEV_RAM_COUNT=16 |
| 1597 | 1597 |
CONFIG_BLK_DEV_RAM_SIZE=16384 |
| 1598 |
-# CONFIG_BLK_DEV_RAM_DAX is not set |
|
| 1599 | 1598 |
# CONFIG_CDROM_PKTCDVD is not set |
| 1600 | 1599 |
CONFIG_ATA_OVER_ETH=m |
| 1601 | 1600 |
CONFIG_XEN_BLKDEV_FRONTEND=m |
| ... | ... |
@@ -1604,8 +1627,13 @@ CONFIG_VIRTIO_BLK=m |
| 1604 | 1604 |
# CONFIG_VIRTIO_BLK_SCSI is not set |
| 1605 | 1605 |
CONFIG_BLK_DEV_RBD=m |
| 1606 | 1606 |
# CONFIG_BLK_DEV_RSXX is not set |
| 1607 |
+ |
|
| 1608 |
+# |
|
| 1609 |
+# NVME Support |
|
| 1610 |
+# |
|
| 1607 | 1611 |
CONFIG_NVME_CORE=m |
| 1608 | 1612 |
CONFIG_BLK_DEV_NVME=m |
| 1613 |
+# CONFIG_NVME_MULTIPATH is not set |
|
| 1609 | 1614 |
# CONFIG_NVME_RDMA is not set |
| 1610 | 1615 |
# CONFIG_NVME_FC is not set |
| 1611 | 1616 |
# CONFIG_NVME_TARGET is not set |
| ... | ... |
@@ -1613,7 +1641,6 @@ CONFIG_BLK_DEV_NVME=m |
| 1613 | 1613 |
# |
| 1614 | 1614 |
# Misc devices |
| 1615 | 1615 |
# |
| 1616 |
-# CONFIG_SENSORS_LIS3LV02D is not set |
|
| 1617 | 1616 |
# CONFIG_AD525X_DPOT is not set |
| 1618 | 1617 |
# CONFIG_DUMMY_IRQ is not set |
| 1619 | 1618 |
# CONFIG_IBM_ASM is not set |
| ... | ... |
@@ -1651,10 +1678,6 @@ CONFIG_VMWARE_BALLOON=m |
| 1651 | 1651 |
# Texas Instruments shared transport line discipline |
| 1652 | 1652 |
# |
| 1653 | 1653 |
# CONFIG_SENSORS_LIS3_I2C is not set |
| 1654 |
- |
|
| 1655 |
-# |
|
| 1656 |
-# Altera FPGA firmware download module |
|
| 1657 |
-# |
|
| 1658 | 1654 |
# CONFIG_ALTERA_STAPL is not set |
| 1659 | 1655 |
# CONFIG_INTEL_MEI is not set |
| 1660 | 1656 |
# CONFIG_INTEL_MEI_ME is not set |
| ... | ... |
@@ -1662,6 +1685,10 @@ CONFIG_VMWARE_BALLOON=m |
| 1662 | 1662 |
CONFIG_VMWARE_VMCI=m |
| 1663 | 1663 |
|
| 1664 | 1664 |
# |
| 1665 |
+# Intel MIC & related support |
|
| 1666 |
+# |
|
| 1667 |
+ |
|
| 1668 |
+# |
|
| 1665 | 1669 |
# Intel MIC Bus Driver |
| 1666 | 1670 |
# |
| 1667 | 1671 |
# CONFIG_INTEL_MIC_BUS is not set |
| ... | ... |
@@ -1697,9 +1724,7 @@ CONFIG_VMWARE_VMCI=m |
| 1697 | 1697 |
# |
| 1698 | 1698 |
# CONFIG_GENWQE is not set |
| 1699 | 1699 |
# CONFIG_ECHO is not set |
| 1700 |
-# CONFIG_CXL_BASE is not set |
|
| 1701 |
-# CONFIG_CXL_AFU_DRIVER_OPS is not set |
|
| 1702 |
-# CONFIG_CXL_LIB is not set |
|
| 1700 |
+# CONFIG_MISC_RTSX_PCI is not set |
|
| 1703 | 1701 |
CONFIG_HAVE_IDE=y |
| 1704 | 1702 |
# CONFIG_IDE is not set |
| 1705 | 1703 |
|
| ... | ... |
@@ -1781,8 +1806,6 @@ CONFIG_LIBFCOE=m |
| 1781 | 1781 |
# CONFIG_FCOE_FNIC is not set |
| 1782 | 1782 |
# CONFIG_SCSI_SNIC is not set |
| 1783 | 1783 |
# CONFIG_SCSI_DMX3191D is not set |
| 1784 |
-# CONFIG_SCSI_EATA is not set |
|
| 1785 |
-# CONFIG_SCSI_FUTURE_DOMAIN is not set |
|
| 1786 | 1784 |
# CONFIG_SCSI_GDTH is not set |
| 1787 | 1785 |
# CONFIG_SCSI_ISCI is not set |
| 1788 | 1786 |
# CONFIG_SCSI_IPS is not set |
| ... | ... |
@@ -1810,7 +1833,6 @@ CONFIG_SCSI_OSD_ULD=m |
| 1810 | 1810 |
CONFIG_SCSI_OSD_DPRINT_SENSE=1 |
| 1811 | 1811 |
# CONFIG_SCSI_OSD_DEBUG is not set |
| 1812 | 1812 |
CONFIG_ATA=m |
| 1813 |
-# CONFIG_ATA_NONSTANDARD is not set |
|
| 1814 | 1813 |
CONFIG_ATA_VERBOSE_ERROR=y |
| 1815 | 1814 |
CONFIG_ATA_ACPI=y |
| 1816 | 1815 |
# CONFIG_SATA_ZPODD is not set |
| ... | ... |
@@ -1820,6 +1842,7 @@ CONFIG_SATA_PMP=y |
| 1820 | 1820 |
# Controllers with non-SFF native interface |
| 1821 | 1821 |
# |
| 1822 | 1822 |
CONFIG_SATA_AHCI=m |
| 1823 |
+CONFIG_SATA_MOBILE_LPM_POLICY=0 |
|
| 1823 | 1824 |
# CONFIG_SATA_AHCI_PLATFORM is not set |
| 1824 | 1825 |
# CONFIG_SATA_INIC162X is not set |
| 1825 | 1826 |
# CONFIG_SATA_ACARD_AHCI is not set |
| ... | ... |
@@ -1924,10 +1947,12 @@ CONFIG_DM_BUFIO=m |
| 1924 | 1924 |
# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set |
| 1925 | 1925 |
CONFIG_DM_BIO_PRISON=m |
| 1926 | 1926 |
CONFIG_DM_PERSISTENT_DATA=m |
| 1927 |
+# CONFIG_DM_UNSTRIPED is not set |
|
| 1927 | 1928 |
CONFIG_DM_CRYPT=m |
| 1928 | 1929 |
CONFIG_DM_SNAPSHOT=m |
| 1929 | 1930 |
CONFIG_DM_THIN_PROVISIONING=m |
| 1930 | 1931 |
# CONFIG_DM_CACHE is not set |
| 1932 |
+# CONFIG_DM_WRITECACHE is not set |
|
| 1931 | 1933 |
# CONFIG_DM_ERA is not set |
| 1932 | 1934 |
CONFIG_DM_MIRROR=m |
| 1933 | 1935 |
# CONFIG_DM_LOG_USERSPACE is not set |
| ... | ... |
@@ -1982,6 +2007,8 @@ CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m |
| 1982 | 1982 |
CONFIG_NET_TEAM_MODE_LOADBALANCE=m |
| 1983 | 1983 |
CONFIG_MACVLAN=m |
| 1984 | 1984 |
CONFIG_MACVTAP=m |
| 1985 |
+CONFIG_IPVLAN=m |
|
| 1986 |
+CONFIG_IPVTAP=m |
|
| 1985 | 1987 |
CONFIG_VXLAN=m |
| 1986 | 1988 |
CONFIG_GENEVE=m |
| 1987 | 1989 |
# CONFIG_GTP is not set |
| ... | ... |
@@ -1996,6 +2023,7 @@ CONFIG_TAP=m |
| 1996 | 1996 |
CONFIG_VETH=m |
| 1997 | 1997 |
CONFIG_VIRTIO_NET=m |
| 1998 | 1998 |
CONFIG_NLMON=m |
| 1999 |
+# CONFIG_NET_VRF is not set |
|
| 1999 | 2000 |
# CONFIG_VSOCKMON is not set |
| 2000 | 2001 |
# CONFIG_ARCNET is not set |
| 2001 | 2002 |
|
| ... | ... |
@@ -2019,21 +2047,22 @@ CONFIG_ETHERNET=y |
| 2019 | 2019 |
# CONFIG_NET_VENDOR_ARC is not set |
| 2020 | 2020 |
# CONFIG_NET_VENDOR_ATHEROS is not set |
| 2021 | 2021 |
# CONFIG_NET_VENDOR_AURORA is not set |
| 2022 |
-# CONFIG_NET_CADENCE is not set |
|
| 2023 | 2022 |
# CONFIG_NET_VENDOR_BROADCOM is not set |
| 2024 | 2023 |
# CONFIG_NET_VENDOR_BROCADE is not set |
| 2024 |
+# CONFIG_NET_CADENCE is not set |
|
| 2025 | 2025 |
# CONFIG_NET_VENDOR_CAVIUM is not set |
| 2026 | 2026 |
# CONFIG_NET_VENDOR_CHELSIO is not set |
| 2027 | 2027 |
# CONFIG_NET_VENDOR_CISCO is not set |
| 2028 |
+# CONFIG_NET_VENDOR_CORTINA is not set |
|
| 2028 | 2029 |
# CONFIG_CX_ECAT is not set |
| 2029 | 2030 |
# CONFIG_DNET is not set |
| 2030 | 2031 |
# CONFIG_NET_VENDOR_DEC is not set |
| 2031 | 2032 |
# CONFIG_NET_VENDOR_DLINK is not set |
| 2032 | 2033 |
# CONFIG_NET_VENDOR_EMULEX is not set |
| 2033 | 2034 |
# CONFIG_NET_VENDOR_EZCHIP is not set |
| 2034 |
-# CONFIG_NET_VENDOR_EXAR is not set |
|
| 2035 | 2035 |
# CONFIG_NET_VENDOR_HP is not set |
| 2036 | 2036 |
# CONFIG_NET_VENDOR_HUAWEI is not set |
| 2037 |
+# CONFIG_NET_VENDOR_I825XX is not set |
|
| 2037 | 2038 |
CONFIG_NET_VENDOR_INTEL=y |
| 2038 | 2039 |
# CONFIG_E100 is not set |
| 2039 | 2040 |
CONFIG_E1000=m |
| ... | ... |
@@ -2046,22 +2075,26 @@ CONFIG_E1000E=m |
| 2046 | 2046 |
CONFIG_IXGBEVF=m |
| 2047 | 2047 |
# CONFIG_I40E is not set |
| 2048 | 2048 |
# CONFIG_I40EVF is not set |
| 2049 |
+# CONFIG_ICE is not set |
|
| 2049 | 2050 |
# CONFIG_FM10K is not set |
| 2050 |
-# CONFIG_NET_VENDOR_I825XX is not set |
|
| 2051 |
+# CONFIG_NET_VENDOR_EXAR is not set |
|
| 2051 | 2052 |
# CONFIG_JME is not set |
| 2052 | 2053 |
# CONFIG_NET_VENDOR_MARVELL is not set |
| 2053 | 2054 |
# CONFIG_NET_VENDOR_MELLANOX is not set |
| 2054 | 2055 |
# CONFIG_NET_VENDOR_MICREL is not set |
| 2056 |
+# CONFIG_NET_VENDOR_MICROSEMI is not set |
|
| 2055 | 2057 |
# CONFIG_NET_VENDOR_MYRI is not set |
| 2056 | 2058 |
# CONFIG_FEALNX is not set |
| 2057 | 2059 |
# CONFIG_NET_VENDOR_NATSEMI is not set |
| 2058 | 2060 |
# CONFIG_NET_VENDOR_NETRONOME is not set |
| 2061 |
+# CONFIG_NET_VENDOR_NI is not set |
|
| 2059 | 2062 |
# CONFIG_NET_VENDOR_NVIDIA is not set |
| 2060 | 2063 |
# CONFIG_NET_VENDOR_OKI is not set |
| 2061 | 2064 |
# CONFIG_ETHOC is not set |
| 2062 | 2065 |
# CONFIG_NET_PACKET_ENGINE is not set |
| 2063 | 2066 |
# CONFIG_NET_VENDOR_QLOGIC is not set |
| 2064 | 2067 |
# CONFIG_NET_VENDOR_QUALCOMM is not set |
| 2068 |
+# CONFIG_NET_VENDOR_RDC is not set |
|
| 2065 | 2069 |
CONFIG_NET_VENDOR_REALTEK=y |
| 2066 | 2070 |
CONFIG_8139CP=m |
| 2067 | 2071 |
CONFIG_8139TOO=m |
| ... | ... |
@@ -2071,27 +2104,28 @@ CONFIG_8139TOO=m |
| 2071 | 2071 |
# CONFIG_8139_OLD_RX_RESET is not set |
| 2072 | 2072 |
# CONFIG_R8169 is not set |
| 2073 | 2073 |
# CONFIG_NET_VENDOR_RENESAS is not set |
| 2074 |
-# CONFIG_NET_VENDOR_RDC is not set |
|
| 2075 | 2074 |
# CONFIG_NET_VENDOR_ROCKER is not set |
| 2076 | 2075 |
# CONFIG_NET_VENDOR_SAMSUNG is not set |
| 2077 | 2076 |
# CONFIG_NET_VENDOR_SEEQ is not set |
| 2077 |
+# CONFIG_NET_VENDOR_SOLARFLARE is not set |
|
| 2078 | 2078 |
# CONFIG_NET_VENDOR_SILAN is not set |
| 2079 | 2079 |
# CONFIG_NET_VENDOR_SIS is not set |
| 2080 |
-# CONFIG_NET_VENDOR_SOLARFLARE is not set |
|
| 2081 | 2080 |
# CONFIG_NET_VENDOR_SMSC is not set |
| 2081 |
+# CONFIG_NET_VENDOR_SOCIONEXT is not set |
|
| 2082 | 2082 |
# CONFIG_NET_VENDOR_STMICRO is not set |
| 2083 | 2083 |
# CONFIG_NET_VENDOR_SUN is not set |
| 2084 |
+# CONFIG_NET_VENDOR_SYNOPSYS is not set |
|
| 2084 | 2085 |
# CONFIG_NET_VENDOR_TEHUTI is not set |
| 2085 | 2086 |
# CONFIG_NET_VENDOR_TI is not set |
| 2086 | 2087 |
# CONFIG_NET_VENDOR_VIA is not set |
| 2087 | 2088 |
# CONFIG_NET_VENDOR_WIZNET is not set |
| 2088 |
-# CONFIG_NET_VENDOR_SYNOPSYS is not set |
|
| 2089 | 2089 |
# CONFIG_FDDI is not set |
| 2090 | 2090 |
# CONFIG_HIPPI is not set |
| 2091 | 2091 |
# CONFIG_NET_SB1000 is not set |
| 2092 | 2092 |
CONFIG_MDIO_DEVICE=y |
| 2093 | 2093 |
CONFIG_MDIO_BUS=m |
| 2094 | 2094 |
# CONFIG_MDIO_BITBANG is not set |
| 2095 |
+# CONFIG_MDIO_MSCC_MIIM is not set |
|
| 2095 | 2096 |
# CONFIG_MDIO_THUNDER is not set |
| 2096 | 2097 |
CONFIG_PHYLIB=m |
| 2097 | 2098 |
|
| ... | ... |
@@ -2100,6 +2134,7 @@ CONFIG_PHYLIB=m |
| 2100 | 2100 |
# |
| 2101 | 2101 |
# CONFIG_AMD_PHY is not set |
| 2102 | 2102 |
# CONFIG_AQUANTIA_PHY is not set |
| 2103 |
+# CONFIG_ASIX_PHY is not set |
|
| 2103 | 2104 |
# CONFIG_AT803X_PHY is not set |
| 2104 | 2105 |
# CONFIG_BCM7XXX_PHY is not set |
| 2105 | 2106 |
# CONFIG_BCM87XX_PHY is not set |
| ... | ... |
@@ -2107,6 +2142,8 @@ CONFIG_PHYLIB=m |
| 2107 | 2107 |
# CONFIG_CICADA_PHY is not set |
| 2108 | 2108 |
# CONFIG_CORTINA_PHY is not set |
| 2109 | 2109 |
# CONFIG_DAVICOM_PHY is not set |
| 2110 |
+# CONFIG_DP83822_PHY is not set |
|
| 2111 |
+# CONFIG_DP83TC811_PHY is not set |
|
| 2110 | 2112 |
# CONFIG_DP83848_PHY is not set |
| 2111 | 2113 |
# CONFIG_DP83867_PHY is not set |
| 2112 | 2114 |
# CONFIG_FIXED_PHY is not set |
| ... | ... |
@@ -2118,10 +2155,12 @@ CONFIG_PHYLIB=m |
| 2118 | 2118 |
# CONFIG_MARVELL_10G_PHY is not set |
| 2119 | 2119 |
# CONFIG_MICREL_PHY is not set |
| 2120 | 2120 |
# CONFIG_MICROCHIP_PHY is not set |
| 2121 |
+# CONFIG_MICROCHIP_T1_PHY is not set |
|
| 2121 | 2122 |
# CONFIG_MICROSEMI_PHY is not set |
| 2122 | 2123 |
# CONFIG_NATIONAL_PHY is not set |
| 2123 | 2124 |
# CONFIG_QSEMI_PHY is not set |
| 2124 | 2125 |
# CONFIG_REALTEK_PHY is not set |
| 2126 |
+# CONFIG_RENESAS_PHY is not set |
|
| 2125 | 2127 |
# CONFIG_ROCKCHIP_PHY is not set |
| 2126 | 2128 |
# CONFIG_SMSC_PHY is not set |
| 2127 | 2129 |
# CONFIG_STE10XP is not set |
| ... | ... |
@@ -2158,6 +2197,8 @@ CONFIG_XEN_NETDEV_BACKEND=m |
| 2158 | 2158 |
CONFIG_VMXNET3=m |
| 2159 | 2159 |
# CONFIG_FUJITSU_ES is not set |
| 2160 | 2160 |
CONFIG_HYPERV_NET=m |
| 2161 |
+# CONFIG_NETDEVSIM is not set |
|
| 2162 |
+CONFIG_NET_FAILOVER=m |
|
| 2161 | 2163 |
# CONFIG_ISDN is not set |
| 2162 | 2164 |
# CONFIG_NVM is not set |
| 2163 | 2165 |
|
| ... | ... |
@@ -2300,7 +2341,6 @@ CONFIG_SERIAL_8250_PCI=y |
| 2300 | 2300 |
CONFIG_SERIAL_8250_NR_UARTS=4 |
| 2301 | 2301 |
CONFIG_SERIAL_8250_RUNTIME_UARTS=4 |
| 2302 | 2302 |
# CONFIG_SERIAL_8250_EXTENDED is not set |
| 2303 |
-# CONFIG_SERIAL_8250_FSL is not set |
|
| 2304 | 2303 |
# CONFIG_SERIAL_8250_DW is not set |
| 2305 | 2304 |
# CONFIG_SERIAL_8250_RT288X is not set |
| 2306 | 2305 |
# CONFIG_SERIAL_8250_LPSS is not set |
| ... | ... |
@@ -2338,7 +2378,6 @@ CONFIG_HW_RANDOM_AMD=m |
| 2338 | 2338 |
CONFIG_HW_RANDOM_RDRAND=m |
| 2339 | 2339 |
CONFIG_HW_RANDOM_VIA=m |
| 2340 | 2340 |
CONFIG_HW_RANDOM_VIRTIO=m |
| 2341 |
-CONFIG_HW_RANDOM_TPM=m |
|
| 2342 | 2341 |
CONFIG_NVRAM=m |
| 2343 | 2342 |
# CONFIG_R3964 is not set |
| 2344 | 2343 |
# CONFIG_APPLICOM is not set |
| ... | ... |
@@ -2414,7 +2453,6 @@ CONFIG_I2C_ALGOBIT=y |
| 2414 | 2414 |
# CONFIG_I2C_EMEV2 is not set |
| 2415 | 2415 |
# CONFIG_I2C_OCORES is not set |
| 2416 | 2416 |
# CONFIG_I2C_PCA_PLATFORM is not set |
| 2417 |
-# CONFIG_I2C_PXA_PCI is not set |
|
| 2418 | 2417 |
# CONFIG_I2C_SIMTEC is not set |
| 2419 | 2418 |
# CONFIG_I2C_XILINX is not set |
| 2420 | 2419 |
|
| ... | ... |
@@ -2456,6 +2494,7 @@ CONFIG_PPS_CLIENT_GPIO=m |
| 2456 | 2456 |
CONFIG_PTP_1588_CLOCK=m |
| 2457 | 2457 |
# CONFIG_DP83640_PHY is not set |
| 2458 | 2458 |
CONFIG_PTP_1588_CLOCK_KVM=m |
| 2459 |
+# CONFIG_PINCTRL is not set |
|
| 2459 | 2460 |
# CONFIG_GPIOLIB is not set |
| 2460 | 2461 |
# CONFIG_W1 is not set |
| 2461 | 2462 |
# CONFIG_POWER_AVS is not set |
| ... | ... |
@@ -2479,7 +2518,6 @@ CONFIG_POWER_SUPPLY=y |
| 2479 | 2479 |
# CONFIG_CHARGER_SMB347 is not set |
| 2480 | 2480 |
# CONFIG_BATTERY_GAUGE_LTC2941 is not set |
| 2481 | 2481 |
CONFIG_HWMON=m |
| 2482 |
-# CONFIG_HWMON_VID is not set |
|
| 2483 | 2482 |
# CONFIG_HWMON_DEBUG_CHIP is not set |
| 2484 | 2483 |
|
| 2485 | 2484 |
# |
| ... | ... |
@@ -2539,6 +2577,7 @@ CONFIG_SENSORS_DELL_SMM=m |
| 2539 | 2539 |
# CONFIG_SENSORS_MAX1619 is not set |
| 2540 | 2540 |
# CONFIG_SENSORS_MAX1668 is not set |
| 2541 | 2541 |
# CONFIG_SENSORS_MAX197 is not set |
| 2542 |
+# CONFIG_SENSORS_MAX6621 is not set |
|
| 2542 | 2543 |
# CONFIG_SENSORS_MAX6639 is not set |
| 2543 | 2544 |
# CONFIG_SENSORS_MAX6642 is not set |
| 2544 | 2545 |
# CONFIG_SENSORS_MAX6650 is not set |
| ... | ... |
@@ -2581,7 +2620,6 @@ CONFIG_SENSORS_DELL_SMM=m |
| 2581 | 2581 |
# CONFIG_SENSORS_SMSC47M1 is not set |
| 2582 | 2582 |
# CONFIG_SENSORS_SMSC47M192 is not set |
| 2583 | 2583 |
# CONFIG_SENSORS_SMSC47B397 is not set |
| 2584 |
-# CONFIG_SENSORS_SCH56XX_COMMON is not set |
|
| 2585 | 2584 |
# CONFIG_SENSORS_STTS751 is not set |
| 2586 | 2585 |
# CONFIG_SENSORS_SMM665 is not set |
| 2587 | 2586 |
# CONFIG_SENSORS_ADC128D818 is not set |
| ... | ... |
@@ -2602,6 +2640,7 @@ CONFIG_SENSORS_DELL_SMM=m |
| 2602 | 2602 |
# CONFIG_SENSORS_VIA686A is not set |
| 2603 | 2603 |
# CONFIG_SENSORS_VT1211 is not set |
| 2604 | 2604 |
# CONFIG_SENSORS_VT8231 is not set |
| 2605 |
+# CONFIG_SENSORS_W83773G is not set |
|
| 2605 | 2606 |
# CONFIG_SENSORS_W83781D is not set |
| 2606 | 2607 |
# CONFIG_SENSORS_W83791D is not set |
| 2607 | 2608 |
# CONFIG_SENSORS_W83792D is not set |
| ... | ... |
@@ -2619,6 +2658,7 @@ CONFIG_SENSORS_DELL_SMM=m |
| 2619 | 2619 |
CONFIG_SENSORS_ACPI_POWER=m |
| 2620 | 2620 |
# CONFIG_SENSORS_ATK0110 is not set |
| 2621 | 2621 |
CONFIG_THERMAL=y |
| 2622 |
+# CONFIG_THERMAL_STATISTICS is not set |
|
| 2622 | 2623 |
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 |
| 2623 | 2624 |
CONFIG_THERMAL_WRITABLE_TRIPS=y |
| 2624 | 2625 |
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y |
| ... | ... |
@@ -2642,15 +2682,10 @@ CONFIG_X86_PKG_TEMP_THERMAL=m |
| 2642 | 2642 |
# CONFIG_INTEL_PCH_THERMAL is not set |
| 2643 | 2643 |
# CONFIG_WATCHDOG is not set |
| 2644 | 2644 |
CONFIG_SSB_POSSIBLE=y |
| 2645 |
- |
|
| 2646 |
-# |
|
| 2647 |
-# Sonics Silicon Backplane |
|
| 2648 |
-# |
|
| 2649 | 2645 |
CONFIG_SSB=m |
| 2650 | 2646 |
CONFIG_SSB_SPROM=y |
| 2651 | 2647 |
CONFIG_SSB_PCIHOST_POSSIBLE=y |
| 2652 | 2648 |
CONFIG_SSB_PCIHOST=y |
| 2653 |
-# CONFIG_SSB_B43_PCI_BRIDGE is not set |
|
| 2654 | 2649 |
# CONFIG_SSB_SILENT is not set |
| 2655 | 2650 |
# CONFIG_SSB_DEBUG is not set |
| 2656 | 2651 |
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y |
| ... | ... |
@@ -2699,7 +2734,6 @@ CONFIG_LPC_SCH=m |
| 2699 | 2699 |
# CONFIG_MFD_RETU is not set |
| 2700 | 2700 |
# CONFIG_MFD_PCF50633 is not set |
| 2701 | 2701 |
# CONFIG_MFD_RDC321X is not set |
| 2702 |
-# CONFIG_MFD_RTSX_PCI is not set |
|
| 2703 | 2702 |
# CONFIG_MFD_RT5033 is not set |
| 2704 | 2703 |
# CONFIG_MFD_RC5T583 is not set |
| 2705 | 2704 |
# CONFIG_MFD_SEC_CORE is not set |
| ... | ... |
@@ -2718,10 +2752,8 @@ CONFIG_LPC_SCH=m |
| 2718 | 2718 |
# CONFIG_TPS6507X is not set |
| 2719 | 2719 |
# CONFIG_MFD_TPS65086 is not set |
| 2720 | 2720 |
# CONFIG_MFD_TPS65090 is not set |
| 2721 |
-# CONFIG_MFD_TPS65217 is not set |
|
| 2722 | 2721 |
# CONFIG_MFD_TPS68470 is not set |
| 2723 | 2722 |
# CONFIG_MFD_TI_LP873X is not set |
| 2724 |
-# CONFIG_MFD_TPS65218 is not set |
|
| 2725 | 2723 |
# CONFIG_MFD_TPS6586X is not set |
| 2726 | 2724 |
# CONFIG_MFD_TPS65912_I2C is not set |
| 2727 | 2725 |
# CONFIG_MFD_TPS80031 is not set |
| ... | ... |
@@ -2729,13 +2761,13 @@ CONFIG_LPC_SCH=m |
| 2729 | 2729 |
# CONFIG_TWL6040_CORE is not set |
| 2730 | 2730 |
# CONFIG_MFD_WL1273_CORE is not set |
| 2731 | 2731 |
# CONFIG_MFD_LM3533 is not set |
| 2732 |
-# CONFIG_MFD_TMIO is not set |
|
| 2733 | 2732 |
# CONFIG_MFD_VX855 is not set |
| 2734 | 2733 |
# CONFIG_MFD_ARIZONA_I2C is not set |
| 2735 | 2734 |
# CONFIG_MFD_WM8400 is not set |
| 2736 | 2735 |
# CONFIG_MFD_WM831X_I2C is not set |
| 2737 | 2736 |
# CONFIG_MFD_WM8350_I2C is not set |
| 2738 | 2737 |
# CONFIG_MFD_WM8994 is not set |
| 2738 |
+# CONFIG_RAVE_SP_CORE is not set |
|
| 2739 | 2739 |
# CONFIG_REGULATOR is not set |
| 2740 | 2740 |
# CONFIG_RC_CORE is not set |
| 2741 | 2741 |
# CONFIG_MEDIA_SUPPORT is not set |
| ... | ... |
@@ -2756,7 +2788,7 @@ CONFIG_DRM=y |
| 2756 | 2756 |
CONFIG_DRM_MIPI_DSI=y |
| 2757 | 2757 |
# CONFIG_DRM_DP_AUX_CHARDEV is not set |
| 2758 | 2758 |
# CONFIG_DRM_DEBUG_MM is not set |
| 2759 |
-# CONFIG_DRM_DEBUG_MM_SELFTEST is not set |
|
| 2759 |
+# CONFIG_DRM_DEBUG_SELFTEST is not set |
|
| 2760 | 2760 |
CONFIG_DRM_KMS_HELPER=y |
| 2761 | 2761 |
CONFIG_DRM_KMS_FB_HELPER=y |
| 2762 | 2762 |
CONFIG_DRM_FBDEV_EMULATION=y |
| ... | ... |
@@ -2771,6 +2803,7 @@ CONFIG_DRM_VM=y |
| 2771 | 2771 |
# CONFIG_DRM_I2C_CH7006 is not set |
| 2772 | 2772 |
# CONFIG_DRM_I2C_SIL164 is not set |
| 2773 | 2773 |
# CONFIG_DRM_I2C_NXP_TDA998X is not set |
| 2774 |
+# CONFIG_DRM_I2C_NXP_TDA9950 is not set |
|
| 2774 | 2775 |
CONFIG_DRM_RADEON=m |
| 2775 | 2776 |
# CONFIG_DRM_RADEON_USERPTR is not set |
| 2776 | 2777 |
# CONFIG_DRM_AMDGPU is not set |
| ... | ... |
@@ -2778,9 +2811,14 @@ CONFIG_DRM_RADEON=m |
| 2778 | 2778 |
# |
| 2779 | 2779 |
# ACP (Audio CoProcessor) Configuration |
| 2780 | 2780 |
# |
| 2781 |
+ |
|
| 2782 |
+# |
|
| 2783 |
+# AMD Library routines |
|
| 2784 |
+# |
|
| 2781 | 2785 |
CONFIG_DRM_NOUVEAU=m |
| 2782 | 2786 |
CONFIG_NOUVEAU_DEBUG=5 |
| 2783 | 2787 |
CONFIG_NOUVEAU_DEBUG_DEFAULT=3 |
| 2788 |
+# CONFIG_NOUVEAU_DEBUG_MMU is not set |
|
| 2784 | 2789 |
CONFIG_DRM_NOUVEAU_BACKLIGHT=y |
| 2785 | 2790 |
CONFIG_DRM_I915=m |
| 2786 | 2791 |
# CONFIG_DRM_I915_ALPHA_SUPPORT is not set |
| ... | ... |
@@ -2795,6 +2833,7 @@ CONFIG_DRM_I915_USERPTR=y |
| 2795 | 2795 |
# CONFIG_DRM_I915_DEBUG is not set |
| 2796 | 2796 |
# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set |
| 2797 | 2797 |
# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set |
| 2798 |
+# CONFIG_DRM_I915_DEBUG_GUC is not set |
|
| 2798 | 2799 |
# CONFIG_DRM_I915_SELFTEST is not set |
| 2799 | 2800 |
# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set |
| 2800 | 2801 |
# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set |
| ... | ... |
@@ -2813,6 +2852,7 @@ CONFIG_DRM_PANEL=y |
| 2813 | 2813 |
# |
| 2814 | 2814 |
# Display Panels |
| 2815 | 2815 |
# |
| 2816 |
+# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set |
|
| 2816 | 2817 |
CONFIG_DRM_BRIDGE=y |
| 2817 | 2818 |
CONFIG_DRM_PANEL_BRIDGE=y |
| 2818 | 2819 |
|
| ... | ... |
@@ -2822,8 +2862,9 @@ CONFIG_DRM_PANEL_BRIDGE=y |
| 2822 | 2822 |
# CONFIG_DRM_ANALOGIX_ANX78XX is not set |
| 2823 | 2823 |
# CONFIG_DRM_HISI_HIBMC is not set |
| 2824 | 2824 |
# CONFIG_DRM_TINYDRM is not set |
| 2825 |
+# CONFIG_DRM_XEN is not set |
|
| 2825 | 2826 |
# CONFIG_DRM_LEGACY is not set |
| 2826 |
-# CONFIG_DRM_LIB_RANDOM is not set |
|
| 2827 |
+CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y |
|
| 2827 | 2828 |
|
| 2828 | 2829 |
# |
| 2829 | 2830 |
# Frame buffer Devices |
| ... | ... |
@@ -2837,16 +2878,12 @@ CONFIG_FB_BOOT_VESA_SUPPORT=y |
| 2837 | 2837 |
CONFIG_FB_CFB_FILLRECT=y |
| 2838 | 2838 |
CONFIG_FB_CFB_COPYAREA=y |
| 2839 | 2839 |
CONFIG_FB_CFB_IMAGEBLIT=y |
| 2840 |
-# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set |
|
| 2841 | 2840 |
CONFIG_FB_SYS_FILLRECT=y |
| 2842 | 2841 |
CONFIG_FB_SYS_COPYAREA=y |
| 2843 | 2842 |
CONFIG_FB_SYS_IMAGEBLIT=y |
| 2844 |
-# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set |
|
| 2845 | 2843 |
# CONFIG_FB_FOREIGN_ENDIAN is not set |
| 2846 | 2844 |
CONFIG_FB_SYS_FOPS=y |
| 2847 | 2845 |
CONFIG_FB_DEFERRED_IO=y |
| 2848 |
-# CONFIG_FB_SVGALIB is not set |
|
| 2849 |
-# CONFIG_FB_MACMODES is not set |
|
| 2850 | 2846 |
CONFIG_FB_BACKLIGHT=y |
| 2851 | 2847 |
CONFIG_FB_MODE_HELPERS=y |
| 2852 | 2848 |
# CONFIG_FB_TILEBLITTING is not set |
| ... | ... |
@@ -2900,7 +2937,6 @@ CONFIG_XEN_FBDEV_FRONTEND=m |
| 2900 | 2900 |
# CONFIG_FB_METRONOME is not set |
| 2901 | 2901 |
# CONFIG_FB_MB862XX is not set |
| 2902 | 2902 |
# CONFIG_FB_BROADSHEET is not set |
| 2903 |
-# CONFIG_FB_AUO_K190X is not set |
|
| 2904 | 2903 |
CONFIG_FB_HYPERV=m |
| 2905 | 2904 |
# CONFIG_FB_SIMPLE is not set |
| 2906 | 2905 |
# CONFIG_FB_SM712 is not set |
| ... | ... |
@@ -2935,7 +2971,6 @@ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y |
| 2935 | 2935 |
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y |
| 2936 | 2936 |
# CONFIG_LOGO is not set |
| 2937 | 2937 |
CONFIG_SOUND=m |
| 2938 |
-# CONFIG_SOUND_OSS_CORE is not set |
|
| 2939 | 2938 |
CONFIG_SND=m |
| 2940 | 2939 |
CONFIG_SND_TIMER=m |
| 2941 | 2940 |
CONFIG_SND_PCM=m |
| ... | ... |
@@ -2954,8 +2989,6 @@ CONFIG_SND_VERBOSE_PROCFS=y |
| 2954 | 2954 |
CONFIG_SND_VMASTER=y |
| 2955 | 2955 |
CONFIG_SND_DMA_SGBUF=y |
| 2956 | 2956 |
# CONFIG_SND_SEQUENCER is not set |
| 2957 |
-# CONFIG_SND_OPL3_LIB_SEQ is not set |
|
| 2958 |
-# CONFIG_SND_OPL4_LIB_SEQ is not set |
|
| 2959 | 2957 |
CONFIG_SND_AC97_CODEC=m |
| 2960 | 2958 |
CONFIG_SND_DRIVERS=y |
| 2961 | 2959 |
# CONFIG_SND_DUMMY is not set |
| ... | ... |
@@ -2999,7 +3032,6 @@ CONFIG_SND_PCI=y |
| 2999 | 2999 |
# CONFIG_SND_INDIGOIOX is not set |
| 3000 | 3000 |
# CONFIG_SND_INDIGODJX is not set |
| 3001 | 3001 |
# CONFIG_SND_EMU10K1 is not set |
| 3002 |
-# CONFIG_SND_EMU10K1_SEQ is not set |
|
| 3003 | 3002 |
# CONFIG_SND_EMU10K1X is not set |
| 3004 | 3003 |
# CONFIG_SND_ENS1370 is not set |
| 3005 | 3004 |
CONFIG_SND_ENS1371=m |
| ... | ... |
@@ -3059,6 +3091,7 @@ CONFIG_SND_HDA_I915=y |
| 3059 | 3059 |
CONFIG_SND_HDA_PREALLOC_SIZE=64 |
| 3060 | 3060 |
# CONFIG_SND_SOC is not set |
| 3061 | 3061 |
# CONFIG_SND_X86 is not set |
| 3062 |
+# CONFIG_SND_XEN_FRONTEND is not set |
|
| 3062 | 3063 |
CONFIG_AC97_BUS=m |
| 3063 | 3064 |
|
| 3064 | 3065 |
# |
| ... | ... |
@@ -3096,6 +3129,7 @@ CONFIG_HID_GENERIC=m |
| 3096 | 3096 |
# CONFIG_HID_GYRATION is not set |
| 3097 | 3097 |
# CONFIG_HID_ICADE is not set |
| 3098 | 3098 |
# CONFIG_HID_ITE is not set |
| 3099 |
+# CONFIG_HID_JABRA is not set |
|
| 3099 | 3100 |
# CONFIG_HID_TWINHAN is not set |
| 3100 | 3101 |
# CONFIG_HID_KENSINGTON is not set |
| 3101 | 3102 |
# CONFIG_HID_LCPOWER is not set |
| ... | ... |
@@ -3104,6 +3138,7 @@ CONFIG_HID_GENERIC=m |
| 3104 | 3104 |
# CONFIG_HID_LOGITECH is not set |
| 3105 | 3105 |
# CONFIG_HID_MAGICMOUSE is not set |
| 3106 | 3106 |
# CONFIG_HID_MAYFLASH is not set |
| 3107 |
+# CONFIG_HID_REDRAGON is not set |
|
| 3107 | 3108 |
# CONFIG_HID_MICROSOFT is not set |
| 3108 | 3109 |
# CONFIG_HID_MONTEREY is not set |
| 3109 | 3110 |
# CONFIG_HID_MULTITOUCH is not set |
| ... | ... |
@@ -3117,6 +3152,7 @@ CONFIG_HID_GENERIC=m |
| 3117 | 3117 |
# CONFIG_HID_SAITEK is not set |
| 3118 | 3118 |
# CONFIG_HID_SAMSUNG is not set |
| 3119 | 3119 |
# CONFIG_HID_SPEEDLINK is not set |
| 3120 |
+# CONFIG_HID_STEAM is not set |
|
| 3120 | 3121 |
# CONFIG_HID_STEELSERIES is not set |
| 3121 | 3122 |
# CONFIG_HID_SUNPLUS is not set |
| 3122 | 3123 |
# CONFIG_HID_RMI is not set |
| ... | ... |
@@ -3157,6 +3193,7 @@ CONFIG_LEDS_CLASS=m |
| 3157 | 3157 |
# |
| 3158 | 3158 |
# LED drivers |
| 3159 | 3159 |
# |
| 3160 |
+# CONFIG_LEDS_APU is not set |
|
| 3160 | 3161 |
# CONFIG_LEDS_LM3530 is not set |
| 3161 | 3162 |
# CONFIG_LEDS_LM3642 is not set |
| 3162 | 3163 |
# CONFIG_LEDS_PCA9532 is not set |
| ... | ... |
@@ -3165,7 +3202,6 @@ CONFIG_LEDS_CLASS=m |
| 3165 | 3165 |
# CONFIG_LEDS_LP5523 is not set |
| 3166 | 3166 |
# CONFIG_LEDS_LP5562 is not set |
| 3167 | 3167 |
# CONFIG_LEDS_LP8501 is not set |
| 3168 |
-# CONFIG_LEDS_LP8860 is not set |
|
| 3169 | 3168 |
# CONFIG_LEDS_CLEVO_MAIL is not set |
| 3170 | 3169 |
# CONFIG_LEDS_PCA955X is not set |
| 3171 | 3170 |
# CONFIG_LEDS_PCA963X is not set |
| ... | ... |
@@ -3180,6 +3216,7 @@ CONFIG_LEDS_CLASS=m |
| 3180 | 3180 |
# |
| 3181 | 3181 |
# CONFIG_LEDS_BLINKM is not set |
| 3182 | 3182 |
# CONFIG_LEDS_MLXCPLD is not set |
| 3183 |
+# CONFIG_LEDS_MLXREG is not set |
|
| 3183 | 3184 |
# CONFIG_LEDS_USER is not set |
| 3184 | 3185 |
# CONFIG_LEDS_NIC78BX is not set |
| 3185 | 3186 |
|
| ... | ... |
@@ -3191,7 +3228,7 @@ CONFIG_LEDS_CLASS=m |
| 3191 | 3191 |
CONFIG_INFINIBAND=m |
| 3192 | 3192 |
# CONFIG_INFINIBAND_USER_MAD is not set |
| 3193 | 3193 |
CONFIG_INFINIBAND_USER_ACCESS=m |
| 3194 |
-# CONFIG_INFINIBAND_EXP_USER_ACCESS is not set |
|
| 3194 |
+# CONFIG_INFINIBAND_EXP_LEGACY_VERBS_NEW_UAPI is not set |
|
| 3195 | 3195 |
CONFIG_INFINIBAND_USER_MEM=y |
| 3196 | 3196 |
CONFIG_INFINIBAND_ON_DEMAND_PAGING=y |
| 3197 | 3197 |
CONFIG_INFINIBAND_ADDR_TRANS=y |
| ... | ... |
@@ -3267,6 +3304,7 @@ CONFIG_RTC_INTF_DEV=y |
| 3267 | 3267 |
# CONFIG_RTC_DRV_X1205 is not set |
| 3268 | 3268 |
# CONFIG_RTC_DRV_PCF8523 is not set |
| 3269 | 3269 |
# CONFIG_RTC_DRV_PCF85063 is not set |
| 3270 |
+# CONFIG_RTC_DRV_PCF85363 is not set |
|
| 3270 | 3271 |
# CONFIG_RTC_DRV_PCF8563 is not set |
| 3271 | 3272 |
# CONFIG_RTC_DRV_PCF8583 is not set |
| 3272 | 3273 |
# CONFIG_RTC_DRV_M41T80 is not set |
| ... | ... |
@@ -3372,11 +3410,9 @@ CONFIG_VFIO_PCI_IGD=y |
| 3372 | 3372 |
# CONFIG_VFIO_MDEV is not set |
| 3373 | 3373 |
CONFIG_IRQ_BYPASS_MANAGER=m |
| 3374 | 3374 |
CONFIG_VIRT_DRIVERS=y |
| 3375 |
+# CONFIG_VBOXGUEST is not set |
|
| 3375 | 3376 |
CONFIG_VIRTIO=m |
| 3376 |
- |
|
| 3377 |
-# |
|
| 3378 |
-# Virtio drivers |
|
| 3379 |
-# |
|
| 3377 |
+CONFIG_VIRTIO_MENU=y |
|
| 3380 | 3378 |
CONFIG_VIRTIO_PCI=m |
| 3381 | 3379 |
CONFIG_VIRTIO_PCI_LEGACY=y |
| 3382 | 3380 |
# CONFIG_VIRTIO_BALLOON is not set |
| ... | ... |
@@ -3407,6 +3443,7 @@ CONFIG_XEN_GRANT_DEV_ALLOC=m |
| 3407 | 3407 |
CONFIG_SWIOTLB_XEN=y |
| 3408 | 3408 |
CONFIG_XEN_TMEM=m |
| 3409 | 3409 |
CONFIG_XEN_PCIDEV_BACKEND=m |
| 3410 |
+# CONFIG_XEN_PVCALLS_FRONTEND is not set |
|
| 3410 | 3411 |
# CONFIG_XEN_PVCALLS_BACKEND is not set |
| 3411 | 3412 |
# CONFIG_XEN_SCSI_BACKEND is not set |
| 3412 | 3413 |
CONFIG_XEN_PRIVCMD=m |
| ... | ... |
@@ -3420,17 +3457,22 @@ CONFIG_XEN_HAVE_VPMU=y |
| 3420 | 3420 |
# CONFIG_STAGING is not set |
| 3421 | 3421 |
CONFIG_X86_PLATFORM_DEVICES=y |
| 3422 | 3422 |
# CONFIG_ACER_WMI is not set |
| 3423 |
+# CONFIG_ACER_WIRELESS is not set |
|
| 3423 | 3424 |
# CONFIG_ACERHDF is not set |
| 3424 | 3425 |
# CONFIG_ALIENWARE_WMI is not set |
| 3425 | 3426 |
# CONFIG_ASUS_LAPTOP is not set |
| 3426 | 3427 |
CONFIG_DELL_SMBIOS=m |
| 3428 |
+# CONFIG_DELL_SMBIOS_WMI is not set |
|
| 3429 |
+# CONFIG_DELL_SMBIOS_SMM is not set |
|
| 3427 | 3430 |
CONFIG_DELL_LAPTOP=m |
| 3428 | 3431 |
CONFIG_DELL_WMI=m |
| 3432 |
+CONFIG_DELL_WMI_DESCRIPTOR=m |
|
| 3429 | 3433 |
# CONFIG_DELL_WMI_AIO is not set |
| 3430 | 3434 |
CONFIG_DELL_WMI_LED=m |
| 3431 | 3435 |
# CONFIG_DELL_SMO8800 is not set |
| 3432 | 3436 |
# CONFIG_FUJITSU_LAPTOP is not set |
| 3433 | 3437 |
# CONFIG_FUJITSU_TABLET is not set |
| 3438 |
+# CONFIG_GPD_POCKET_FAN is not set |
|
| 3434 | 3439 |
# CONFIG_HP_ACCEL is not set |
| 3435 | 3440 |
# CONFIG_HP_WIRELESS is not set |
| 3436 | 3441 |
# CONFIG_HP_WMI is not set |
| ... | ... |
@@ -3443,6 +3485,7 @@ CONFIG_DELL_WMI_LED=m |
| 3443 | 3443 |
# CONFIG_ASUS_WIRELESS is not set |
| 3444 | 3444 |
CONFIG_ACPI_WMI=m |
| 3445 | 3445 |
CONFIG_WMI_BMOF=m |
| 3446 |
+# CONFIG_INTEL_WMI_THUNDERBOLT is not set |
|
| 3446 | 3447 |
# CONFIG_MSI_WMI is not set |
| 3447 | 3448 |
# CONFIG_PEAQ_WMI is not set |
| 3448 | 3449 |
# CONFIG_TOPSTAR_LAPTOP is not set |
| ... | ... |
@@ -3450,7 +3493,6 @@ CONFIG_WMI_BMOF=m |
| 3450 | 3450 |
# CONFIG_TOSHIBA_HAPS is not set |
| 3451 | 3451 |
# CONFIG_TOSHIBA_WMI is not set |
| 3452 | 3452 |
# CONFIG_ACPI_CMPC is not set |
| 3453 |
-# CONFIG_INTEL_CHT_INT33FE is not set |
|
| 3454 | 3453 |
# CONFIG_INTEL_HID_EVENT is not set |
| 3455 | 3454 |
# CONFIG_INTEL_VBTN is not set |
| 3456 | 3455 |
# CONFIG_INTEL_IPS is not set |
| ... | ... |
@@ -3467,10 +3509,10 @@ CONFIG_MXM_WMI=m |
| 3467 | 3467 |
# CONFIG_SURFACE_PRO3_BUTTON is not set |
| 3468 | 3468 |
# CONFIG_INTEL_PUNIT_IPC is not set |
| 3469 | 3469 |
# CONFIG_MLX_PLATFORM is not set |
| 3470 |
-# CONFIG_MLX_CPLD_PLATFORM is not set |
|
| 3471 | 3470 |
# CONFIG_INTEL_TURBO_MAX_3 is not set |
| 3472 | 3471 |
CONFIG_PMC_ATOM=y |
| 3473 | 3472 |
# CONFIG_CHROME_PLATFORMS is not set |
| 3473 |
+# CONFIG_MELLANOX_PLATFORM is not set |
|
| 3474 | 3474 |
CONFIG_CLKDEV_LOOKUP=y |
| 3475 | 3475 |
CONFIG_HAVE_CLK_PREPARE=y |
| 3476 | 3476 |
CONFIG_COMMON_CLK=y |
| ... | ... |
@@ -3479,23 +3521,16 @@ CONFIG_COMMON_CLK=y |
| 3479 | 3479 |
# Common Clock Framework |
| 3480 | 3480 |
# |
| 3481 | 3481 |
# CONFIG_COMMON_CLK_SI5351 is not set |
| 3482 |
+# CONFIG_COMMON_CLK_SI544 is not set |
|
| 3482 | 3483 |
# CONFIG_COMMON_CLK_CDCE706 is not set |
| 3483 | 3484 |
# CONFIG_COMMON_CLK_CS2000_CP is not set |
| 3484 |
-# CONFIG_COMMON_CLK_NXP is not set |
|
| 3485 |
-# CONFIG_COMMON_CLK_PXA is not set |
|
| 3486 |
-# CONFIG_COMMON_CLK_PIC32 is not set |
|
| 3487 |
-CONFIG_HWSPINLOCK=m |
|
| 3485 |
+CONFIG_HWSPINLOCK=y |
|
| 3488 | 3486 |
|
| 3489 | 3487 |
# |
| 3490 | 3488 |
# Clock Source drivers |
| 3491 | 3489 |
# |
| 3492 | 3490 |
CONFIG_CLKEVT_I8253=y |
| 3493 | 3491 |
CONFIG_CLKBLD_I8253=y |
| 3494 |
-# CONFIG_ATMEL_PIT is not set |
|
| 3495 |
-# CONFIG_SH_TIMER_CMT is not set |
|
| 3496 |
-# CONFIG_SH_TIMER_MTU2 is not set |
|
| 3497 |
-# CONFIG_SH_TIMER_TMU is not set |
|
| 3498 |
-# CONFIG_EM_TIMER_STI is not set |
|
| 3499 | 3492 |
CONFIG_MAILBOX=y |
| 3500 | 3493 |
CONFIG_PCC=y |
| 3501 | 3494 |
# CONFIG_ALTERA_MBOX is not set |
| ... | ... |
@@ -3523,6 +3558,8 @@ CONFIG_IRQ_REMAP=y |
| 3523 | 3523 |
# Rpmsg drivers |
| 3524 | 3524 |
# |
| 3525 | 3525 |
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set |
| 3526 |
+# CONFIG_RPMSG_VIRTIO is not set |
|
| 3527 |
+# CONFIG_SOUNDWIRE is not set |
|
| 3526 | 3528 |
|
| 3527 | 3529 |
# |
| 3528 | 3530 |
# SOC (System On Chip) specific Drivers |
| ... | ... |
@@ -3543,8 +3580,12 @@ CONFIG_IRQ_REMAP=y |
| 3543 | 3543 |
# |
| 3544 | 3544 |
# Qualcomm SoC drivers |
| 3545 | 3545 |
# |
| 3546 |
-# CONFIG_SUNXI_SRAM is not set |
|
| 3547 | 3546 |
# CONFIG_SOC_TI is not set |
| 3547 |
+ |
|
| 3548 |
+# |
|
| 3549 |
+# Xilinx SoC drivers |
|
| 3550 |
+# |
|
| 3551 |
+# CONFIG_XILINX_VCU is not set |
|
| 3548 | 3552 |
# CONFIG_PM_DEVFREQ is not set |
| 3549 | 3553 |
# CONFIG_EXTCON is not set |
| 3550 | 3554 |
# CONFIG_MEMORY is not set |
| ... | ... |
@@ -3552,6 +3593,10 @@ CONFIG_IRQ_REMAP=y |
| 3552 | 3552 |
# CONFIG_NTB is not set |
| 3553 | 3553 |
# CONFIG_VME_BUS is not set |
| 3554 | 3554 |
# CONFIG_PWM is not set |
| 3555 |
+ |
|
| 3556 |
+# |
|
| 3557 |
+# IRQ chip support |
|
| 3558 |
+# |
|
| 3555 | 3559 |
CONFIG_ARM_GIC_MAX_NR=1 |
| 3556 | 3560 |
# CONFIG_IPACK_BUS is not set |
| 3557 | 3561 |
# CONFIG_RESET_CONTROLLER is not set |
| ... | ... |
@@ -3581,16 +3626,16 @@ CONFIG_RAS=y |
| 3581 | 3581 |
CONFIG_DAX=y |
| 3582 | 3582 |
CONFIG_DEV_DAX=m |
| 3583 | 3583 |
# CONFIG_NVMEM is not set |
| 3584 |
-# CONFIG_STM is not set |
|
| 3585 |
-# CONFIG_INTEL_TH is not set |
|
| 3586 |
-# CONFIG_FPGA is not set |
|
| 3587 | 3584 |
|
| 3588 | 3585 |
# |
| 3589 |
-# FSI support |
|
| 3586 |
+# HW tracing support |
|
| 3590 | 3587 |
# |
| 3591 |
-CONFIG_FSI=m |
|
| 3592 |
-CONFIG_FSI_MASTER_HUB=m |
|
| 3593 |
-CONFIG_FSI_SCOM=m |
|
| 3588 |
+# CONFIG_STM is not set |
|
| 3589 |
+# CONFIG_INTEL_TH is not set |
|
| 3590 |
+# CONFIG_FPGA is not set |
|
| 3591 |
+# CONFIG_UNISYS_VISORBUS is not set |
|
| 3592 |
+# CONFIG_SIOX is not set |
|
| 3593 |
+# CONFIG_SLIMBUS is not set |
|
| 3594 | 3594 |
CONFIG_AMAZON_DRIVER_UPDATES=y |
| 3595 | 3595 |
CONFIG_AMAZON_ENA_ETHERNET=m |
| 3596 | 3596 |
|
| ... | ... |
@@ -3609,7 +3654,7 @@ CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y |
| 3609 | 3609 |
# CONFIG_FW_CFG_SYSFS is not set |
| 3610 | 3610 |
# CONFIG_GOOGLE_FIRMWARE is not set |
| 3611 | 3611 |
CONFIG_UEFI_CPER=y |
| 3612 |
-# CONFIG_EFI_DEV_PATH_PARSER is not set |
|
| 3612 |
+CONFIG_UEFI_CPER_X86=y |
|
| 3613 | 3613 |
|
| 3614 | 3614 |
# |
| 3615 | 3615 |
# Tegra firmware driver |
| ... | ... |
@@ -3642,6 +3687,7 @@ CONFIG_XFS_FS=m |
| 3642 | 3642 |
CONFIG_XFS_QUOTA=y |
| 3643 | 3643 |
CONFIG_XFS_POSIX_ACL=y |
| 3644 | 3644 |
CONFIG_XFS_RT=y |
| 3645 |
+# CONFIG_XFS_ONLINE_SCRUB is not set |
|
| 3645 | 3646 |
CONFIG_XFS_WARN=y |
| 3646 | 3647 |
# CONFIG_XFS_DEBUG is not set |
| 3647 | 3648 |
# CONFIG_GFS2_FS is not set |
| ... | ... |
@@ -3652,6 +3698,7 @@ CONFIG_BTRFS_FS_POSIX_ACL=y |
| 3652 | 3652 |
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set |
| 3653 | 3653 |
# CONFIG_BTRFS_DEBUG is not set |
| 3654 | 3654 |
# CONFIG_BTRFS_ASSERT is not set |
| 3655 |
+# CONFIG_BTRFS_FS_REF_VERIFY is not set |
|
| 3655 | 3656 |
# CONFIG_NILFS2_FS is not set |
| 3656 | 3657 |
# CONFIG_F2FS_FS is not set |
| 3657 | 3658 |
CONFIG_FS_DAX=y |
| ... | ... |
@@ -3676,11 +3723,14 @@ CONFIG_QFMT_V2=m |
| 3676 | 3676 |
CONFIG_QUOTACTL=y |
| 3677 | 3677 |
CONFIG_QUOTACTL_COMPAT=y |
| 3678 | 3678 |
CONFIG_AUTOFS4_FS=m |
| 3679 |
+CONFIG_AUTOFS_FS=m |
|
| 3679 | 3680 |
CONFIG_FUSE_FS=m |
| 3680 | 3681 |
# CONFIG_CUSE is not set |
| 3681 | 3682 |
CONFIG_OVERLAY_FS=m |
| 3682 | 3683 |
# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set |
| 3684 |
+CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y |
|
| 3683 | 3685 |
# CONFIG_OVERLAY_FS_INDEX is not set |
| 3686 |
+# CONFIG_OVERLAY_FS_XINO_AUTO is not set |
|
| 3684 | 3687 |
|
| 3685 | 3688 |
# |
| 3686 | 3689 |
# Caches |
| ... | ... |
@@ -3701,7 +3751,6 @@ CONFIG_ISO9660_FS=y |
| 3701 | 3701 |
CONFIG_JOLIET=y |
| 3702 | 3702 |
CONFIG_ZISOFS=y |
| 3703 | 3703 |
CONFIG_UDF_FS=y |
| 3704 |
-CONFIG_UDF_NLS=y |
|
| 3705 | 3704 |
|
| 3706 | 3705 |
# |
| 3707 | 3706 |
# DOS/FAT/NT Filesystems |
| ... | ... |
@@ -3720,6 +3769,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii" |
| 3720 | 3720 |
CONFIG_PROC_FS=y |
| 3721 | 3721 |
CONFIG_PROC_KCORE=y |
| 3722 | 3722 |
CONFIG_PROC_VMCORE=y |
| 3723 |
+# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set |
|
| 3723 | 3724 |
CONFIG_PROC_SYSCTL=y |
| 3724 | 3725 |
CONFIG_PROC_PAGE_MONITOR=y |
| 3725 | 3726 |
CONFIG_PROC_CHILDREN=y |
| ... | ... |
@@ -3730,6 +3780,7 @@ CONFIG_TMPFS_POSIX_ACL=y |
| 3730 | 3730 |
CONFIG_TMPFS_XATTR=y |
| 3731 | 3731 |
CONFIG_HUGETLBFS=y |
| 3732 | 3732 |
CONFIG_HUGETLB_PAGE=y |
| 3733 |
+CONFIG_MEMFD_CREATE=y |
|
| 3733 | 3734 |
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y |
| 3734 | 3735 |
CONFIG_CONFIGFS_FS=m |
| 3735 | 3736 |
CONFIG_MISC_FILESYSTEMS=y |
| ... | ... |
@@ -3743,6 +3794,7 @@ CONFIG_MISC_FILESYSTEMS=y |
| 3743 | 3743 |
# CONFIG_BFS_FS is not set |
| 3744 | 3744 |
# CONFIG_EFS_FS is not set |
| 3745 | 3745 |
CONFIG_CRAMFS=m |
| 3746 |
+CONFIG_CRAMFS_BLOCKDEV=y |
|
| 3746 | 3747 |
CONFIG_SQUASHFS=m |
| 3747 | 3748 |
CONFIG_SQUASHFS_FILE_CACHE=y |
| 3748 | 3749 |
# CONFIG_SQUASHFS_FILE_DIRECT is not set |
| ... | ... |
@@ -3766,9 +3818,11 @@ CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 |
| 3766 | 3766 |
# CONFIG_QNX6FS_FS is not set |
| 3767 | 3767 |
# CONFIG_ROMFS_FS is not set |
| 3768 | 3768 |
CONFIG_PSTORE=y |
| 3769 |
-CONFIG_PSTORE_ZLIB_COMPRESS=y |
|
| 3769 |
+# CONFIG_PSTORE_DEFLATE_COMPRESS is not set |
|
| 3770 | 3770 |
# CONFIG_PSTORE_LZO_COMPRESS is not set |
| 3771 | 3771 |
# CONFIG_PSTORE_LZ4_COMPRESS is not set |
| 3772 |
+# CONFIG_PSTORE_LZ4HC_COMPRESS is not set |
|
| 3773 |
+# CONFIG_PSTORE_842_COMPRESS is not set |
|
| 3772 | 3774 |
# CONFIG_PSTORE_CONSOLE is not set |
| 3773 | 3775 |
# CONFIG_PSTORE_PMSG is not set |
| 3774 | 3776 |
CONFIG_PSTORE_RAM=m |
| ... | ... |
@@ -3832,8 +3886,8 @@ CONFIG_CIFS_DEBUG=y |
| 3832 | 3832 |
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set |
| 3833 | 3833 |
CONFIG_CIFS_DFS_UPCALL=y |
| 3834 | 3834 |
# CONFIG_CIFS_SMB311 is not set |
| 3835 |
+# CONFIG_CIFS_SMB_DIRECT is not set |
|
| 3835 | 3836 |
# CONFIG_CIFS_FSCACHE is not set |
| 3836 |
-# CONFIG_NCP_FS is not set |
|
| 3837 | 3837 |
# CONFIG_CODA_FS is not set |
| 3838 | 3838 |
# CONFIG_AFS_FS is not set |
| 3839 | 3839 |
CONFIG_9P_FS=m |
| ... | ... |
@@ -3959,6 +4013,7 @@ CONFIG_HAVE_DEBUG_STACKOVERFLOW=y |
| 3959 | 3959 |
CONFIG_HAVE_ARCH_KASAN=y |
| 3960 | 3960 |
# CONFIG_KASAN is not set |
| 3961 | 3961 |
CONFIG_ARCH_HAS_KCOV=y |
| 3962 |
+CONFIG_CC_HAS_SANCOV_TRACE_PC=y |
|
| 3962 | 3963 |
# CONFIG_KCOV is not set |
| 3963 | 3964 |
# CONFIG_DEBUG_SHIRQ is not set |
| 3964 | 3965 |
|
| ... | ... |
@@ -3967,13 +4022,13 @@ CONFIG_ARCH_HAS_KCOV=y |
| 3967 | 3967 |
# |
| 3968 | 3968 |
CONFIG_LOCKUP_DETECTOR=y |
| 3969 | 3969 |
CONFIG_SOFTLOCKUP_DETECTOR=y |
| 3970 |
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set |
|
| 3971 |
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 |
|
| 3970 | 3972 |
CONFIG_HARDLOCKUP_DETECTOR_PERF=y |
| 3971 | 3973 |
CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y |
| 3972 | 3974 |
CONFIG_HARDLOCKUP_DETECTOR=y |
| 3973 | 3975 |
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y |
| 3974 | 3976 |
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=1 |
| 3975 |
-# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set |
|
| 3976 |
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 |
|
| 3977 | 3977 |
CONFIG_DETECT_HUNG_TASK=y |
| 3978 | 3978 |
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 |
| 3979 | 3979 |
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set |
| ... | ... |
@@ -3991,13 +4046,15 @@ CONFIG_SCHEDSTATS=y |
| 3991 | 3991 |
# |
| 3992 | 3992 |
# Lock Debugging (spinlocks, mutexes, etc...) |
| 3993 | 3993 |
# |
| 3994 |
+CONFIG_LOCK_DEBUGGING_SUPPORT=y |
|
| 3995 |
+# CONFIG_PROVE_LOCKING is not set |
|
| 3996 |
+# CONFIG_LOCK_STAT is not set |
|
| 3994 | 3997 |
# CONFIG_DEBUG_RT_MUTEXES is not set |
| 3995 | 3998 |
# CONFIG_DEBUG_SPINLOCK is not set |
| 3996 | 3999 |
# CONFIG_DEBUG_MUTEXES is not set |
| 3997 | 4000 |
# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set |
| 4001 |
+# CONFIG_DEBUG_RWSEMS is not set |
|
| 3998 | 4002 |
# CONFIG_DEBUG_LOCK_ALLOC is not set |
| 3999 |
-# CONFIG_PROVE_LOCKING is not set |
|
| 4000 |
-# CONFIG_LOCK_STAT is not set |
|
| 4001 | 4003 |
# CONFIG_DEBUG_ATOMIC_SLEEP is not set |
| 4002 | 4004 |
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set |
| 4003 | 4005 |
# CONFIG_LOCK_TORTURE_TEST is not set |
| ... | ... |
@@ -4015,8 +4072,6 @@ CONFIG_DEBUG_LIST=y |
| 4015 | 4015 |
# |
| 4016 | 4016 |
# RCU Debugging |
| 4017 | 4017 |
# |
| 4018 |
-# CONFIG_PROVE_RCU is not set |
|
| 4019 |
-# CONFIG_TORTURE_TEST is not set |
|
| 4020 | 4018 |
# CONFIG_RCU_PERF_TEST is not set |
| 4021 | 4019 |
# CONFIG_RCU_TORTURE_TEST is not set |
| 4022 | 4020 |
CONFIG_RCU_CPU_STALL_TIMEOUT=60 |
| ... | ... |
@@ -4026,6 +4081,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 |
| 4026 | 4026 |
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set |
| 4027 | 4027 |
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set |
| 4028 | 4028 |
# CONFIG_NOTIFIER_ERROR_INJECTION is not set |
| 4029 |
+CONFIG_FUNCTION_ERROR_INJECTION=y |
|
| 4029 | 4030 |
# CONFIG_FAULT_INJECTION is not set |
| 4030 | 4031 |
CONFIG_LATENCYTOP=y |
| 4031 | 4032 |
CONFIG_USER_STACKTRACE_SUPPORT=y |
| ... | ... |
@@ -4048,6 +4104,7 @@ CONFIG_GENERIC_TRACER=y |
| 4048 | 4048 |
CONFIG_TRACING_SUPPORT=y |
| 4049 | 4049 |
CONFIG_FTRACE=y |
| 4050 | 4050 |
# CONFIG_FUNCTION_TRACER is not set |
| 4051 |
+# CONFIG_PREEMPTIRQ_EVENTS is not set |
|
| 4051 | 4052 |
# CONFIG_IRQSOFF_TRACER is not set |
| 4052 | 4053 |
# CONFIG_SCHED_TRACER is not set |
| 4053 | 4054 |
# CONFIG_HWLAT_TRACER is not set |
| ... | ... |
@@ -4069,43 +4126,13 @@ CONFIG_PROBE_EVENTS=y |
| 4069 | 4069 |
# CONFIG_TRACE_EVAL_MAP_FILE is not set |
| 4070 | 4070 |
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set |
| 4071 | 4071 |
# CONFIG_DMA_API_DEBUG is not set |
| 4072 |
- |
|
| 4073 |
-# |
|
| 4074 |
-# Runtime Testing |
|
| 4075 |
-# |
|
| 4076 |
-# CONFIG_LKDTM is not set |
|
| 4077 |
-# CONFIG_TEST_LIST_SORT is not set |
|
| 4078 |
-# CONFIG_TEST_SORT is not set |
|
| 4079 |
-# CONFIG_KPROBES_SANITY_TEST is not set |
|
| 4080 |
-# CONFIG_BACKTRACE_SELF_TEST is not set |
|
| 4081 |
-# CONFIG_RBTREE_TEST is not set |
|
| 4082 |
-# CONFIG_INTERVAL_TREE_TEST is not set |
|
| 4083 |
-# CONFIG_PERCPU_TEST is not set |
|
| 4084 |
-# CONFIG_ATOMIC64_SELFTEST is not set |
|
| 4085 |
-# CONFIG_ASYNC_RAID6_TEST is not set |
|
| 4086 |
-# CONFIG_TEST_HEXDUMP is not set |
|
| 4087 |
-# CONFIG_TEST_STRING_HELPERS is not set |
|
| 4088 |
-# CONFIG_TEST_KSTRTOX is not set |
|
| 4089 |
-# CONFIG_TEST_PRINTF is not set |
|
| 4090 |
-# CONFIG_TEST_BITMAP is not set |
|
| 4091 |
-# CONFIG_TEST_UUID is not set |
|
| 4092 |
-# CONFIG_TEST_RHASHTABLE is not set |
|
| 4093 |
-# CONFIG_TEST_HASH is not set |
|
| 4094 |
-# CONFIG_TEST_LKM is not set |
|
| 4095 |
-# CONFIG_TEST_USER_COPY is not set |
|
| 4096 |
-# CONFIG_TEST_BPF is not set |
|
| 4097 |
-# CONFIG_TEST_FIRMWARE is not set |
|
| 4098 |
-# CONFIG_TEST_SYSCTL is not set |
|
| 4099 |
-# CONFIG_TEST_UDELAY is not set |
|
| 4100 |
-# CONFIG_TEST_STATIC_KEYS is not set |
|
| 4101 |
-# CONFIG_TEST_KMOD is not set |
|
| 4072 |
+# CONFIG_RUNTIME_TESTING_MENU is not set |
|
| 4102 | 4073 |
CONFIG_MEMTEST=y |
| 4103 | 4074 |
CONFIG_BUG_ON_DATA_CORRUPTION=y |
| 4104 | 4075 |
# CONFIG_SAMPLES is not set |
| 4105 | 4076 |
CONFIG_HAVE_ARCH_KGDB=y |
| 4106 | 4077 |
# CONFIG_KGDB is not set |
| 4107 | 4078 |
CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y |
| 4108 |
-# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set |
|
| 4109 | 4079 |
# CONFIG_UBSAN is not set |
| 4110 | 4080 |
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y |
| 4111 | 4081 |
CONFIG_STRICT_DEVMEM=y |
| ... | ... |
@@ -4114,13 +4141,11 @@ CONFIG_STRICT_DEVMEM=y |
| 4114 | 4114 |
CONFIG_EARLY_PRINTK=y |
| 4115 | 4115 |
# CONFIG_EARLY_PRINTK_DBGP is not set |
| 4116 | 4116 |
# CONFIG_EARLY_PRINTK_USB_XDBC is not set |
| 4117 |
-# CONFIG_X86_PTDUMP_CORE is not set |
|
| 4118 | 4117 |
# CONFIG_X86_PTDUMP is not set |
| 4119 | 4118 |
# CONFIG_DEBUG_WX is not set |
| 4120 | 4119 |
CONFIG_DOUBLEFAULT=y |
| 4121 | 4120 |
# CONFIG_DEBUG_TLBFLUSH is not set |
| 4122 | 4121 |
# CONFIG_IOMMU_DEBUG is not set |
| 4123 |
-# CONFIG_IOMMU_STRESS is not set |
|
| 4124 | 4122 |
CONFIG_HAVE_MMIOTRACE_SUPPORT=y |
| 4125 | 4123 |
# CONFIG_X86_DECODER_SELFTEST is not set |
| 4126 | 4124 |
CONFIG_IO_DELAY_TYPE_0X80=0 |
| ... | ... |
@@ -4237,7 +4262,6 @@ CONFIG_CRYPTO_CRYPTD=m |
| 4237 | 4237 |
CONFIG_CRYPTO_MCRYPTD=m |
| 4238 | 4238 |
CONFIG_CRYPTO_AUTHENC=m |
| 4239 | 4239 |
CONFIG_CRYPTO_TEST=m |
| 4240 |
-CONFIG_CRYPTO_ABLK_HELPER=m |
|
| 4241 | 4240 |
CONFIG_CRYPTO_SIMD=m |
| 4242 | 4241 |
CONFIG_CRYPTO_GLUE_HELPER_X86=m |
| 4243 | 4242 |
|
| ... | ... |
@@ -4247,6 +4271,17 @@ CONFIG_CRYPTO_GLUE_HELPER_X86=m |
| 4247 | 4247 |
CONFIG_CRYPTO_CCM=m |
| 4248 | 4248 |
CONFIG_CRYPTO_GCM=m |
| 4249 | 4249 |
CONFIG_CRYPTO_CHACHA20POLY1305=m |
| 4250 |
+# CONFIG_CRYPTO_AEGIS128 is not set |
|
| 4251 |
+# CONFIG_CRYPTO_AEGIS128L is not set |
|
| 4252 |
+# CONFIG_CRYPTO_AEGIS256 is not set |
|
| 4253 |
+# CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 is not set |
|
| 4254 |
+# CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 is not set |
|
| 4255 |
+# CONFIG_CRYPTO_AEGIS256_AESNI_SSE2 is not set |
|
| 4256 |
+# CONFIG_CRYPTO_MORUS640 is not set |
|
| 4257 |
+# CONFIG_CRYPTO_MORUS640_SSE2 is not set |
|
| 4258 |
+# CONFIG_CRYPTO_MORUS1280 is not set |
|
| 4259 |
+# CONFIG_CRYPTO_MORUS1280_SSE2 is not set |
|
| 4260 |
+# CONFIG_CRYPTO_MORUS1280_AVX2 is not set |
|
| 4250 | 4261 |
CONFIG_CRYPTO_SEQIV=y |
| 4251 | 4262 |
CONFIG_CRYPTO_ECHAINIV=m |
| 4252 | 4263 |
|
| ... | ... |
@@ -4254,6 +4289,7 @@ CONFIG_CRYPTO_ECHAINIV=m |
| 4254 | 4254 |
# Block modes |
| 4255 | 4255 |
# |
| 4256 | 4256 |
CONFIG_CRYPTO_CBC=y |
| 4257 |
+# CONFIG_CRYPTO_CFB is not set |
|
| 4257 | 4258 |
CONFIG_CRYPTO_CTR=y |
| 4258 | 4259 |
CONFIG_CRYPTO_CTS=y |
| 4259 | 4260 |
CONFIG_CRYPTO_ECB=y |
| ... | ... |
@@ -4299,6 +4335,7 @@ CONFIG_CRYPTO_SHA512_MB=m |
| 4299 | 4299 |
CONFIG_CRYPTO_SHA256=y |
| 4300 | 4300 |
CONFIG_CRYPTO_SHA512=y |
| 4301 | 4301 |
CONFIG_CRYPTO_SHA3=m |
| 4302 |
+# CONFIG_CRYPTO_SM3 is not set |
|
| 4302 | 4303 |
CONFIG_CRYPTO_TGR192=m |
| 4303 | 4304 |
CONFIG_CRYPTO_WP512=m |
| 4304 | 4305 |
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m |
| ... | ... |
@@ -4336,6 +4373,8 @@ CONFIG_CRYPTO_SERPENT=m |
| 4336 | 4336 |
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m |
| 4337 | 4337 |
CONFIG_CRYPTO_SERPENT_AVX_X86_64=m |
| 4338 | 4338 |
CONFIG_CRYPTO_SERPENT_AVX2_X86_64=m |
| 4339 |
+# CONFIG_CRYPTO_SM4 is not set |
|
| 4340 |
+# CONFIG_CRYPTO_SPECK is not set |
|
| 4339 | 4341 |
CONFIG_CRYPTO_TEA=m |
| 4340 | 4342 |
CONFIG_CRYPTO_TWOFISH=m |
| 4341 | 4343 |
CONFIG_CRYPTO_TWOFISH_COMMON=m |
| ... | ... |
@@ -4351,6 +4390,7 @@ CONFIG_CRYPTO_LZO=y |
| 4351 | 4351 |
CONFIG_CRYPTO_842=m |
| 4352 | 4352 |
CONFIG_CRYPTO_LZ4=m |
| 4353 | 4353 |
CONFIG_CRYPTO_LZ4HC=m |
| 4354 |
+# CONFIG_CRYPTO_ZSTD is not set |
|
| 4354 | 4355 |
|
| 4355 | 4356 |
# |
| 4356 | 4357 |
# Random Number Generation |
| ... | ... |
@@ -4415,7 +4455,6 @@ CONFIG_BINARY_PRINTF=y |
| 4415 | 4415 |
# |
| 4416 | 4416 |
CONFIG_RAID6_PQ=m |
| 4417 | 4417 |
CONFIG_BITREVERSE=y |
| 4418 |
-# CONFIG_HAVE_ARCH_BITREVERSE is not set |
|
| 4419 | 4418 |
CONFIG_RATIONAL=y |
| 4420 | 4419 |
CONFIG_GENERIC_STRNCPY_FROM_USER=y |
| 4421 | 4420 |
CONFIG_GENERIC_STRNLEN_USER=y |
| ... | ... |
@@ -4423,7 +4462,6 @@ CONFIG_GENERIC_NET_UTILS=y |
| 4423 | 4423 |
CONFIG_GENERIC_FIND_FIRST_BIT=y |
| 4424 | 4424 |
CONFIG_GENERIC_PCI_IOMAP=y |
| 4425 | 4425 |
CONFIG_GENERIC_IOMAP=y |
| 4426 |
-CONFIG_GENERIC_IO=y |
|
| 4427 | 4426 |
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y |
| 4428 | 4427 |
CONFIG_ARCH_HAS_FAST_MULTIPLIER=y |
| 4429 | 4428 |
CONFIG_CRC_CCITT=m |
| ... | ... |
@@ -4441,12 +4479,11 @@ CONFIG_CRC7=m |
| 4441 | 4441 |
CONFIG_LIBCRC32C=m |
| 4442 | 4442 |
# CONFIG_CRC8 is not set |
| 4443 | 4443 |
CONFIG_XXHASH=m |
| 4444 |
-# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set |
|
| 4445 | 4444 |
# CONFIG_RANDOM32_SELFTEST is not set |
| 4446 | 4445 |
CONFIG_842_COMPRESS=m |
| 4447 | 4446 |
CONFIG_842_DECOMPRESS=m |
| 4448 | 4447 |
CONFIG_ZLIB_INFLATE=y |
| 4449 |
-CONFIG_ZLIB_DEFLATE=y |
|
| 4448 |
+CONFIG_ZLIB_DEFLATE=m |
|
| 4450 | 4449 |
CONFIG_LZO_COMPRESS=y |
| 4451 | 4450 |
CONFIG_LZO_DECOMPRESS=y |
| 4452 | 4451 |
CONFIG_LZ4_COMPRESS=m |
| ... | ... |
@@ -4483,8 +4520,13 @@ CONFIG_ASSOCIATIVE_ARRAY=y |
| 4483 | 4483 |
CONFIG_HAS_IOMEM=y |
| 4484 | 4484 |
CONFIG_HAS_IOPORT_MAP=y |
| 4485 | 4485 |
CONFIG_HAS_DMA=y |
| 4486 |
-# CONFIG_DMA_NOOP_OPS is not set |
|
| 4487 |
-# CONFIG_DMA_VIRT_OPS is not set |
|
| 4486 |
+CONFIG_NEED_SG_DMA_LENGTH=y |
|
| 4487 |
+CONFIG_NEED_DMA_MAP_STATE=y |
|
| 4488 |
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y |
|
| 4489 |
+CONFIG_DMA_DIRECT_OPS=y |
|
| 4490 |
+CONFIG_SWIOTLB=y |
|
| 4491 |
+CONFIG_SGL_ALLOC=y |
|
| 4492 |
+CONFIG_IOMMU_HELPER=y |
|
| 4488 | 4493 |
CONFIG_CPUMASK_OFFSTACK=y |
| 4489 | 4494 |
CONFIG_CPU_RMAP=y |
| 4490 | 4495 |
CONFIG_DQL=y |
| ... | ... |
@@ -4498,14 +4540,15 @@ CONFIG_CLZ_TAB=y |
| 4498 | 4498 |
CONFIG_IRQ_POLL=y |
| 4499 | 4499 |
CONFIG_MPILIB=y |
| 4500 | 4500 |
CONFIG_OID_REGISTRY=y |
| 4501 |
+CONFIG_UCS2_STRING=m |
|
| 4501 | 4502 |
CONFIG_FONT_SUPPORT=y |
| 4502 | 4503 |
# CONFIG_FONTS is not set |
| 4503 | 4504 |
CONFIG_FONT_8x8=y |
| 4504 | 4505 |
CONFIG_FONT_8x16=y |
| 4505 |
-# CONFIG_SG_SPLIT is not set |
|
| 4506 | 4506 |
CONFIG_SG_POOL=y |
| 4507 | 4507 |
CONFIG_ARCH_HAS_SG_CHAIN=y |
| 4508 | 4508 |
CONFIG_ARCH_HAS_PMEM_API=y |
| 4509 | 4509 |
CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y |
| 4510 |
+CONFIG_ARCH_HAS_UACCESS_MCSAFE=y |
|
| 4510 | 4511 |
CONFIG_SBITMAP=y |
| 4511 | 4512 |
# CONFIG_STRING_SELFTEST is not set |
| ... | ... |
@@ -1,15 +1,15 @@ |
| 1 | 1 |
%global security_hardening none |
| 2 | 2 |
Summary: Kernel |
| 3 | 3 |
Name: linux-aws |
| 4 |
-Version: 4.14.67 |
|
| 5 |
-Release: 2%{?kat_build:.%kat_build}%{?dist}
|
|
| 4 |
+Version: 4.18.9 |
|
| 5 |
+Release: 1%{?kat_build:.%kat_build}%{?dist}
|
|
| 6 | 6 |
License: GPLv2 |
| 7 | 7 |
URL: http://www.kernel.org/ |
| 8 | 8 |
Group: System Environment/Kernel |
| 9 | 9 |
Vendor: VMware, Inc. |
| 10 | 10 |
Distribution: Photon |
| 11 | 11 |
Source0: http://www.kernel.org/pub/linux/kernel/v4.x/linux-%{version}.tar.xz
|
| 12 |
-%define sha1 linux=4a6aa8d8a5190dbf1a835a5171609f02b27809e1 |
|
| 12 |
+%define sha1 linux=229ed4bedc5b8256bdd761845b1d7e20e1df12d7 |
|
| 13 | 13 |
Source1: config-aws |
| 14 | 14 |
Source2: initramfs.trigger |
| 15 | 15 |
# common |
| ... | ... |
@@ -20,26 +20,26 @@ Patch1: double-tcp_mem-limits.patch |
| 20 | 20 |
Patch3: SUNRPC-Do-not-reuse-srcport-for-TIME_WAIT-socket.patch |
| 21 | 21 |
Patch4: SUNRPC-xs_bind-uses-ip_local_reserved_ports.patch |
| 22 | 22 |
Patch5: vsock-transport-for-9p.patch |
| 23 |
-Patch6: x86-vmware-STA-support.patch |
|
| 23 |
+Patch6: 4.18-x86-vmware-STA-support.patch |
|
| 24 | 24 |
#HyperV patches |
| 25 | 25 |
Patch13: 0004-vmbus-Don-t-spam-the-logs-with-unknown-GUIDs.patch |
| 26 | 26 |
# TODO: Is CONFIG_HYPERV_VSOCKETS the same? |
| 27 | 27 |
#Patch23: 0014-hv_sock-introduce-Hyper-V-Sockets.patch |
| 28 | 28 |
#FIPS patches - allow some algorithms |
| 29 |
-Patch24: Allow-some-algo-tests-for-FIPS.patch |
|
| 30 |
-Patch26: add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch |
|
| 29 |
+Patch24: 4.18-Allow-some-algo-tests-for-FIPS.patch |
|
| 30 |
+Patch26: 4.18-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch |
|
| 31 | 31 |
# Fix CVE-2017-1000252 |
| 32 | 32 |
Patch28: kvm-dont-accept-wrong-gsi-values.patch |
| 33 | 33 |
# Out-of-tree patches from AppArmor: |
| 34 |
-Patch29: 0001-apparmor-add-base-infastructure-for-socket-mediation.patch |
|
| 35 |
-Patch30: 0002-apparmor-af_unix-mediation.patch |
|
| 36 |
-Patch31: 0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch |
|
| 34 |
+Patch29: 4.17-0001-apparmor-patch-to-provide-compatibility-with-v2.x-ne.patch |
|
| 35 |
+Patch30: 4.17-0002-apparmor-af_unix-mediation.patch |
|
| 36 |
+Patch31: 4.17-0003-apparmor-fix-use-after-free-in-sk_peer_label.patch |
|
| 37 |
+Patch32: 4.18-0001-hwrng-rdrand-Add-RNG-driver-based-on-x86-rdrand-inst.patch |
|
| 37 | 38 |
|
| 38 | 39 |
# Amazon AWS |
| 39 | 40 |
Patch101: 0002-watchdog-Disable-watchdog-on-virtual-machines.patch |
| 40 | 41 |
Patch102: 0004-bump-the-default-TTL-to-255.patch |
| 41 | 42 |
Patch103: 0005-bump-default-tcp_wmem-from-16KB-to-20KB.patch |
| 42 |
-Patch104: 0007-nvme-update-timeout-module-parameter-type.patch |
|
| 43 | 43 |
Patch105: 0009-drivers-introduce-AMAZON_DRIVER_UPDATES.patch |
| 44 | 44 |
Patch106: 0010-drivers-amazon-add-network-device-drivers-support.patch |
| 45 | 45 |
Patch107: 0011-drivers-amazon-introduce-AMAZON_ENA_ETHERNET.patch |
| ... | ... |
@@ -59,34 +59,12 @@ Patch120: 0024-PM-hibernate-update-the-resume-offset-on-SNAPSHOT_SE.patch |
| 59 | 59 |
Patch121: 0025-Not-for-upstream-PM-hibernate-Speed-up-hibernation-b.patch |
| 60 | 60 |
Patch122: 0026-xen-blkfront-resurrect-request-based-mode.patch |
| 61 | 61 |
Patch123: 0027-xen-blkfront-add-persistent_grants-parameter.patch |
| 62 |
-Patch124: 0028-ACPI-SPCR-Make-SPCR-available-to-x86.patch |
|
| 63 | 62 |
Patch125: 0029-Revert-xen-dont-fiddle-with-event-channel-masking-in.patch |
| 64 |
-Patch126: 0030-locking-paravirt-Use-new-static-key-for-controlling-.patch |
|
| 65 |
-Patch127: 0031-KVM-Introduce-paravirtualization-hints-and-KVM_HINTS.patch |
|
| 66 |
-Patch128: 0032-KVM-X86-Choose-qspinlock-when-dedicated-physical-CPU.patch |
|
| 67 |
-Patch129: 0033-x86-paravirt-Set-up-the-virt_spin_lock_key-after-sta.patch |
|
| 68 |
-Patch130: 0034-KVM-X86-Fix-setup-the-virt_spin_lock_key-before-stat.patch |
|
| 69 | 63 |
Patch131: 0035-xen-blkfront-Fixed-blkfront_restore-to-remove-a-call.patch |
| 70 |
-Patch132: 0036-xen-netfront-Update-features-after-registering-netde.patch |
|
| 71 | 64 |
Patch133: 0037-x86-tsc-avoid-system-instability-in-hibernation.patch |
| 72 |
-Patch134: 0038-blk-mq-simplify-queue-mapping-schedule-with-each-pos.patch |
|
| 73 | 65 |
Patch135: 0039-blk-wbt-Avoid-lock-contention-and-thundering-herd-is.patch |
| 74 |
-Patch136: 0040-x86-MCE-AMD-Read-MCx_MISC-block-addresses-on-any-CPU.patch |
|
| 75 |
-Patch137: 0041-x86-bugs-Add-AMD-s-variant-of-SSB_NO.patch |
|
| 76 |
-Patch138: 0042-x86-bugs-Add-AMD-s-SPEC_CTRL-MSR-usage.patch |
|
| 77 |
-Patch139: 0043-x86-bugs-Switch-the-selection-of-mitigation-from-CPU.patch |
|
| 78 |
-Patch140: 0044-x86-CPU-Rename-intel_cacheinfo.c-to-cacheinfo.c.patch |
|
| 79 |
-Patch141: 0045-x86-CPU-AMD-Calculate-last-level-cache-ID-from-numbe.patch |
|
| 80 |
-Patch142: 0046-x86-CPU-AMD-Fix-LLC-ID-bit-shift-calculation.patch |
|
| 81 |
-Patch143: 0047-x86-bugs-Update-when-to-check-for-the-LS_CFG-SSBD-mi.patch |
|
| 82 |
-Patch144: 0048-x86-bugs-Fix-the-AMD-SSBD-usage-of-the-SPEC_CTRL-MSR.patch |
|
| 83 |
-Patch145: 0049-tools-power-turbostat-Read-extended-processor-family.patch |
|
| 84 |
-Patch146: 0050-sched-topology-Introduce-NUMA-identity-node-sched-do.patch |
|
| 85 |
-Patch147: 0051-x86-CPU-AMD-Derive-CPU-topology-from-CPUID-function-.patch |
|
| 86 |
-Patch148: 0052-vmxnet3-increase-default-rx-ring-sizes.patch |
|
| 87 |
-Patch149: 0053-Revert-e1000e-Separate-signaling-for-link-check-link.patch |
|
| 88 |
-Patch150: 0054-e1000e-Fix-link-check-race-condition.patch |
|
| 89 | 66 |
Patch151: 0055-net-ipv4-defensive-cipso-option-parsing.patch |
| 67 |
+Patch152: 0056-Amazon-ENA-driver-Update-to-version-1.6.0.patch |
|
| 90 | 68 |
|
| 91 | 69 |
%if 0%{?kat_build:1}
|
| 92 | 70 |
Patch1000: %{kat_build}.patch
|
| ... | ... |
@@ -115,7 +93,7 @@ The Linux package contains the Linux kernel. |
| 115 | 115 |
Summary: Kernel Dev |
| 116 | 116 |
Group: System Environment/Kernel |
| 117 | 117 |
Requires: %{name} = %{version}-%{release}
|
| 118 |
-Requires: python2 gawk |
|
| 118 |
+Requires: python3 gawk |
|
| 119 | 119 |
%description devel |
| 120 | 120 |
The Linux package contains the Linux kernel dev files |
| 121 | 121 |
|
| ... | ... |
@@ -136,7 +114,7 @@ The Linux package contains the Linux kernel sound support |
| 136 | 136 |
%package docs |
| 137 | 137 |
Summary: Kernel docs |
| 138 | 138 |
Group: System Environment/Kernel |
| 139 |
-Requires: python2 |
|
| 139 |
+Requires: python3 |
|
| 140 | 140 |
%description docs |
| 141 | 141 |
The Linux package contains the Linux kernel doc files |
| 142 | 142 |
|
| ... | ... |
@@ -174,11 +152,11 @@ This package contains the 'perf' performance analysis tools for Linux kernel. |
| 174 | 174 |
%patch29 -p1 |
| 175 | 175 |
%patch30 -p1 |
| 176 | 176 |
%patch31 -p1 |
| 177 |
+%patch32 -p1 |
|
| 177 | 178 |
|
| 178 | 179 |
%patch101 -p1 |
| 179 | 180 |
%patch102 -p1 |
| 180 | 181 |
%patch103 -p1 |
| 181 |
-%patch104 -p1 |
|
| 182 | 182 |
%patch105 -p1 |
| 183 | 183 |
%patch106 -p1 |
| 184 | 184 |
%patch107 -p1 |
| ... | ... |
@@ -198,34 +176,12 @@ This package contains the 'perf' performance analysis tools for Linux kernel. |
| 198 | 198 |
%patch121 -p1 |
| 199 | 199 |
%patch122 -p1 |
| 200 | 200 |
%patch123 -p1 |
| 201 |
-%patch124 -p1 |
|
| 202 | 201 |
%patch125 -p1 |
| 203 |
-%patch126 -p1 |
|
| 204 |
-%patch127 -p1 |
|
| 205 |
-%patch128 -p1 |
|
| 206 |
-%patch129 -p1 |
|
| 207 |
-%patch130 -p1 |
|
| 208 | 202 |
%patch131 -p1 |
| 209 |
-%patch132 -p1 |
|
| 210 | 203 |
%patch133 -p1 |
| 211 |
-%patch134 -p1 |
|
| 212 | 204 |
%patch135 -p1 |
| 213 |
-%patch136 -p1 |
|
| 214 |
-%patch137 -p1 |
|
| 215 |
-%patch138 -p1 |
|
| 216 |
-%patch139 -p1 |
|
| 217 |
-%patch140 -p1 |
|
| 218 |
-%patch141 -p1 |
|
| 219 |
-%patch142 -p1 |
|
| 220 |
-%patch143 -p1 |
|
| 221 |
-%patch144 -p1 |
|
| 222 |
-%patch145 -p1 |
|
| 223 |
-%patch146 -p1 |
|
| 224 |
-%patch147 -p1 |
|
| 225 |
-%patch148 -p1 |
|
| 226 |
-%patch149 -p1 |
|
| 227 |
-%patch150 -p1 |
|
| 228 | 205 |
%patch151 -p1 |
| 206 |
+%patch152 -p1 |
|
| 229 | 207 |
|
| 230 | 208 |
%if 0%{?kat_build:1}
|
| 231 | 209 |
%patch1000 -p1 |
| ... | ... |
@@ -399,8 +355,13 @@ ln -sf %{name}-%{uname_r}.cfg /boot/photon.cfg
|
| 399 | 399 |
/etc/bash_completion.d/* |
| 400 | 400 |
/usr/share/perf-core/strace/groups/file |
| 401 | 401 |
/usr/share/doc/* |
| 402 |
+%{_libdir}/perf/examples/bpf/5sec.c
|
|
| 403 |
+%{_libdir}/perf/examples/bpf/empty.c
|
|
| 404 |
+%{_libdir}/perf/include/bpf/bpf.h
|
|
| 402 | 405 |
|
| 403 | 406 |
%changelog |
| 407 |
+* Mon Oct 22 2018 Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> 4.18.9-1 |
|
| 408 |
+- Update to version 4.18.9 |
|
| 404 | 409 |
* Mon Oct 08 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.14.67-2 |
| 405 | 410 |
- Add enhancements from Amazon. |
| 406 | 411 |
* Wed Sep 19 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.14.67-1 |
| 407 | 412 |
deleted file mode 100644 |
| ... | ... |
@@ -1,249 +0,0 @@ |
| 1 |
-From 3dad5371924736819950b964bbc28ce32e420c12 Mon Sep 17 00:00:00 2001 |
|
| 2 |
-From: Alexey Makhalov <amakhalov@vmware.com> |
|
| 3 |
-Date: Fri, 22 Dec 2017 15:23:06 -0800 |
|
| 4 |
-Subject: [PATCH] x86/vmware: STA support |
|
| 5 |
- |
|
| 6 |
-Use callbacks via the state machine ot enable or disable STA per CPU. |
|
| 7 |
-local_irq_disable() is used because smp_call_function_single() used to invoke |
|
| 8 |
-the function with interrupts disabled. |
|
| 9 |
- arch/x86/kernel/cpu/vmware.c | 185 +++++++++++++++++++++++++++++++++++++++++-- |
|
| 10 |
- 1 file changed, 179 insertions(+), 6 deletions(-) |
|
| 11 |
- |
|
| 12 |
-diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c |
|
| 13 |
-index 50ed5769..fa6ea7dc 100644 |
|
| 14 |
-+++ b/arch/x86/kernel/cpu/vmware.c |
|
| 15 |
-@@ -30,8 +30,12 @@ |
|
| 16 |
- #include <asm/hypervisor.h> |
|
| 17 |
- #include <asm/timer.h> |
|
| 18 |
- #include <asm/apic.h> |
|
| 19 |
-+#include <linux/sched.h> |
|
| 20 |
-+#include <linux/cpu.h> |
|
| 21 |
- #include <linux/kmsg_dump.h> |
|
| 22 |
- #include <linux/frame.h> |
|
| 23 |
-+#include <linux/notifier.h> |
|
| 24 |
-+#include <linux/reboot.h> |
|
| 25 |
- |
|
| 26 |
- #undef pr_fmt |
|
| 27 |
- #define pr_fmt(fmt) "vmware: " fmt |
|
| 28 |
-@@ -48,15 +52,57 @@ |
|
| 29 |
- #define VMWARE_PORT_CMD_VCPU_RESERVED 31 |
|
| 30 |
- #define VMWARE_PORT_CMD_MESSAGE 30 |
|
| 31 |
- #define VMWARE_HB_PORT_CMD_MESSAGE 0 |
|
| 32 |
-+#define VMWARE_PORT_CMD_STEALCLOCK 91 |
|
| 33 |
-+# define STEALCLOCK_IS_NOT_AVALIABLE -1 |
|
| 34 |
-+# define STEALCLOCK_IS_DISABLED 0 |
|
| 35 |
-+# define STEALCLOCK_IS_ENABLED 1 |
|
| 36 |
-+#define VMWARE_PORT_CMD_MESSAGE 30 |
|
| 37 |
-+#define VMWARE_HB_PORT_CMD_MESSAGE 0 |
|
| 38 |
- |
|
| 39 |
- #define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ |
|
| 40 |
-+ VMWARE_PORT2(cmd, eax, ebx, ecx, edx, UINT_MAX) |
|
| 41 |
-+ |
|
| 42 |
-+#define VMWARE_PORT2(cmd, eax, ebx, ecx, edx, arg) \ |
|
| 43 |
- __asm__("inl (%%dx)" : \
|
|
| 44 |
- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ |
|
| 45 |
- "0"(VMWARE_HYPERVISOR_MAGIC), \ |
|
| 46 |
- "1"(VMWARE_PORT_CMD_##cmd), \ |
|
| 47 |
-- "2"(VMWARE_HYPERVISOR_PORT), "3"(UINT_MAX) : \ |
|
| 48 |
-+ "2"(VMWARE_HYPERVISOR_PORT), "3"(arg) : \ |
|
| 49 |
- "memory"); |
|
| 50 |
- |
|
| 51 |
-+struct vmware_steal_time {
|
|
| 52 |
-+ uint64_t clock; /* stolen time counter in units of vtsc */ |
|
| 53 |
-+ uint64_t reserved[7]; |
|
| 54 |
-+}; |
|
| 55 |
-+static DEFINE_PER_CPU(struct vmware_steal_time, steal_time) __aligned(64); |
|
| 56 |
-+static int has_steal_clock = 0; |
|
| 57 |
-+ |
|
| 58 |
-+static int vmware_cmd_stealclock(uint32_t arg1, uint32_t arg2) |
|
| 59 |
-+{
|
|
| 60 |
-+ uint32_t result, info; |
|
| 61 |
-+ __asm__ __volatile__ ("inl (%%dx)"
|
|
| 62 |
-+ : "=a" (result), |
|
| 63 |
-+ "=c" (info) |
|
| 64 |
-+ : "a" (VMWARE_HYPERVISOR_MAGIC), |
|
| 65 |
-+ "c" (VMWARE_PORT_CMD_STEALCLOCK), |
|
| 66 |
-+ "d" (VMWARE_HYPERVISOR_PORT), |
|
| 67 |
-+ "b" (0), |
|
| 68 |
-+ "S" (arg1), |
|
| 69 |
-+ "D" (arg2)); |
|
| 70 |
-+ return result; |
|
| 71 |
-+} |
|
| 72 |
-+#define STEALCLOCK_ENABLE(pa) \ |
|
| 73 |
-+ (vmware_cmd_stealclock((pa) >> 32, (pa) & 0xffffffff) \ |
|
| 74 |
-+ == STEALCLOCK_IS_ENABLED) |
|
| 75 |
-+ |
|
| 76 |
-+#define STEALCLOCK_DISABLE() \ |
|
| 77 |
-+ vmware_cmd_stealclock(0, 1) |
|
| 78 |
-+ |
|
| 79 |
-+static int vmware_is_stealclock_available(void) |
|
| 80 |
-+{
|
|
| 81 |
-+ return STEALCLOCK_DISABLE() != STEALCLOCK_IS_NOT_AVALIABLE; |
|
| 82 |
-+} |
|
| 83 |
-+ |
|
| 84 |
- static unsigned long vmware_tsc_khz __ro_after_init; |
|
| 85 |
- |
|
| 86 |
- static inline int __vmware_platform(void) |
|
| 87 |
-@@ -99,7 +145,7 @@ static unsigned long long vmware_sched_clock(void) |
|
| 88 |
- return ns; |
|
| 89 |
- } |
|
| 90 |
- |
|
| 91 |
--static void __init vmware_sched_clock_setup(void) |
|
| 92 |
-+static void __init vmware_cyc2ns_setup(void) |
|
| 93 |
- {
|
|
| 94 |
- struct cyc2ns_data *d = &vmware_cyc2ns; |
|
| 95 |
- unsigned long long tsc_now = rdtsc(); |
|
| 96 |
-@@ -109,17 +155,144 @@ static void __init vmware_sched_clock_setup(void) |
|
| 97 |
- d->cyc2ns_offset = mul_u64_u32_shr(tsc_now, d->cyc2ns_mul, |
|
| 98 |
- d->cyc2ns_shift); |
|
| 99 |
- |
|
| 100 |
-- pv_time_ops.sched_clock = vmware_sched_clock; |
|
| 101 |
-- pr_info("using sched offset of %llu ns\n", d->cyc2ns_offset);
|
|
| 102 |
-+ pr_info("using clock offset of %llu ns\n", d->cyc2ns_offset);
|
|
| 103 |
-+} |
|
| 104 |
-+ |
|
| 105 |
-+static uint64_t vmware_steal_clock(int cpu) |
|
| 106 |
-+{
|
|
| 107 |
-+ struct vmware_steal_time *steal; |
|
| 108 |
-+ |
|
| 109 |
-+ steal = &per_cpu(steal_time, cpu); |
|
| 110 |
-+ return mul_u64_u32_shr(steal->clock, vmware_cyc2ns.cyc2ns_mul, |
|
| 111 |
-+ vmware_cyc2ns.cyc2ns_shift); |
|
| 112 |
-+} |
|
| 113 |
-+ |
|
| 114 |
-+static void vmware_register_steal_time(void) |
|
| 115 |
-+{
|
|
| 116 |
-+ int cpu = smp_processor_id(); |
|
| 117 |
-+ struct vmware_steal_time *st = &per_cpu(steal_time, cpu); |
|
| 118 |
-+ |
|
| 119 |
-+ if (!has_steal_clock) |
|
| 120 |
-+ return; |
|
| 121 |
-+ |
|
| 122 |
-+ memset(st, 0, sizeof(*st)); |
|
| 123 |
-+ |
|
| 124 |
-+ if (!STEALCLOCK_ENABLE(slow_virt_to_phys(st))) {
|
|
| 125 |
-+ has_steal_clock = 0; |
|
| 126 |
-+ return; |
|
| 127 |
-+ } |
|
| 128 |
-+ |
|
| 129 |
-+ pr_info("vmware-stealtime: cpu %d, pa %llx\n",
|
|
| 130 |
-+ cpu, (unsigned long long) slow_virt_to_phys(st)); |
|
| 131 |
-+} |
|
| 132 |
-+ |
|
| 133 |
-+void vmware_disable_steal_time(void) |
|
| 134 |
-+{
|
|
| 135 |
-+ if (!has_steal_clock) |
|
| 136 |
-+ return; |
|
| 137 |
-+ |
|
| 138 |
-+ STEALCLOCK_DISABLE(); |
|
| 139 |
-+} |
|
| 140 |
-+ |
|
| 141 |
-+static void vmware_guest_cpu_init(void) |
|
| 142 |
-+{
|
|
| 143 |
-+ if (has_steal_clock) |
|
| 144 |
-+ vmware_register_steal_time(); |
|
| 145 |
-+} |
|
| 146 |
-+ |
|
| 147 |
-+static void vmware_pv_guest_cpu_reboot(void *unused) |
|
| 148 |
-+{
|
|
| 149 |
-+ vmware_disable_steal_time(); |
|
| 150 |
-+} |
|
| 151 |
-+ |
|
| 152 |
-+static int vmware_pv_reboot_notify(struct notifier_block *nb, |
|
| 153 |
-+ unsigned long code, void *unused) |
|
| 154 |
-+{
|
|
| 155 |
-+ if (code == SYS_RESTART) |
|
| 156 |
-+ on_each_cpu(vmware_pv_guest_cpu_reboot, NULL, 1); |
|
| 157 |
-+ return NOTIFY_DONE; |
|
| 158 |
-+} |
|
| 159 |
-+ |
|
| 160 |
-+static struct notifier_block vmware_pv_reboot_nb = {
|
|
| 161 |
-+ .notifier_call = vmware_pv_reboot_notify, |
|
| 162 |
-+}; |
|
| 163 |
-+ |
|
| 164 |
-+#ifdef CONFIG_SMP |
|
| 165 |
-+static void __init vmware_smp_prepare_boot_cpu(void) |
|
| 166 |
-+{
|
|
| 167 |
-+ vmware_guest_cpu_init(); |
|
| 168 |
-+ native_smp_prepare_boot_cpu(); |
|
| 169 |
-+} |
|
| 170 |
-+ |
|
| 171 |
-+static int vmware_cpu_online(unsigned int cpu) |
|
| 172 |
-+{
|
|
| 173 |
-+ local_irq_disable(); |
|
| 174 |
-+ vmware_guest_cpu_init(); |
|
| 175 |
-+ local_irq_enable(); |
|
| 176 |
-+ return 0; |
|
| 177 |
- } |
|
| 178 |
- |
|
| 179 |
-+static int vmware_cpu_down_prepare(unsigned int cpu) |
|
| 180 |
-+{
|
|
| 181 |
-+ local_irq_disable(); |
|
| 182 |
-+ vmware_disable_steal_time(); |
|
| 183 |
-+ local_irq_enable(); |
|
| 184 |
-+ return 0; |
|
| 185 |
-+} |
|
| 186 |
-+#endif |
|
| 187 |
-+ |
|
| 188 |
-+static int sta_enabled __initdata = 1; /* steal time accounting */ |
|
| 189 |
-+static __init int parse_no_vmw_sta(char *arg) |
|
| 190 |
-+{
|
|
| 191 |
-+ sta_enabled = 0; |
|
| 192 |
-+ return 0; |
|
| 193 |
-+} |
|
| 194 |
-+ |
|
| 195 |
-+early_param("no-vmw-sta", parse_no_vmw_sta);
|
|
| 196 |
-+ |
|
| 197 |
-+static __init int activate_jump_labels(void) |
|
| 198 |
-+{
|
|
| 199 |
-+ if (has_steal_clock) {
|
|
| 200 |
-+ static_key_slow_inc(¶virt_steal_enabled); |
|
| 201 |
-+ if (sta_enabled) |
|
| 202 |
-+ static_key_slow_inc(¶virt_steal_rq_enabled); |
|
| 203 |
-+ } |
|
| 204 |
-+ |
|
| 205 |
-+ return 0; |
|
| 206 |
-+} |
|
| 207 |
-+arch_initcall(activate_jump_labels); |
|
| 208 |
-+ |
|
| 209 |
-+ |
|
| 210 |
- static void __init vmware_paravirt_ops_setup(void) |
|
| 211 |
- {
|
|
| 212 |
- pv_info.name = "VMware hypervisor"; |
|
| 213 |
- pv_cpu_ops.io_delay = paravirt_nop; |
|
| 214 |
- |
|
| 215 |
-- if (vmware_tsc_khz && vmw_sched_clock) |
|
| 216 |
-- vmware_sched_clock_setup(); |
|
| 217 |
-+ if (vmware_tsc_khz == 0) |
|
| 218 |
-+ return; |
|
| 219 |
-+ |
|
| 220 |
-+ vmware_cyc2ns_setup(); |
|
| 221 |
-+ |
|
| 222 |
-+ if (vmw_sched_clock) |
|
| 223 |
-+ pv_time_ops.sched_clock = vmware_sched_clock; |
|
| 224 |
-+ |
|
| 225 |
-+ if (vmware_is_stealclock_available()) {
|
|
| 226 |
-+ has_steal_clock = 1; |
|
| 227 |
-+ pv_time_ops.steal_clock = vmware_steal_clock; |
|
| 228 |
-+ } |
|
| 229 |
-+ |
|
| 230 |
-+ if (has_steal_clock) {
|
|
| 231 |
-+ /* We use reboot notifier only to disable steal clock */ |
|
| 232 |
-+ register_reboot_notifier(&vmware_pv_reboot_nb); |
|
| 233 |
-+#ifdef CONFIG_SMP |
|
| 234 |
-+ smp_ops.smp_prepare_boot_cpu = vmware_smp_prepare_boot_cpu; |
|
| 235 |
-+ if (cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "x86/vmware:online", |
|
| 236 |
-+ vmware_cpu_online, vmware_cpu_down_prepare) < 0) |
|
| 237 |
-+ pr_err("vmware_guest: Failed to install cpu hotplug callbacks\n");
|
|
| 238 |
-+#else |
|
| 239 |
-+ vmware_guest_cpu_init(); |
|
| 240 |
-+#endif |
|
| 241 |
-+ } |
|
| 242 |
- } |
|
| 243 |
- #else |
|
| 244 |
- #define vmware_paravirt_ops_setup() do {} while (0)
|
|
| 245 |
-2.11.0 |
|
| 246 |
- |