Merge tag 'v4.9.93' into android-4.9
This is the 4.9.93 stable release Change-Id: I4293d83f45982c6fd479bddbf9b0f811248ddc30 Signed-off-by: Greg Hackmann <ghackmann@google.com>
This commit is contained in:
@@ -35,6 +35,15 @@ Optional properties:
|
||||
- ti,palmas-enable-dvfs2: Enable DVFS2. Configure pins for DVFS2 mode.
|
||||
Selection primary or secondary function associated to GPADC_START
|
||||
and SYSEN2 pin/pad for DVFS2 interface
|
||||
- ti,palmas-override-powerhold: This is applicable for PMICs for which
|
||||
GPIO7 is configured in POWERHOLD mode which has higher priority
|
||||
over DEV_ON bit and keeps the PMIC supplies on even after the DEV_ON
|
||||
bit is turned off. This property enables driver to over ride the
|
||||
POWERHOLD value to GPIO7 so as to turn off the PMIC in power off
|
||||
scenarios. So for GPIO7 if ti,palmas-override-powerhold is set
|
||||
then the GPIO_7 field should never be muxed to anything else.
|
||||
It should be set to POWERHOLD by default and only in case of
|
||||
power off scenarios the driver will over ride the mux value.
|
||||
|
||||
This binding uses the following generic properties as defined in
|
||||
pinctrl-bindings.txt:
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 92
|
||||
SUBLEVEL = 93
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
&audio_codec {
|
||||
status = "okay";
|
||||
|
||||
reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
|
||||
gpio-reset = <&gpio1 16 GPIO_ACTIVE_LOW>;
|
||||
AVDD-supply = <&ldo3_reg>;
|
||||
IOVDD-supply = <&ldo3_reg>;
|
||||
DRVDD-supply = <&ldo3_reg>;
|
||||
|
||||
@@ -204,6 +204,7 @@
|
||||
interrupt-controller;
|
||||
|
||||
ti,system-power-controller;
|
||||
ti,palmas-override-powerhold;
|
||||
|
||||
tps659038_pmic {
|
||||
compatible = "ti,tps659038-pmic";
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-controller;
|
||||
ti,system-power-controller;
|
||||
ti,palmas-override-powerhold;
|
||||
|
||||
tps659038_pmic {
|
||||
compatible = "ti,tps659038-pmic";
|
||||
|
||||
@@ -398,6 +398,8 @@
|
||||
tps659038: tps659038@58 {
|
||||
compatible = "ti,tps659038";
|
||||
reg = <0x58>;
|
||||
ti,palmas-override-powerhold;
|
||||
ti,system-power-controller;
|
||||
|
||||
tps659038_pmic {
|
||||
compatible = "ti,tps659038-pmic";
|
||||
|
||||
@@ -510,7 +510,7 @@
|
||||
tlv320aic3x: tlv320aic3x@18 {
|
||||
compatible = "ti,tlv320aic3x";
|
||||
reg = <0x18>;
|
||||
reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; /* 60 */
|
||||
gpio-reset = <&gpio2 28 GPIO_ACTIVE_HIGH>; /* 60 */
|
||||
ai3x-gpio-func = <
|
||||
0 /* AIC3X_GPIO1_FUNC_DISABLED */
|
||||
5 /* AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT */
|
||||
@@ -527,7 +527,7 @@
|
||||
tlv320aic3x_aux: tlv320aic3x@19 {
|
||||
compatible = "ti,tlv320aic3x";
|
||||
reg = <0x19>;
|
||||
reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; /* 60 */
|
||||
gpio-reset = <&gpio2 28 GPIO_ACTIVE_HIGH>; /* 60 */
|
||||
|
||||
AVDD-supply = <&vmmc2>;
|
||||
DRVDD-supply = <&vmmc2>;
|
||||
|
||||
@@ -648,7 +648,7 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp,
|
||||
*/
|
||||
static int vfp_dying_cpu(unsigned int cpu)
|
||||
{
|
||||
vfp_force_reload(cpu, current_thread_info());
|
||||
vfp_current_hw_state[cpu] = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,4 +429,7 @@ alternative_endif
|
||||
mrs \rd, sp_el0
|
||||
.endm
|
||||
|
||||
.macro pte_to_phys, phys, pte
|
||||
and \phys, \pte, #(((1 << (48 - PAGE_SHIFT)) - 1) << PAGE_SHIFT)
|
||||
.endm
|
||||
#endif /* __ASM_ASSEMBLER_H */
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
|
||||
#define CAVIUM_CPU_PART_THUNDERX 0x0A1
|
||||
#define CAVIUM_CPU_PART_THUNDERX_81XX 0x0A2
|
||||
#define CAVIUM_CPU_PART_THUNDERX2 0x0AF
|
||||
|
||||
#define BRCM_CPU_PART_VULCAN 0x516
|
||||
|
||||
@@ -88,6 +89,8 @@
|
||||
#define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
|
||||
#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
|
||||
#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)
|
||||
#define MIDR_CAVIUM_THUNDERX2 MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX2)
|
||||
#define MIDR_BRCM_VULCAN MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
@@ -78,16 +78,8 @@
|
||||
/*
|
||||
* Initial memory map attributes.
|
||||
*/
|
||||
#define _SWAPPER_PTE_FLAGS (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
|
||||
#define _SWAPPER_PMD_FLAGS (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
|
||||
|
||||
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
|
||||
#define SWAPPER_PTE_FLAGS (_SWAPPER_PTE_FLAGS | PTE_NG)
|
||||
#define SWAPPER_PMD_FLAGS (_SWAPPER_PMD_FLAGS | PMD_SECT_NG)
|
||||
#else
|
||||
#define SWAPPER_PTE_FLAGS _SWAPPER_PTE_FLAGS
|
||||
#define SWAPPER_PMD_FLAGS _SWAPPER_PMD_FLAGS
|
||||
#endif
|
||||
#define SWAPPER_PTE_FLAGS (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
|
||||
#define SWAPPER_PMD_FLAGS (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
|
||||
|
||||
#if ARM64_SWAPPER_USES_SECTION_MAPS
|
||||
#define SWAPPER_MM_MMUFLAGS (PMD_ATTRINDX(MT_NORMAL) | SWAPPER_PMD_FLAGS)
|
||||
|
||||
@@ -64,8 +64,10 @@
|
||||
* TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area.
|
||||
*/
|
||||
#define VA_BITS (CONFIG_ARM64_VA_BITS)
|
||||
#define VA_START (UL(0xffffffffffffffff) << VA_BITS)
|
||||
#define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1))
|
||||
#define VA_START (UL(0xffffffffffffffff) - \
|
||||
(UL(1) << VA_BITS) + 1)
|
||||
#define PAGE_OFFSET (UL(0xffffffffffffffff) - \
|
||||
(UL(1) << (VA_BITS - 1)) + 1)
|
||||
#define KIMAGE_VADDR (MODULES_END)
|
||||
#define MODULES_END (MODULES_VADDR + MODULES_VSIZE)
|
||||
#define MODULES_VADDR (VA_START + KASAN_SHADOW_SIZE)
|
||||
|
||||
@@ -37,13 +37,11 @@
|
||||
#define _PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
|
||||
#define _PROT_SECT_DEFAULT (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
|
||||
|
||||
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
|
||||
#define PROT_DEFAULT (_PROT_DEFAULT | PTE_NG)
|
||||
#define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_SECT_NG)
|
||||
#else
|
||||
#define PROT_DEFAULT _PROT_DEFAULT
|
||||
#define PROT_SECT_DEFAULT _PROT_SECT_DEFAULT
|
||||
#endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
|
||||
#define PTE_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PTE_NG : 0)
|
||||
#define PMD_MAYBE_NG (arm64_kernel_unmapped_at_el0() ? PMD_SECT_NG : 0)
|
||||
|
||||
#define PROT_DEFAULT (_PROT_DEFAULT | PTE_MAYBE_NG)
|
||||
#define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_MAYBE_NG)
|
||||
|
||||
#define PROT_DEVICE_nGnRnE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRnE))
|
||||
#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRE))
|
||||
@@ -55,22 +53,22 @@
|
||||
#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
|
||||
#define PROT_SECT_NORMAL_EXEC (PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
|
||||
|
||||
#define _PAGE_DEFAULT (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
|
||||
#define _HYP_PAGE_DEFAULT (_PAGE_DEFAULT & ~PTE_NG)
|
||||
#define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
|
||||
#define _HYP_PAGE_DEFAULT _PAGE_DEFAULT
|
||||
|
||||
#define PAGE_KERNEL __pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE)
|
||||
#define PAGE_KERNEL_RO __pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
|
||||
#define PAGE_KERNEL_ROX __pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
|
||||
#define PAGE_KERNEL_EXEC __pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE)
|
||||
#define PAGE_KERNEL_EXEC_CONT __pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_CONT)
|
||||
#define PAGE_KERNEL __pgprot(PROT_NORMAL)
|
||||
#define PAGE_KERNEL_RO __pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)
|
||||
#define PAGE_KERNEL_ROX __pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY)
|
||||
#define PAGE_KERNEL_EXEC __pgprot(PROT_NORMAL & ~PTE_PXN)
|
||||
#define PAGE_KERNEL_EXEC_CONT __pgprot((PROT_NORMAL & ~PTE_PXN) | PTE_CONT)
|
||||
|
||||
#define PAGE_HYP __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
|
||||
#define PAGE_HYP_EXEC __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
|
||||
#define PAGE_HYP_RO __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
|
||||
#define PAGE_HYP_DEVICE __pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
|
||||
|
||||
#define PAGE_S2 __pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
|
||||
#define PAGE_S2_DEVICE __pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
|
||||
#define PAGE_S2 __pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
|
||||
#define PAGE_S2_DEVICE __pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
|
||||
|
||||
#define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_NG | PTE_PXN | PTE_UXN)
|
||||
#define PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
#define ID_AA64ISAR0_AES_SHIFT 4
|
||||
|
||||
/* id_aa64pfr0 */
|
||||
#define ID_AA64PFR0_CSV3_SHIFT 60
|
||||
#define ID_AA64PFR0_GIC_SHIFT 24
|
||||
#define ID_AA64PFR0_ASIMD_SHIFT 20
|
||||
#define ID_AA64PFR0_FP_SHIFT 16
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <asm/virt.h>
|
||||
|
||||
.text
|
||||
.pushsection .idmap.text, "ax"
|
||||
.pushsection .idmap.text, "awx"
|
||||
|
||||
/*
|
||||
* __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for
|
||||
|
||||
@@ -95,7 +95,8 @@ static const struct arm64_ftr_bits ftr_id_aa64isar0[] = {
|
||||
};
|
||||
|
||||
static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = {
|
||||
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 32, 32, 0),
|
||||
ARM64_FTR_BITS(FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_CSV3_SHIFT, 4, 0),
|
||||
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 32, 28, 0),
|
||||
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 28, 4, 0),
|
||||
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, ID_AA64PFR0_GIC_SHIFT, 4, 0),
|
||||
S_ARM64_FTR_BITS(FTR_STRICT, FTR_LOWER_SAFE, ID_AA64PFR0_ASIMD_SHIFT, 4, ID_AA64PFR0_ASIMD_NI),
|
||||
@@ -754,10 +755,23 @@ static int __kpti_forced; /* 0: not forced, >0: forced on, <0: forced off */
|
||||
static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
|
||||
int __unused)
|
||||
{
|
||||
/* Forced on command line? */
|
||||
char const *str = "command line option";
|
||||
u64 pfr0 = read_system_reg(SYS_ID_AA64PFR0_EL1);
|
||||
|
||||
/*
|
||||
* For reasons that aren't entirely clear, enabling KPTI on Cavium
|
||||
* ThunderX leads to apparent I-cache corruption of kernel text, which
|
||||
* ends as well as you might imagine. Don't even try.
|
||||
*/
|
||||
if (cpus_have_cap(ARM64_WORKAROUND_CAVIUM_27456)) {
|
||||
str = "ARM64_WORKAROUND_CAVIUM_27456";
|
||||
__kpti_forced = -1;
|
||||
}
|
||||
|
||||
/* Forced? */
|
||||
if (__kpti_forced) {
|
||||
pr_info_once("kernel page table isolation forced %s by command line option\n",
|
||||
__kpti_forced > 0 ? "ON" : "OFF");
|
||||
pr_info_once("kernel page table isolation forced %s by %s\n",
|
||||
__kpti_forced > 0 ? "ON" : "OFF", str);
|
||||
return __kpti_forced > 0;
|
||||
}
|
||||
|
||||
@@ -765,7 +779,40 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
|
||||
if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
/* Don't force KPTI for CPUs that are not vulnerable */
|
||||
switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) {
|
||||
case MIDR_CAVIUM_THUNDERX2:
|
||||
case MIDR_BRCM_VULCAN:
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Defer to CPU feature registers */
|
||||
return !cpuid_feature_extract_unsigned_field(pfr0,
|
||||
ID_AA64PFR0_CSV3_SHIFT);
|
||||
}
|
||||
|
||||
static int kpti_install_ng_mappings(void *__unused)
|
||||
{
|
||||
typedef void (kpti_remap_fn)(int, int, phys_addr_t);
|
||||
extern kpti_remap_fn idmap_kpti_install_ng_mappings;
|
||||
kpti_remap_fn *remap_fn;
|
||||
|
||||
static bool kpti_applied = false;
|
||||
int cpu = smp_processor_id();
|
||||
|
||||
if (kpti_applied)
|
||||
return 0;
|
||||
|
||||
remap_fn = (void *)__pa_symbol(idmap_kpti_install_ng_mappings);
|
||||
|
||||
cpu_install_idmap();
|
||||
remap_fn(cpu, num_online_cpus(), __pa_symbol(swapper_pg_dir));
|
||||
cpu_uninstall_idmap();
|
||||
|
||||
if (!cpu)
|
||||
kpti_applied = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init parse_kpti(char *str)
|
||||
@@ -867,9 +914,11 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
|
||||
},
|
||||
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
|
||||
{
|
||||
.desc = "Kernel page table isolation (KPTI)",
|
||||
.capability = ARM64_UNMAP_KERNEL_AT_EL0,
|
||||
.def_scope = SCOPE_SYSTEM,
|
||||
.matches = unmap_kernel_at_el0,
|
||||
.enable = kpti_install_ng_mappings,
|
||||
},
|
||||
#endif
|
||||
{},
|
||||
@@ -965,6 +1014,26 @@ static void __init setup_elf_hwcaps(const struct arm64_cpu_capabilities *hwcaps)
|
||||
cap_set_elf_hwcap(hwcaps);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the current CPU has a given feature capability.
|
||||
* Should be called from non-preemptible context.
|
||||
*/
|
||||
static bool __this_cpu_has_cap(const struct arm64_cpu_capabilities *cap_array,
|
||||
unsigned int cap)
|
||||
{
|
||||
const struct arm64_cpu_capabilities *caps;
|
||||
|
||||
if (WARN_ON(preemptible()))
|
||||
return false;
|
||||
|
||||
for (caps = cap_array; caps->desc; caps++)
|
||||
if (caps->capability == cap &&
|
||||
caps->matches &&
|
||||
caps->matches(caps, SCOPE_LOCAL_CPU))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
|
||||
const char *info)
|
||||
{
|
||||
@@ -1033,8 +1102,9 @@ verify_local_elf_hwcaps(const struct arm64_cpu_capabilities *caps)
|
||||
}
|
||||
|
||||
static void
|
||||
verify_local_cpu_features(const struct arm64_cpu_capabilities *caps)
|
||||
verify_local_cpu_features(const struct arm64_cpu_capabilities *caps_list)
|
||||
{
|
||||
const struct arm64_cpu_capabilities *caps = caps_list;
|
||||
for (; caps->matches; caps++) {
|
||||
if (!cpus_have_cap(caps->capability))
|
||||
continue;
|
||||
@@ -1042,7 +1112,7 @@ verify_local_cpu_features(const struct arm64_cpu_capabilities *caps)
|
||||
* If the new CPU misses an advertised feature, we cannot proceed
|
||||
* further, park the cpu.
|
||||
*/
|
||||
if (!caps->matches(caps, SCOPE_LOCAL_CPU)) {
|
||||
if (!__this_cpu_has_cap(caps_list, caps->capability)) {
|
||||
pr_crit("CPU%d: missing feature: %s\n",
|
||||
smp_processor_id(), caps->desc);
|
||||
cpu_die_early();
|
||||
@@ -1095,22 +1165,12 @@ static void __init setup_feature_capabilities(void)
|
||||
enable_cpu_capabilities(arm64_features);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the current CPU has a given feature capability.
|
||||
* Should be called from non-preemptible context.
|
||||
*/
|
||||
extern const struct arm64_cpu_capabilities arm64_errata[];
|
||||
|
||||
bool this_cpu_has_cap(unsigned int cap)
|
||||
{
|
||||
const struct arm64_cpu_capabilities *caps;
|
||||
|
||||
if (WARN_ON(preemptible()))
|
||||
return false;
|
||||
|
||||
for (caps = arm64_features; caps->desc; caps++)
|
||||
if (caps->capability == cap && caps->matches)
|
||||
return caps->matches(caps, SCOPE_LOCAL_CPU);
|
||||
|
||||
return false;
|
||||
return (__this_cpu_has_cap(arm64_features, cap) ||
|
||||
__this_cpu_has_cap(arm64_errata, cap));
|
||||
}
|
||||
|
||||
void __init setup_cpu_features(void)
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/asm-uaccess.h>
|
||||
#include <asm/unistd.h>
|
||||
#include <asm/kernel-pgtable.h>
|
||||
|
||||
/*
|
||||
* Context tracking subsystem. Used to instrument transitions
|
||||
@@ -929,16 +930,9 @@ __ni_sys_trace:
|
||||
orr \tmp, \tmp, #USER_ASID_FLAG
|
||||
msr ttbr1_el1, \tmp
|
||||
/*
|
||||
* We avoid running the post_ttbr_update_workaround here because the
|
||||
* user and kernel ASIDs don't have conflicting mappings, so any
|
||||
* "blessing" as described in:
|
||||
*
|
||||
* http://lkml.kernel.org/r/56BB848A.6060603@caviumnetworks.com
|
||||
*
|
||||
* will not hurt correctness. Whilst this may partially defeat the
|
||||
* point of using split ASIDs in the first place, it avoids
|
||||
* the hit of invalidating the entire I-cache on every return to
|
||||
* userspace.
|
||||
* We avoid running the post_ttbr_update_workaround here because
|
||||
* it's only needed by Cavium ThunderX, which requires KPTI to be
|
||||
* disabled.
|
||||
*/
|
||||
.endm
|
||||
|
||||
@@ -948,6 +942,11 @@ __ni_sys_trace:
|
||||
.if \regsize == 64
|
||||
msr tpidrro_el0, x30 // Restored in kernel_ventry
|
||||
.endif
|
||||
/*
|
||||
* Defend against branch aliasing attacks by pushing a dummy
|
||||
* entry onto the return stack and using a RET instruction to
|
||||
* enter the full-fat kernel vectors.
|
||||
*/
|
||||
bl 2f
|
||||
b .
|
||||
2:
|
||||
|
||||
@@ -473,7 +473,7 @@ ENDPROC(__primary_switched)
|
||||
* end early head section, begin head code that is also used for
|
||||
* hotplug and needs to have the same protections as the text region
|
||||
*/
|
||||
.section ".idmap.text","ax"
|
||||
.section ".idmap.text","awx"
|
||||
|
||||
ENTRY(kimage_vaddr)
|
||||
.quad _text - TEXT_OFFSET
|
||||
|
||||
@@ -95,7 +95,7 @@ ENTRY(__cpu_suspend_enter)
|
||||
ret
|
||||
ENDPROC(__cpu_suspend_enter)
|
||||
|
||||
.pushsection ".idmap.text", "ax"
|
||||
.pushsection ".idmap.text", "awx"
|
||||
ENTRY(cpu_resume)
|
||||
bl el2_setup // if in EL2 drop to EL1 cleanly
|
||||
bl __cpu_setup
|
||||
|
||||
@@ -425,7 +425,7 @@ static int __init map_entry_trampoline(void)
|
||||
{
|
||||
extern char __entry_tramp_text_start[];
|
||||
|
||||
pgprot_t prot = PAGE_KERNEL_EXEC;
|
||||
pgprot_t prot = rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
|
||||
phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
|
||||
|
||||
/* The trampoline is always mapped and can therefore be global */
|
||||
|
||||
@@ -83,7 +83,7 @@ ENDPROC(cpu_do_suspend)
|
||||
*
|
||||
* x0: Address of context pointer
|
||||
*/
|
||||
.pushsection ".idmap.text", "ax"
|
||||
.pushsection ".idmap.text", "awx"
|
||||
ENTRY(cpu_do_resume)
|
||||
ldp x2, x3, [x0]
|
||||
ldp x4, x5, [x0, #16]
|
||||
@@ -145,7 +145,17 @@ ENTRY(cpu_do_switch_mm)
|
||||
b post_ttbr_update_workaround // Back to C code...
|
||||
ENDPROC(cpu_do_switch_mm)
|
||||
|
||||
.pushsection ".idmap.text", "ax"
|
||||
.pushsection ".idmap.text", "awx"
|
||||
|
||||
.macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2
|
||||
adrp \tmp1, empty_zero_page
|
||||
msr ttbr1_el1, \tmp1
|
||||
isb
|
||||
tlbi vmalle1
|
||||
dsb nsh
|
||||
isb
|
||||
.endm
|
||||
|
||||
/*
|
||||
* void idmap_cpu_replace_ttbr1(phys_addr_t new_pgd)
|
||||
*
|
||||
@@ -156,13 +166,7 @@ ENTRY(idmap_cpu_replace_ttbr1)
|
||||
mrs x2, daif
|
||||
msr daifset, #0xf
|
||||
|
||||
adrp x1, empty_zero_page
|
||||
msr ttbr1_el1, x1
|
||||
isb
|
||||
|
||||
tlbi vmalle1
|
||||
dsb nsh
|
||||
isb
|
||||
__idmap_cpu_set_reserved_ttbr1 x1, x3
|
||||
|
||||
msr ttbr1_el1, x0
|
||||
isb
|
||||
@@ -173,13 +177,196 @@ ENTRY(idmap_cpu_replace_ttbr1)
|
||||
ENDPROC(idmap_cpu_replace_ttbr1)
|
||||
.popsection
|
||||
|
||||
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
|
||||
.pushsection ".idmap.text", "awx"
|
||||
|
||||
.macro __idmap_kpti_get_pgtable_ent, type
|
||||
dc cvac, cur_\()\type\()p // Ensure any existing dirty
|
||||
dmb sy // lines are written back before
|
||||
ldr \type, [cur_\()\type\()p] // loading the entry
|
||||
tbz \type, #0, next_\()\type // Skip invalid entries
|
||||
.endm
|
||||
|
||||
.macro __idmap_kpti_put_pgtable_ent_ng, type
|
||||
orr \type, \type, #PTE_NG // Same bit for blocks and pages
|
||||
str \type, [cur_\()\type\()p] // Update the entry and ensure it
|
||||
dc civac, cur_\()\type\()p // is visible to all CPUs.
|
||||
.endm
|
||||
|
||||
/*
|
||||
* void __kpti_install_ng_mappings(int cpu, int num_cpus, phys_addr_t swapper)
|
||||
*
|
||||
* Called exactly once from stop_machine context by each CPU found during boot.
|
||||
*/
|
||||
__idmap_kpti_flag:
|
||||
.long 1
|
||||
ENTRY(idmap_kpti_install_ng_mappings)
|
||||
cpu .req w0
|
||||
num_cpus .req w1
|
||||
swapper_pa .req x2
|
||||
swapper_ttb .req x3
|
||||
flag_ptr .req x4
|
||||
cur_pgdp .req x5
|
||||
end_pgdp .req x6
|
||||
pgd .req x7
|
||||
cur_pudp .req x8
|
||||
end_pudp .req x9
|
||||
pud .req x10
|
||||
cur_pmdp .req x11
|
||||
end_pmdp .req x12
|
||||
pmd .req x13
|
||||
cur_ptep .req x14
|
||||
end_ptep .req x15
|
||||
pte .req x16
|
||||
|
||||
mrs swapper_ttb, ttbr1_el1
|
||||
adr flag_ptr, __idmap_kpti_flag
|
||||
|
||||
cbnz cpu, __idmap_kpti_secondary
|
||||
|
||||
/* We're the boot CPU. Wait for the others to catch up */
|
||||
sevl
|
||||
1: wfe
|
||||
ldaxr w18, [flag_ptr]
|
||||
eor w18, w18, num_cpus
|
||||
cbnz w18, 1b
|
||||
|
||||
/* We need to walk swapper, so turn off the MMU. */
|
||||
mrs x18, sctlr_el1
|
||||
bic x18, x18, #SCTLR_ELx_M
|
||||
msr sctlr_el1, x18
|
||||
isb
|
||||
|
||||
/* Everybody is enjoying the idmap, so we can rewrite swapper. */
|
||||
/* PGD */
|
||||
mov cur_pgdp, swapper_pa
|
||||
add end_pgdp, cur_pgdp, #(PTRS_PER_PGD * 8)
|
||||
do_pgd: __idmap_kpti_get_pgtable_ent pgd
|
||||
tbnz pgd, #1, walk_puds
|
||||
__idmap_kpti_put_pgtable_ent_ng pgd
|
||||
next_pgd:
|
||||
add cur_pgdp, cur_pgdp, #8
|
||||
cmp cur_pgdp, end_pgdp
|
||||
b.ne do_pgd
|
||||
|
||||
/* Publish the updated tables and nuke all the TLBs */
|
||||
dsb sy
|
||||
tlbi vmalle1is
|
||||
dsb ish
|
||||
isb
|
||||
|
||||
/* We're done: fire up the MMU again */
|
||||
mrs x18, sctlr_el1
|
||||
orr x18, x18, #SCTLR_ELx_M
|
||||
msr sctlr_el1, x18
|
||||
isb
|
||||
|
||||
/* Set the flag to zero to indicate that we're all done */
|
||||
str wzr, [flag_ptr]
|
||||
ret
|
||||
|
||||
/* PUD */
|
||||
walk_puds:
|
||||
.if CONFIG_PGTABLE_LEVELS > 3
|
||||
pte_to_phys cur_pudp, pgd
|
||||
add end_pudp, cur_pudp, #(PTRS_PER_PUD * 8)
|
||||
do_pud: __idmap_kpti_get_pgtable_ent pud
|
||||
tbnz pud, #1, walk_pmds
|
||||
__idmap_kpti_put_pgtable_ent_ng pud
|
||||
next_pud:
|
||||
add cur_pudp, cur_pudp, 8
|
||||
cmp cur_pudp, end_pudp
|
||||
b.ne do_pud
|
||||
b next_pgd
|
||||
.else /* CONFIG_PGTABLE_LEVELS <= 3 */
|
||||
mov pud, pgd
|
||||
b walk_pmds
|
||||
next_pud:
|
||||
b next_pgd
|
||||
.endif
|
||||
|
||||
/* PMD */
|
||||
walk_pmds:
|
||||
.if CONFIG_PGTABLE_LEVELS > 2
|
||||
pte_to_phys cur_pmdp, pud
|
||||
add end_pmdp, cur_pmdp, #(PTRS_PER_PMD * 8)
|
||||
do_pmd: __idmap_kpti_get_pgtable_ent pmd
|
||||
tbnz pmd, #1, walk_ptes
|
||||
__idmap_kpti_put_pgtable_ent_ng pmd
|
||||
next_pmd:
|
||||
add cur_pmdp, cur_pmdp, #8
|
||||
cmp cur_pmdp, end_pmdp
|
||||
b.ne do_pmd
|
||||
b next_pud
|
||||
.else /* CONFIG_PGTABLE_LEVELS <= 2 */
|
||||
mov pmd, pud
|
||||
b walk_ptes
|
||||
next_pmd:
|
||||
b next_pud
|
||||
.endif
|
||||
|
||||
/* PTE */
|
||||
walk_ptes:
|
||||
pte_to_phys cur_ptep, pmd
|
||||
add end_ptep, cur_ptep, #(PTRS_PER_PTE * 8)
|
||||
do_pte: __idmap_kpti_get_pgtable_ent pte
|
||||
__idmap_kpti_put_pgtable_ent_ng pte
|
||||
next_pte:
|
||||
add cur_ptep, cur_ptep, #8
|
||||
cmp cur_ptep, end_ptep
|
||||
b.ne do_pte
|
||||
b next_pmd
|
||||
|
||||
/* Secondary CPUs end up here */
|
||||
__idmap_kpti_secondary:
|
||||
/* Uninstall swapper before surgery begins */
|
||||
__idmap_cpu_set_reserved_ttbr1 x18, x17
|
||||
|
||||
/* Increment the flag to let the boot CPU we're ready */
|
||||
1: ldxr w18, [flag_ptr]
|
||||
add w18, w18, #1
|
||||
stxr w17, w18, [flag_ptr]
|
||||
cbnz w17, 1b
|
||||
|
||||
/* Wait for the boot CPU to finish messing around with swapper */
|
||||
sevl
|
||||
1: wfe
|
||||
ldxr w18, [flag_ptr]
|
||||
cbnz w18, 1b
|
||||
|
||||
/* All done, act like nothing happened */
|
||||
msr ttbr1_el1, swapper_ttb
|
||||
isb
|
||||
ret
|
||||
|
||||
.unreq cpu
|
||||
.unreq num_cpus
|
||||
.unreq swapper_pa
|
||||
.unreq swapper_ttb
|
||||
.unreq flag_ptr
|
||||
.unreq cur_pgdp
|
||||
.unreq end_pgdp
|
||||
.unreq pgd
|
||||
.unreq cur_pudp
|
||||
.unreq end_pudp
|
||||
.unreq pud
|
||||
.unreq cur_pmdp
|
||||
.unreq end_pmdp
|
||||
.unreq pmd
|
||||
.unreq cur_ptep
|
||||
.unreq end_ptep
|
||||
.unreq pte
|
||||
ENDPROC(idmap_kpti_install_ng_mappings)
|
||||
.popsection
|
||||
#endif
|
||||
|
||||
/*
|
||||
* __cpu_setup
|
||||
*
|
||||
* Initialise the processor for turning the MMU on. Return in x0 the
|
||||
* value of the SCTLR_EL1 register.
|
||||
*/
|
||||
.pushsection ".idmap.text", "ax"
|
||||
.pushsection ".idmap.text", "awx"
|
||||
ENTRY(__cpu_setup)
|
||||
tlbi vmalle1 // Invalidate local TLB
|
||||
dsb nsh
|
||||
|
||||
@@ -16,5 +16,11 @@ static inline cycles_t get_cycles(void)
|
||||
#define vxtime_lock() do {} while (0)
|
||||
#define vxtime_unlock() do {} while (0)
|
||||
|
||||
/* This attribute is used in include/linux/jiffies.h alongside with
|
||||
* __cacheline_aligned_in_smp. It is assumed that __cacheline_aligned_in_smp
|
||||
* for frv does not contain another section specification.
|
||||
*/
|
||||
#define __jiffy_arch_data __attribute__((__section__(".data")))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -723,7 +723,7 @@ EXC_COMMON_BEGIN(bad_addr_slb)
|
||||
ld r3, PACA_EXSLB+EX_DAR(r13)
|
||||
std r3, _DAR(r1)
|
||||
beq cr6, 2f
|
||||
li r10, 0x480 /* fix trap number for I-SLB miss */
|
||||
li r10, 0x481 /* fix trap number for I-SLB miss */
|
||||
std r10, _TRAP(r1)
|
||||
2: bl save_nvgprs
|
||||
addi r3, r1, STACK_FRAME_OVERHEAD
|
||||
|
||||
@@ -372,6 +372,14 @@ void force_external_irq_replay(void)
|
||||
*/
|
||||
WARN_ON(!arch_irqs_disabled());
|
||||
|
||||
/*
|
||||
* Interrupts must always be hard disabled before irq_happened is
|
||||
* modified (to prevent lost update in case of interrupt between
|
||||
* load and store).
|
||||
*/
|
||||
__hard_irq_disable();
|
||||
local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
|
||||
|
||||
/* Indicate in the PACA that we have an interrupt to replay */
|
||||
local_paca->irq_happened |= PACA_IRQ_EE;
|
||||
}
|
||||
|
||||
@@ -66,8 +66,6 @@ static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk,
|
||||
void (*fn)(struct cast5_ctx *ctx, u8 *dst, const u8 *src);
|
||||
int err;
|
||||
|
||||
fn = (enc) ? cast5_ecb_enc_16way : cast5_ecb_dec_16way;
|
||||
|
||||
err = blkcipher_walk_virt(desc, walk);
|
||||
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
|
||||
@@ -79,6 +77,7 @@ static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk,
|
||||
|
||||
/* Process multi-block batch */
|
||||
if (nbytes >= bsize * CAST5_PARALLEL_BLOCKS) {
|
||||
fn = (enc) ? cast5_ecb_enc_16way : cast5_ecb_dec_16way;
|
||||
do {
|
||||
fn(ctx, wdst, wsrc);
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <linux/ftrace.h>
|
||||
#include <linux/frame.h>
|
||||
#include <linux/kasan.h>
|
||||
#include <linux/moduleloader.h>
|
||||
|
||||
#include <asm/text-patching.h>
|
||||
#include <asm/cacheflush.h>
|
||||
@@ -405,6 +406,14 @@ int __copy_instruction(u8 *dest, u8 *src)
|
||||
return length;
|
||||
}
|
||||
|
||||
/* Recover page to RW mode before releasing it */
|
||||
void free_insn_page(void *page)
|
||||
{
|
||||
set_memory_nx((unsigned long)page & PAGE_MASK, 1);
|
||||
set_memory_rw((unsigned long)page & PAGE_MASK, 1);
|
||||
module_memfree(page);
|
||||
}
|
||||
|
||||
static int arch_copy_kprobe(struct kprobe *p)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
* break badly! cannot be bigger than what you can fit into an
|
||||
* unsigned short
|
||||
*/
|
||||
#define BV(x) { .nr_vecs = x, .name = "biovec-"__stringify(x) }
|
||||
#define BV(x, n) { .nr_vecs = x, .name = "biovec-"#n }
|
||||
static struct biovec_slab bvec_slabs[BVEC_POOL_NR] __read_mostly = {
|
||||
BV(1), BV(4), BV(16), BV(64), BV(128), BV(BIO_MAX_PAGES),
|
||||
BV(1, 1), BV(4, 4), BV(16, 16), BV(64, 64), BV(128, 128), BV(BIO_MAX_PAGES, max),
|
||||
};
|
||||
#undef BV
|
||||
|
||||
|
||||
@@ -300,7 +300,9 @@ static void parse_bsd(struct parsed_partitions *state,
|
||||
continue;
|
||||
bsd_start = le32_to_cpu(p->p_offset);
|
||||
bsd_size = le32_to_cpu(p->p_size);
|
||||
if (memcmp(flavour, "bsd\0", 4) == 0)
|
||||
/* FreeBSD has relative offset if C partition offset is zero */
|
||||
if (memcmp(flavour, "bsd\0", 4) == 0 &&
|
||||
le32_to_cpu(l->d_partitions[2].p_offset) == 0)
|
||||
bsd_start += offset;
|
||||
if (offset == bsd_start && size == bsd_size)
|
||||
/* full parent partition, we have it already */
|
||||
|
||||
@@ -91,13 +91,14 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
|
||||
|
||||
if (nbytes && walk->offset & alignmask && !err) {
|
||||
walk->offset = ALIGN(walk->offset, alignmask + 1);
|
||||
walk->data += walk->offset;
|
||||
|
||||
nbytes = min(nbytes,
|
||||
((unsigned int)(PAGE_SIZE)) - walk->offset);
|
||||
walk->entrylen -= nbytes;
|
||||
|
||||
return nbytes;
|
||||
if (nbytes) {
|
||||
walk->data += walk->offset;
|
||||
return nbytes;
|
||||
}
|
||||
}
|
||||
|
||||
if (walk->flags & CRYPTO_ALG_ASYNC)
|
||||
|
||||
@@ -169,25 +169,6 @@ static bool mtip_check_surprise_removal(struct pci_dev *pdev)
|
||||
return false; /* device present */
|
||||
}
|
||||
|
||||
/* we have to use runtime tag to setup command header */
|
||||
static void mtip_init_cmd_header(struct request *rq)
|
||||
{
|
||||
struct driver_data *dd = rq->q->queuedata;
|
||||
struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq);
|
||||
u32 host_cap_64 = readl(dd->mmio + HOST_CAP) & HOST_CAP_64;
|
||||
|
||||
/* Point the command headers at the command tables. */
|
||||
cmd->command_header = dd->port->command_list +
|
||||
(sizeof(struct mtip_cmd_hdr) * rq->tag);
|
||||
cmd->command_header_dma = dd->port->command_list_dma +
|
||||
(sizeof(struct mtip_cmd_hdr) * rq->tag);
|
||||
|
||||
if (host_cap_64)
|
||||
cmd->command_header->ctbau = __force_bit2int cpu_to_le32((cmd->command_dma >> 16) >> 16);
|
||||
|
||||
cmd->command_header->ctba = __force_bit2int cpu_to_le32(cmd->command_dma & 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd)
|
||||
{
|
||||
struct request *rq;
|
||||
@@ -199,9 +180,6 @@ static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd)
|
||||
if (IS_ERR(rq))
|
||||
return NULL;
|
||||
|
||||
/* Internal cmd isn't submitted via .queue_rq */
|
||||
mtip_init_cmd_header(rq);
|
||||
|
||||
return blk_mq_rq_to_pdu(rq);
|
||||
}
|
||||
|
||||
@@ -3833,8 +3811,6 @@ static int mtip_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||
struct request *rq = bd->rq;
|
||||
int ret;
|
||||
|
||||
mtip_init_cmd_header(rq);
|
||||
|
||||
if (unlikely(mtip_check_unal_depth(hctx, rq)))
|
||||
return BLK_MQ_RQ_QUEUE_BUSY;
|
||||
|
||||
@@ -3866,6 +3842,7 @@ static int mtip_init_cmd(void *data, struct request *rq, unsigned int hctx_idx,
|
||||
{
|
||||
struct driver_data *dd = data;
|
||||
struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq);
|
||||
u32 host_cap_64 = readl(dd->mmio + HOST_CAP) & HOST_CAP_64;
|
||||
|
||||
/*
|
||||
* For flush requests, request_idx starts at the end of the
|
||||
@@ -3882,6 +3859,17 @@ static int mtip_init_cmd(void *data, struct request *rq, unsigned int hctx_idx,
|
||||
|
||||
memset(cmd->command, 0, CMD_DMA_ALLOC_SZ);
|
||||
|
||||
/* Point the command headers at the command tables. */
|
||||
cmd->command_header = dd->port->command_list +
|
||||
(sizeof(struct mtip_cmd_hdr) * request_idx);
|
||||
cmd->command_header_dma = dd->port->command_list_dma +
|
||||
(sizeof(struct mtip_cmd_hdr) * request_idx);
|
||||
|
||||
if (host_cap_64)
|
||||
cmd->command_header->ctbau = __force_bit2int cpu_to_le32((cmd->command_dma >> 16) >> 16);
|
||||
|
||||
cmd->command_header->ctba = __force_bit2int cpu_to_le32(cmd->command_dma & 0xFFFFFFFF);
|
||||
|
||||
sg_init_table(cmd->sg, MTIP_MAX_SG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1056,6 @@ struct sony_sc {
|
||||
u8 battery_charging;
|
||||
u8 battery_capacity;
|
||||
u8 led_state[MAX_LEDS];
|
||||
u8 resume_led_state[MAX_LEDS];
|
||||
u8 led_delay_on[MAX_LEDS];
|
||||
u8 led_delay_off[MAX_LEDS];
|
||||
u8 led_count;
|
||||
@@ -1793,6 +1792,7 @@ static int sony_leds_init(struct sony_sc *sc)
|
||||
led->name = name;
|
||||
led->brightness = sc->led_state[n];
|
||||
led->max_brightness = max_brightness[n];
|
||||
led->flags = LED_CORE_SUSPENDRESUME;
|
||||
led->brightness_get = sony_led_get_brightness;
|
||||
led->brightness_set = sony_led_set_brightness;
|
||||
|
||||
@@ -2509,47 +2509,32 @@ static void sony_remove(struct hid_device *hdev)
|
||||
|
||||
static int sony_suspend(struct hid_device *hdev, pm_message_t message)
|
||||
{
|
||||
/*
|
||||
* On suspend save the current LED state,
|
||||
* stop running force-feedback and blank the LEDS.
|
||||
*/
|
||||
if (SONY_LED_SUPPORT || SONY_FF_SUPPORT) {
|
||||
#ifdef CONFIG_SONY_FF
|
||||
|
||||
/* On suspend stop any running force-feedback events */
|
||||
if (SONY_FF_SUPPORT) {
|
||||
struct sony_sc *sc = hid_get_drvdata(hdev);
|
||||
|
||||
#ifdef CONFIG_SONY_FF
|
||||
sc->left = sc->right = 0;
|
||||
#endif
|
||||
|
||||
memcpy(sc->resume_led_state, sc->led_state,
|
||||
sizeof(sc->resume_led_state));
|
||||
memset(sc->led_state, 0, sizeof(sc->led_state));
|
||||
|
||||
sony_send_output_report(sc);
|
||||
}
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sony_resume(struct hid_device *hdev)
|
||||
{
|
||||
/* Restore the state of controller LEDs on resume */
|
||||
if (SONY_LED_SUPPORT) {
|
||||
struct sony_sc *sc = hid_get_drvdata(hdev);
|
||||
struct sony_sc *sc = hid_get_drvdata(hdev);
|
||||
|
||||
memcpy(sc->led_state, sc->resume_led_state,
|
||||
sizeof(sc->led_state));
|
||||
|
||||
/*
|
||||
* The Sixaxis and navigation controllers on USB need to be
|
||||
* reinitialized on resume or they won't behave properly.
|
||||
*/
|
||||
if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
|
||||
(sc->quirks & NAVIGATION_CONTROLLER_USB)) {
|
||||
sixaxis_set_operational_usb(sc->hdev);
|
||||
sc->defer_initialization = 1;
|
||||
}
|
||||
|
||||
sony_set_leds(sc);
|
||||
/*
|
||||
* The Sixaxis and navigation controllers on USB need to be
|
||||
* reinitialized on resume or they won't behave properly.
|
||||
*/
|
||||
if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
|
||||
(sc->quirks & NAVIGATION_CONTROLLER_USB)) {
|
||||
sixaxis_set_operational_usb(sc->hdev);
|
||||
sc->defer_initialization = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -209,6 +209,22 @@ int rdma_addr_size(struct sockaddr *addr)
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_addr_size);
|
||||
|
||||
int rdma_addr_size_in6(struct sockaddr_in6 *addr)
|
||||
{
|
||||
int ret = rdma_addr_size((struct sockaddr *) addr);
|
||||
|
||||
return ret <= sizeof(*addr) ? ret : 0;
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_addr_size_in6);
|
||||
|
||||
int rdma_addr_size_kss(struct __kernel_sockaddr_storage *addr)
|
||||
{
|
||||
int ret = rdma_addr_size((struct sockaddr *) addr);
|
||||
|
||||
return ret <= sizeof(*addr) ? ret : 0;
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_addr_size_kss);
|
||||
|
||||
static struct rdma_addr_client self;
|
||||
|
||||
void rdma_addr_register_client(struct rdma_addr_client *client)
|
||||
|
||||
@@ -132,7 +132,7 @@ static inline struct ucma_context *_ucma_find_context(int id,
|
||||
ctx = idr_find(&ctx_idr, id);
|
||||
if (!ctx)
|
||||
ctx = ERR_PTR(-ENOENT);
|
||||
else if (ctx->file != file)
|
||||
else if (ctx->file != file || !ctx->cm_id)
|
||||
ctx = ERR_PTR(-EINVAL);
|
||||
return ctx;
|
||||
}
|
||||
@@ -454,6 +454,7 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
|
||||
struct rdma_ucm_create_id cmd;
|
||||
struct rdma_ucm_create_id_resp resp;
|
||||
struct ucma_context *ctx;
|
||||
struct rdma_cm_id *cm_id;
|
||||
enum ib_qp_type qp_type;
|
||||
int ret;
|
||||
|
||||
@@ -474,10 +475,10 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
|
||||
return -ENOMEM;
|
||||
|
||||
ctx->uid = cmd.uid;
|
||||
ctx->cm_id = rdma_create_id(current->nsproxy->net_ns,
|
||||
ucma_event_handler, ctx, cmd.ps, qp_type);
|
||||
if (IS_ERR(ctx->cm_id)) {
|
||||
ret = PTR_ERR(ctx->cm_id);
|
||||
cm_id = rdma_create_id(current->nsproxy->net_ns,
|
||||
ucma_event_handler, ctx, cmd.ps, qp_type);
|
||||
if (IS_ERR(cm_id)) {
|
||||
ret = PTR_ERR(cm_id);
|
||||
goto err1;
|
||||
}
|
||||
|
||||
@@ -487,14 +488,19 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
|
||||
ret = -EFAULT;
|
||||
goto err2;
|
||||
}
|
||||
|
||||
ctx->cm_id = cm_id;
|
||||
return 0;
|
||||
|
||||
err2:
|
||||
rdma_destroy_id(ctx->cm_id);
|
||||
rdma_destroy_id(cm_id);
|
||||
err1:
|
||||
mutex_lock(&mut);
|
||||
idr_remove(&ctx_idr, ctx->id);
|
||||
mutex_unlock(&mut);
|
||||
mutex_lock(&file->mut);
|
||||
list_del(&ctx->list);
|
||||
mutex_unlock(&file->mut);
|
||||
kfree(ctx);
|
||||
return ret;
|
||||
}
|
||||
@@ -624,6 +630,9 @@ static ssize_t ucma_bind_ip(struct ucma_file *file, const char __user *inbuf,
|
||||
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!rdma_addr_size_in6(&cmd.addr))
|
||||
return -EINVAL;
|
||||
|
||||
ctx = ucma_get_ctx(file, cmd.id);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
@@ -637,22 +646,21 @@ static ssize_t ucma_bind(struct ucma_file *file, const char __user *inbuf,
|
||||
int in_len, int out_len)
|
||||
{
|
||||
struct rdma_ucm_bind cmd;
|
||||
struct sockaddr *addr;
|
||||
struct ucma_context *ctx;
|
||||
int ret;
|
||||
|
||||
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
|
||||
addr = (struct sockaddr *) &cmd.addr;
|
||||
if (cmd.reserved || !cmd.addr_size || (cmd.addr_size != rdma_addr_size(addr)))
|
||||
if (cmd.reserved || !cmd.addr_size ||
|
||||
cmd.addr_size != rdma_addr_size_kss(&cmd.addr))
|
||||
return -EINVAL;
|
||||
|
||||
ctx = ucma_get_ctx(file, cmd.id);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
ret = rdma_bind_addr(ctx->cm_id, addr);
|
||||
ret = rdma_bind_addr(ctx->cm_id, (struct sockaddr *) &cmd.addr);
|
||||
ucma_put_ctx(ctx);
|
||||
return ret;
|
||||
}
|
||||
@@ -668,13 +676,16 @@ static ssize_t ucma_resolve_ip(struct ucma_file *file,
|
||||
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!rdma_addr_size_in6(&cmd.src_addr) ||
|
||||
!rdma_addr_size_in6(&cmd.dst_addr))
|
||||
return -EINVAL;
|
||||
|
||||
ctx = ucma_get_ctx(file, cmd.id);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
ret = rdma_resolve_addr(ctx->cm_id, (struct sockaddr *) &cmd.src_addr,
|
||||
(struct sockaddr *) &cmd.dst_addr,
|
||||
cmd.timeout_ms);
|
||||
(struct sockaddr *) &cmd.dst_addr, cmd.timeout_ms);
|
||||
ucma_put_ctx(ctx);
|
||||
return ret;
|
||||
}
|
||||
@@ -684,24 +695,23 @@ static ssize_t ucma_resolve_addr(struct ucma_file *file,
|
||||
int in_len, int out_len)
|
||||
{
|
||||
struct rdma_ucm_resolve_addr cmd;
|
||||
struct sockaddr *src, *dst;
|
||||
struct ucma_context *ctx;
|
||||
int ret;
|
||||
|
||||
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
|
||||
src = (struct sockaddr *) &cmd.src_addr;
|
||||
dst = (struct sockaddr *) &cmd.dst_addr;
|
||||
if (cmd.reserved || (cmd.src_size && (cmd.src_size != rdma_addr_size(src))) ||
|
||||
!cmd.dst_size || (cmd.dst_size != rdma_addr_size(dst)))
|
||||
if (cmd.reserved ||
|
||||
(cmd.src_size && (cmd.src_size != rdma_addr_size_kss(&cmd.src_addr))) ||
|
||||
!cmd.dst_size || (cmd.dst_size != rdma_addr_size_kss(&cmd.dst_addr)))
|
||||
return -EINVAL;
|
||||
|
||||
ctx = ucma_get_ctx(file, cmd.id);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
ret = rdma_resolve_addr(ctx->cm_id, src, dst, cmd.timeout_ms);
|
||||
ret = rdma_resolve_addr(ctx->cm_id, (struct sockaddr *) &cmd.src_addr,
|
||||
(struct sockaddr *) &cmd.dst_addr, cmd.timeout_ms);
|
||||
ucma_put_ctx(ctx);
|
||||
return ret;
|
||||
}
|
||||
@@ -1146,6 +1156,11 @@ static ssize_t ucma_init_qp_attr(struct ucma_file *file,
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
if (!ctx->cm_id->device) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
resp.qp_attr_mask = 0;
|
||||
memset(&qp_attr, 0, sizeof qp_attr);
|
||||
qp_attr.qp_state = cmd.qp_state;
|
||||
@@ -1302,7 +1317,7 @@ static ssize_t ucma_notify(struct ucma_file *file, const char __user *inbuf,
|
||||
{
|
||||
struct rdma_ucm_notify cmd;
|
||||
struct ucma_context *ctx;
|
||||
int ret;
|
||||
int ret = -EINVAL;
|
||||
|
||||
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
@@ -1311,7 +1326,9 @@ static ssize_t ucma_notify(struct ucma_file *file, const char __user *inbuf,
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
ret = rdma_notify(ctx->cm_id, (enum ib_event_type) cmd.event);
|
||||
if (ctx->cm_id->device)
|
||||
ret = rdma_notify(ctx->cm_id, (enum ib_event_type)cmd.event);
|
||||
|
||||
ucma_put_ctx(ctx);
|
||||
return ret;
|
||||
}
|
||||
@@ -1397,7 +1414,7 @@ static ssize_t ucma_join_ip_multicast(struct ucma_file *file,
|
||||
join_cmd.response = cmd.response;
|
||||
join_cmd.uid = cmd.uid;
|
||||
join_cmd.id = cmd.id;
|
||||
join_cmd.addr_size = rdma_addr_size((struct sockaddr *) &cmd.addr);
|
||||
join_cmd.addr_size = rdma_addr_size_in6(&cmd.addr);
|
||||
if (!join_cmd.addr_size)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1416,7 +1433,7 @@ static ssize_t ucma_join_multicast(struct ucma_file *file,
|
||||
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!rdma_addr_size((struct sockaddr *)&cmd.addr))
|
||||
if (!rdma_addr_size_kss(&cmd.addr))
|
||||
return -EINVAL;
|
||||
|
||||
return ucma_process_join(file, &cmd, out_len);
|
||||
|
||||
@@ -2538,13 +2538,31 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4],
|
||||
}
|
||||
|
||||
static int alps_update_dual_info_ss4_v2(unsigned char otp[][4],
|
||||
struct alps_data *priv)
|
||||
struct alps_data *priv,
|
||||
struct psmouse *psmouse)
|
||||
{
|
||||
bool is_dual = false;
|
||||
int reg_val = 0;
|
||||
struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
|
||||
if (IS_SS4PLUS_DEV(priv->dev_id))
|
||||
if (IS_SS4PLUS_DEV(priv->dev_id)) {
|
||||
is_dual = (otp[0][0] >> 4) & 0x01;
|
||||
|
||||
if (!is_dual) {
|
||||
/* For support TrackStick of Thinkpad L/E series */
|
||||
if (alps_exit_command_mode(psmouse) == 0 &&
|
||||
alps_enter_command_mode(psmouse) == 0) {
|
||||
reg_val = alps_command_mode_read_reg(psmouse,
|
||||
0xD7);
|
||||
}
|
||||
alps_exit_command_mode(psmouse);
|
||||
ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
|
||||
|
||||
if (reg_val == 0x0C || reg_val == 0x1D)
|
||||
is_dual = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_dual)
|
||||
priv->flags |= ALPS_DUALPOINT |
|
||||
ALPS_DUALPOINT_WITH_PRESSURE;
|
||||
@@ -2567,7 +2585,7 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse,
|
||||
|
||||
alps_update_btn_info_ss4_v2(otp, priv);
|
||||
|
||||
alps_update_dual_info_ss4_v2(otp, priv);
|
||||
alps_update_dual_info_ss4_v2(otp, priv, psmouse);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#define MOUSEDEV_MINORS 31
|
||||
#define MOUSEDEV_MIX 63
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/poll.h>
|
||||
@@ -103,7 +104,7 @@ struct mousedev_client {
|
||||
spinlock_t packet_lock;
|
||||
int pos_x, pos_y;
|
||||
|
||||
signed char ps2[6];
|
||||
u8 ps2[6];
|
||||
unsigned char ready, buffer, bufsiz;
|
||||
unsigned char imexseq, impsseq;
|
||||
enum mousedev_emul mode;
|
||||
@@ -291,11 +292,10 @@ static void mousedev_notify_readers(struct mousedev *mousedev,
|
||||
}
|
||||
|
||||
client->pos_x += packet->dx;
|
||||
client->pos_x = client->pos_x < 0 ?
|
||||
0 : (client->pos_x >= xres ? xres : client->pos_x);
|
||||
client->pos_x = clamp_val(client->pos_x, 0, xres);
|
||||
|
||||
client->pos_y += packet->dy;
|
||||
client->pos_y = client->pos_y < 0 ?
|
||||
0 : (client->pos_y >= yres ? yres : client->pos_y);
|
||||
client->pos_y = clamp_val(client->pos_y, 0, yres);
|
||||
|
||||
p->dx += packet->dx;
|
||||
p->dy += packet->dy;
|
||||
@@ -571,44 +571,50 @@ static int mousedev_open(struct inode *inode, struct file *file)
|
||||
return error;
|
||||
}
|
||||
|
||||
static inline int mousedev_limit_delta(int delta, int limit)
|
||||
{
|
||||
return delta > limit ? limit : (delta < -limit ? -limit : delta);
|
||||
}
|
||||
|
||||
static void mousedev_packet(struct mousedev_client *client,
|
||||
signed char *ps2_data)
|
||||
static void mousedev_packet(struct mousedev_client *client, u8 *ps2_data)
|
||||
{
|
||||
struct mousedev_motion *p = &client->packets[client->tail];
|
||||
s8 dx, dy, dz;
|
||||
|
||||
ps2_data[0] = 0x08 |
|
||||
((p->dx < 0) << 4) | ((p->dy < 0) << 5) | (p->buttons & 0x07);
|
||||
ps2_data[1] = mousedev_limit_delta(p->dx, 127);
|
||||
ps2_data[2] = mousedev_limit_delta(p->dy, 127);
|
||||
p->dx -= ps2_data[1];
|
||||
p->dy -= ps2_data[2];
|
||||
dx = clamp_val(p->dx, -127, 127);
|
||||
p->dx -= dx;
|
||||
|
||||
dy = clamp_val(p->dy, -127, 127);
|
||||
p->dy -= dy;
|
||||
|
||||
ps2_data[0] = BIT(3);
|
||||
ps2_data[0] |= ((dx & BIT(7)) >> 3) | ((dy & BIT(7)) >> 2);
|
||||
ps2_data[0] |= p->buttons & 0x07;
|
||||
ps2_data[1] = dx;
|
||||
ps2_data[2] = dy;
|
||||
|
||||
switch (client->mode) {
|
||||
case MOUSEDEV_EMUL_EXPS:
|
||||
ps2_data[3] = mousedev_limit_delta(p->dz, 7);
|
||||
p->dz -= ps2_data[3];
|
||||
ps2_data[3] = (ps2_data[3] & 0x0f) | ((p->buttons & 0x18) << 1);
|
||||
dz = clamp_val(p->dz, -7, 7);
|
||||
p->dz -= dz;
|
||||
|
||||
ps2_data[3] = (dz & 0x0f) | ((p->buttons & 0x18) << 1);
|
||||
client->bufsiz = 4;
|
||||
break;
|
||||
|
||||
case MOUSEDEV_EMUL_IMPS:
|
||||
ps2_data[0] |=
|
||||
((p->buttons & 0x10) >> 3) | ((p->buttons & 0x08) >> 1);
|
||||
ps2_data[3] = mousedev_limit_delta(p->dz, 127);
|
||||
p->dz -= ps2_data[3];
|
||||
dz = clamp_val(p->dz, -127, 127);
|
||||
p->dz -= dz;
|
||||
|
||||
ps2_data[0] |= ((p->buttons & 0x10) >> 3) |
|
||||
((p->buttons & 0x08) >> 1);
|
||||
ps2_data[3] = dz;
|
||||
|
||||
client->bufsiz = 4;
|
||||
break;
|
||||
|
||||
case MOUSEDEV_EMUL_PS2:
|
||||
default:
|
||||
ps2_data[0] |=
|
||||
((p->buttons & 0x10) >> 3) | ((p->buttons & 0x08) >> 1);
|
||||
p->dz = 0;
|
||||
|
||||
ps2_data[0] |= ((p->buttons & 0x10) >> 3) |
|
||||
((p->buttons & 0x08) >> 1);
|
||||
|
||||
client->bufsiz = 3;
|
||||
break;
|
||||
}
|
||||
@@ -714,7 +720,7 @@ static ssize_t mousedev_read(struct file *file, char __user *buffer,
|
||||
{
|
||||
struct mousedev_client *client = file->private_data;
|
||||
struct mousedev *mousedev = client->mousedev;
|
||||
signed char data[sizeof(client->ps2)];
|
||||
u8 data[sizeof(client->ps2)];
|
||||
int retval = 0;
|
||||
|
||||
if (!client->ready && !client->buffer && mousedev->exist &&
|
||||
|
||||
@@ -530,6 +530,20 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
|
||||
{
|
||||
/*
|
||||
* Sony Vaio VGN-CS series require MUX or the touch sensor
|
||||
* buttons will disturb touchpad operation
|
||||
*/
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
/*
|
||||
* On some Asus laptops, just running self tests cause problems.
|
||||
*/
|
||||
@@ -692,6 +706,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Lenovo ThinkPad L460 */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
|
||||
.matches = {
|
||||
@@ -1223,6 +1244,9 @@ static int __init i8042_platform_init(void)
|
||||
if (dmi_check_system(i8042_dmi_nomux_table))
|
||||
i8042_nomux = true;
|
||||
|
||||
if (dmi_check_system(i8042_dmi_forcemux_table))
|
||||
i8042_nomux = false;
|
||||
|
||||
if (dmi_check_system(i8042_dmi_notimeout_table))
|
||||
i8042_notimeout = true;
|
||||
|
||||
|
||||
@@ -1777,12 +1777,12 @@ static int validate_params(uint cmd, struct dm_ioctl *param)
|
||||
cmd == DM_LIST_VERSIONS_CMD)
|
||||
return 0;
|
||||
|
||||
if ((cmd == DM_DEV_CREATE_CMD)) {
|
||||
if (cmd == DM_DEV_CREATE_CMD) {
|
||||
if (!*param->name) {
|
||||
DMWARN("name not supplied when creating device");
|
||||
return -EINVAL;
|
||||
}
|
||||
} else if ((*param->uuid && *param->name)) {
|
||||
} else if (*param->uuid && *param->name) {
|
||||
DMWARN("only supply one of name or uuid, cmd(%u)", cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3681,6 +3681,7 @@ static int raid10_run(struct mddev *mddev)
|
||||
|
||||
if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
|
||||
discard_supported = true;
|
||||
first = 0;
|
||||
}
|
||||
|
||||
if (mddev->queue) {
|
||||
|
||||
@@ -109,6 +109,8 @@ static int usbtv_probe(struct usb_interface *intf,
|
||||
return 0;
|
||||
|
||||
usbtv_audio_fail:
|
||||
/* we must not free at this point */
|
||||
usb_get_dev(usbtv->udev);
|
||||
usbtv_video_free(usbtv);
|
||||
|
||||
usbtv_video_fail:
|
||||
|
||||
@@ -551,7 +551,6 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||
break;
|
||||
|
||||
default:
|
||||
dev_err(dev->dev, ": unsupported ioctl %d.\n", cmd);
|
||||
rets = -ENOIOCTLCMD;
|
||||
}
|
||||
|
||||
|
||||
@@ -1889,6 +1889,8 @@ static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base,
|
||||
do {
|
||||
uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), map, cfi);
|
||||
mask = (1 << (cfi->device_type * 8)) - 1;
|
||||
if (ofs >= map->size)
|
||||
return 0;
|
||||
result = map_read(map, base + ofs);
|
||||
bank++;
|
||||
} while ((result.x[0] & mask) == CFI_MFR_CONTINUATION);
|
||||
|
||||
@@ -1680,6 +1680,30 @@ static void xgene_enet_napi_add(struct xgene_enet_pdata *pdata)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id xgene_enet_acpi_match[] = {
|
||||
{ "APMC0D05", XGENE_ENET1},
|
||||
{ "APMC0D30", XGENE_ENET1},
|
||||
{ "APMC0D31", XGENE_ENET1},
|
||||
{ "APMC0D3F", XGENE_ENET1},
|
||||
{ "APMC0D26", XGENE_ENET2},
|
||||
{ "APMC0D25", XGENE_ENET2},
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
|
||||
#endif
|
||||
|
||||
static const struct of_device_id xgene_enet_of_match[] = {
|
||||
{.compatible = "apm,xgene-enet", .data = (void *)XGENE_ENET1},
|
||||
{.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
|
||||
{.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
|
||||
{.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
|
||||
{.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
|
||||
|
||||
static int xgene_enet_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev;
|
||||
@@ -1826,32 +1850,6 @@ static void xgene_enet_shutdown(struct platform_device *pdev)
|
||||
xgene_enet_remove(pdev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id xgene_enet_acpi_match[] = {
|
||||
{ "APMC0D05", XGENE_ENET1},
|
||||
{ "APMC0D30", XGENE_ENET1},
|
||||
{ "APMC0D31", XGENE_ENET1},
|
||||
{ "APMC0D3F", XGENE_ENET1},
|
||||
{ "APMC0D26", XGENE_ENET2},
|
||||
{ "APMC0D25", XGENE_ENET2},
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id xgene_enet_of_match[] = {
|
||||
{.compatible = "apm,xgene-enet", .data = (void *)XGENE_ENET1},
|
||||
{.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
|
||||
{.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
|
||||
{.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
|
||||
{.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
|
||||
#endif
|
||||
|
||||
static struct platform_driver xgene_enet_driver = {
|
||||
.driver = {
|
||||
.name = "xgene-enet",
|
||||
|
||||
@@ -671,7 +671,7 @@ static void hns_gmac_get_strings(u32 stringset, u8 *data)
|
||||
|
||||
static int hns_gmac_get_sset_count(int stringset)
|
||||
{
|
||||
if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)
|
||||
if (stringset == ETH_SS_STATS)
|
||||
return ARRAY_SIZE(g_gmac_stats_string);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -422,7 +422,7 @@ void hns_ppe_update_stats(struct hns_ppe_cb *ppe_cb)
|
||||
|
||||
int hns_ppe_get_sset_count(int stringset)
|
||||
{
|
||||
if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)
|
||||
if (stringset == ETH_SS_STATS)
|
||||
return ETH_PPE_STATIC_NUM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@ void hns_rcb_get_stats(struct hnae_queue *queue, u64 *data)
|
||||
*/
|
||||
int hns_rcb_get_ring_sset_count(int stringset)
|
||||
{
|
||||
if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)
|
||||
if (stringset == ETH_SS_STATS)
|
||||
return HNS_RING_STATIC_REG_NUM;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1017,8 +1017,10 @@ int hns_get_sset_count(struct net_device *netdev, int stringset)
|
||||
cnt--;
|
||||
|
||||
return cnt;
|
||||
} else {
|
||||
} else if (stringset == ETH_SS_STATS) {
|
||||
return (HNS_NET_STATS_CNT + ops->get_sset_count(h, stringset));
|
||||
} else {
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -314,6 +314,30 @@ static acpi_status acpi_register_phy(acpi_handle handle, u32 lvl,
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct of_device_id xgene_mdio_of_match[] = {
|
||||
{
|
||||
.compatible = "apm,xgene-mdio-rgmii",
|
||||
.data = (void *)XGENE_MDIO_RGMII
|
||||
},
|
||||
{
|
||||
.compatible = "apm,xgene-mdio-xfi",
|
||||
.data = (void *)XGENE_MDIO_XFI
|
||||
},
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id xgene_mdio_acpi_match[] = {
|
||||
{ "APMC0D65", XGENE_MDIO_RGMII },
|
||||
{ "APMC0D66", XGENE_MDIO_XFI },
|
||||
{ }
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
|
||||
#endif
|
||||
|
||||
|
||||
static int xgene_mdio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -439,32 +463,6 @@ static int xgene_mdio_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id xgene_mdio_of_match[] = {
|
||||
{
|
||||
.compatible = "apm,xgene-mdio-rgmii",
|
||||
.data = (void *)XGENE_MDIO_RGMII
|
||||
},
|
||||
{
|
||||
.compatible = "apm,xgene-mdio-xfi",
|
||||
.data = (void *)XGENE_MDIO_XFI
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id xgene_mdio_acpi_match[] = {
|
||||
{ "APMC0D65", XGENE_MDIO_RGMII },
|
||||
{ "APMC0D66", XGENE_MDIO_XFI },
|
||||
{ }
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
|
||||
#endif
|
||||
|
||||
static struct platform_driver xgene_mdio_driver = {
|
||||
.driver = {
|
||||
.name = "xgene-mdio",
|
||||
|
||||
@@ -132,10 +132,6 @@ static inline u64 xgene_enet_get_field_value(int pos, int len, u64 src)
|
||||
#define GET_BIT(field, src) \
|
||||
xgene_enet_get_field_value(field ## _POS, 1, src)
|
||||
|
||||
static const struct of_device_id xgene_mdio_of_match[];
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id xgene_mdio_acpi_match[];
|
||||
#endif
|
||||
int xgene_mdio_rgmii_read(struct mii_bus *bus, int phy_id, int reg);
|
||||
int xgene_mdio_rgmii_write(struct mii_bus *bus, int phy_id, int reg, u16 data);
|
||||
struct phy_device *xgene_enet_phy_register(struct mii_bus *bus, int phy_addr);
|
||||
|
||||
@@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards {
|
||||
netmos_9901,
|
||||
netmos_9865,
|
||||
quatech_sppxp100,
|
||||
wch_ch382l,
|
||||
};
|
||||
|
||||
|
||||
@@ -2708,6 +2709,7 @@ static struct parport_pc_pci {
|
||||
/* netmos_9901 */ { 1, { { 0, -1 }, } },
|
||||
/* netmos_9865 */ { 1, { { 0, -1 }, } },
|
||||
/* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
|
||||
/* wch_ch382l */ { 1, { { 2, -1 }, } },
|
||||
};
|
||||
|
||||
static const struct pci_device_id parport_pc_pci_tbl[] = {
|
||||
@@ -2797,6 +2799,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
|
||||
/* Quatech SPPXP-100 Parallel port PCI ExpressCard */
|
||||
{ PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
|
||||
/* WCH CH382L PCI-E single parallel port card */
|
||||
{ 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l },
|
||||
{ 0, } /* terminate list */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
|
||||
|
||||
@@ -231,7 +231,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
|
||||
res->flags |= IORESOURCE_ROM_ENABLE;
|
||||
l64 = l & PCI_ROM_ADDRESS_MASK;
|
||||
sz64 = sz & PCI_ROM_ADDRESS_MASK;
|
||||
mask64 = (u32)PCI_ROM_ADDRESS_MASK;
|
||||
mask64 = PCI_ROM_ADDRESS_MASK;
|
||||
}
|
||||
|
||||
if (res->flags & IORESOURCE_MEM_64) {
|
||||
|
||||
@@ -63,7 +63,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
|
||||
mask = (u32)PCI_BASE_ADDRESS_IO_MASK;
|
||||
new |= res->flags & ~PCI_BASE_ADDRESS_IO_MASK;
|
||||
} else if (resno == PCI_ROM_RESOURCE) {
|
||||
mask = (u32)PCI_ROM_ADDRESS_MASK;
|
||||
mask = PCI_ROM_ADDRESS_MASK;
|
||||
} else {
|
||||
mask = (u32)PCI_BASE_ADDRESS_MEM_MASK;
|
||||
new |= res->flags & ~PCI_BASE_ADDRESS_MEM_MASK;
|
||||
|
||||
@@ -819,6 +819,7 @@ static struct scsi_host_template virtscsi_host_template_multi = {
|
||||
.change_queue_depth = virtscsi_change_queue_depth,
|
||||
.eh_abort_handler = virtscsi_abort,
|
||||
.eh_device_reset_handler = virtscsi_device_reset,
|
||||
.slave_alloc = virtscsi_device_alloc,
|
||||
|
||||
.can_queue = 1024,
|
||||
.dma_boundary = UINT_MAX,
|
||||
|
||||
@@ -156,7 +156,6 @@ config SPI_BCM63XX_HSSPI
|
||||
config SPI_BCM_QSPI
|
||||
tristate "Broadcom BSPI and MSPI controller support"
|
||||
depends on ARCH_BRCMSTB || ARCH_BCM || ARCH_BCM_IPROC || COMPILE_TEST
|
||||
depends on MTD_NORFLASH
|
||||
default ARCH_BCM_IPROC
|
||||
help
|
||||
Enables support for the Broadcom SPI flash and MSPI controller.
|
||||
|
||||
@@ -646,7 +646,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
|
||||
buf = t->rx_buf;
|
||||
t->rx_dma = dma_map_single(&spi->dev, buf,
|
||||
t->len, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&spi->dev, !t->rx_dma)) {
|
||||
if (dma_mapping_error(&spi->dev, t->rx_dma)) {
|
||||
ret = -EFAULT;
|
||||
goto err_rx_map;
|
||||
}
|
||||
|
||||
@@ -1284,6 +1284,8 @@ static void ack_a_interrupt(struct comedi_device *dev, unsigned short a_status)
|
||||
ack |= NISTC_INTA_ACK_AI_START;
|
||||
if (a_status & NISTC_AI_STATUS1_STOP)
|
||||
ack |= NISTC_INTA_ACK_AI_STOP;
|
||||
if (a_status & NISTC_AI_STATUS1_OVER)
|
||||
ack |= NISTC_INTA_ACK_AI_ERR;
|
||||
if (ack)
|
||||
ni_stc_writew(dev, ack, NISTC_INTA_ACK_REG);
|
||||
}
|
||||
|
||||
@@ -1354,6 +1354,11 @@ static void csi_m(struct vc_data *vc)
|
||||
case 3:
|
||||
vc->vc_italic = 1;
|
||||
break;
|
||||
case 21:
|
||||
/*
|
||||
* No console drivers support double underline, so
|
||||
* convert it to a single underline.
|
||||
*/
|
||||
case 4:
|
||||
vc->vc_underline = 1;
|
||||
break;
|
||||
@@ -1389,7 +1394,6 @@ static void csi_m(struct vc_data *vc)
|
||||
vc->vc_disp_ctrl = 1;
|
||||
vc->vc_toggle_meta = 1;
|
||||
break;
|
||||
case 21:
|
||||
case 22:
|
||||
vc->vc_intensity = 1;
|
||||
break;
|
||||
|
||||
@@ -3220,7 +3220,6 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
|
||||
dwc2_core_init(hsotg, false);
|
||||
dwc2_enable_global_interrupts(hsotg);
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
dwc2_hsotg_disconnect(hsotg);
|
||||
dwc2_hsotg_core_init_disconnected(hsotg, false);
|
||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||
dwc2_hsotg_core_connect(hsotg);
|
||||
@@ -3238,8 +3237,12 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
|
||||
if (count > 250)
|
||||
dev_err(hsotg->dev,
|
||||
"Connection id status change timed out\n");
|
||||
hsotg->op_state = OTG_STATE_A_HOST;
|
||||
|
||||
spin_lock_irqsave(&hsotg->lock, flags);
|
||||
dwc2_hsotg_disconnect(hsotg);
|
||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||
|
||||
hsotg->op_state = OTG_STATE_A_HOST;
|
||||
/* Initialize the Core for Host mode */
|
||||
dwc2_core_init(hsotg, false);
|
||||
dwc2_enable_global_interrupts(hsotg);
|
||||
|
||||
@@ -139,10 +139,8 @@ int usb_ep_disable(struct usb_ep *ep)
|
||||
goto out;
|
||||
|
||||
ret = ep->ops->disable(ep);
|
||||
if (ret) {
|
||||
ret = ret;
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ep->enabled = false;
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */
|
||||
{ USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
|
||||
{ USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
|
||||
{ USB_DEVICE(0x155A, 0x1006) }, /* ELDAT Easywave RX09 */
|
||||
{ USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */
|
||||
{ USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */
|
||||
{ USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
|
||||
|
||||
@@ -773,6 +773,7 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
.driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
|
||||
{ USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
|
||||
{ USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) },
|
||||
{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) },
|
||||
@@ -935,6 +936,7 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_FHE_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) },
|
||||
{ USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
|
||||
@@ -922,6 +922,9 @@
|
||||
/*
|
||||
* RT Systems programming cables for various ham radios
|
||||
*/
|
||||
/* This device uses the VID of FTDI */
|
||||
#define RTSYSTEMS_USB_VX8_PID 0x9e50 /* USB-VX8 USB to 7 pin modular plug for Yaesu VX-8 radio */
|
||||
|
||||
#define RTSYSTEMS_VID 0x2100 /* Vendor ID */
|
||||
#define RTSYSTEMS_USB_S03_PID 0x9001 /* RTS-03 USB to Serial Adapter */
|
||||
#define RTSYSTEMS_USB_59_PID 0x9e50 /* USB-59 USB to 8 pin plug */
|
||||
@@ -1440,6 +1443,12 @@
|
||||
*/
|
||||
#define FTDI_CINTERION_MC55I_PID 0xA951
|
||||
|
||||
/*
|
||||
* Product: FirmwareHubEmulator
|
||||
* Manufacturer: Harman Becker Automotive Systems
|
||||
*/
|
||||
#define FTDI_FHE_PID 0xA9A0
|
||||
|
||||
/*
|
||||
* Product: Comet Caller ID decoder
|
||||
* Manufacturer: Crucible Technologies
|
||||
|
||||
@@ -3664,7 +3664,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans,
|
||||
|
||||
src_offset = btrfs_item_ptr_offset(src, start_slot + i);
|
||||
|
||||
if ((i == (nr - 1)))
|
||||
if (i == nr - 1)
|
||||
last_key = ins_keys[i];
|
||||
|
||||
if (ins_keys[i].type == BTRFS_INODE_ITEM_KEY) {
|
||||
|
||||
@@ -598,7 +598,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *i,
|
||||
struct ceph_aio_request {
|
||||
struct kiocb *iocb;
|
||||
size_t total_len;
|
||||
int write;
|
||||
bool write;
|
||||
bool should_dirty;
|
||||
int error;
|
||||
struct list_head osd_reqs;
|
||||
unsigned num_reqs;
|
||||
@@ -708,7 +709,7 @@ static void ceph_aio_complete_req(struct ceph_osd_request *req)
|
||||
}
|
||||
}
|
||||
|
||||
ceph_put_page_vector(osd_data->pages, num_pages, !aio_req->write);
|
||||
ceph_put_page_vector(osd_data->pages, num_pages, aio_req->should_dirty);
|
||||
ceph_osdc_put_request(req);
|
||||
|
||||
if (rc < 0)
|
||||
@@ -890,6 +891,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
|
||||
size_t count = iov_iter_count(iter);
|
||||
loff_t pos = iocb->ki_pos;
|
||||
bool write = iov_iter_rw(iter) == WRITE;
|
||||
bool should_dirty = !write && iter_is_iovec(iter);
|
||||
|
||||
if (write && ceph_snap(file_inode(file)) != CEPH_NOSNAP)
|
||||
return -EROFS;
|
||||
@@ -954,6 +956,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
|
||||
if (aio_req) {
|
||||
aio_req->iocb = iocb;
|
||||
aio_req->write = write;
|
||||
aio_req->should_dirty = should_dirty;
|
||||
INIT_LIST_HEAD(&aio_req->osd_reqs);
|
||||
if (write) {
|
||||
aio_req->mtime = mtime;
|
||||
@@ -1012,7 +1015,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
|
||||
len = ret;
|
||||
}
|
||||
|
||||
ceph_put_page_vector(pages, num_pages, !write);
|
||||
ceph_put_page_vector(pages, num_pages, should_dirty);
|
||||
|
||||
ceph_osdc_put_request(req);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -833,7 +833,7 @@ static int compat_ioctl_preallocate(struct file *file,
|
||||
*/
|
||||
#define XFORM(i) (((i) ^ ((i) << 27) ^ ((i) << 17)) & 0xffffffff)
|
||||
|
||||
#define COMPATIBLE_IOCTL(cmd) XFORM(cmd),
|
||||
#define COMPATIBLE_IOCTL(cmd) XFORM((u32)cmd),
|
||||
/* ioctl should not be warned about even if it's not implemented.
|
||||
Valid reasons to use this:
|
||||
- It is implemented with ->compat_ioctl on some device, but programs
|
||||
|
||||
@@ -680,6 +680,11 @@ void alloc_bootmem_cpumask_var(cpumask_var_t *mask);
|
||||
void free_cpumask_var(cpumask_var_t mask);
|
||||
void free_bootmem_cpumask_var(cpumask_var_t mask);
|
||||
|
||||
static inline bool cpumask_available(cpumask_var_t mask)
|
||||
{
|
||||
return mask != NULL;
|
||||
}
|
||||
|
||||
#else
|
||||
typedef struct cpumask cpumask_var_t[1];
|
||||
|
||||
@@ -720,6 +725,11 @@ static inline void free_cpumask_var(cpumask_var_t mask)
|
||||
static inline void free_bootmem_cpumask_var(cpumask_var_t mask)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool cpumask_available(cpumask_var_t mask)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif /* CONFIG_CPUMASK_OFFSTACK */
|
||||
|
||||
/* It's common to want to use cpu_all_mask in struct member initializers,
|
||||
|
||||
@@ -133,6 +133,9 @@ void prepare_namespace(void);
|
||||
void __init load_default_modules(void);
|
||||
int __init init_rootfs(void);
|
||||
|
||||
#if defined(CONFIG_DEBUG_RODATA) || defined(CONFIG_DEBUG_SET_MODULE_RONX)
|
||||
extern bool rodata_enabled;
|
||||
#endif
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
void mark_rodata_ro(void);
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _LINUX_JIFFIES_H
|
||||
#define _LINUX_JIFFIES_H
|
||||
|
||||
#include <linux/cache.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
@@ -63,19 +64,17 @@ extern int register_refined_jiffies(long clock_tick_rate);
|
||||
/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
|
||||
#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
|
||||
|
||||
/* some arch's have a small-data section that can be accessed register-relative
|
||||
* but that can only take up to, say, 4-byte variables. jiffies being part of
|
||||
* an 8-byte variable may not be correctly accessed unless we force the issue
|
||||
*/
|
||||
#define __jiffy_data __attribute__((section(".data")))
|
||||
#ifndef __jiffy_arch_data
|
||||
#define __jiffy_arch_data
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The 64-bit value is not atomic - you MUST NOT read it
|
||||
* without sampling the sequence number in jiffies_lock.
|
||||
* get_jiffies_64() will do this for you as appropriate.
|
||||
*/
|
||||
extern u64 __jiffy_data jiffies_64;
|
||||
extern unsigned long volatile __jiffy_data jiffies;
|
||||
extern u64 __cacheline_aligned_in_smp jiffies_64;
|
||||
extern unsigned long volatile __cacheline_aligned_in_smp __jiffy_arch_data jiffies;
|
||||
|
||||
#if (BITS_PER_LONG < 64)
|
||||
u64 get_jiffies_64(void);
|
||||
|
||||
@@ -254,6 +254,8 @@ unsigned int *xt_alloc_entry_offsets(unsigned int size);
|
||||
bool xt_find_jump_offset(const unsigned int *offsets,
|
||||
unsigned int target, unsigned int size);
|
||||
|
||||
int xt_check_proc_name(const char *name, unsigned int size);
|
||||
|
||||
int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int8_t proto,
|
||||
bool inv_proto);
|
||||
int xt_check_target(struct xt_tgchk_param *, unsigned int size, u_int8_t proto,
|
||||
|
||||
@@ -129,6 +129,8 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
|
||||
const unsigned char *dst_dev_addr);
|
||||
|
||||
int rdma_addr_size(struct sockaddr *addr);
|
||||
int rdma_addr_size_in6(struct sockaddr_in6 *addr);
|
||||
int rdma_addr_size_kss(struct __kernel_sockaddr_storage *addr);
|
||||
|
||||
int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id);
|
||||
int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
#define PCI_SUBSYSTEM_ID 0x2e
|
||||
#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
|
||||
#define PCI_ROM_ADDRESS_ENABLE 0x01
|
||||
#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
|
||||
#define PCI_ROM_ADDRESS_MASK (~0x7ffU)
|
||||
|
||||
#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
#include <linux/proc_ns.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kaiser.h>
|
||||
#include <linux/cache.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/bugs.h>
|
||||
@@ -914,14 +915,16 @@ static int try_to_run_init_process(const char *init_filename)
|
||||
|
||||
static noinline void __init kernel_init_freeable(void);
|
||||
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
static bool rodata_enabled = true;
|
||||
#if defined(CONFIG_DEBUG_RODATA) || defined(CONFIG_SET_MODULE_RONX)
|
||||
bool rodata_enabled __ro_after_init = true;
|
||||
static int __init set_debug_rodata(char *str)
|
||||
{
|
||||
return strtobool(str, &rodata_enabled);
|
||||
}
|
||||
__setup("rodata=", set_debug_rodata);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
static void mark_readonly(void)
|
||||
{
|
||||
if (rodata_enabled)
|
||||
|
||||
12
ipc/shm.c
12
ipc/shm.c
@@ -381,6 +381,17 @@ static int shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
return sfd->vm_ops->fault(vma, vmf);
|
||||
}
|
||||
|
||||
static int shm_split(struct vm_area_struct *vma, unsigned long addr)
|
||||
{
|
||||
struct file *file = vma->vm_file;
|
||||
struct shm_file_data *sfd = shm_file_data(file);
|
||||
|
||||
if (sfd->vm_ops && sfd->vm_ops->split)
|
||||
return sfd->vm_ops->split(vma, addr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
|
||||
{
|
||||
@@ -503,6 +514,7 @@ static const struct vm_operations_struct shm_vm_ops = {
|
||||
.open = shm_open, /* callback for a new vm-area open */
|
||||
.close = shm_close, /* callback for when the vm-area is released */
|
||||
.fault = shm_fault,
|
||||
.split = shm_split,
|
||||
#if defined(CONFIG_NUMA)
|
||||
.set_policy = shm_set_policy,
|
||||
.get_policy = shm_get_policy,
|
||||
|
||||
@@ -427,16 +427,9 @@ EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
|
||||
* modify_user_hw_breakpoint - modify a user-space hardware breakpoint
|
||||
* @bp: the breakpoint structure to modify
|
||||
* @attr: new breakpoint attributes
|
||||
* @triggered: callback to trigger when we hit the breakpoint
|
||||
* @tsk: pointer to 'task_struct' of the process to which the address belongs
|
||||
*/
|
||||
int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
|
||||
{
|
||||
u64 old_addr = bp->attr.bp_addr;
|
||||
u64 old_len = bp->attr.bp_len;
|
||||
int old_type = bp->attr.bp_type;
|
||||
int err = 0;
|
||||
|
||||
/*
|
||||
* modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it
|
||||
* will not be possible to raise IPIs that invoke __perf_event_disable.
|
||||
@@ -451,27 +444,18 @@ int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *att
|
||||
bp->attr.bp_addr = attr->bp_addr;
|
||||
bp->attr.bp_type = attr->bp_type;
|
||||
bp->attr.bp_len = attr->bp_len;
|
||||
bp->attr.disabled = 1;
|
||||
|
||||
if (attr->disabled)
|
||||
goto end;
|
||||
if (!attr->disabled) {
|
||||
int err = validate_hw_breakpoint(bp);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = validate_hw_breakpoint(bp);
|
||||
if (!err)
|
||||
perf_event_enable(bp);
|
||||
|
||||
if (err) {
|
||||
bp->attr.bp_addr = old_addr;
|
||||
bp->attr.bp_type = old_type;
|
||||
bp->attr.bp_len = old_len;
|
||||
if (!bp->attr.disabled)
|
||||
perf_event_enable(bp);
|
||||
|
||||
return err;
|
||||
bp->attr.disabled = 0;
|
||||
}
|
||||
|
||||
end:
|
||||
bp->attr.disabled = attr->disabled;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint);
|
||||
|
||||
@@ -850,7 +850,7 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
|
||||
* This code is triggered unconditionally. Check the affinity
|
||||
* mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
|
||||
*/
|
||||
if (desc->irq_common_data.affinity)
|
||||
if (cpumask_available(desc->irq_common_data.affinity))
|
||||
cpumask_copy(mask, desc->irq_common_data.affinity);
|
||||
else
|
||||
valid = false;
|
||||
|
||||
@@ -125,7 +125,7 @@ static void *alloc_insn_page(void)
|
||||
return module_alloc(PAGE_SIZE);
|
||||
}
|
||||
|
||||
static void free_insn_page(void *page)
|
||||
void __weak free_insn_page(void *page)
|
||||
{
|
||||
module_memfree(page);
|
||||
}
|
||||
|
||||
@@ -1911,6 +1911,9 @@ static void frob_writable_data(const struct module_layout *layout,
|
||||
/* livepatching wants to disable read-only so it can frob module. */
|
||||
void module_disable_ro(const struct module *mod)
|
||||
{
|
||||
if (!rodata_enabled)
|
||||
return;
|
||||
|
||||
frob_text(&mod->core_layout, set_memory_rw);
|
||||
frob_rodata(&mod->core_layout, set_memory_rw);
|
||||
frob_ro_after_init(&mod->core_layout, set_memory_rw);
|
||||
@@ -1920,6 +1923,9 @@ void module_disable_ro(const struct module *mod)
|
||||
|
||||
void module_enable_ro(const struct module *mod, bool after_init)
|
||||
{
|
||||
if (!rodata_enabled)
|
||||
return;
|
||||
|
||||
frob_text(&mod->core_layout, set_memory_ro);
|
||||
frob_rodata(&mod->core_layout, set_memory_ro);
|
||||
frob_text(&mod->init_layout, set_memory_ro);
|
||||
@@ -1952,6 +1958,9 @@ void set_all_modules_text_rw(void)
|
||||
{
|
||||
struct module *mod;
|
||||
|
||||
if (!rodata_enabled)
|
||||
return;
|
||||
|
||||
mutex_lock(&module_mutex);
|
||||
list_for_each_entry_rcu(mod, &modules, list) {
|
||||
if (mod->state == MODULE_STATE_UNFORMED)
|
||||
@@ -1968,6 +1977,9 @@ void set_all_modules_text_ro(void)
|
||||
{
|
||||
struct module *mod;
|
||||
|
||||
if (!rodata_enabled)
|
||||
return;
|
||||
|
||||
mutex_lock(&module_mutex);
|
||||
list_for_each_entry_rcu(mod, &modules, list) {
|
||||
if (mod->state == MODULE_STATE_UNFORMED)
|
||||
@@ -1981,10 +1993,12 @@ void set_all_modules_text_ro(void)
|
||||
|
||||
static void disable_ro_nx(const struct module_layout *layout)
|
||||
{
|
||||
frob_text(layout, set_memory_rw);
|
||||
frob_rodata(layout, set_memory_rw);
|
||||
if (rodata_enabled) {
|
||||
frob_text(layout, set_memory_rw);
|
||||
frob_rodata(layout, set_memory_rw);
|
||||
frob_ro_after_init(layout, set_memory_rw);
|
||||
}
|
||||
frob_rodata(layout, set_memory_x);
|
||||
frob_ro_after_init(layout, set_memory_rw);
|
||||
frob_ro_after_init(layout, set_memory_x);
|
||||
frob_writable_data(layout, set_memory_x);
|
||||
}
|
||||
|
||||
13
mm/vmscan.c
13
mm/vmscan.c
@@ -2966,7 +2966,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
|
||||
unsigned long nr_reclaimed;
|
||||
struct scan_control sc = {
|
||||
.nr_to_reclaim = SWAP_CLUSTER_MAX,
|
||||
.gfp_mask = (gfp_mask = memalloc_noio_flags(gfp_mask)),
|
||||
.gfp_mask = memalloc_noio_flags(gfp_mask),
|
||||
.reclaim_idx = gfp_zone(gfp_mask),
|
||||
.order = order,
|
||||
.nodemask = nodemask,
|
||||
@@ -2981,12 +2981,12 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
|
||||
* 1 is returned so that the page allocator does not OOM kill at this
|
||||
* point.
|
||||
*/
|
||||
if (throttle_direct_reclaim(gfp_mask, zonelist, nodemask))
|
||||
if (throttle_direct_reclaim(sc.gfp_mask, zonelist, nodemask))
|
||||
return 1;
|
||||
|
||||
trace_mm_vmscan_direct_reclaim_begin(order,
|
||||
sc.may_writepage,
|
||||
gfp_mask,
|
||||
sc.gfp_mask,
|
||||
sc.reclaim_idx);
|
||||
|
||||
nr_reclaimed = do_try_to_free_pages(zonelist, &sc);
|
||||
@@ -3749,16 +3749,15 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
|
||||
const unsigned long nr_pages = 1 << order;
|
||||
struct task_struct *p = current;
|
||||
struct reclaim_state reclaim_state;
|
||||
int classzone_idx = gfp_zone(gfp_mask);
|
||||
struct scan_control sc = {
|
||||
.nr_to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX),
|
||||
.gfp_mask = (gfp_mask = memalloc_noio_flags(gfp_mask)),
|
||||
.gfp_mask = memalloc_noio_flags(gfp_mask),
|
||||
.order = order,
|
||||
.priority = NODE_RECLAIM_PRIORITY,
|
||||
.may_writepage = !!(node_reclaim_mode & RECLAIM_WRITE),
|
||||
.may_unmap = !!(node_reclaim_mode & RECLAIM_UNMAP),
|
||||
.may_swap = 1,
|
||||
.reclaim_idx = classzone_idx,
|
||||
.reclaim_idx = gfp_zone(gfp_mask),
|
||||
};
|
||||
|
||||
cond_resched();
|
||||
@@ -3768,7 +3767,7 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
|
||||
* and RECLAIM_UNMAP.
|
||||
*/
|
||||
p->flags |= PF_MEMALLOC | PF_SWAPWRITE;
|
||||
lockdep_set_current_reclaim_state(gfp_mask);
|
||||
lockdep_set_current_reclaim_state(sc.gfp_mask);
|
||||
reclaim_state.reclaimed_slab = 0;
|
||||
p->reclaim_state = &reclaim_state;
|
||||
|
||||
|
||||
@@ -2233,8 +2233,14 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||
else
|
||||
sec_level = authreq_to_seclevel(auth);
|
||||
|
||||
if (smp_sufficient_security(hcon, sec_level, SMP_USE_LTK))
|
||||
if (smp_sufficient_security(hcon, sec_level, SMP_USE_LTK)) {
|
||||
/* If link is already encrypted with sufficient security we
|
||||
* still need refresh encryption as per Core Spec 5.0 Vol 3,
|
||||
* Part H 2.4.6
|
||||
*/
|
||||
smp_ltk_encrypt(conn, hcon->sec_level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sec_level > hcon->pending_sec_level)
|
||||
hcon->pending_sec_level = sec_level;
|
||||
|
||||
@@ -177,6 +177,28 @@ static bool poolsize_invalid(const struct ebt_mac_wormhash *w)
|
||||
return w && w->poolsize >= (INT_MAX / sizeof(struct ebt_mac_wormhash_tuple));
|
||||
}
|
||||
|
||||
static bool wormhash_offset_invalid(int off, unsigned int len)
|
||||
{
|
||||
if (off == 0) /* not present */
|
||||
return false;
|
||||
|
||||
if (off < (int)sizeof(struct ebt_among_info) ||
|
||||
off % __alignof__(struct ebt_mac_wormhash))
|
||||
return true;
|
||||
|
||||
off += sizeof(struct ebt_mac_wormhash);
|
||||
|
||||
return off > len;
|
||||
}
|
||||
|
||||
static bool wormhash_sizes_valid(const struct ebt_mac_wormhash *wh, int a, int b)
|
||||
{
|
||||
if (a == 0)
|
||||
a = sizeof(struct ebt_among_info);
|
||||
|
||||
return ebt_mac_wormhash_size(wh) + a == b;
|
||||
}
|
||||
|
||||
static int ebt_among_mt_check(const struct xt_mtchk_param *par)
|
||||
{
|
||||
const struct ebt_among_info *info = par->matchinfo;
|
||||
@@ -189,6 +211,10 @@ static int ebt_among_mt_check(const struct xt_mtchk_param *par)
|
||||
if (expected_length > em->match_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (wormhash_offset_invalid(info->wh_dst_ofs, em->match_size) ||
|
||||
wormhash_offset_invalid(info->wh_src_ofs, em->match_size))
|
||||
return -EINVAL;
|
||||
|
||||
wh_dst = ebt_among_wh_dst(info);
|
||||
if (poolsize_invalid(wh_dst))
|
||||
return -EINVAL;
|
||||
@@ -201,6 +227,14 @@ static int ebt_among_mt_check(const struct xt_mtchk_param *par)
|
||||
if (poolsize_invalid(wh_src))
|
||||
return -EINVAL;
|
||||
|
||||
if (info->wh_src_ofs < info->wh_dst_ofs) {
|
||||
if (!wormhash_sizes_valid(wh_src, info->wh_src_ofs, info->wh_dst_ofs))
|
||||
return -EINVAL;
|
||||
} else {
|
||||
if (!wormhash_sizes_valid(wh_dst, info->wh_dst_ofs, info->wh_src_ofs))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
expected_length += ebt_mac_wormhash_size(wh_src);
|
||||
|
||||
if (em->match_size != EBT_ALIGN(expected_length)) {
|
||||
|
||||
@@ -252,16 +252,16 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
|
||||
if (set_h245_addr(skb, protoff, data, dataoff, taddr,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons((port & htons(1)) ? nated_port + 1 :
|
||||
nated_port)) == 0) {
|
||||
/* Save ports */
|
||||
info->rtp_port[i][dir] = rtp_port;
|
||||
info->rtp_port[i][!dir] = htons(nated_port);
|
||||
} else {
|
||||
nated_port))) {
|
||||
nf_ct_unexpect_related(rtp_exp);
|
||||
nf_ct_unexpect_related(rtcp_exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Save ports */
|
||||
info->rtp_port[i][dir] = rtp_port;
|
||||
info->rtp_port[i][!dir] = htons(nated_port);
|
||||
|
||||
/* Success */
|
||||
pr_debug("nf_nat_h323: expect RTP %pI4:%hu->%pI4:%hu\n",
|
||||
&rtp_exp->tuple.src.u3.ip,
|
||||
@@ -370,15 +370,15 @@ static int nat_h245(struct sk_buff *skb, struct nf_conn *ct,
|
||||
/* Modify signal */
|
||||
if (set_h225_addr(skb, protoff, data, dataoff, taddr,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons(nated_port)) == 0) {
|
||||
/* Save ports */
|
||||
info->sig_port[dir] = port;
|
||||
info->sig_port[!dir] = htons(nated_port);
|
||||
} else {
|
||||
htons(nated_port))) {
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Save ports */
|
||||
info->sig_port[dir] = port;
|
||||
info->sig_port[!dir] = htons(nated_port);
|
||||
|
||||
pr_debug("nf_nat_q931: expect H.245 %pI4:%hu->%pI4:%hu\n",
|
||||
&exp->tuple.src.u3.ip,
|
||||
ntohs(exp->tuple.src.u.tcp.port),
|
||||
@@ -462,24 +462,27 @@ static int nat_q931(struct sk_buff *skb, struct nf_conn *ct,
|
||||
/* Modify signal */
|
||||
if (set_h225_addr(skb, protoff, data, 0, &taddr[idx],
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons(nated_port)) == 0) {
|
||||
/* Save ports */
|
||||
info->sig_port[dir] = port;
|
||||
info->sig_port[!dir] = htons(nated_port);
|
||||
|
||||
/* Fix for Gnomemeeting */
|
||||
if (idx > 0 &&
|
||||
get_h225_addr(ct, *data, &taddr[0], &addr, &port) &&
|
||||
(ntohl(addr.ip) & 0xff000000) == 0x7f000000) {
|
||||
set_h225_addr(skb, protoff, data, 0, &taddr[0],
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
info->sig_port[!dir]);
|
||||
}
|
||||
} else {
|
||||
htons(nated_port))) {
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Save ports */
|
||||
info->sig_port[dir] = port;
|
||||
info->sig_port[!dir] = htons(nated_port);
|
||||
|
||||
/* Fix for Gnomemeeting */
|
||||
if (idx > 0 &&
|
||||
get_h225_addr(ct, *data, &taddr[0], &addr, &port) &&
|
||||
(ntohl(addr.ip) & 0xff000000) == 0x7f000000) {
|
||||
if (set_h225_addr(skb, protoff, data, 0, &taddr[0],
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
info->sig_port[!dir])) {
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Success */
|
||||
pr_debug("nf_nat_ras: expect Q.931 %pI4:%hu->%pI4:%hu\n",
|
||||
&exp->tuple.src.u3.ip,
|
||||
@@ -550,9 +553,9 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
|
||||
}
|
||||
|
||||
/* Modify signal */
|
||||
if (!set_h225_addr(skb, protoff, data, dataoff, taddr,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons(nated_port)) == 0) {
|
||||
if (set_h225_addr(skb, protoff, data, dataoff, taddr,
|
||||
&ct->tuplehash[!dir].tuple.dst.u3,
|
||||
htons(nated_port))) {
|
||||
nf_ct_unexpect_related(exp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -626,7 +626,6 @@ static void vti6_link_config(struct ip6_tnl *t)
|
||||
{
|
||||
struct net_device *dev = t->dev;
|
||||
struct __ip6_tnl_parm *p = &t->parms;
|
||||
struct net_device *tdev = NULL;
|
||||
|
||||
memcpy(dev->dev_addr, &p->laddr, sizeof(struct in6_addr));
|
||||
memcpy(dev->broadcast, &p->raddr, sizeof(struct in6_addr));
|
||||
@@ -639,25 +638,6 @@ static void vti6_link_config(struct ip6_tnl *t)
|
||||
dev->flags |= IFF_POINTOPOINT;
|
||||
else
|
||||
dev->flags &= ~IFF_POINTOPOINT;
|
||||
|
||||
if (p->flags & IP6_TNL_F_CAP_XMIT) {
|
||||
int strict = (ipv6_addr_type(&p->raddr) &
|
||||
(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL));
|
||||
struct rt6_info *rt = rt6_lookup(t->net,
|
||||
&p->raddr, &p->laddr,
|
||||
p->link, strict);
|
||||
|
||||
if (rt)
|
||||
tdev = rt->dst.dev;
|
||||
ip6_rt_put(rt);
|
||||
}
|
||||
|
||||
if (!tdev && p->link)
|
||||
tdev = __dev_get_by_index(t->net, p->link);
|
||||
|
||||
if (tdev)
|
||||
dev->mtu = max_t(int, tdev->mtu - dev->hard_header_len,
|
||||
IPV6_MIN_MTU);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -427,7 +427,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
cfg80211_chandef_create(&chandef, cbss->channel,
|
||||
NL80211_CHAN_WIDTH_20_NOHT);
|
||||
NL80211_CHAN_NO_HT);
|
||||
chandef.width = sdata->u.ibss.chandef.width;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
@@ -439,7 +439,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
default:
|
||||
/* fall back to 20 MHz for unsupported modes */
|
||||
cfg80211_chandef_create(&chandef, cbss->channel,
|
||||
NL80211_CHAN_WIDTH_20_NOHT);
|
||||
NL80211_CHAN_NO_HT);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,9 +173,11 @@ ieee80211_rate_control_ops_get(const char *name)
|
||||
/* try default if specific alg requested but not found */
|
||||
ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo);
|
||||
|
||||
/* try built-in one if specific alg requested but not found */
|
||||
if (!ops && strlen(CONFIG_MAC80211_RC_DEFAULT))
|
||||
/* Note: check for > 0 is intentional to avoid clang warning */
|
||||
if (!ops && (strlen(CONFIG_MAC80211_RC_DEFAULT) > 0))
|
||||
/* try built-in one if specific alg requested but not found */
|
||||
ops = ieee80211_try_rate_control_ops_get(CONFIG_MAC80211_RC_DEFAULT);
|
||||
|
||||
kernel_param_unlock(THIS_MODULE);
|
||||
|
||||
return ops;
|
||||
|
||||
@@ -1008,9 +1008,8 @@ static const struct nla_policy tuple_nla_policy[CTA_TUPLE_MAX+1] = {
|
||||
|
||||
static int
|
||||
ctnetlink_parse_tuple(const struct nlattr * const cda[],
|
||||
struct nf_conntrack_tuple *tuple,
|
||||
enum ctattr_type type, u_int8_t l3num,
|
||||
struct nf_conntrack_zone *zone)
|
||||
struct nf_conntrack_tuple *tuple, u32 type,
|
||||
u_int8_t l3num, struct nf_conntrack_zone *zone)
|
||||
{
|
||||
struct nlattr *tb[CTA_TUPLE_MAX+1];
|
||||
int err;
|
||||
@@ -2409,7 +2408,7 @@ static struct nfnl_ct_hook ctnetlink_glue_hook = {
|
||||
|
||||
static int ctnetlink_exp_dump_tuple(struct sk_buff *skb,
|
||||
const struct nf_conntrack_tuple *tuple,
|
||||
enum ctattr_expect type)
|
||||
u32 type)
|
||||
{
|
||||
struct nlattr *nest_parms;
|
||||
|
||||
|
||||
@@ -367,6 +367,36 @@ textify_hooks(char *buf, size_t size, unsigned int mask, uint8_t nfproto)
|
||||
return buf;
|
||||
}
|
||||
|
||||
/**
|
||||
* xt_check_proc_name - check that name is suitable for /proc file creation
|
||||
*
|
||||
* @name: file name candidate
|
||||
* @size: length of buffer
|
||||
*
|
||||
* some x_tables modules wish to create a file in /proc.
|
||||
* This function makes sure that the name is suitable for this
|
||||
* purpose, it checks that name is NUL terminated and isn't a 'special'
|
||||
* name, like "..".
|
||||
*
|
||||
* returns negative number on error or 0 if name is useable.
|
||||
*/
|
||||
int xt_check_proc_name(const char *name, unsigned int size)
|
||||
{
|
||||
if (name[0] == '\0')
|
||||
return -EINVAL;
|
||||
|
||||
if (strnlen(name, size) == size)
|
||||
return -ENAMETOOLONG;
|
||||
|
||||
if (strcmp(name, ".") == 0 ||
|
||||
strcmp(name, "..") == 0 ||
|
||||
strchr(name, '/'))
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(xt_check_proc_name);
|
||||
|
||||
int xt_check_match(struct xt_mtchk_param *par,
|
||||
unsigned int size, u_int8_t proto, bool inv_proto)
|
||||
{
|
||||
|
||||
@@ -794,8 +794,9 @@ static int hashlimit_mt_check_v1(const struct xt_mtchk_param *par)
|
||||
struct hashlimit_cfg2 cfg = {};
|
||||
int ret;
|
||||
|
||||
if (info->name[sizeof(info->name) - 1] != '\0')
|
||||
return -EINVAL;
|
||||
ret = xt_check_proc_name(info->name, sizeof(info->name));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = cfg_copy(&cfg, (void *)&info->cfg, 1);
|
||||
|
||||
@@ -809,9 +810,11 @@ static int hashlimit_mt_check_v1(const struct xt_mtchk_param *par)
|
||||
static int hashlimit_mt_check(const struct xt_mtchk_param *par)
|
||||
{
|
||||
struct xt_hashlimit_mtinfo2 *info = par->matchinfo;
|
||||
int ret;
|
||||
|
||||
if (info->name[sizeof(info->name) - 1] != '\0')
|
||||
return -EINVAL;
|
||||
ret = xt_check_proc_name(info->name, sizeof(info->name));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return hashlimit_mt_check_common(par, &info->hinfo, &info->cfg,
|
||||
info->name, 2);
|
||||
|
||||
@@ -361,9 +361,9 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
|
||||
info->hit_count, XT_RECENT_MAX_NSTAMPS - 1);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (info->name[0] == '\0' ||
|
||||
strnlen(info->name, XT_RECENT_NAME_LEN) == XT_RECENT_NAME_LEN)
|
||||
return -EINVAL;
|
||||
ret = xt_check_proc_name(info->name, sizeof(info->name));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (ip_pkt_list_tot && info->hit_count < ip_pkt_list_tot)
|
||||
nstamp_mask = roundup_pow_of_two(ip_pkt_list_tot) - 1;
|
||||
|
||||
@@ -4081,7 +4081,7 @@ static bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info,
|
||||
struct nlattr *rate;
|
||||
u32 bitrate;
|
||||
u16 bitrate_compat;
|
||||
enum nl80211_attrs rate_flg;
|
||||
enum nl80211_rate_info rate_flg;
|
||||
|
||||
rate = nla_nest_start(msg, attr);
|
||||
if (!rate)
|
||||
|
||||
@@ -663,7 +663,7 @@ __ieee80211_amsdu_copy_frag(struct sk_buff *skb, struct sk_buff *frame,
|
||||
int offset, int len)
|
||||
{
|
||||
struct skb_shared_info *sh = skb_shinfo(skb);
|
||||
const skb_frag_t *frag = &sh->frags[-1];
|
||||
const skb_frag_t *frag = &sh->frags[0];
|
||||
struct page *frag_page;
|
||||
void *frag_ptr;
|
||||
int frag_len, frag_size;
|
||||
@@ -676,10 +676,10 @@ __ieee80211_amsdu_copy_frag(struct sk_buff *skb, struct sk_buff *frame,
|
||||
|
||||
while (offset >= frag_size) {
|
||||
offset -= frag_size;
|
||||
frag++;
|
||||
frag_page = skb_frag_page(frag);
|
||||
frag_ptr = skb_frag_address(frag);
|
||||
frag_size = skb_frag_size(frag);
|
||||
frag++;
|
||||
}
|
||||
|
||||
frag_ptr += offset;
|
||||
@@ -691,12 +691,12 @@ __ieee80211_amsdu_copy_frag(struct sk_buff *skb, struct sk_buff *frame,
|
||||
len -= cur_len;
|
||||
|
||||
while (len > 0) {
|
||||
frag++;
|
||||
frag_len = skb_frag_size(frag);
|
||||
cur_len = min(len, frag_len);
|
||||
__frame_add_frag(frame, skb_frag_page(frag),
|
||||
skb_frag_address(frag), cur_len, frag_len);
|
||||
len -= cur_len;
|
||||
frag++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ static struct crypto_comp * __percpu *ipcomp_alloc_tfms(const char *alg_name)
|
||||
struct crypto_comp *tfm;
|
||||
|
||||
/* This can be any valid CPU ID so we don't need locking. */
|
||||
tfm = __this_cpu_read(*pos->tfms);
|
||||
tfm = this_cpu_read(*pos->tfms);
|
||||
|
||||
if (!strcmp(crypto_comp_name(tfm), alg_name)) {
|
||||
pos->users++;
|
||||
|
||||
@@ -1883,6 +1883,11 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen
|
||||
struct xfrm_mgr *km;
|
||||
struct xfrm_policy *pol = NULL;
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
if (in_compat_syscall())
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
|
||||
if (!optval && !optlen) {
|
||||
xfrm_sk_policy_insert(sk, XFRM_POLICY_IN, NULL);
|
||||
xfrm_sk_policy_insert(sk, XFRM_POLICY_OUT, NULL);
|
||||
|
||||
@@ -121,22 +121,17 @@ static inline int verify_replay(struct xfrm_usersa_info *p,
|
||||
struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL];
|
||||
struct xfrm_replay_state_esn *rs;
|
||||
|
||||
if (p->flags & XFRM_STATE_ESN) {
|
||||
if (!rt)
|
||||
return -EINVAL;
|
||||
|
||||
rs = nla_data(rt);
|
||||
|
||||
if (rs->bmp_len > XFRMA_REPLAY_ESN_MAX / sizeof(rs->bmp[0]) / 8)
|
||||
return -EINVAL;
|
||||
|
||||
if (nla_len(rt) < xfrm_replay_state_esn_len(rs) &&
|
||||
nla_len(rt) != sizeof(*rs))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!rt)
|
||||
return 0;
|
||||
return (p->flags & XFRM_STATE_ESN) ? -EINVAL : 0;
|
||||
|
||||
rs = nla_data(rt);
|
||||
|
||||
if (rs->bmp_len > XFRMA_REPLAY_ESN_MAX / sizeof(rs->bmp[0]) / 8)
|
||||
return -EINVAL;
|
||||
|
||||
if (nla_len(rt) < xfrm_replay_state_esn_len(rs) &&
|
||||
nla_len(rt) != sizeof(*rs))
|
||||
return -EINVAL;
|
||||
|
||||
/* As only ESP and AH support ESN feature. */
|
||||
if ((p->id.proto != IPPROTO_ESP) && (p->id.proto != IPPROTO_AH))
|
||||
|
||||
@@ -407,18 +407,6 @@ static void superblock_free_security(struct super_block *sb)
|
||||
kfree(sbsec);
|
||||
}
|
||||
|
||||
/* The file system's label must be initialized prior to use. */
|
||||
|
||||
static const char *labeling_behaviors[7] = {
|
||||
"uses xattr",
|
||||
"uses transition SIDs",
|
||||
"uses task SIDs",
|
||||
"uses genfs_contexts",
|
||||
"not configured for labeling",
|
||||
"uses mountpoint labeling",
|
||||
"uses native labeling",
|
||||
};
|
||||
|
||||
static inline int inode_doinit(struct inode *inode)
|
||||
{
|
||||
return inode_doinit_with_dentry(inode, NULL);
|
||||
@@ -530,10 +518,6 @@ static int sb_finish_set_opts(struct super_block *sb)
|
||||
}
|
||||
}
|
||||
|
||||
if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
|
||||
printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
|
||||
sb->s_id, sb->s_type->name);
|
||||
|
||||
sbsec->flags |= SE_SBINITIALIZED;
|
||||
if (selinux_is_sblabel_mnt(sb))
|
||||
sbsec->flags |= SBLABEL_MNT;
|
||||
|
||||
@@ -155,7 +155,7 @@ static int selinux_set_mapping(struct policydb *pol,
|
||||
}
|
||||
|
||||
k = 0;
|
||||
while (p_in->perms && p_in->perms[k]) {
|
||||
while (p_in->perms[k]) {
|
||||
/* An empty permission string skips ahead */
|
||||
if (!*p_in->perms[k]) {
|
||||
k++;
|
||||
|
||||
@@ -1361,7 +1361,7 @@ static ssize_t snd_pcm_oss_write2(struct snd_pcm_substream *substream, const cha
|
||||
static ssize_t snd_pcm_oss_write1(struct snd_pcm_substream *substream, const char __user *buf, size_t bytes)
|
||||
{
|
||||
size_t xfer = 0;
|
||||
ssize_t tmp;
|
||||
ssize_t tmp = 0;
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
|
||||
if (atomic_read(&substream->mmap_count))
|
||||
@@ -1468,7 +1468,7 @@ static ssize_t snd_pcm_oss_read2(struct snd_pcm_substream *substream, char *buf,
|
||||
static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __user *buf, size_t bytes)
|
||||
{
|
||||
size_t xfer = 0;
|
||||
ssize_t tmp;
|
||||
ssize_t tmp = 0;
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
|
||||
if (atomic_read(&substream->mmap_count))
|
||||
|
||||
@@ -3410,7 +3410,7 @@ int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
|
||||
area,
|
||||
substream->runtime->dma_area,
|
||||
substream->runtime->dma_addr,
|
||||
area->vm_end - area->vm_start);
|
||||
substream->runtime->dma_bytes);
|
||||
#endif /* CONFIG_X86 */
|
||||
/* mmap with fault handler */
|
||||
area->vm_ops = &snd_pcm_vm_ops_data_fault;
|
||||
|
||||
@@ -1175,6 +1175,7 @@ static bool is_teac_dsd_dac(unsigned int id)
|
||||
switch (id) {
|
||||
case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */
|
||||
case USB_ID(0x0644, 0x8044): /* Esoteric D-05X */
|
||||
case USB_ID(0x0644, 0x804a): /* TEAC UD-301 */
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user