Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
Merge tag 'v3.0.47' into exp
Browse files Browse the repository at this point in the history
This is the 3.0.47 stable release

* tag 'v3.0.47':
  Linux 3.0.47
  ALSA: emu10k1: add chip details for E-mu 1010 PCIe card
  ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
  udf: fix retun value on error path in udf_load_logicalvol
  tpm: Propagate error from tpm_transmit to fix a timeout hang
  x86, random: Verify RDRAND functionality and allow it to be disabled
  x86, random: Architectural inlines to get random integers with RDRAND
  jbd: Fix assertion failure in commit code due to lacking transaction credits
  drm/radeon: Don't destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy().
  Add CDC-ACM support for the CX93010-2x UCMxx USB Modem
  netfilter: xt_limit: have r->cost != 0 case work
  netfilter: limit, hashlimit: avoid duplicated inline
  netfilter: nf_ct_expect: fix possible access to uninitialized timer
  netfilter: nf_nat_sip: fix via header translation with multiple parameters
  ipvs: fix oops on NAT reply in br_nf context
  netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP expectation
  netfilter: nf_ct_ipv4: packets with wrong ihl are invalid
  netfilter: nf_conntrack: fix racy timer handling with reliable events
  ipvs: fix oops in ip_vs_dst_event on rmmod
  tg3: Apply short DMA frag workaround to 5906
  pktgen: fix crash when generating IPv6 packets
  timers: Fix endless looping between cascade() and internal_add_timer()
  viafb: don't touch clock state on OLPC XO-1.5
  video/udlfb: fix line counting in fb_write
  module: taint kernel when lve module is loaded
  autofs4 - fix reset pending flag on mount fail
  block: fix request_queue->flags initialization
  xen/bootup: allow read_tscp call for Xen PV guests.
  xen/bootup: allow {read|write}_cr8 pvops call.
  SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT
  firewire: cdev: fix user memory corruption (i386 userland on amd64 kernel)
  ARM: 7541/1: Add ARM ERRATA 775420 workaround
  tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking
  mips,kgdb: fix recursive page fault with CONFIG_KPROBES
  ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
  ACPI: EC: Make the GPE storm threshold a module parameter
  lockd: use rpc client's cl_nodename for id encoding
  ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels

Conflicts:
	net/netfilter/nf_conntrack_expect.c
  • Loading branch information
tamcore committed Oct 23, 2012
2 parents 55aea98 + e496537 commit 8f1dde2
Show file tree
Hide file tree
Showing 47 changed files with 480 additions and 109 deletions.
5 changes: 5 additions & 0 deletions Documentation/kernel-parameters.txt
Expand Up @@ -1764,6 +1764,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.

noresidual [PPC] Don't use residual data on PReP machines.

nordrand [X86] Disable the direct use of the RDRAND
instruction even if it is supported by the
processor. RDRAND is still available to user
space applications.

noresume [SWSUSP] Disables resume and restores original swap
space.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 46
SUBLEVEL = 47
EXTRAVERSION =
NAME = Sneaky Weasel

Expand Down
10 changes: 10 additions & 0 deletions arch/arm/Kconfig
Expand Up @@ -1305,6 +1305,16 @@ config PL310_ERRATA_769419
on systems with an outer cache, the store buffer is drained
explicitly.

config ARM_ERRATA_775420
bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock"
depends on CPU_V7
help
This option enables the workaround for the 775420 Cortex-A9 (r2p2,
r2p6,r2p8,r2p10,r3p0) erratum. In case a date cache maintenance
operation aborts with MMU exception, it might cause the processor
to deadlock. This workaround puts DSB before executing ISB if
an abort may occur on cache maintenance.

endmenu

