Many patches from 3.3.5 stable queue
This commit is contained in:
parent
aef7a0c111
commit
28303e222e
|
@ -0,0 +1,153 @@
|
|||
From: Trond Myklebust <Trond.Myklebust@netapp.com>
|
||||
|
||||
Currently, we will correctly optimise away a truncate that doesn't
|
||||
change the file size. However, in the case of open(O_TRUNC), we
|
||||
also want to optimise away the time changes.
|
||||
|
||||
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
|
||||
---
|
||||
fs/nfs/dir.c | 25 +++++++++++++++++++------
|
||||
fs/nfs/inode.c | 4 ++--
|
||||
fs/nfs/nfs4proc.c | 10 +++++++---
|
||||
3 files changed, 28 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
|
||||
index fd9a872..bb132a8 100644
|
||||
--- a/fs/nfs/dir.c
|
||||
+++ b/fs/nfs/dir.c
|
||||
@@ -1429,6 +1429,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
|
||||
}
|
||||
|
||||
open_flags = nd->intent.open.flags;
|
||||
+ attr.ia_valid = 0;
|
||||
|
||||
ctx = create_nfs_open_context(dentry, open_flags);
|
||||
res = ERR_CAST(ctx);
|
||||
@@ -1437,11 +1438,14 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
|
||||
|
||||
if (nd->flags & LOOKUP_CREATE) {
|
||||
attr.ia_mode = nd->intent.open.create_mode;
|
||||
- attr.ia_valid = ATTR_MODE;
|
||||
+ attr.ia_valid |= ATTR_MODE;
|
||||
attr.ia_mode &= ~current_umask();
|
||||
- } else {
|
||||
+ } else
|
||||
open_flags &= ~(O_EXCL | O_CREAT);
|
||||
- attr.ia_valid = 0;
|
||||
+
|
||||
+ if (open_flags & O_TRUNC) {
|
||||
+ attr.ia_valid |= ATTR_SIZE;
|
||||
+ attr.ia_size = 0;
|
||||
}
|
||||
|
||||
/* Open the file on the server */
|
||||
@@ -1495,6 +1499,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
|
||||
struct inode *inode;
|
||||
struct inode *dir;
|
||||
struct nfs_open_context *ctx;
|
||||
+ struct iattr attr;
|
||||
int openflags, ret = 0;
|
||||
|
||||
if (nd->flags & LOOKUP_RCU)
|
||||
@@ -1523,19 +1528,27 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
|
||||
/* We cannot do exclusive creation on a positive dentry */
|
||||
if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
|
||||
goto no_open_dput;
|
||||
- /* We can't create new files, or truncate existing ones here */
|
||||
- openflags &= ~(O_CREAT|O_EXCL|O_TRUNC);
|
||||
+ /* We can't create new files here */
|
||||
+ openflags &= ~(O_CREAT|O_EXCL);
|
||||
|
||||
ctx = create_nfs_open_context(dentry, openflags);
|
||||
ret = PTR_ERR(ctx);
|
||||
if (IS_ERR(ctx))
|
||||
goto out;
|
||||
+
|
||||
+ attr.ia_valid = 0;
|
||||
+ if (openflags & O_TRUNC) {
|
||||
+ attr.ia_valid |= ATTR_SIZE;
|
||||
+ attr.ia_size = 0;
|
||||
+ nfs_wb_all(inode);
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Note: we're not holding inode->i_mutex and so may be racing with
|
||||
* operations that change the directory. We therefore save the
|
||||
* change attribute *before* we do the RPC call.
|
||||
*/
|
||||
- inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, NULL);
|
||||
+ inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr);
|
||||
if (IS_ERR(inode)) {
|
||||
ret = PTR_ERR(inode);
|
||||
switch (ret) {
|
||||
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
|
||||
index f649fba..57d0abb 100644
|
||||
--- a/fs/nfs/inode.c
|
||||
+++ b/fs/nfs/inode.c
|
||||
@@ -401,7 +401,7 @@ out_no_inode:
|
||||
goto out;
|
||||
}
|
||||
|
||||
-#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE)
|
||||
+#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN)
|
||||
|
||||
int
|
||||
nfs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
@@ -423,7 +423,7 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
|
||||
/* Optimization: if the end result is no change, don't RPC */
|
||||
attr->ia_valid &= NFS_VALID_ATTRS;
|
||||
- if ((attr->ia_valid & ~ATTR_FILE) == 0)
|
||||
+ if ((attr->ia_valid & ~(ATTR_FILE|ATTR_OPEN)) == 0)
|
||||
return 0;
|
||||
|
||||
/* Write all dirty data */
|
||||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
|
||||
index 1515e45..c4c6b48 100644
|
||||
--- a/fs/nfs/nfs4proc.c
|
||||
+++ b/fs/nfs/nfs4proc.c
|
||||
@@ -833,7 +833,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
|
||||
p->o_arg.bitmask = server->attr_bitmask;
|
||||
p->o_arg.dir_bitmask = server->cache_consistency_bitmask;
|
||||
p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
|
||||
- if (flags & O_CREAT) {
|
||||
+ if (attrs != NULL && attrs->ia_valid != 0) {
|
||||
u32 *s;
|
||||
|
||||
p->o_arg.u.attrs = &p->attrs;
|
||||
@@ -890,7 +890,7 @@ static int can_open_cached(struct nfs4_state *state, fmode_t mode, int open_mode
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
- if (open_mode & O_EXCL)
|
||||
+ if (open_mode & (O_EXCL|O_TRUNC))
|
||||
goto out;
|
||||
switch (mode & (FMODE_READ|FMODE_WRITE)) {
|
||||
case FMODE_READ:
|
||||
@@ -1038,7 +1038,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
|
||||
struct nfs4_state *state = opendata->state;
|
||||
struct nfs_inode *nfsi = NFS_I(state->inode);
|
||||
struct nfs_delegation *delegation;
|
||||
- int open_mode = opendata->o_arg.open_flags & O_EXCL;
|
||||
+ int open_mode = opendata->o_arg.open_flags & (O_EXCL|O_TRUNC);
|
||||
fmode_t fmode = opendata->o_arg.fmode;
|
||||
nfs4_stateid stateid;
|
||||
int ret = -EAGAIN;
|
||||
@@ -2439,6 +2439,10 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Deal with open(O_TRUNC) */
|
||||
+ if (sattr->ia_valid & ATTR_OPEN)
|
||||
+ sattr->ia_valid &= ~(ATTR_MTIME|ATTR_CTIME|ATTR_OPEN);
|
||||
+
|
||||
status = nfs4_do_setattr(inode, cred, fattr, sattr, state);
|
||||
if (status == 0)
|
||||
nfs_setattr_update_inode(inode, sattr);
|
||||
--
|
||||
1.7.7.6
|
||||
|
||||
_______________________________________________
|
||||
kernel mailing list
|
||||
kernel@lists.fedoraproject.org
|
||||
https://admin.fedoraproject.org/mailman/listinfo/kernel
|
|
@ -0,0 +1,69 @@
|
|||
From: Trond Myklebust <Trond.Myklebust@netapp.com>
|
||||
|
||||
If the file wasn't opened for writing, then truncate and ftruncate
|
||||
need to report the appropriate errors.
|
||||
|
||||
Reported-by: Miklos Szeredi <miklos@szeredi.hu>
|
||||
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
|
||||
Cc: stable@vger.kernel.org
|
||||
---
|
||||
fs/nfs/dir.c | 4 ++--
|
||||
fs/nfs/nfs4proc.c | 15 ++++++++++++---
|
||||
2 files changed, 14 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
|
||||
index bb132a8..51a2686 100644
|
||||
--- a/fs/nfs/dir.c
|
||||
+++ b/fs/nfs/dir.c
|
||||
@@ -1429,7 +1429,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
|
||||
}
|
||||
|
||||
open_flags = nd->intent.open.flags;
|
||||
- attr.ia_valid = 0;
|
||||
+ attr.ia_valid = ATTR_OPEN;
|
||||
|
||||
ctx = create_nfs_open_context(dentry, open_flags);
|
||||
res = ERR_CAST(ctx);
|
||||
@@ -1536,7 +1536,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
|
||||
if (IS_ERR(ctx))
|
||||
goto out;
|
||||
|
||||
- attr.ia_valid = 0;
|
||||
+ attr.ia_valid = ATTR_OPEN;
|
||||
if (openflags & O_TRUNC) {
|
||||
attr.ia_valid |= ATTR_SIZE;
|
||||
attr.ia_size = 0;
|
||||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
|
||||
index c4c6b48..e2a2893 100644
|
||||
--- a/fs/nfs/nfs4proc.c
|
||||
+++ b/fs/nfs/nfs4proc.c
|
||||
@@ -1921,10 +1921,19 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
|
||||
};
|
||||
int err;
|
||||
do {
|
||||
- err = nfs4_handle_exception(server,
|
||||
- _nfs4_do_setattr(inode, cred, fattr, sattr, state),
|
||||
- &exception);
|
||||
+ err = _nfs4_do_setattr(inode, cred, fattr, sattr, state);
|
||||
+ switch (err) {
|
||||
+ case -NFS4ERR_OPENMODE:
|
||||
+ if (state && !(state->state & FMODE_WRITE)) {
|
||||
+ err = -EBADF;
|
||||
+ if (sattr->ia_valid & ATTR_OPEN)
|
||||
+ err = -EACCES;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ err = nfs4_handle_exception(server, err, &exception);
|
||||
} while (exception.retry);
|
||||
+out:
|
||||
return err;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.7.6
|
||||
|
||||
_______________________________________________
|
||||
kernel mailing list
|
||||
kernel@lists.fedoraproject.org
|
||||
https://admin.fedoraproject.org/mailman/listinfo/kernel
|
|
@ -1,38 +0,0 @@
|
|||
From 899c612d74d4a242158a4db20367388d6299c028 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
||||
Date: Fri, 20 Apr 2012 22:34:49 -0700
|
||||
Subject: [PATCH] Input: synaptics - fix regression with "image sensor"
|
||||
trackpads
|
||||
|
||||
commit 7968a5dd492ccc38345013e534ad4c8d6eb60ed1
|
||||
Input: synaptics - add support for Relative mode
|
||||
|
||||
Accidentally broke support for advanced gestures (multitouch)
|
||||
on some trackpads such as the one in my ThinkPad X220 by
|
||||
incorretly changing the condition for enabling them. This
|
||||
restores it.
|
||||
|
||||
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
||||
CC: stable@kernel.org [3.3]
|
||||
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
|
||||
---
|
||||
drivers/input/mouse/synaptics.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
|
||||
index 8081a0a..a4b14a4 100644
|
||||
--- a/drivers/input/mouse/synaptics.c
|
||||
+++ b/drivers/input/mouse/synaptics.c
|
||||
@@ -274,7 +274,8 @@ static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)
|
||||
static unsigned char param = 0xc8;
|
||||
struct synaptics_data *priv = psmouse->private;
|
||||
|
||||
- if (!SYN_CAP_ADV_GESTURE(priv->ext_cap_0c))
|
||||
+ if (!(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) ||
|
||||
+ SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)))
|
||||
return 0;
|
||||
|
||||
if (psmouse_sliced_command(psmouse, SYN_QUE_MODEL))
|
||||
--
|
||||
1.7.10
|
||||
|
31
kernel.spec
31
kernel.spec
|
@ -54,7 +54,7 @@ Summary: The Linux kernel
|
|||
# For non-released -rc kernels, this will be appended after the rcX and
|
||||
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
|
||||
#
|
||||
%global baserelease 2
|
||||
%global baserelease 3
|
||||
%global fedora_build %{baserelease}
|
||||
|
||||
# base_sublevel is the kernel version we're starting with and patching
|
||||
|
@ -721,6 +721,10 @@ Patch4000: NFSv4-Reduce-the-footprint-of-the-idmapper.patch
|
|||
Patch4001: NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
|
||||
Patch4107: NFSv4-Minor-cleanups-for-nfs4_handle_exception-and-n.patch
|
||||
|
||||
# NFS Client Patch set from Upstream
|
||||
Patch4113: NFS-optimise-away-unnecessary-setattrs-for-open-O_TRUNC.patch
|
||||
Patch4114: NFSv4-fix-open-O_TRUNC-and-ftruncate-error-handling.patch
|
||||
|
||||
# patches headed upstream
|
||||
|
||||
Patch12016: disable-i8042-check-on-apple-mac.patch
|
||||
|
@ -785,9 +789,6 @@ Patch21520: KVM-Ensure-all-vcpus-are-consistent-with-in-kernel-i.patch
|
|||
#rhbz 808559
|
||||
Patch21530: ALSA-hda-realtek-Add-quirk-for-Mac-Pro-5-1-machines.patch
|
||||
|
||||
Patch21700: x86-microcode-Fix-sysfs-warning-during-module-unload-on-unsupported-CPUs.patch
|
||||
Patch21701: x86-microcode-Ensure-that-module-is-only-loaded-for-supported-AMD-CPUs.patch
|
||||
|
||||
#rhbz 806295
|
||||
Patch21710: disable-hid-battery.patch
|
||||
|
||||
|
@ -798,14 +799,15 @@ Patch30010: debug-808990.patch
|
|||
#rhbz 814278 814289 CVE-2012-2119
|
||||
Patch22007: macvtap-zerocopy-validate-vector-length.patch
|
||||
|
||||
Patch22011: input-synaptics-fix-regression-with-image-sensor-trackpads.patch
|
||||
|
||||
#rhbz 783708
|
||||
Patch22012: ipw2200-Fix-race-condition-in-the-command-completion-acknowledge.patch
|
||||
|
||||
#rhbz 817298
|
||||
Patch22013: ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
|
||||
|
||||
#Lots of fixes from 3.3.5 stable queue
|
||||
Patch22015: stable-queue-3.3.5-0502.patch
|
||||
|
||||
# END OF PATCH DEFINITIONS
|
||||
|
||||
%endif
|
||||
|
@ -1340,6 +1342,10 @@ ApplyPatch NFSv4-Reduce-the-footprint-of-the-idmapper.patch
|
|||
ApplyPatch NFSv4-Further-reduce-the-footprint-of-the-idmapper.patch
|
||||
ApplyPatch NFSv4-Minor-cleanups-for-nfs4_handle_exception-and-n.patch
|
||||
|
||||
# NFS Client Patch set from Upstream
|
||||
ApplyPatch NFS-optimise-away-unnecessary-setattrs-for-open-O_TRUNC.patch
|
||||
ApplyPatch NFSv4-fix-open-O_TRUNC-and-ftruncate-error-handling.patch
|
||||
|
||||
# USB
|
||||
|
||||
# WMI
|
||||
|
@ -1485,24 +1491,21 @@ ApplyPatch KVM-Ensure-all-vcpus-are-consistent-with-in-kernel-i.patch
|
|||
#rhbz 807632
|
||||
ApplyPatch libata-forbid-port-runtime-pm-by-default.patch
|
||||
|
||||
#rhbz 797559
|
||||
ApplyPatch x86-microcode-Fix-sysfs-warning-during-module-unload-on-unsupported-CPUs.patch
|
||||
ApplyPatch x86-microcode-Ensure-that-module-is-only-loaded-for-supported-AMD-CPUs.patch
|
||||
|
||||
#rhbz 806295
|
||||
ApplyPatch disable-hid-battery.patch
|
||||
|
||||
#rhbz 814278 814289 CVE-2012-2119
|
||||
ApplyPatch macvtap-zerocopy-validate-vector-length.patch
|
||||
|
||||
ApplyPatch input-synaptics-fix-regression-with-image-sensor-trackpads.patch
|
||||
|
||||
#rhbz 783708
|
||||
ApplyPatch ipw2200-Fix-race-condition-in-the-command-completion-acknowledge.patch
|
||||
|
||||
#rhbz 817298
|
||||
ApplyPatch ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
|
||||
|
||||
#Lots of fixes from 3.3.5 stable queue
|
||||
ApplyPatch stable-queue-3.3.5-0502.patch
|
||||
|
||||
# END OF PATCH APPLICATIONS
|
||||
|
||||
%endif
|
||||
|
@ -2241,6 +2244,10 @@ fi
|
|||
# and build.
|
||||
|
||||
%changelog
|
||||
* Thu May 03 2012 Justin M. Forbes <jforbes@redhat.com> 3.3.4-3
|
||||
- Many patches from 3.3.5 stable queue
|
||||
- NFS Bugfixes from upstream
|
||||
|
||||
* Mon Apr 30 2012 Josh Boyer <jwboyer@redhat.com>
|
||||
- Backport ipw2x00 nl80211 cipher suite reporting (rhbz 817298)
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,163 +0,0 @@
|
|||
Path: news.gmane.org!not-for-mail
|
||||
From: Borislav Petkov <borislav.petkov@amd.com>
|
||||
Newsgroups: gmane.linux.kernel
|
||||
Subject: [PATCH 2/2] x86, microcode: Ensure that module is only loaded for
|
||||
Date: Thu, 12 Apr 2012 18:34:22 +0200
|
||||
Lines: 80
|
||||
Approved: news@gmane.org
|
||||
Message-ID: <20120412163422.GM24549@aftab>
|
||||
References: <20120411163849.GE4794@alberich.amd.com>
|
||||
<20120411200601.GC12288@kroah.com>
|
||||
<20120411201053.GF18114@aftab>
|
||||
<20120412162351.GJ24549@aftab>
|
||||
NNTP-Posting-Host: plane.gmane.org
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset="us-ascii"
|
||||
X-Trace: dough.gmane.org 1334248500 15307 80.91.229.3 (12 Apr 2012 16:35:00 GMT)
|
||||
X-Complaints-To: usenet@dough.gmane.org
|
||||
NNTP-Posting-Date: Thu, 12 Apr 2012 16:35:00 +0000 (UTC)
|
||||
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>,
|
||||
Kay Sievers <kay.sievers@vrfy.org>,
|
||||
Dave Jones <davej@redhat.com>, <linux-kernel@vger.kernel.org>
|
||||
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Original-X-From: linux-kernel-owner@vger.kernel.org Thu Apr 12 18:34:59 2012
|
||||
Return-path: <linux-kernel-owner@vger.kernel.org>
|
||||
Envelope-to: glk-linux-kernel-3@plane.gmane.org
|
||||
Original-Received: from vger.kernel.org ([209.132.180.67])
|
||||
by plane.gmane.org with esmtp (Exim 4.69)
|
||||
(envelope-from <linux-kernel-owner@vger.kernel.org>)
|
||||
id 1SIMz4-0008MV-3g
|
||||
for glk-linux-kernel-3@plane.gmane.org; Thu, 12 Apr 2012 18:34:58 +0200
|
||||
Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||
id S965760Ab2DLQep (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
|
||||
Thu, 12 Apr 2012 12:34:45 -0400
|
||||
Original-Received: from db3ehsobe002.messaging.microsoft.com ([213.199.154.140]:56919
|
||||
"EHLO db3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK)
|
||||
by vger.kernel.org with ESMTP id S965553Ab2DLQen (ORCPT
|
||||
<rfc822;linux-kernel@vger.kernel.org>);
|
||||
Thu, 12 Apr 2012 12:34:43 -0400
|
||||
Original-Received: from mail2-db3-R.bigfish.com (10.3.81.239) by
|
||||
DB3EHSOBE005.bigfish.com (10.3.84.25) with Microsoft SMTP Server id
|
||||
14.1.225.23; Thu, 12 Apr 2012 16:34:41 +0000
|
||||
Original-Received: from mail2-db3 (localhost [127.0.0.1]) by mail2-db3-R.bigfish.com
|
||||
(Postfix) with ESMTP id E4EF14404B4; Thu, 12 Apr 2012 16:34:41 +0000 (UTC)
|
||||
X-SpamScore: 0
|
||||
X-BigFish: VPS0(zzzz1202hzz8275bh8275dhz2dh668h839h944hd25hd2bh)
|
||||
X-Forefront-Antispam-Report: CIP:163.181.249.108;KIP:(null);UIP:(null);IPV:NLI;H:ausb3twp01.amd.com;RD:none;EFVD:NLI
|
||||
Original-Received: from mail2-db3 (localhost.localdomain [127.0.0.1]) by mail2-db3
|
||||
(MessageSwitch) id 1334248479906480_3860; Thu, 12 Apr 2012 16:34:39 +0000
|
||||
(UTC)
|
||||
Original-Received: from DB3EHSMHS005.bigfish.com (unknown [10.3.81.241]) by
|
||||
mail2-db3.bigfish.com (Postfix) with ESMTP id CEB76400A4; Thu, 12 Apr 2012
|
||||
16:34:39 +0000 (UTC)
|
||||
Original-Received: from ausb3twp01.amd.com (163.181.249.108) by
|
||||
DB3EHSMHS005.bigfish.com (10.3.87.105) with Microsoft SMTP Server id
|
||||
14.1.225.23; Thu, 12 Apr 2012 16:34:38 +0000
|
||||
X-WSS-ID: 0M2DKPO-01-CNU-02
|
||||
X-M-MSG:
|
||||
Original-Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com
|
||||
[163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No
|
||||
client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1)
|
||||
with ESMTP id 2C1D81028100; Thu, 12 Apr 2012 11:34:36 -0500 (CDT)
|
||||
Original-Received: from SAUSEXDAG02.amd.com (163.181.55.2) by sausexedgep02.amd.com
|
||||
(163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 12 Apr
|
||||
2012 11:34:51 -0500
|
||||
Original-Received: from storexhtp01.amd.com (172.24.4.3) by sausexdag02.amd.com
|
||||
(163.181.55.2) with Microsoft SMTP Server (TLS) id 14.1.323.3; Thu, 12 Apr
|
||||
2012 11:34:36 -0500
|
||||
Original-Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com
|
||||
(172.24.4.3) with Microsoft SMTP Server id 8.3.213.0; Thu, 12 Apr 2012
|
||||
12:34:35 -0400
|
||||
Original-Received: from aftab (aftab.osrc.amd.com [165.204.15.109]) by gwo.osrc.amd.com
|
||||
(Postfix) with ESMTP id D8E4C49C58B; Thu, 12 Apr 2012 17:34:33 +0100 (BST)
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <20120412162351.GJ24549@aftab>
|
||||
User-Agent: Mutt/1.5.21 (2010-09-15)
|
||||
X-OriginatorOrg: amd.com
|
||||
Original-Sender: linux-kernel-owner@vger.kernel.org
|
||||
Precedence: bulk
|
||||
List-ID: <linux-kernel.vger.kernel.org>
|
||||
X-Mailing-List: linux-kernel@vger.kernel.org
|
||||
Xref: news.gmane.org gmane.linux.kernel:1281050
|
||||
Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1281050>
|
||||
|
||||
From: Andreas Herrmann <andreas.herrmann3@amd.com>
|
||||
Date: Thu, 12 Apr 2012 16:51:57 +0200
|
||||
Subject: [PATCH 2/2] x86, microcode: Ensure that module is only loaded for supported AMD CPUs
|
||||
|
||||
Exit early when there's no support for a particular CPU family. Also,
|
||||
fixup the "no support for this CPU vendor" to be issued only when the
|
||||
driver is attempted to be loaded on an unsupported vendor.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
|
||||
Cc: Borislav Petkov <borislav.petkov@amd.com>
|
||||
[Boris: added a commit msg because Andreas is lazy]
|
||||
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
|
||||
---
|
||||
arch/x86/kernel/microcode_amd.c | 12 +++++++-----
|
||||
arch/x86/kernel/microcode_core.c | 6 +++---
|
||||
2 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
|
||||
index 73465aa..8a2ce8f 100644
|
||||
--- a/arch/x86/kernel/microcode_amd.c
|
||||
+++ b/arch/x86/kernel/microcode_amd.c
|
||||
@@ -82,11 +82,6 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
|
||||
{
|
||||
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
||||
|
||||
- if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
|
||||
- pr_warning("CPU%d: family %d not supported\n", cpu, c->x86);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
csig->rev = c->microcode;
|
||||
pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);
|
||||
|
||||
@@ -380,6 +375,13 @@ static struct microcode_ops microcode_amd_ops = {
|
||||
|
||||
struct microcode_ops * __init init_amd_microcode(void)
|
||||
{
|
||||
+ struct cpuinfo_x86 *c = &cpu_data(0);
|
||||
+
|
||||
+ if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
|
||||
+ pr_warning("AMD CPU family 0x%x not supported\n", c->x86);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
patch = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
if (!patch)
|
||||
return NULL;
|
||||
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
|
||||
index d389e74..c9bda6d 100644
|
||||
--- a/arch/x86/kernel/microcode_core.c
|
||||
+++ b/arch/x86/kernel/microcode_core.c
|
||||
@@ -526,11 +526,11 @@ static int __init microcode_init(void)
|
||||
microcode_ops = init_intel_microcode();
|
||||
else if (c->x86_vendor == X86_VENDOR_AMD)
|
||||
microcode_ops = init_amd_microcode();
|
||||
-
|
||||
- if (!microcode_ops) {
|
||||
+ else
|
||||
pr_err("no support for this CPU vendor\n");
|
||||
+
|
||||
+ if (!microcode_ops)
|
||||
return -ENODEV;
|
||||
- }
|
||||
|
||||
microcode_pdev = platform_device_register_simple("microcode", -1,
|
||||
NULL, 0);
|
||||
--
|
||||
1.7.8.4
|
||||
|
||||
--
|
||||
Regards/Gruss,
|
||||
Boris.
|
||||
|
||||
Advanced Micro Devices GmbH
|
||||
Einsteinring 24, 85609 Dornach
|
||||
GM: Alberto Bozzo
|
||||
Reg: Dornach, Landkreis Muenchen
|
||||
HRB Nr. 43632 WEEE Registernr: 129 19551
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
Path: news.gmane.org!not-for-mail
|
||||
From: Borislav Petkov <borislav.petkov@amd.com>
|
||||
Newsgroups: gmane.linux.kernel
|
||||
Subject: [PATCH 1/2] x86, microcode: Fix sysfs warning during module unload
|
||||
Date: Thu, 12 Apr 2012 18:30:38 +0200
|
||||
Lines: 83
|
||||
Approved: news@gmane.org
|
||||
Message-ID: <20120412163038.GL24549@aftab>
|
||||
References: <20120411163849.GE4794@alberich.amd.com>
|
||||
<20120411200601.GC12288@kroah.com>
|
||||
<20120411201053.GF18114@aftab>
|
||||
<20120412162351.GJ24549@aftab>
|
||||
NNTP-Posting-Host: plane.gmane.org
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset="us-ascii"
|
||||
X-Trace: dough.gmane.org 1334248312 13759 80.91.229.3 (12 Apr 2012 16:31:52 GMT)
|
||||
X-Complaints-To: usenet@dough.gmane.org
|
||||
NNTP-Posting-Date: Thu, 12 Apr 2012 16:31:52 +0000 (UTC)
|
||||
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>,
|
||||
Kay Sievers <kay.sievers@vrfy.org>,
|
||||
Dave Jones <davej@redhat.com>, <linux-kernel@vger.kernel.org>
|
||||
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Original-X-From: linux-kernel-owner@vger.kernel.org Thu Apr 12 18:31:50 2012
|
||||
Return-path: <linux-kernel-owner@vger.kernel.org>
|
||||
Envelope-to: glk-linux-kernel-3@plane.gmane.org
|
||||
Original-Received: from vger.kernel.org ([209.132.180.67])
|
||||
by plane.gmane.org with esmtp (Exim 4.69)
|
||||
(envelope-from <linux-kernel-owner@vger.kernel.org>)
|
||||
id 1SIMw1-0005nm-KE
|
||||
for glk-linux-kernel-3@plane.gmane.org; Thu, 12 Apr 2012 18:31:49 +0200
|
||||
Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||
id S934534Ab2DLQbF (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
|
||||
Thu, 12 Apr 2012 12:31:05 -0400
|
||||
Original-Received: from db3ehsobe004.messaging.microsoft.com ([213.199.154.142]:35401
|
||||
"EHLO db3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK)
|
||||
by vger.kernel.org with ESMTP id S934436Ab2DLQbD (ORCPT
|
||||
<rfc822;linux-kernel@vger.kernel.org>);
|
||||
Thu, 12 Apr 2012 12:31:03 -0400
|
||||
Original-Received: from mail117-db3-R.bigfish.com (10.3.81.240) by
|
||||
DB3EHSOBE002.bigfish.com (10.3.84.22) with Microsoft SMTP Server id
|
||||
14.1.225.23; Thu, 12 Apr 2012 16:31:00 +0000
|
||||
Original-Received: from mail117-db3 (localhost [127.0.0.1]) by
|
||||
mail117-db3-R.bigfish.com (Postfix) with ESMTP id BAA93180481; Thu, 12 Apr
|
||||
2012 16:31:00 +0000 (UTC)
|
||||
X-SpamScore: 1
|
||||
X-BigFish: VPS1(zzzz1202hzz8275eh8275bh8275dha1495iz2dh668h839h944hd25hd2bh)
|
||||
X-Forefront-Antispam-Report: CIP:163.181.249.109;KIP:(null);UIP:(null);IPV:NLI;H:ausb3twp02.amd.com;RD:none;EFVD:NLI
|
||||
Original-Received: from mail117-db3 (localhost.localdomain [127.0.0.1]) by mail117-db3
|
||||
(MessageSwitch) id 133424825930391_28243; Thu, 12 Apr 2012 16:30:59 +0000
|
||||
(UTC)
|
||||
Original-Received: from DB3EHSMHS006.bigfish.com (unknown [10.3.81.226]) by
|
||||
mail117-db3.bigfish.com (Postfix) with ESMTP id ED7022E004F; Thu, 12 Apr 2012
|
||||
16:30:58 +0000 (UTC)
|
||||
Original-Received: from ausb3twp02.amd.com (163.181.249.109) by
|
||||
DB3EHSMHS006.bigfish.com (10.3.87.106) with Microsoft SMTP Server id
|
||||
14.1.225.23; Thu, 12 Apr 2012 16:30:57 +0000
|
||||
X-WSS-ID: 0M2DKJG-02-0NU-02
|
||||
X-M-MSG:
|
||||
Original-Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com
|
||||
[163.181.249.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No
|
||||
client certificate requested) by ausb3twp02.amd.com (Axway MailGate 3.8.1)
|
||||
with ESMTP id 21D3FC814C; Thu, 12 Apr 2012 11:30:50 -0500 (CDT)
|
||||
Original-Received: from SAUSEXDAG01.amd.com (163.181.55.1) by sausexedgep01.amd.com
|
||||
(163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 12 Apr
|
||||
2012 11:31:09 -0500
|
||||
Original-Received: from storexhtp02.amd.com (172.24.4.4) by sausexdag01.amd.com
|
||||
(163.181.55.1) with Microsoft SMTP Server (TLS) id 14.1.323.3; Thu, 12 Apr
|
||||
2012 11:30:54 -0500
|
||||
Original-Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com
|
||||
(172.24.4.4) with Microsoft SMTP Server id 8.3.213.0; Thu, 12 Apr 2012
|
||||
12:30:51 -0400
|
||||
Original-Received: from aftab (aftab.osrc.amd.com [165.204.15.109]) by gwo.osrc.amd.com
|
||||
(Postfix) with ESMTP id 0D00D49C58B; Thu, 12 Apr 2012 17:30:50 +0100 (BST)
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <20120412162351.GJ24549@aftab>
|
||||
User-Agent: Mutt/1.5.21 (2010-09-15)
|
||||
X-OriginatorOrg: amd.com
|
||||
Original-Sender: linux-kernel-owner@vger.kernel.org
|
||||
Precedence: bulk
|
||||
List-ID: <linux-kernel.vger.kernel.org>
|
||||
X-Mailing-List: linux-kernel@vger.kernel.org
|
||||
Xref: news.gmane.org gmane.linux.kernel:1281049
|
||||
Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1281049>
|
||||
|
||||
From: Andreas Herrmann <andreas.herrmann3@amd.com>
|
||||
Date: Thu, 12 Apr 2012 16:48:01 +0200
|
||||
Subject: [PATCH 1/2] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs
|
||||
|
||||
Loading microcode driver on an unsupported CPU and subsequently
|
||||
unloading the driver causes
|
||||
|
||||
WARNING: at fs/sysfs/group.c:138 mc_device_remove+0x5f/0x70 [microcode]()
|
||||
Hardware name: 01972NG
|
||||
sysfs group ffffffffa00013d0 not found for kobject 'cpu0'
|
||||
Modules linked in: snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel btusb snd_hda_codec bluetooth thinkpad_acpi rfkill microcode(-) [last unloaded: cfg80211]
|
||||
Pid: 4560, comm: modprobe Not tainted 3.4.0-rc2-00002-g258f742 #5
|
||||
Call Trace:
|
||||
[<ffffffff8103113b>] ? warn_slowpath_common+0x7b/0xc0
|
||||
[<ffffffff81031235>] ? warn_slowpath_fmt+0x45/0x50
|
||||
[<ffffffff81120e74>] ? sysfs_remove_group+0x34/0x120
|
||||
[<ffffffffa00000ef>] ? mc_device_remove+0x5f/0x70 [microcode]
|
||||
[<ffffffff81331eb9>] ? subsys_interface_unregister+0x69/0xa0
|
||||
[<ffffffff81563526>] ? mutex_lock+0x16/0x40
|
||||
[<ffffffffa0000c3e>] ? microcode_exit+0x50/0x92 [microcode]
|
||||
[<ffffffff8107051d>] ? sys_delete_module+0x16d/0x260
|
||||
[<ffffffff810a0065>] ? wait_iff_congested+0x45/0x110
|
||||
[<ffffffff815656af>] ? page_fault+0x1f/0x30
|
||||
[<ffffffff81565ba2>] ? system_call_fastpath+0x16/0x1b
|
||||
|
||||
on recent kernels.
|
||||
|
||||
This is due to
|
||||
|
||||
commit 8a25a2fd126c621f44f3aeaef80d51f00fc11639
|
||||
(cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular
|
||||
subsystem)
|
||||
|
||||
which renders
|
||||
|
||||
commit 6c53cbfced048c421e4f72cb2183465f68fbc5e7
|
||||
(x86, microcode: Correct sysdev_add error path)
|
||||
|
||||
useless.
|
||||
|
||||
See http://marc.info/?l=linux-kernel&m=133416246406478
|
||||
|
||||
Avoid above warning by restoring the old driver behaviour before
|
||||
commit 6c53cbfced048c421e4f72cb2183465f68fbc5e7 (x86, microcode:
|
||||
Correct sysdev_add error path)
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
|
||||
Cc: Borislav Petkov <borislav.petkov@amd.com>
|
||||
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
|
||||
---
|
||||
arch/x86/kernel/microcode_core.c | 4 +---
|
||||
1 files changed, 1 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
|
||||
index 87a0f86..d389e74 100644
|
||||
--- a/arch/x86/kernel/microcode_core.c
|
||||
+++ b/arch/x86/kernel/microcode_core.c
|
||||
@@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- if (microcode_init_cpu(cpu) == UCODE_ERROR) {
|
||||
- sysfs_remove_group(&dev->kobj, &mc_attr_group);
|
||||
+ if (microcode_init_cpu(cpu) == UCODE_ERROR)
|
||||
return -EINVAL;
|
||||
- }
|
||||
|
||||
return err;
|
||||
}
|
||||
--
|
||||
1.7.8.4
|
||||
|
||||
--
|
||||
Regards/Gruss,
|
||||
Boris.
|
||||
|
||||
Advanced Micro Devices GmbH
|
||||
Einsteinring 24, 85609 Dornach
|
||||
GM: Alberto Bozzo
|
||||
Reg: Dornach, Landkreis Muenchen
|
||||
HRB Nr. 43632 WEEE Registernr: 129 19551
|
||||
|
Loading…
Reference in New Issue