source "arch/arm/common/Kconfig"
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/include/asm/vfpmacros.h
Expand Up @@ -28,7 +28,7 @@
ldr \tmp, =elf_hwcap @ may not have MVFR regs
ldr \tmp, [\tmp, #0]
tst \tmp, #HWCAP_VFPv3D16
ldceq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
addne \base, \base, #32*4 @ step over unused register space
#else
VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
Expand All @@ -52,7 +52,7 @@
ldr \tmp, =elf_hwcap @ may not have MVFR regs
ldr \tmp, [\tmp, #0]
tst \tmp, #HWCAP_VFPv3D16
stceq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
addne \base, \base, #32*4 @ step over unused register space
#else
VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mm/cache-v7.S
Expand Up @@ -211,6 +211,9 @@ ENTRY(v7_coherent_user_range)
* isn't mapped, just try the next page.
*/
9001:
#ifdef CONFIG_ARM_ERRATA_775420
dsb
#endif
mov r12, r12, lsr #12
mov r12, r12, lsl #12
add r12, r12, #4096
Expand Down
9 changes: 9 additions & 0 deletions arch/mips/kernel/kgdb.c
Expand Up @@ -283,6 +283,15 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
struct pt_regs *regs = args->regs;
int trap = (regs->cp0_cause & 0x7c) >> 2;

#ifdef CONFIG_KPROBES
/*
* Return immediately if the kprobes fault notifier has set
* DIE_PAGE_FAULT.
*/
if (cmd == DIE_PAGE_FAULT)
return NOTIFY_DONE;
#endif /* CONFIG_KPROBES */

/* Userspace events, ignore. */
if (user_mode(regs))
return NOTIFY_DONE;
Expand Down
9 changes: 9 additions & 0 deletions arch/x86/Kconfig
Expand Up @@ -1451,6 +1451,15 @@ config ARCH_USES_PG_UNCACHED
def_bool y
depends on X86_PAT

config ARCH_RANDOM
def_bool y
prompt "x86 architectural random number generator" if EXPERT
---help---
Enable the x86 architectural RDRAND instruction
(Intel Bull Mountain technology) to generate random numbers.
If supported, this is a high bandwidth, cryptographically
secure hardware random number generator.

config EFI
bool "EFI runtime service support"
depends on ACPI
Expand Down
75 changes: 75 additions & 0 deletions arch/x86/include/asm/archrandom.h
@@ -0,0 +1,75 @@
/*
* This file is part of the Linux kernel.
*
* Copyright (c) 2011, Intel Corporation
* Authors: Fenghua Yu <fenghua.yu@intel.com>,
* H. Peter Anvin <hpa@linux.intel.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
*/

#ifndef ASM_X86_ARCHRANDOM_H
#define ASM_X86_ARCHRANDOM_H

#include <asm/processor.h>
#include <asm/cpufeature.h>
#include <asm/alternative.h>
#include <asm/nops.h>

#define RDRAND_RETRY_LOOPS 10

#define RDRAND_INT ".byte 0x0f,0xc7,0xf0"
#ifdef CONFIG_X86_64
# define RDRAND_LONG ".byte 0x48,0x0f,0xc7,0xf0"
#else
# define RDRAND_LONG RDRAND_INT
#endif

#ifdef CONFIG_ARCH_RANDOM

#define GET_RANDOM(name, type, rdrand, nop) \
static inline int name(type *v) \
{ \
int ok; \
alternative_io("movl $0, %0\n\t" \
nop, \
"\n1: " rdrand "\n\t" \
"jc 2f\n\t" \
"decl %0\n\t" \
"jnz 1b\n\t" \
"2:", \
X86_FEATURE_RDRAND, \
ASM_OUTPUT2("=r" (ok), "=a" (*v)), \
"0" (RDRAND_RETRY_LOOPS)); \
return ok; \
}

#ifdef CONFIG_X86_64

GET_RANDOM(arch_get_random_long, unsigned long, RDRAND_LONG, ASM_NOP5);
GET_RANDOM(arch_get_random_int, unsigned int, RDRAND_INT, ASM_NOP4);

#else

GET_RANDOM(arch_get_random_long, unsigned long, RDRAND_LONG, ASM_NOP3);
GET_RANDOM(arch_get_random_int, unsigned int, RDRAND_INT, ASM_NOP3);

#endif /* CONFIG_X86_64 */

#endif /* CONFIG_ARCH_RANDOM */

extern void x86_init_rdrand(struct cpuinfo_x86 *c);

#endif /* ASM_X86_ARCHRANDOM_H */
1 change: 1 addition & 0 deletions arch/x86/kernel/cpu/Makefile
Expand Up @@ -15,6 +15,7 @@ CFLAGS_common.o := $(nostackp)
obj-y := intel_cacheinfo.o scattered.o topology.o
obj-y += proc.o capflags.o powerflags.o common.o
obj-y += vmware.o hypervisor.o sched.o mshyperv.o
obj-y += rdrand.o

obj-$(CONFIG_X86_32) += bugs.o
obj-$(CONFIG_X86_64) += bugs_64.o
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/cpu/common.c
Expand Up @@ -15,6 +15,7 @@
#include <asm/stackprotector.h>
#include <asm/perf_event.h>
#include <asm/mmu_context.h>
#include <asm/archrandom.h>
#include <asm/hypervisor.h>
#include <asm/processor.h>
#include <asm/sections.h>
Expand Down Expand Up @@ -852,6 +853,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
#endif

init_hypervisor(c);
x86_init_rdrand(c);

/*
* Clear/Set all flags overriden by options, need do it
Expand Down
73 changes: 73 additions & 0 deletions arch/x86/kernel/cpu/rdrand.c
@@ -0,0 +1,73 @@
/*
* This file is part of the Linux kernel.
*
* Copyright (c) 2011, Intel Corporation
* Authors: Fenghua Yu <fenghua.yu@intel.com>,
* H. Peter Anvin <hpa@linux.intel.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
*/

#include <asm/processor.h>
#include <asm/archrandom.h>
#include <asm/sections.h>

static int __init x86_rdrand_setup(char *s)
{
setup_clear_cpu_cap(X86_FEATURE_RDRAND);
return 1;
}
__setup("nordrand", x86_rdrand_setup);

/* We can't use arch_get_random_long() here since alternatives haven't run */
static inline int rdrand_long(unsigned long *v)
{
int ok;
asm volatile("1: " RDRAND_LONG "\n\t"
"jc 2f\n\t"
"decl %0\n\t"
"jnz 1b\n\t"
"2:"
: "=r" (ok), "=a" (*v)
: "0" (RDRAND_RETRY_LOOPS));
return ok;
}

/*
* Force a reseed cycle; we are architecturally guaranteed a reseed
* after no more than 512 128-bit chunks of random data. This also
* acts as a test of the CPU capability.
*/
#define RESEED_LOOP ((512*128)/sizeof(unsigned long))

void __cpuinit x86_init_rdrand(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_ARCH_RANDOM
unsigned long tmp;
int i, count, ok;

if (!cpu_has(c, X86_FEATURE_RDRAND))
return; /* Nothing to do */

for (count = i = 0; i < RESEED_LOOP; i++) {
ok = rdrand_long(&tmp);
if (ok)
count++;
}

if (count != RESEED_LOOP)
clear_cpu_cap(c, X86_FEATURE_RDRAND);
#endif
}
18 changes: 17 additions & 1 deletion arch/x86/xen/enlighten.c
Expand Up @@ -803,7 +803,16 @@ static void xen_write_cr4(unsigned long cr4)

native_write_cr4(cr4);
}

#ifdef CONFIG_X86_64
static inline unsigned long xen_read_cr8(void)
{
return 0;
}
static inline void xen_write_cr8(unsigned long val)
{
BUG_ON(val);
}
#endif
static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
{
int ret;
Expand Down Expand Up @@ -968,13 +977,20 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = {
.read_cr4_safe = native_read_cr4_safe,
.write_cr4 = xen_write_cr4,

#ifdef CONFIG_X86_64
.read_cr8 = xen_read_cr8,
.write_cr8 = xen_write_cr8,
#endif

.wbinvd = native_wbinvd,

.read_msr = native_read_msr_safe,
.write_msr = xen_write_msr_safe,
.read_tsc = native_read_tsc,
.read_pmc = native_read_pmc,

.read_tscp = native_read_tscp,

.iret = xen_iret,
.irq_enable_sysexit = xen_sysexit,
#ifdef CONFIG_X86_64
Expand Down
2 changes: 1 addition & 1 deletion block/blk-core.c
Expand Up @@ -524,7 +524,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
q->request_fn = rfn;
q->prep_rq_fn = NULL;
q->unprep_rq_fn = NULL;
q->queue_flags = QUEUE_FLAG_DEFAULT;
q->queue_flags |= QUEUE_FLAG_DEFAULT;

/* Override internal queue lock with supplied lock pointer */
if (lock)
Expand Down
30 changes: 25 additions & 5 deletions drivers/acpi/ec.c
Expand Up @@ -71,9 +71,6 @@ enum ec_command {
#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */
#define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */

#define ACPI_EC_STORM_THRESHOLD 8 /* number of false interrupts
per one transaction */

enum {
EC_FLAGS_QUERY_PENDING, /* Query is pending */
EC_FLAGS_GPE_STORM, /* GPE storm detected */
Expand All @@ -87,6 +84,15 @@ static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY;
module_param(ec_delay, uint, 0644);
MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes");

/*
* If the number of false interrupts per one transaction exceeds
* this threshold, will think there is a GPE storm happened and
* will disable the GPE for normal transaction.
*/
static unsigned int ec_storm_threshold __read_mostly = 8;
module_param(ec_storm_threshold, uint, 0644);
MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");

/* If we find an EC via the ECDT, we need to keep a ptr to its context */
/* External interfaces use first EC only, so remember */
typedef int (*acpi_ec_query_func) (void *data);
Expand Down Expand Up @@ -319,7 +325,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
msleep(1);
/* It is safe to enable the GPE outside of the transaction. */
acpi_enable_gpe(NULL, ec->gpe);
} else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) {
} else if (t->irq_count > ec_storm_threshold) {
pr_info(PREFIX "GPE storm detected, "
"transactions will use polling mode\n");
set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
Expand Down Expand Up @@ -914,6 +920,17 @@ static int ec_flag_msi(const struct dmi_system_id *id)
return 0;
}

/*
* Clevo M720 notebook actually works ok with IRQ mode, if we lifted
* the GPE storm threshold back to 20
*/
static int ec_enlarge_storm_threshold(const struct dmi_system_id *id)
{
pr_debug("Setting the EC GPE storm threshold to 20\n");
ec_storm_threshold = 20;
return 0;
}

static struct dmi_system_id __initdata ec_dmi_table[] = {
{
ec_skip_dsdt_scan, "Compal JFL92", {
Expand Down Expand Up @@ -945,10 +962,13 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
{
ec_validate_ecdt, "ASUS hardware", {
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL},
{
ec_enlarge_storm_threshold, "CLEVO hardware", {
DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL},
{},
};


int __init acpi_ec_ecdt_probe(void)
{
acpi_status status;
Expand Down

0 comments on commit 8f1dde2

Please sign in to comment.