···724724F: drivers/char/apm-emulation.c725725726726APPLE BCM5974 MULTITOUCH DRIVER727727-M: Henrik Rydberg <rydberg@euromail.se>727727+M: Henrik Rydberg <rydberg@bitmath.org>728728L: linux-input@vger.kernel.org729729-S: Maintained729729+S: Odd fixes730730F: drivers/input/mouse/bcm5974.c731731732732APPLE SMC DRIVER733733-M: Henrik Rydberg <rydberg@euromail.se>733733+M: Henrik Rydberg <rydberg@bitmath.org>734734L: lm-sensors@lm-sensors.org735735-S: Maintained735735+S: Odd fixes736736F: drivers/hwmon/applesmc.c737737738738APPLETALK NETWORK LAYER···22592259BTRFS FILE SYSTEM22602260M: Chris Mason <clm@fb.com>22612261M: Josef Bacik <jbacik@fb.com>22622262+M: David Sterba <dsterba@suse.cz>22622263L: linux-btrfs@vger.kernel.org22632264W: http://btrfs.wiki.kernel.org/22642265Q: http://patchwork.kernel.org/project/linux-btrfs/list/···49414940F: include/linux/input/4942494149434942INPUT MULTITOUCH (MT) PROTOCOL49444944-M: Henrik Rydberg <rydberg@euromail.se>49434943+M: Henrik Rydberg <rydberg@bitmath.org>49454944L: linux-input@vger.kernel.org49464945T: git git://git.kernel.org/pub/scm/linux/kernel/git/rydberg/input-mt.git49474947-S: Maintained49464946+S: Odd fixes49484947F: Documentation/input/multi-touch-protocol.txt49494948F: drivers/input/input-mt.c49504949K: \b(ABS|SYN)_MT_···52795278W: www.open-iscsi.org52805279Q: http://patchwork.kernel.org/project/linux-rdma/list/52815280F: drivers/infiniband/ulp/iser/52815281+52825282+ISCSI EXTENSIONS FOR RDMA (ISER) TARGET52835283+M: Sagi Grimberg <sagig@mellanox.com>52845284+T: git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master52855285+L: linux-rdma@vger.kernel.org52865286+L: target-devel@vger.kernel.org52875287+S: Supported52885288+W: http://www.linux-iscsi.org52895289+F: drivers/infiniband/ulp/isert5282529052835291ISDN SUBSYSTEM52845292M: Karsten Keil <isdn@linux-pingi.de>
+2-1
Makefile
···11VERSION = 322PATCHLEVEL = 1933SUBLEVEL = 044-EXTRAVERSION = -rc244+EXTRAVERSION = -rc455NAME = Diseased Newt6677# *DOCUMENTATION*···391391# Needed to be compatible with the O= option392392LINUXINCLUDE := \393393 -I$(srctree)/arch/$(hdr-arch)/include \394394+ -Iarch/$(hdr-arch)/include/generated/uapi \394395 -Iarch/$(hdr-arch)/include/generated \395396 $(if $(KBUILD_SRC), -I$(srctree)/include) \396397 -Iinclude \
+1
arch/arm/include/uapi/asm/unistd.h
···413413#define __NR_getrandom (__NR_SYSCALL_BASE+384)414414#define __NR_memfd_create (__NR_SYSCALL_BASE+385)415415#define __NR_bpf (__NR_SYSCALL_BASE+386)416416+#define __NR_execveat (__NR_SYSCALL_BASE+387)416417417418/*418419 * The following SWIs are ARM private.
···31313232#include <asm/fpsimd.h>3333#include <asm/hw_breakpoint.h>3434+#include <asm/pgtable-hwdef.h>3435#include <asm/ptrace.h>3536#include <asm/types.h>3637···123122124123/* Free all resources held by a thread. */125124extern void release_thread(struct task_struct *);126126-127127-/* Prepare to copy thread state - unlazy all lazy status */128128-#define prepare_to_copy(tsk) do { } while (0)129125130126unsigned long get_wchan(struct task_struct *p);131127
···147147 * If we have AArch32, we care about 32-bit features for compat. These148148 * registers should be RES0 otherwise.149149 */150150+ diff |= CHECK(id_dfr0, boot, cur, cpu);150151 diff |= CHECK(id_isar0, boot, cur, cpu);151152 diff |= CHECK(id_isar1, boot, cur, cpu);152153 diff |= CHECK(id_isar2, boot, cur, cpu);···165164 diff |= CHECK(id_mmfr3, boot, cur, cpu);166165 diff |= CHECK(id_pfr0, boot, cur, cpu);167166 diff |= CHECK(id_pfr1, boot, cur, cpu);167167+168168+ diff |= CHECK(mvfr0, boot, cur, cpu);169169+ diff |= CHECK(mvfr1, boot, cur, cpu);170170+ diff |= CHECK(mvfr2, boot, cur, cpu);168171169172 /*170173 * Mismatched CPU features are a recipe for disaster. Don't even···194189 info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1);195190 info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1);196191192192+ info->reg_id_dfr0 = read_cpuid(ID_DFR0_EL1);197193 info->reg_id_isar0 = read_cpuid(ID_ISAR0_EL1);198194 info->reg_id_isar1 = read_cpuid(ID_ISAR1_EL1);199195 info->reg_id_isar2 = read_cpuid(ID_ISAR2_EL1);···207201 info->reg_id_mmfr3 = read_cpuid(ID_MMFR3_EL1);208202 info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1);209203 info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1);204204+205205+ info->reg_mvfr0 = read_cpuid(MVFR0_EL1);206206+ info->reg_mvfr1 = read_cpuid(MVFR1_EL1);207207+ info->reg_mvfr2 = read_cpuid(MVFR2_EL1);210208211209 cpuinfo_detect_icache_policy(info);212210
+1-1
arch/arm64/kernel/efi.c
···326326327327 /* boot time idmap_pg_dir is incomplete, so fill in missing parts */328328 efi_setup_idmap();329329+ early_memunmap(memmap.map, memmap.map_end - memmap.map);329330}330331331332static int __init remap_region(efi_memory_desc_t *md, void **new)···381380 }382381383382 mapsize = memmap.map_end - memmap.map;384384- early_memunmap(memmap.map, mapsize);385383386384 if (efi_runtime_disabled()) {387385 pr_info("EFI runtime services will be disabled.\n");
···1111121213131414-#define NR_syscalls 318 /* length of syscall table */1414+#define NR_syscalls 319 /* length of syscall table */15151616/*1717 * The following defines stop scripts/checksyscalls.sh from complaining about
···330330 * using debugger IPI.331331 */332332333333- if (crashing_cpu == -1)333333+ if (!kdump_in_progress())334334 kexec_prepare_cpus();335335336336 pr_debug("kexec: Starting switchover sequence.\n");
+1-8
arch/powerpc/kernel/smp.c
···700700 smp_store_cpu_info(cpu);701701 set_dec(tb_ticks_per_jiffy);702702 preempt_disable();703703+ cpu_callin_map[cpu] = 1;703704704705 if (smp_ops->setup_cpu)705706 smp_ops->setup_cpu(cpu);···738737 smp_wmb();739738 notify_cpu_starting(cpu);740739 set_cpu_online(cpu, true);741741-742742- /*743743- * CPU must be marked active and online before we signal back to the744744- * master, because the scheduler needs to see the cpu_online and745745- * cpu_active bits set.746746- */747747- smp_wmb();748748- cpu_callin_map[cpu] = 1;749740750741 local_irq_enable();751742
+7-1
arch/powerpc/platforms/pseries/lpar.c
···4343#include <asm/trace.h>4444#include <asm/firmware.h>4545#include <asm/plpar_wrappers.h>4646+#include <asm/kexec.h>4647#include <asm/fadump.h>47484849#include "pseries.h"···268267 * out to the user, but at least this will stop us from269268 * continuing on further and creating an even more270269 * difficult to debug situation.270270+ *271271+ * There is a known problem when kdump'ing, if cpus are offline272272+ * the above call will fail. Rather than panicking again, keep273273+ * going and hope the kdump kernel is also little endian, which274274+ * it usually is.271275 */272272- if (rc)276276+ if (rc && !kdump_in_progress())273277 panic("Could not enable big endian exceptions");274278 }275279#endif
···80808181 /*8282 * Load per CPU data from GDT. LSL is faster than RDTSCP and8383- * works on all CPUs.8383+ * works on all CPUs. This is volatile so that it orders8484+ * correctly wrt barrier() and to keep gcc from cleverly8585+ * hoisting it out of the calling function.8486 */8585- asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));8787+ asm volatile ("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));86888789 return p;8890}
+4-5
arch/x86/kernel/acpi/boot.c
···750750}751751752752/* wrapper to silence section mismatch warning */753753-int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)753753+int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)754754{755755 return _acpi_map_lsapic(handle, physid, pcpu);756756}757757-EXPORT_SYMBOL(acpi_map_lsapic);757757+EXPORT_SYMBOL(acpi_map_cpu);758758759759-int acpi_unmap_lsapic(int cpu)759759+int acpi_unmap_cpu(int cpu)760760{761761#ifdef CONFIG_ACPI_NUMA762762 set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE);···768768769769 return (0);770770}771771-772772-EXPORT_SYMBOL(acpi_unmap_lsapic);771771+EXPORT_SYMBOL(acpi_unmap_cpu);773772#endif /* CONFIG_ACPI_HOTPLUG_CPU */774773775774int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
···891891enum {892892 SNBEP_PCI_QPI_PORT0_FILTER,893893 SNBEP_PCI_QPI_PORT1_FILTER,894894+ HSWEP_PCI_PCU_3,894895};895896896897static int snbep_qpi_hw_config(struct intel_uncore_box *box, struct perf_event *event)···20272026{20282027 if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)20292028 hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;20292029+20302030+ /* Detect 6-8 core systems with only two SBOXes */20312031+ if (uncore_extra_pci_dev[0][HSWEP_PCI_PCU_3]) {20322032+ u32 capid4;20332033+20342034+ pci_read_config_dword(uncore_extra_pci_dev[0][HSWEP_PCI_PCU_3],20352035+ 0x94, &capid4);20362036+ if (((capid4 >> 6) & 0x3) == 0)20372037+ hswep_uncore_sbox.num_boxes = 2;20382038+ }20392039+20302040 uncore_msr_uncores = hswep_msr_uncores;20312041}20322042···22982286 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2f96),22992287 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,23002288 SNBEP_PCI_QPI_PORT1_FILTER),22892289+ },22902290+ { /* PCU.3 (for Capability registers) */22912291+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2fc0),22922292+ .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,22932293+ HSWEP_PCI_PCU_3),23012294 },23022295 { /* end: all zeroes */ }23032296};
+90
arch/x86/kernel/perf_regs.c
···7878{7979 return PERF_SAMPLE_REGS_ABI_32;8080}8181+8282+void perf_get_regs_user(struct perf_regs *regs_user,8383+ struct pt_regs *regs,8484+ struct pt_regs *regs_user_copy)8585+{8686+ regs_user->regs = task_pt_regs(current);8787+ regs_user->abi = perf_reg_abi(current);8888+}8189#else /* CONFIG_X86_64 */8290#define REG_NOSUPPORT ((1ULL << PERF_REG_X86_DS) | \8391 (1ULL << PERF_REG_X86_ES) | \···109101 return PERF_SAMPLE_REGS_ABI_32;110102 else111103 return PERF_SAMPLE_REGS_ABI_64;104104+}105105+106106+void perf_get_regs_user(struct perf_regs *regs_user,107107+ struct pt_regs *regs,108108+ struct pt_regs *regs_user_copy)109109+{110110+ struct pt_regs *user_regs = task_pt_regs(current);111111+112112+ /*113113+ * If we're in an NMI that interrupted task_pt_regs setup, then114114+ * we can't sample user regs at all. This check isn't really115115+ * sufficient, though, as we could be in an NMI inside an interrupt116116+ * that happened during task_pt_regs setup.117117+ */118118+ if (regs->sp > (unsigned long)&user_regs->r11 &&119119+ regs->sp <= (unsigned long)(user_regs + 1)) {120120+ regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE;121121+ regs_user->regs = NULL;122122+ return;123123+ }124124+125125+ /*126126+ * RIP, flags, and the argument registers are usually saved.127127+ * orig_ax is probably okay, too.128128+ */129129+ regs_user_copy->ip = user_regs->ip;130130+ regs_user_copy->cx = user_regs->cx;131131+ regs_user_copy->dx = user_regs->dx;132132+ regs_user_copy->si = user_regs->si;133133+ regs_user_copy->di = user_regs->di;134134+ regs_user_copy->r8 = user_regs->r8;135135+ regs_user_copy->r9 = user_regs->r9;136136+ regs_user_copy->r10 = user_regs->r10;137137+ regs_user_copy->r11 = user_regs->r11;138138+ regs_user_copy->orig_ax = user_regs->orig_ax;139139+ regs_user_copy->flags = user_regs->flags;140140+141141+ /*142142+ * Don't even try to report the "rest" regs.143143+ */144144+ regs_user_copy->bx = -1;145145+ regs_user_copy->bp = -1;146146+ regs_user_copy->r12 = -1;147147+ regs_user_copy->r13 = -1;148148+ regs_user_copy->r14 = -1;149149+ regs_user_copy->r15 = -1;150150+151151+ /*152152+ * For this to be at all useful, we need a reasonable guess for153153+ * sp and the ABI. Be careful: we're in NMI context, and we're154154+ * considering current to be the current task, so we should155155+ * be careful not to look at any other percpu variables that might156156+ * change during context switches.157157+ */158158+ if (IS_ENABLED(CONFIG_IA32_EMULATION) &&159159+ task_thread_info(current)->status & TS_COMPAT) {160160+ /* Easy case: we're in a compat syscall. */161161+ regs_user->abi = PERF_SAMPLE_REGS_ABI_32;162162+ regs_user_copy->sp = user_regs->sp;163163+ regs_user_copy->cs = user_regs->cs;164164+ regs_user_copy->ss = user_regs->ss;165165+ } else if (user_regs->orig_ax != -1) {166166+ /*167167+ * We're probably in a 64-bit syscall.168168+ * Warning: this code is severely racy. At least it's better169169+ * than just blindly copying user_regs.170170+ */171171+ regs_user->abi = PERF_SAMPLE_REGS_ABI_64;172172+ regs_user_copy->sp = this_cpu_read(old_rsp);173173+ regs_user_copy->cs = __USER_CS;174174+ regs_user_copy->ss = __USER_DS;175175+ regs_user_copy->cx = -1; /* usually contains garbage */176176+ } else {177177+ /* We're probably in an interrupt or exception. */178178+ regs_user->abi = user_64bit_mode(user_regs) ?179179+ PERF_SAMPLE_REGS_ABI_64 : PERF_SAMPLE_REGS_ABI_32;180180+ regs_user_copy->sp = user_regs->sp;181181+ regs_user_copy->cs = user_regs->cs;182182+ regs_user_copy->ss = user_regs->ss;183183+ }184184+185185+ regs_user->regs = regs_user_copy;112186}113187#endif /* CONFIG_X86_32 */
+1-1
arch/x86/lib/insn.c
···28282929/* Verify next sizeof(t) bytes can be on the same instruction */3030#define validate_next(t, insn, n) \3131- ((insn)->next_byte + sizeof(t) + n < (insn)->end_kaddr)3131+ ((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)32323333#define __get_next(t, insn) \3434 ({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
+17-20
arch/x86/mm/init.c
···438438static unsigned long __init get_new_step_size(unsigned long step_size)439439{440440 /*441441- * Explain why we shift by 5 and why we don't have to worry about442442- * 'step_size << 5' overflowing:443443- *444444- * initial mapped size is PMD_SIZE (2M).441441+ * Initial mapped size is PMD_SIZE (2M).445442 * We can not set step_size to be PUD_SIZE (1G) yet.446443 * In worse case, when we cross the 1G boundary, and447444 * PG_LEVEL_2M is not set, we will need 1+1+512 pages (2M + 8k)448448- * to map 1G range with PTE. Use 5 as shift for now.445445+ * to map 1G range with PTE. Hence we use one less than the446446+ * difference of page table level shifts.449447 *450450- * Don't need to worry about overflow, on 32bit, when step_size451451- * is 0, round_down() returns 0 for start, and that turns it452452- * into 0x100000000ULL.448448+ * Don't need to worry about overflow in the top-down case, on 32bit,449449+ * when step_size is 0, round_down() returns 0 for start, and that450450+ * turns it into 0x100000000ULL.451451+ * In the bottom-up case, round_up(x, 0) returns 0 though too, which452452+ * needs to be taken into consideration by the code below.453453 */454454- return step_size << 5;454454+ return step_size << (PMD_SHIFT - PAGE_SHIFT - 1);455455}456456457457/**···471471 unsigned long step_size;472472 unsigned long addr;473473 unsigned long mapped_ram_size = 0;474474- unsigned long new_mapped_ram_size;475474476475 /* xen has big range in reserved near end of ram, skip it at first.*/477476 addr = memblock_find_in_range(map_start, map_end, PMD_SIZE, PMD_SIZE);···495496 start = map_start;496497 } else497498 start = map_start;498498- new_mapped_ram_size = init_range_memory_mapping(start,499499+ mapped_ram_size += init_range_memory_mapping(start,499500 last_start);500501 last_start = start;501502 min_pfn_mapped = last_start >> PAGE_SHIFT;502502- /* only increase step_size after big range get mapped */503503- if (new_mapped_ram_size > mapped_ram_size)503503+ if (mapped_ram_size >= step_size)504504 step_size = get_new_step_size(step_size);505505- mapped_ram_size += new_mapped_ram_size;506505 }507506508507 if (real_end < map_end)···521524static void __init memory_map_bottom_up(unsigned long map_start,522525 unsigned long map_end)523526{524524- unsigned long next, new_mapped_ram_size, start;527527+ unsigned long next, start;525528 unsigned long mapped_ram_size = 0;526529 /* step_size need to be small so pgt_buf from BRK could cover it */527530 unsigned long step_size = PMD_SIZE;···536539 * for page table.537540 */538541 while (start < map_end) {539539- if (map_end - start > step_size) {542542+ if (step_size && map_end - start > step_size) {540543 next = round_up(start + 1, step_size);541544 if (next > map_end)542545 next = map_end;543543- } else546546+ } else {544547 next = map_end;548548+ }545549546546- new_mapped_ram_size = init_range_memory_mapping(start, next);550550+ mapped_ram_size += init_range_memory_mapping(start, next);547551 start = next;548552549549- if (new_mapped_ram_size > mapped_ram_size)553553+ if (mapped_ram_size >= step_size)550554 step_size = get_new_step_size(step_size);551551- mapped_ram_size += new_mapped_ram_size;552555 }553556}554557
+29-16
arch/x86/vdso/vma.c
···41414242struct linux_binprm;43434444-/* Put the vdso above the (randomized) stack with another randomized offset.4545- This way there is no hole in the middle of address space.4646- To save memory make sure it is still in the same PTE as the stack top.4747- This doesn't give that many random bits.4848-4949- Only used for the 64-bit and x32 vdsos. */4444+/*4545+ * Put the vdso above the (randomized) stack with another randomized4646+ * offset. This way there is no hole in the middle of address space.4747+ * To save memory make sure it is still in the same PTE as the stack4848+ * top. This doesn't give that many random bits.4949+ *5050+ * Note that this algorithm is imperfect: the distribution of the vdso5151+ * start address within a PMD is biased toward the end.5252+ *5353+ * Only used for the 64-bit and x32 vdsos.5454+ */5055static unsigned long vdso_addr(unsigned long start, unsigned len)5156{5257#ifdef CONFIG_X86_32···5954#else6055 unsigned long addr, end;6156 unsigned offset;6262- end = (start + PMD_SIZE - 1) & PMD_MASK;5757+5858+ /*5959+ * Round up the start address. It can start out unaligned as a result6060+ * of stack start randomization.6161+ */6262+ start = PAGE_ALIGN(start);6363+6464+ /* Round the lowest possible end address up to a PMD boundary. */6565+ end = (start + len + PMD_SIZE - 1) & PMD_MASK;6366 if (end >= TASK_SIZE_MAX)6467 end = TASK_SIZE_MAX;6568 end -= len;6666- /* This loses some more bits than a modulo, but is cheaper */6767- offset = get_random_int() & (PTRS_PER_PTE - 1);6868- addr = start + (offset << PAGE_SHIFT);6969- if (addr >= end)7070- addr = end;6969+7070+ if (end > start) {7171+ offset = get_random_int() % (((end - start) >> PAGE_SHIFT) + 1);7272+ addr = start + (offset << PAGE_SHIFT);7373+ } else {7474+ addr = start;7575+ }71767277 /*7373- * page-align it here so that get_unmapped_area doesn't7474- * align it wrongfully again to the next page. addr can come in 4K7575- * unaligned here as a result of stack start randomization.7878+ * Forcibly align the final address in case we have a hardware7979+ * issue that requires alignment for performance reasons.7680 */7777- addr = PAGE_ALIGN(addr);7881 addr = align_vdso_addr(addr);79828083 return addr;
+21-1
arch/x86/xen/enlighten.c
···4040#include <xen/interface/physdev.h>4141#include <xen/interface/vcpu.h>4242#include <xen/interface/memory.h>4343+#include <xen/interface/nmi.h>4344#include <xen/interface/xen-mca.h>4445#include <xen/features.h>4546#include <xen/page.h>···6766#include <asm/reboot.h>6867#include <asm/stackprotector.h>6968#include <asm/hypervisor.h>6969+#include <asm/mach_traps.h>7070#include <asm/mwait.h>7171#include <asm/pci_x86.h>7272#include <asm/pat.h>···13531351 .emergency_restart = xen_emergency_restart,13541352};1355135313541354+static unsigned char xen_get_nmi_reason(void)13551355+{13561356+ unsigned char reason = 0;13571357+13581358+ /* Construct a value which looks like it came from port 0x61. */13591359+ if (test_bit(_XEN_NMIREASON_io_error,13601360+ &HYPERVISOR_shared_info->arch.nmi_reason))13611361+ reason |= NMI_REASON_IOCHK;13621362+ if (test_bit(_XEN_NMIREASON_pci_serr,13631363+ &HYPERVISOR_shared_info->arch.nmi_reason))13641364+ reason |= NMI_REASON_SERR;13651365+13661366+ return reason;13671367+}13681368+13561369static void __init xen_boot_params_init_edd(void)13571370{13581371#if IS_ENABLED(CONFIG_EDD)···15521535 pv_info = xen_info;15531536 pv_init_ops = xen_init_ops;15541537 pv_apic_ops = xen_apic_ops;15551555- if (!xen_pvh_domain())15381538+ if (!xen_pvh_domain()) {15561539 pv_cpu_ops = xen_cpu_ops;15401540+15411541+ x86_platform.get_nmi_reason = xen_get_nmi_reason;15421542+ }1557154315581544 if (xen_feature(XENFEAT_auto_translated_physmap))15591545 x86_init.resources.memory_setup = xen_auto_xlated_memory_setup;
+10-10
arch/x86/xen/p2m.c
···167167 return (void *)__get_free_page(GFP_KERNEL | __GFP_REPEAT);168168}169169170170-/* Only to be called in case of a race for a page just allocated! */171171-static void free_p2m_page(void *p)170170+static void __ref free_p2m_page(void *p)172171{173173- BUG_ON(!slab_is_available());172172+ if (unlikely(!slab_is_available())) {173173+ free_bootmem((unsigned long)p, PAGE_SIZE);174174+ return;175175+ }176176+174177 free_page((unsigned long)p);175178}176179···378375 p2m_missing_pte : p2m_identity_pte;379376 for (i = 0; i < PMDS_PER_MID_PAGE; i++) {380377 pmdp = populate_extra_pmd(381381- (unsigned long)(p2m + pfn + i * PTRS_PER_PTE));378378+ (unsigned long)(p2m + pfn) + i * PMD_SIZE);382379 set_pmd(pmdp, __pmd(__pa(ptep) | _KERNPG_TABLE));383380 }384381 }···439436 * a new pmd is to replace p2m_missing_pte or p2m_identity_pte by a individual440437 * pmd. In case of PAE/x86-32 there are multiple pmds to allocate!441438 */442442-static pte_t *alloc_p2m_pmd(unsigned long addr, pte_t *ptep, pte_t *pte_pg)439439+static pte_t *alloc_p2m_pmd(unsigned long addr, pte_t *pte_pg)443440{444441 pte_t *ptechk;445445- pte_t *pteret = ptep;446442 pte_t *pte_newpg[PMDS_PER_MID_PAGE];447443 pmd_t *pmdp;448444 unsigned int level;···475473 if (ptechk == pte_pg) {476474 set_pmd(pmdp,477475 __pmd(__pa(pte_newpg[i]) | _KERNPG_TABLE));478478- if (vaddr == (addr & ~(PMD_SIZE - 1)))479479- pteret = pte_offset_kernel(pmdp, addr);480476 pte_newpg[i] = NULL;481477 }482478···488488 vaddr += PMD_SIZE;489489 }490490491491- return pteret;491491+ return lookup_address(addr, &level);492492}493493494494/*···517517518518 if (pte_pg == p2m_missing_pte || pte_pg == p2m_identity_pte) {519519 /* PMD level is missing, allocate a new one */520520- ptep = alloc_p2m_pmd(addr, ptep, pte_pg);520520+ ptep = alloc_p2m_pmd(addr, pte_pg);521521 if (!ptep)522522 return false;523523 }
+20-22
arch/x86/xen/setup.c
···140140unsigned long __ref xen_chk_extra_mem(unsigned long pfn)141141{142142 int i;143143- unsigned long addr = PFN_PHYS(pfn);143143+ phys_addr_t addr = PFN_PHYS(pfn);144144145145 for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {146146 if (addr >= xen_extra_mem[i].start &&···160160 int i;161161162162 for (i = 0; i < XEN_EXTRA_MEM_MAX_REGIONS; i++) {163163+ if (!xen_extra_mem[i].size)164164+ continue;163165 pfn_s = PFN_DOWN(xen_extra_mem[i].start);164166 pfn_e = PFN_UP(xen_extra_mem[i].start + xen_extra_mem[i].size);165167 for (pfn = pfn_s; pfn < pfn_e; pfn++)···231229 * as a fallback if the remapping fails.232230 */233231static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,234234- unsigned long end_pfn, unsigned long nr_pages, unsigned long *identity,235235- unsigned long *released)232232+ unsigned long end_pfn, unsigned long nr_pages, unsigned long *released)236233{237237- unsigned long len = 0;238234 unsigned long pfn, end;239235 int ret;240236241237 WARN_ON(start_pfn > end_pfn);242238239239+ /* Release pages first. */243240 end = min(end_pfn, nr_pages);244241 for (pfn = start_pfn; pfn < end; pfn++) {245242 unsigned long mfn = pfn_to_mfn(pfn);···251250 WARN(ret != 1, "Failed to release pfn %lx err=%d\n", pfn, ret);252251253252 if (ret == 1) {253253+ (*released)++;254254 if (!__set_phys_to_machine(pfn, INVALID_P2M_ENTRY))255255 break;256256- len++;257256 } else258257 break;259258 }260259261261- /* Need to release pages first */262262- *released += len;263263- *identity += set_phys_range_identity(start_pfn, end_pfn);260260+ set_phys_range_identity(start_pfn, end_pfn);264261}265262266263/*···286287 }287288288289 /* Update kernel mapping, but not for highmem. */289289- if ((pfn << PAGE_SHIFT) >= __pa(high_memory))290290+ if (pfn >= PFN_UP(__pa(high_memory - 1)))290291 return;291292292293 if (HYPERVISOR_update_va_mapping((unsigned long)__va(pfn << PAGE_SHIFT),···317318 unsigned long ident_pfn_iter, remap_pfn_iter;318319 unsigned long ident_end_pfn = start_pfn + size;319320 unsigned long left = size;320320- unsigned long ident_cnt = 0;321321 unsigned int i, chunk;322322323323 WARN_ON(size == 0);···345347 xen_remap_mfn = mfn;346348347349 /* Set identity map */348348- ident_cnt += set_phys_range_identity(ident_pfn_iter,349349- ident_pfn_iter + chunk);350350+ set_phys_range_identity(ident_pfn_iter, ident_pfn_iter + chunk);350351351352 left -= chunk;352353 }···368371static unsigned long __init xen_set_identity_and_remap_chunk(369372 const struct e820entry *list, size_t map_size, unsigned long start_pfn,370373 unsigned long end_pfn, unsigned long nr_pages, unsigned long remap_pfn,371371- unsigned long *identity, unsigned long *released)374374+ unsigned long *released, unsigned long *remapped)372375{373376 unsigned long pfn;374377 unsigned long i = 0;···383386 /* Do not remap pages beyond the current allocation */384387 if (cur_pfn >= nr_pages) {385388 /* Identity map remaining pages */386386- *identity += set_phys_range_identity(cur_pfn,387387- cur_pfn + size);389389+ set_phys_range_identity(cur_pfn, cur_pfn + size);388390 break;389391 }390392 if (cur_pfn + size > nr_pages)···394398 if (!remap_range_size) {395399 pr_warning("Unable to find available pfn range, not remapping identity pages\n");396400 xen_set_identity_and_release_chunk(cur_pfn,397397- cur_pfn + left, nr_pages, identity, released);401401+ cur_pfn + left, nr_pages, released);398402 break;399403 }400404 /* Adjust size to fit in current e820 RAM region */···406410 /* Update variables to reflect new mappings. */407411 i += size;408412 remap_pfn += size;409409- *identity += size;413413+ *remapped += size;410414 }411415412416 /*···423427424428static void __init xen_set_identity_and_remap(425429 const struct e820entry *list, size_t map_size, unsigned long nr_pages,426426- unsigned long *released)430430+ unsigned long *released, unsigned long *remapped)427431{428432 phys_addr_t start = 0;429429- unsigned long identity = 0;430433 unsigned long last_pfn = nr_pages;431434 const struct e820entry *entry;432435 unsigned long num_released = 0;436436+ unsigned long num_remapped = 0;433437 int i;434438435439 /*···456460 last_pfn = xen_set_identity_and_remap_chunk(457461 list, map_size, start_pfn,458462 end_pfn, nr_pages, last_pfn,459459- &identity, &num_released);463463+ &num_released, &num_remapped);460464 start = end;461465 }462466 }463467464468 *released = num_released;469469+ *remapped = num_remapped;465470466466- pr_info("Set %ld page(s) to 1-1 mapping\n", identity);467471 pr_info("Released %ld page(s)\n", num_released);468472}469473···582586 struct xen_memory_map memmap;583587 unsigned long max_pages;584588 unsigned long extra_pages = 0;589589+ unsigned long remapped_pages;585590 int i;586591 int op;587592···632635 * underlying RAM.633636 */634637 xen_set_identity_and_remap(map, memmap.nr_entries, max_pfn,635635- &xen_released_pages);638638+ &xen_released_pages, &remapped_pages);636639637640 extra_pages += xen_released_pages;641641+ extra_pages += remapped_pages;638642639643 /*640644 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
···5050obj-y += tty/5151obj-y += char/52525353-# gpu/ comes after char for AGP vs DRM startup5353+# iommu/ comes before gpu as gpu are using iommu controllers5454+obj-$(CONFIG_IOMMU_SUPPORT) += iommu/5555+5656+# gpu/ comes after char for AGP vs DRM startup and after iommu5457obj-y += gpu/55585659obj-$(CONFIG_CONNECTOR) += connector/···144141145142obj-$(CONFIG_MAILBOX) += mailbox/146143obj-$(CONFIG_HWSPINLOCK) += hwspinlock/147147-obj-$(CONFIG_IOMMU_SUPPORT) += iommu/148144obj-$(CONFIG_REMOTEPROC) += remoteproc/149145obj-$(CONFIG_RPMSG) += rpmsg/150146
+14-11
drivers/acpi/acpi_processor.c
···170170 acpi_status status;171171 int ret;172172173173- if (pr->apic_id == -1)173173+ if (pr->phys_id == -1)174174 return -ENODEV;175175176176 status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta);···180180 cpu_maps_update_begin();181181 cpu_hotplug_begin();182182183183- ret = acpi_map_lsapic(pr->handle, pr->apic_id, &pr->id);183183+ ret = acpi_map_cpu(pr->handle, pr->phys_id, &pr->id);184184 if (ret)185185 goto out;186186187187 ret = arch_register_cpu(pr->id);188188 if (ret) {189189- acpi_unmap_lsapic(pr->id);189189+ acpi_unmap_cpu(pr->id);190190 goto out;191191 }192192···215215 union acpi_object object = { 0 };216216 struct acpi_buffer buffer = { sizeof(union acpi_object), &object };217217 struct acpi_processor *pr = acpi_driver_data(device);218218- int apic_id, cpu_index, device_declaration = 0;218218+ int phys_id, cpu_index, device_declaration = 0;219219 acpi_status status = AE_OK;220220 static int cpu0_initialized;221221 unsigned long long value;···262262 pr->acpi_id = value;263263 }264264265265- apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id);266266- if (apic_id < 0)267267- acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n");268268- pr->apic_id = apic_id;265265+ phys_id = acpi_get_phys_id(pr->handle, device_declaration, pr->acpi_id);266266+ if (phys_id < 0)267267+ acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n");268268+ pr->phys_id = phys_id;269269270270- cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id);270270+ cpu_index = acpi_map_cpuid(pr->phys_id, pr->acpi_id);271271 if (!cpu0_initialized && !acpi_has_cpu_in_madt()) {272272 cpu0_initialized = 1;273273- /* Handle UP system running SMP kernel, with no LAPIC in MADT */273273+ /*274274+ * Handle UP system running SMP kernel, with no CPU275275+ * entry in MADT276276+ */274277 if ((cpu_index == -1) && (num_online_cpus() == 1))275278 cpu_index = 0;276279 }···461458462459 /* Remove the CPU. */463460 arch_unregister_cpu(pr->id);464464- acpi_unmap_lsapic(pr->id);461461+ acpi_unmap_cpu(pr->id);465462466463 cpu_hotplug_done();467464 cpu_maps_update_done();
+1-1
drivers/acpi/device_pm.c
···257257258258 device->power.state = ACPI_STATE_UNKNOWN;259259 if (!acpi_device_is_present(device))260260- return 0;260260+ return -ENXIO;261261262262 result = acpi_device_get_power(device, &state);263263 if (result)
···463463 bool is_32bit_user_mode;464464};465465466466+/**467467+ * Ioctl function type.468468+ *469469+ * \param filep pointer to file structure.470470+ * \param p amdkfd process pointer.471471+ * \param data pointer to arg that was copied from user.472472+ */473473+typedef int amdkfd_ioctl_t(struct file *filep, struct kfd_process *p,474474+ void *data);475475+476476+struct amdkfd_ioctl_desc {477477+ unsigned int cmd;478478+ int flags;479479+ amdkfd_ioctl_t *func;480480+ unsigned int cmd_drv;481481+ const char *name;482482+};483483+466484void kfd_process_create_wq(void);467485void kfd_process_destroy_wq(void);468486struct kfd_process *kfd_create_process(const struct task_struct *);
+1-1
drivers/gpu/drm/amd/amdkfd/kfd_topology.c
···921921 uint32_t i = 0;922922923923 list_for_each_entry(dev, &topology_device_list, list) {924924- ret = kfd_build_sysfs_node_entry(dev, 0);924924+ ret = kfd_build_sysfs_node_entry(dev, i);925925 if (ret < 0)926926 return ret;927927 i++;
···37253725 if ((iir & flip_pending) == 0)37263726 goto check_page_flip;3727372737283728- intel_prepare_page_flip(dev, plane);37293729-37303728 /* We detect FlipDone by looking for the change in PendingFlip from '1'37313729 * to '0' on the following vblank, i.e. IIR has the Pendingflip37323730 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence···37343736 if (I915_READ16(ISR) & flip_pending)37353737 goto check_page_flip;3736373837393739+ intel_prepare_page_flip(dev, plane);37373740 intel_finish_page_flip(dev, pipe);37383741 return true;37393742···39063907 if ((iir & flip_pending) == 0)39073908 goto check_page_flip;3908390939093909- intel_prepare_page_flip(dev, plane);39103910-39113910 /* We detect FlipDone by looking for the change in PendingFlip from '1'39123911 * to '0' on the following vblank, i.e. IIR has the Pendingflip39133912 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence···39153918 if (I915_READ(ISR) & flip_pending)39163919 goto check_page_flip;3917392039213921+ intel_prepare_page_flip(dev, plane);39183922 intel_finish_page_flip(dev, pipe);39193923 return true;39203924
+1-7
drivers/gpu/drm/i915/intel_display.c
···1305713057 vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);1305813058 udelay(300);13059130591306013060- /*1306113061- * Fujitsu-Siemens Lifebook S6010 (830) has problems resuming1306213062- * from S3 without preserving (some of?) the other bits.1306313063- */1306413064- I915_WRITE(vga_reg, dev_priv->bios_vgacntr | VGA_DISP_DISABLE);1306013060+ I915_WRITE(vga_reg, VGA_DISP_DISABLE);1306513061 POSTING_READ(vga_reg);1306613062}1306713063···13142131461314313147 intel_shared_dpll_init(dev);13144131481314513145- /* save the BIOS value before clobbering it */1314613146- dev_priv->bios_vgacntr = I915_READ(i915_vgacntrl_reg(dev));1314713149 /* Just disable it once at startup */1314813150 i915_disable_vga(dev);1314913151 intel_setup_outputs(dev);
···15721572 * so use the DMA API for them.15731573 */15741574 if (!nv_device_is_cpu_coherent(device) &&15751575- ttm->caching_state == tt_uncached)15751575+ ttm->caching_state == tt_uncached) {15761576 ttm_dma_unpopulate(ttm_dma, dev->dev);15771577+ return;15781578+ }1577157915781580#if __OS_HAS_AGP15791581 if (drm->agp.stat == ENABLED) {
+31-6
drivers/gpu/drm/nouveau/nouveau_gem.c
···3636nouveau_gem_object_del(struct drm_gem_object *gem)3737{3838 struct nouveau_bo *nvbo = nouveau_gem_object(gem);3939+ struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);3940 struct ttm_buffer_object *bo = &nvbo->bo;4141+ struct device *dev = drm->dev->dev;4242+ int ret;4343+4444+ ret = pm_runtime_get_sync(dev);4545+ if (WARN_ON(ret < 0 && ret != -EACCES))4646+ return;40474148 if (gem->import_attach)4249 drm_prime_gem_destroy(gem, nvbo->bo.sg);···5346 /* reset filp so nouveau_bo_del_ttm() can test for it */5447 gem->filp = NULL;5548 ttm_bo_unref(&bo);4949+5050+ pm_runtime_mark_last_busy(dev);5151+ pm_runtime_put_autosuspend(dev);5652}57535854int···6353{6454 struct nouveau_cli *cli = nouveau_cli(file_priv);6555 struct nouveau_bo *nvbo = nouveau_gem_object(gem);5656+ struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);6657 struct nouveau_vma *vma;5858+ struct device *dev = drm->dev->dev;6759 int ret;68606961 if (!cli->vm)···8371 goto out;8472 }85738686- ret = nouveau_bo_vma_add(nvbo, cli->vm, vma);8787- if (ret) {8888- kfree(vma);7474+ ret = pm_runtime_get_sync(dev);7575+ if (ret < 0 && ret != -EACCES)8976 goto out;9090- }7777+7878+ ret = nouveau_bo_vma_add(nvbo, cli->vm, vma);7979+ if (ret)8080+ kfree(vma);8181+8282+ pm_runtime_mark_last_busy(dev);8383+ pm_runtime_put_autosuspend(dev);9184 } else {9285 vma->refcount++;9386 }···146129{147130 struct nouveau_cli *cli = nouveau_cli(file_priv);148131 struct nouveau_bo *nvbo = nouveau_gem_object(gem);132132+ struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);133133+ struct device *dev = drm->dev->dev;149134 struct nouveau_vma *vma;150135 int ret;151136···160141161142 vma = nouveau_bo_vma_find(nvbo, cli->vm);162143 if (vma) {163163- if (--vma->refcount == 0)164164- nouveau_gem_object_unmap(nvbo, vma);144144+ if (--vma->refcount == 0) {145145+ ret = pm_runtime_get_sync(dev);146146+ if (!WARN_ON(ret < 0 && ret != -EACCES)) {147147+ nouveau_gem_object_unmap(nvbo, vma);148148+ pm_runtime_mark_last_busy(dev);149149+ pm_runtime_put_autosuspend(dev);150150+ }151151+ }165152 }166153 ttm_bo_unreserve(&nvbo->bo);167154}
+4-4
drivers/gpu/drm/radeon/atombios_crtc.c
···18511851 return pll;18521852 }18531853 /* otherwise, pick one of the plls */18541854- if ((rdev->family == CHIP_KAVERI) ||18551855- (rdev->family == CHIP_KABINI) ||18541854+ if ((rdev->family == CHIP_KABINI) ||18561855 (rdev->family == CHIP_MULLINS)) {18571857- /* KB/KV/ML has PPLL1 and PPLL2 */18561856+ /* KB/ML has PPLL1 and PPLL2 */18581857 pll_in_use = radeon_get_pll_use_mask(crtc);18591858 if (!(pll_in_use & (1 << ATOM_PPLL2)))18601859 return ATOM_PPLL2;···18621863 DRM_ERROR("unable to allocate a PPLL\n");18631864 return ATOM_PPLL_INVALID;18641865 } else {18651865- /* CI has PPLL0, PPLL1, and PPLL2 */18661866+ /* CI/KV has PPLL0, PPLL1, and PPLL2 */18661867 pll_in_use = radeon_get_pll_use_mask(crtc);18671868 if (!(pll_in_use & (1 << ATOM_PPLL2)))18681869 return ATOM_PPLL2;···21542155 case ATOM_PPLL0:21552156 /* disable the ppll */21562157 if ((rdev->family == CHIP_ARUBA) ||21582158+ (rdev->family == CHIP_KAVERI) ||21572159 (rdev->family == CHIP_BONAIRE) ||21582160 (rdev->family == CHIP_HAWAII))21592161 atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id,
+4
drivers/gpu/drm/radeon/atombios_dp.c
···492492 struct radeon_connector_atom_dig *dig_connector;493493 int dp_clock;494494495495+ if ((mode->clock > 340000) &&496496+ (!radeon_connector_is_dp12_capable(connector)))497497+ return MODE_CLOCK_HIGH;498498+495499 if (!radeon_connector->con_priv)496500 return MODE_CLOCK_HIGH;497501 dig_connector = radeon_connector->con_priv;
···40294029 if (action != BUS_NOTIFY_REMOVED_DEVICE)40304030 return 0;4031403140324032- /*40334033- * If the device is still attached to a device driver we can't40344034- * tear down the domain yet as DMA mappings may still be in use.40354035- * Wait for the BUS_NOTIFY_UNBOUND_DRIVER event to do that.40364036- */40374037- if (action == BUS_NOTIFY_DEL_DEVICE && dev->driver != NULL)40384038- return 0;40394039-40404032 domain = find_domain(dev);40414033 if (!domain)40424034 return 0;···44204428 domain_remove_one_dev_info(old_domain, dev);44214429 else44224430 domain_remove_dev_info(old_domain);44314431+44324432+ if (!domain_type_is_vm_or_si(old_domain) &&44334433+ list_empty(&old_domain->devices))44344434+ domain_exit(old_domain);44234435 }44244436 }44254437
+3-3
drivers/iommu/ipmmu-vmsa.c
···558558559559static u64 ipmmu_page_prot(unsigned int prot, u64 type)560560{561561- u64 pgprot = ARM_VMSA_PTE_XN | ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF561561+ u64 pgprot = ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF562562 | ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV563563 | ARM_VMSA_PTE_NS | type;564564···568568 if (prot & IOMMU_CACHE)569569 pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT;570570571571- if (prot & IOMMU_EXEC)572572- pgprot &= ~ARM_VMSA_PTE_XN;571571+ if (prot & IOMMU_NOEXEC)572572+ pgprot |= ARM_VMSA_PTE_XN;573573 else if (!(prot & (IOMMU_READ | IOMMU_WRITE)))574574 /* If no access create a faulting entry to avoid TLB fills. */575575 pgprot &= ~ARM_VMSA_PTE_PAGE;
···300300 if (IS_ERR(host))301301 return PTR_ERR(host);302302303303- if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {304304- ret = mv_conf_mbus_windows(pdev, mv_mbus_dram_info());305305- if (ret < 0)306306- goto err_mbus_win;307307- }308308-309309-310303 pltfm_host = sdhci_priv(host);311304 pltfm_host->priv = pxa;312305···317324 pxa->clk_core = devm_clk_get(dev, "core");318325 if (!IS_ERR(pxa->clk_core))319326 clk_prepare_enable(pxa->clk_core);327327+328328+ if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {329329+ ret = mv_conf_mbus_windows(pdev, mv_mbus_dram_info());330330+ if (ret < 0)331331+ goto err_mbus_win;332332+ }320333321334 /* enable 1/8V DDR capable */322335 host->mmc->caps |= MMC_CAP_1_8V_DDR;···395396 pm_runtime_disable(&pdev->dev);396397err_of_parse:397398err_cd_req:399399+err_mbus_win:398400 clk_disable_unprepare(pxa->clk_io);399401 if (!IS_ERR(pxa->clk_core))400402 clk_disable_unprepare(pxa->clk_core);401403err_clk_get:402402-err_mbus_win:403404 sdhci_pltfm_free(pdev);404405 return ret;405406}
+48-26
drivers/mmc/host/sdhci.c
···259259260260 del_timer_sync(&host->tuning_timer);261261 host->flags &= ~SDHCI_NEEDS_RETUNING;262262- host->mmc->max_blk_count =263263- (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535;264262 }265263 sdhci_enable_card_detection(host);266264}···1351135313521354 sdhci_runtime_pm_get(host);1353135513561356+ present = mmc_gpio_get_cd(host->mmc);13571357+13541358 spin_lock_irqsave(&host->lock, flags);1355135913561360 WARN_ON(host->mrq != NULL);···13811381 * zero: cd-gpio is used, and card is removed13821382 * one: cd-gpio is used, and card is present13831383 */13841384- present = mmc_gpio_get_cd(host->mmc);13851384 if (present < 0) {13861385 /* If polling, assume that the card is always present. */13871386 if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)···18791880 return !(present_state & SDHCI_DATA_LVL_MASK);18801881}1881188218831883+static int sdhci_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios)18841884+{18851885+ struct sdhci_host *host = mmc_priv(mmc);18861886+ unsigned long flags;18871887+18881888+ spin_lock_irqsave(&host->lock, flags);18891889+ host->flags |= SDHCI_HS400_TUNING;18901890+ spin_unlock_irqrestore(&host->lock, flags);18911891+18921892+ return 0;18931893+}18941894+18821895static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)18831896{18841897 struct sdhci_host *host = mmc_priv(mmc);···18981887 int tuning_loop_counter = MAX_TUNING_LOOP;18991888 int err = 0;19001889 unsigned long flags;18901890+ unsigned int tuning_count = 0;18911891+ bool hs400_tuning;1901189219021893 sdhci_runtime_pm_get(host);19031894 spin_lock_irqsave(&host->lock, flags);18951895+18961896+ hs400_tuning = host->flags & SDHCI_HS400_TUNING;18971897+ host->flags &= ~SDHCI_HS400_TUNING;18981898+18991899+ if (host->tuning_mode == SDHCI_TUNING_MODE_1)19001900+ tuning_count = host->tuning_count;1904190119051902 /*19061903 * The Host Controller needs tuning only in case of SDR104 mode···19181899 * tuning function has to be executed.19191900 */19201901 switch (host->timing) {19021902+ /* HS400 tuning is done in HS200 mode */19211903 case MMC_TIMING_MMC_HS400:19041904+ err = -EINVAL;19051905+ goto out_unlock;19061906+19221907 case MMC_TIMING_MMC_HS200:19081908+ /*19091909+ * Periodic re-tuning for HS400 is not expected to be needed, so19101910+ * disable it here.19111911+ */19121912+ if (hs400_tuning)19131913+ tuning_count = 0;19141914+ break;19151915+19231916 case MMC_TIMING_UHS_SDR104:19241917 break;19251918···19421911 /* FALLTHROUGH */1943191219441913 default:19451945- spin_unlock_irqrestore(&host->lock, flags);19461946- sdhci_runtime_pm_put(host);19471947- return 0;19141914+ goto out_unlock;19481915 }1949191619501917 if (host->ops->platform_execute_tuning) {···20662037 }2067203820682039out:20692069- /*20702070- * If this is the very first time we are here, we start the retuning20712071- * timer. Since only during the first time, SDHCI_NEEDS_RETUNING20722072- * flag won't be set, we check this condition before actually starting20732073- * the timer.20742074- */20752075- if (!(host->flags & SDHCI_NEEDS_RETUNING) && host->tuning_count &&20762076- (host->tuning_mode == SDHCI_TUNING_MODE_1)) {20402040+ host->flags &= ~SDHCI_NEEDS_RETUNING;20412041+20422042+ if (tuning_count) {20772043 host->flags |= SDHCI_USING_RETUNING_TIMER;20782078- mod_timer(&host->tuning_timer, jiffies +20792079- host->tuning_count * HZ);20802080- /* Tuning mode 1 limits the maximum data length to 4MB */20812081- mmc->max_blk_count = (4 * 1024 * 1024) / mmc->max_blk_size;20822082- } else if (host->flags & SDHCI_USING_RETUNING_TIMER) {20832083- host->flags &= ~SDHCI_NEEDS_RETUNING;20842084- /* Reload the new initial value for timer */20852085- mod_timer(&host->tuning_timer, jiffies +20862086- host->tuning_count * HZ);20442044+ mod_timer(&host->tuning_timer, jiffies + tuning_count * HZ);20872045 }2088204620892047 /*···2086207020872071 sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);20882072 sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);20732073+out_unlock:20892074 spin_unlock_irqrestore(&host->lock, flags);20902075 sdhci_runtime_pm_put(host);20912076···21272110{21282111 struct sdhci_host *host = mmc_priv(mmc);21292112 unsigned long flags;21132113+ int present;2130211421312115 /* First check if client has provided their own card event */21322116 if (host->ops->card_event)21332117 host->ops->card_event(host);2134211821192119+ present = sdhci_do_get_cd(host);21202120+21352121 spin_lock_irqsave(&host->lock, flags);2136212221372123 /* Check host->mrq first in case we are runtime suspended */21382138- if (host->mrq && !sdhci_do_get_cd(host)) {21242124+ if (host->mrq && !present) {21392125 pr_err("%s: Card removed during transfer!\n",21402126 mmc_hostname(host->mmc));21412127 pr_err("%s: Resetting controller.\n",···21622142 .hw_reset = sdhci_hw_reset,21632143 .enable_sdio_irq = sdhci_enable_sdio_irq,21642144 .start_signal_voltage_switch = sdhci_start_signal_voltage_switch,21452145+ .prepare_hs400_tuning = sdhci_prepare_hs400_tuning,21652146 .execute_tuning = sdhci_execute_tuning,21662147 .card_event = sdhci_card_event,21672148 .card_busy = sdhci_card_busy,···32813260 mmc->max_segs = SDHCI_MAX_SEGS;3282326132833262 /*32843284- * Maximum number of sectors in one transfer. Limited by DMA boundary32853285- * size (512KiB).32633263+ * Maximum number of sectors in one transfer. Limited by SDMA boundary32643264+ * size (512KiB). Note some tuning modes impose a 4MiB limit, but this32653265+ * is less anyway.32863266 */32873267 mmc->max_req_size = 524288;32883268
+3-1
drivers/net/ethernet/allwinner/sun4i-emac.c
···850850 }851851852852 db->clk = devm_clk_get(&pdev->dev, NULL);853853- if (IS_ERR(db->clk))853853+ if (IS_ERR(db->clk)) {854854+ ret = PTR_ERR(db->clk);854855 goto out;856856+ }855857856858 clk_prepare_enable(db->clk);857859
+6-9
drivers/net/ethernet/altera/altera_tse_main.c
···11701170init_error:11711171 free_skbufs(dev);11721172alloc_skbuf_error:11731173- if (priv->phydev) {11741174- phy_disconnect(priv->phydev);11751175- priv->phydev = NULL;11761176- }11771173phy_error:11781174 return ret;11791175}···11821186 int ret;11831187 unsigned long int flags;1184118811851185- /* Stop and disconnect the PHY */11861186- if (priv->phydev) {11891189+ /* Stop the PHY */11901190+ if (priv->phydev)11871191 phy_stop(priv->phydev);11881188- phy_disconnect(priv->phydev);11891189- priv->phydev = NULL;11901190- }1191119211921193 netif_stop_queue(dev);11931194 napi_disable(&priv->napi);···15181525static int altera_tse_remove(struct platform_device *pdev)15191526{15201527 struct net_device *ndev = platform_get_drvdata(pdev);15281528+ struct altera_tse_private *priv = netdev_priv(ndev);15291529+15301530+ if (priv->phydev)15311531+ phy_disconnect(priv->phydev);1521153215221533 platform_set_drvdata(pdev, NULL);15231534 altera_tse_mdio_destroy(ndev);
+4-2
drivers/net/ethernet/cisco/enic/enic_main.c
···16161616 if (vnic_rq_desc_used(&enic->rq[i]) == 0) {16171617 netdev_err(netdev, "Unable to alloc receive buffers\n");16181618 err = -ENOMEM;16191619- goto err_out_notify_unset;16191619+ goto err_out_free_rq;16201620 }16211621 }16221622···1649164916501650 return 0;1651165116521652-err_out_notify_unset:16521652+err_out_free_rq:16531653+ for (i = 0; i < enic->rq_count; i++)16541654+ vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);16531655 enic_dev_notify_unset(enic);16541656err_out_free_intr:16551657 enic_free_intr(enic);
···11251125 u32 swmask = mask;11261126 u32 fwmask = mask << 16;11271127 s32 ret_val = 0;11281128- s32 i = 0, timeout = 200; /* FIXME: find real value to use here */11281128+ s32 i = 0, timeout = 200;1129112911301130 while (i < timeout) {11311131 if (igb_get_hw_semaphore(hw)) {
···40334033 (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));40344034 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),40354035 &mgp->cmd_bus, GFP_KERNEL);40364036- if (mgp->cmd == NULL)40364036+ if (!mgp->cmd) {40374037+ status = -ENOMEM;40374038 goto abort_with_enabled;40394039+ }4038404040394041 mgp->board_span = pci_resource_len(pdev, 0);40404042 mgp->iomem_base = pci_resource_start(pdev, 0);
+3-5
drivers/net/ethernet/qlogic/qla3xxx.c
···146146{147147 int i = 0;148148149149- while (i < 10) {150150- if (i)151151- ssleep(1);152152-149149+ do {153150 if (ql_sem_lock(qdev,154151 QL_DRVR_SEM_MASK,155152 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)···155158 "driver lock acquired\n");156159 return 1;157160 }158158- }161161+ ssleep(1);162162+ } while (++i < 10);159163160164 netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");161165 return 0;
···5656/* default ethernet address used by the modem */5757static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};58585959+static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};6060+5961/* Make up an ethernet header if the packet doesn't have one.6062 *6163 * A firmware bug common among several devices cause them to send raw···334332 usb_driver_release_interface(driver, info->data);335333 }336334337337- /* Never use the same address on both ends of the link, even338338- * if the buggy firmware told us to.335335+ /* Never use the same address on both ends of the link, even if the336336+ * buggy firmware told us to. Or, if device is assigned the well-known337337+ * buggy firmware MAC address, replace it with a random address,339338 */340340- if (ether_addr_equal(dev->net->dev_addr, default_modem_addr))339339+ if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) ||340340+ ether_addr_equal(dev->net->dev_addr, buggy_fw_addr))341341 eth_hw_addr_random(dev->net);342342343343 /* make MAC addr easily distinguishable from an IP header */
···734734 * Return target busy if we've received a non-zero retry_delay_timer735735 * in a FCP_RSP.736736 */737737- if (time_after(jiffies, fcport->retry_delay_timestamp))737737+ if (fcport->retry_delay_timestamp == 0) {738738+ /* retry delay not set */739739+ } else if (time_after(jiffies, fcport->retry_delay_timestamp))738740 fcport->retry_delay_timestamp = 0;739741 else740742 goto qc24_target_busy;
+6-6
drivers/target/iscsi/iscsi_target.c
···20272027 goto reject;20282028 }20292029 if (!strncmp("=All", text_ptr, 4)) {20302030- cmd->cmd_flags |= IFC_SENDTARGETS_ALL;20302030+ cmd->cmd_flags |= ICF_SENDTARGETS_ALL;20312031 } else if (!strncmp("=iqn.", text_ptr, 5) ||20322032 !strncmp("=eui.", text_ptr, 5)) {20332033- cmd->cmd_flags |= IFC_SENDTARGETS_SINGLE;20332033+ cmd->cmd_flags |= ICF_SENDTARGETS_SINGLE;20342034 } else {20352035 pr_err("Unable to locate valid SendTargets=%s value\n", text_ptr);20362036 goto reject;···34153415 return -ENOMEM;34163416 }34173417 /*34183418- * Locate pointer to iqn./eui. string for IFC_SENDTARGETS_SINGLE34183418+ * Locate pointer to iqn./eui. string for ICF_SENDTARGETS_SINGLE34193419 * explicit case..34203420 */34213421- if (cmd->cmd_flags & IFC_SENDTARGETS_SINGLE) {34213421+ if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) {34223422 text_ptr = strchr(text_in, '=');34233423 if (!text_ptr) {34243424 pr_err("Unable to locate '=' string in text_in:"···3434343434353435 spin_lock(&tiqn_lock);34363436 list_for_each_entry(tiqn, &g_tiqn_list, tiqn_list) {34373437- if ((cmd->cmd_flags & IFC_SENDTARGETS_SINGLE) &&34373437+ if ((cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) &&34383438 strcmp(tiqn->tiqn, text_ptr)) {34393439 continue;34403440 }···35123512 if (end_of_buf)35133513 break;3514351435153515- if (cmd->cmd_flags & IFC_SENDTARGETS_SINGLE)35153515+ if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE)35163516 break;35173517 }35183518 spin_unlock(&tiqn_lock);
···11031103}11041104EXPORT_SYMBOL(se_dev_set_queue_depth);1105110511061106-int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)11071107-{11081108- int block_size = dev->dev_attrib.block_size;11091109-11101110- if (dev->export_count) {11111111- pr_err("dev[%p]: Unable to change SE Device"11121112- " fabric_max_sectors while export_count is %d\n",11131113- dev, dev->export_count);11141114- return -EINVAL;11151115- }11161116- if (!fabric_max_sectors) {11171117- pr_err("dev[%p]: Illegal ZERO value for"11181118- " fabric_max_sectors\n", dev);11191119- return -EINVAL;11201120- }11211121- if (fabric_max_sectors < DA_STATUS_MAX_SECTORS_MIN) {11221122- pr_err("dev[%p]: Passed fabric_max_sectors: %u less than"11231123- " DA_STATUS_MAX_SECTORS_MIN: %u\n", dev, fabric_max_sectors,11241124- DA_STATUS_MAX_SECTORS_MIN);11251125- return -EINVAL;11261126- }11271127- if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) {11281128- pr_err("dev[%p]: Passed fabric_max_sectors: %u"11291129- " greater than DA_STATUS_MAX_SECTORS_MAX:"11301130- " %u\n", dev, fabric_max_sectors,11311131- DA_STATUS_MAX_SECTORS_MAX);11321132- return -EINVAL;11331133- }11341134- /*11351135- * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks()11361136- */11371137- if (!block_size) {11381138- block_size = 512;11391139- pr_warn("Defaulting to 512 for zero block_size\n");11401140- }11411141- fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors,11421142- block_size);11431143-11441144- dev->dev_attrib.fabric_max_sectors = fabric_max_sectors;11451145- pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",11461146- dev, fabric_max_sectors);11471147- return 0;11481148-}11491149-EXPORT_SYMBOL(se_dev_set_fabric_max_sectors);11501150-11511106int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)11521107{11531108 if (dev->export_count) {···11111156 dev, dev->export_count);11121157 return -EINVAL;11131158 }11141114- if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) {11591159+ if (optimal_sectors > dev->dev_attrib.hw_max_sectors) {11151160 pr_err("dev[%p]: Passed optimal_sectors %u cannot be"11161116- " greater than fabric_max_sectors: %u\n", dev,11171117- optimal_sectors, dev->dev_attrib.fabric_max_sectors);11611161+ " greater than hw_max_sectors: %u\n", dev,11621162+ optimal_sectors, dev->dev_attrib.hw_max_sectors);11181163 return -EINVAL;11191164 }11201165···15081553 dev->dev_attrib.unmap_granularity_alignment =15091554 DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT;15101555 dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN;15111511- dev->dev_attrib.fabric_max_sectors = DA_FABRIC_MAX_SECTORS;15121512- dev->dev_attrib.optimal_sectors = DA_FABRIC_MAX_SECTORS;1513155615141557 xcopy_lun = &dev->xcopy_lun;15151558 xcopy_lun->lun_se_dev = dev;···15481595 dev->dev_attrib.hw_max_sectors =15491596 se_dev_align_max_sectors(dev->dev_attrib.hw_max_sectors,15501597 dev->dev_attrib.hw_block_size);15981598+ dev->dev_attrib.optimal_sectors = dev->dev_attrib.hw_max_sectors;1551159915521600 dev->dev_index = scsi_get_new_index(SCSI_DEVICE_INDEX);15531601 dev->creation_time = get_jiffies_64();
+10-2
drivers/target/target_core_file.c
···621621 struct fd_prot fd_prot;622622 sense_reason_t rc;623623 int ret = 0;624624-624624+ /*625625+ * We are currently limited by the number of iovecs (2048) per626626+ * single vfs_[writev,readv] call.627627+ */628628+ if (cmd->data_length > FD_MAX_BYTES) {629629+ pr_err("FILEIO: Not able to process I/O of %u bytes due to"630630+ "FD_MAX_BYTES: %u iovec count limitiation\n",631631+ cmd->data_length, FD_MAX_BYTES);632632+ return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;633633+ }625634 /*626635 * Call vectorized fileio functions to map struct scatterlist627636 * physical memory addresses to struct iovec virtual memory.···968959 &fileio_dev_attrib_hw_block_size.attr,969960 &fileio_dev_attrib_block_size.attr,970961 &fileio_dev_attrib_hw_max_sectors.attr,971971- &fileio_dev_attrib_fabric_max_sectors.attr,972962 &fileio_dev_attrib_optimal_sectors.attr,973963 &fileio_dev_attrib_hw_queue_depth.attr,974964 &fileio_dev_attrib_queue_depth.attr,
···119119 continue;120120121121 result = acpi_bus_get_device(trt->source, &adev);122122- if (!result)123123- acpi_create_platform_device(adev);124124- else122122+ if (result)125123 pr_warn("Failed to get source ACPI device\n");126124127125 result = acpi_bus_get_device(trt->target, &adev);128128- if (!result)129129- acpi_create_platform_device(adev);130130- else126126+ if (result)131127 pr_warn("Failed to get target ACPI device\n");132128 }133129···202206203207 if (art->source) {204208 result = acpi_bus_get_device(art->source, &adev);205205- if (!result)206206- acpi_create_platform_device(adev);207207- else209209+ if (result)208210 pr_warn("Failed to get source ACPI device\n");209211 }210212 if (art->target) {211213 result = acpi_bus_get_device(art->target, &adev);212212- if (!result)213213- acpi_create_platform_device(adev);214214- else214214+ if (result)215215 pr_warn("Failed to get source ACPI device\n");216216 }217217 }
···130130 int ret;131131132132 adev = ACPI_COMPANION(dev);133133+ if (!adev)134134+ return -ENODEV;133135134136 status = acpi_evaluate_object(adev->handle, "PPCC", NULL, &buf);135137 if (ACPI_FAILURE(status))
+1-3
drivers/vfio/pci/vfio_pci.c
···840840841841static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)842842{843843- u8 type;844843 struct vfio_pci_device *vdev;845844 struct iommu_group *group;846845 int ret;847846848848- pci_read_config_byte(pdev, PCI_HEADER_TYPE, &type);849849- if ((type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL)847847+ if (pdev->hdr_type != PCI_HEADER_TYPE_NORMAL)850848 return -EINVAL;851849852850 group = iommu_group_get(&pdev->dev);
+1-1
drivers/vhost/net.c
···538538 ++headcount;539539 seg += in;540540 }541541- heads[headcount - 1].len = cpu_to_vhost32(vq, len - datalen);541541+ heads[headcount - 1].len = cpu_to_vhost32(vq, len + datalen);542542 *iovcount = seg;543543 if (unlikely(log))544544 *log_num = nlogs;
···282282283283 vp_free_vectors(vdev);284284 kfree(vp_dev->vqs);285285+ vp_dev->vqs = NULL;285286}286287287288static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,···420419 }421420 }422421 return 0;423423-}424424-425425-void virtio_pci_release_dev(struct device *_d)426426-{427427- /*428428- * No need for a release method as we allocate/free429429- * all devices together with the pci devices.430430- * Provide an empty one to avoid getting a warning from core.431431- */432422}433423434424#ifdef CONFIG_PM_SLEEP
-1
drivers/virtio/virtio_pci_common.h
···126126 * - ignore the affinity request if we're using INTX127127 */128128int vp_set_vq_affinity(struct virtqueue *vq, int cpu);129129-void virtio_pci_release_dev(struct device *);130129131130int virtio_pci_legacy_probe(struct pci_dev *pci_dev,132131 const struct pci_device_id *id);
+11-1
drivers/virtio/virtio_pci_legacy.c
···211211 .set_vq_affinity = vp_set_vq_affinity,212212};213213214214+static void virtio_pci_release_dev(struct device *_d)215215+{216216+ struct virtio_device *vdev = dev_to_virtio(_d);217217+ struct virtio_pci_device *vp_dev = to_vp_device(vdev);218218+219219+ /* As struct device is a kobject, it's not safe to220220+ * free the memory (including the reference counter itself)221221+ * until it's release callback. */222222+ kfree(vp_dev);223223+}224224+214225/* the PCI probing function */215226int virtio_pci_legacy_probe(struct pci_dev *pci_dev,216227 const struct pci_device_id *id)···313302 pci_iounmap(pci_dev, vp_dev->ioaddr);314303 pci_release_regions(pci_dev);315304 pci_disable_device(pci_dev);316316- kfree(vp_dev);317305}
+10-3
fs/btrfs/backref.c
···15521552{15531553 int ret;15541554 int type;15551555- struct btrfs_tree_block_info *info;15561555 struct btrfs_extent_inline_ref *eiref;1557155615581557 if (*ptr == (unsigned long)-1)···15721573 }1573157415741575 /* we can treat both ref types equally here */15751575- info = (struct btrfs_tree_block_info *)(ei + 1);15761576 *out_root = btrfs_extent_inline_ref_offset(eb, eiref);15771577- *out_level = btrfs_tree_block_level(eb, info);15771577+15781578+ if (key->type == BTRFS_EXTENT_ITEM_KEY) {15791579+ struct btrfs_tree_block_info *info;15801580+15811581+ info = (struct btrfs_tree_block_info *)(ei + 1);15821582+ *out_level = btrfs_tree_block_level(eb, info);15831583+ } else {15841584+ ASSERT(key->type == BTRFS_METADATA_ITEM_KEY);15851585+ *out_level = (u8)key->offset;15861586+ }1578158715791588 if (ret == 1)15801589 *ptr = (unsigned long)-1;
+8
fs/btrfs/delayed-inode.c
···18571857{18581858 struct btrfs_delayed_node *delayed_node;1859185918601860+ /*18611861+ * we don't do delayed inode updates during log recovery because it18621862+ * leads to enospc problems. This means we also can't do18631863+ * delayed inode refs18641864+ */18651865+ if (BTRFS_I(inode)->root->fs_info->log_root_recovering)18661866+ return -EAGAIN;18671867+18601868 delayed_node = btrfs_get_or_create_delayed_node(inode);18611869 if (IS_ERR(delayed_node))18621870 return PTR_ERR(delayed_node);
+6-6
fs/btrfs/extent-tree.c
···31393139 struct extent_buffer *leaf;3140314031413141 ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1);31423142- if (ret < 0)31423142+ if (ret) {31433143+ if (ret > 0)31443144+ ret = -ENOENT;31433145 goto fail;31443144- BUG_ON(ret); /* Corruption */31463146+ }3145314731463148 leaf = path->nodes[0];31473149 bi = btrfs_item_ptr_offset(leaf, path->slots[0]);···31513149 btrfs_mark_buffer_dirty(leaf);31523150 btrfs_release_path(path);31533151fail:31543154- if (ret) {31523152+ if (ret)31553153 btrfs_abort_transaction(trans, root, ret);31563156- return ret;31573157- }31583158- return 0;31543154+ return ret;3159315531603156}31613157
+3-1
fs/btrfs/inode.c
···6255625562566256out_fail:62576257 btrfs_end_transaction(trans, root);62586258- if (drop_on_err)62586258+ if (drop_on_err) {62596259+ inode_dec_link_count(inode);62596260 iput(inode);62616261+ }62606262 btrfs_balance_delayed_items(root);62616263 btrfs_btree_balance_dirty(root);62626264 return err;
···14161416 }14171417 }1418141814191419- dout("fill_inline_data %p %llx.%llx len %lu locked_page %p\n",14191419+ dout("fill_inline_data %p %llx.%llx len %zu locked_page %p\n",14201420 inode, ceph_vinop(inode), len, locked_page);1421142114221422 if (len > 0) {
+2-2
fs/ext4/extents.c
···5166516651675167 /* fallback to generic here if not in extents fmt */51685168 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))51695169- return __generic_block_fiemap(inode, fieinfo, start, len,51705170- ext4_get_block);51695169+ return generic_block_fiemap(inode, fieinfo, start, len,51705170+ ext4_get_block);5171517151725172 if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS))51735173 return -EBADR;
+116-108
fs/ext4/file.c
···273273 * we determine this extent as a data or a hole according to whether the274274 * page cache has data or not.275275 */276276-static int ext4_find_unwritten_pgoff(struct inode *inode, int whence,277277- loff_t endoff, loff_t *offset)276276+static int ext4_find_unwritten_pgoff(struct inode *inode,277277+ int whence,278278+ struct ext4_map_blocks *map,279279+ loff_t *offset)278280{279281 struct pagevec pvec;282282+ unsigned int blkbits;280283 pgoff_t index;281284 pgoff_t end;285285+ loff_t endoff;282286 loff_t startoff;283287 loff_t lastoff;284288 int found = 0;285289290290+ blkbits = inode->i_sb->s_blocksize_bits;286291 startoff = *offset;287292 lastoff = startoff;288288-293293+ endoff = (loff_t)(map->m_lblk + map->m_len) << blkbits;289294290295 index = startoff >> PAGE_CACHE_SHIFT;291296 end = endoff >> PAGE_CACHE_SHIFT;···408403static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)409404{410405 struct inode *inode = file->f_mapping->host;411411- struct fiemap_extent_info fie;412412- struct fiemap_extent ext[2];413413- loff_t next;414414- int i, ret = 0;406406+ struct ext4_map_blocks map;407407+ struct extent_status es;408408+ ext4_lblk_t start, last, end;409409+ loff_t dataoff, isize;410410+ int blkbits;411411+ int ret = 0;415412416413 mutex_lock(&inode->i_mutex);417417- if (offset >= inode->i_size) {414414+415415+ isize = i_size_read(inode);416416+ if (offset >= isize) {418417 mutex_unlock(&inode->i_mutex);419418 return -ENXIO;420419 }421421- fie.fi_flags = 0;422422- fie.fi_extents_max = 2;423423- fie.fi_extents_start = (struct fiemap_extent __user *) &ext;424424- while (1) {425425- mm_segment_t old_fs = get_fs();426420427427- fie.fi_extents_mapped = 0;428428- memset(ext, 0, sizeof(*ext) * fie.fi_extents_max);421421+ blkbits = inode->i_sb->s_blocksize_bits;422422+ start = offset >> blkbits;423423+ last = start;424424+ end = isize >> blkbits;425425+ dataoff = offset;429426430430- set_fs(get_ds());431431- ret = ext4_fiemap(inode, &fie, offset, maxsize - offset);432432- set_fs(old_fs);433433- if (ret)434434- break;435435-436436- /* No extents found, EOF */437437- if (!fie.fi_extents_mapped) {438438- ret = -ENXIO;427427+ do {428428+ map.m_lblk = last;429429+ map.m_len = end - last + 1;430430+ ret = ext4_map_blocks(NULL, inode, &map, 0);431431+ if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) {432432+ if (last != start)433433+ dataoff = (loff_t)last << blkbits;439434 break;440435 }441441- for (i = 0; i < fie.fi_extents_mapped; i++) {442442- next = (loff_t)(ext[i].fe_length + ext[i].fe_logical);443436444444- if (offset < (loff_t)ext[i].fe_logical)445445- offset = (loff_t)ext[i].fe_logical;446446- /*447447- * If extent is not unwritten, then it contains valid448448- * data, mapped or delayed.449449- */450450- if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN))451451- goto out;452452-453453- /*454454- * If there is a unwritten extent at this offset,455455- * it will be as a data or a hole according to page456456- * cache that has data or not.457457- */458458- if (ext4_find_unwritten_pgoff(inode, SEEK_DATA,459459- next, &offset))460460- goto out;461461-462462- if (ext[i].fe_flags & FIEMAP_EXTENT_LAST) {463463- ret = -ENXIO;464464- goto out;465465- }466466- offset = next;437437+ /*438438+ * If there is a delay extent at this offset,439439+ * it will be as a data.440440+ */441441+ ext4_es_find_delayed_extent_range(inode, last, last, &es);442442+ if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) {443443+ if (last != start)444444+ dataoff = (loff_t)last << blkbits;445445+ break;467446 }468468- }469469- if (offset > inode->i_size)470470- offset = inode->i_size;471471-out:447447+448448+ /*449449+ * If there is a unwritten extent at this offset,450450+ * it will be as a data or a hole according to page451451+ * cache that has data or not.452452+ */453453+ if (map.m_flags & EXT4_MAP_UNWRITTEN) {454454+ int unwritten;455455+ unwritten = ext4_find_unwritten_pgoff(inode, SEEK_DATA,456456+ &map, &dataoff);457457+ if (unwritten)458458+ break;459459+ }460460+461461+ last++;462462+ dataoff = (loff_t)last << blkbits;463463+ } while (last <= end);464464+472465 mutex_unlock(&inode->i_mutex);473473- if (ret)474474- return ret;475466476476- return vfs_setpos(file, offset, maxsize);467467+ if (dataoff > isize)468468+ return -ENXIO;469469+470470+ return vfs_setpos(file, dataoff, maxsize);477471}478472479473/*480480- * ext4_seek_hole() retrieves the offset for SEEK_HOLE474474+ * ext4_seek_hole() retrieves the offset for SEEK_HOLE.481475 */482476static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)483477{484478 struct inode *inode = file->f_mapping->host;485485- struct fiemap_extent_info fie;486486- struct fiemap_extent ext[2];487487- loff_t next;488488- int i, ret = 0;479479+ struct ext4_map_blocks map;480480+ struct extent_status es;481481+ ext4_lblk_t start, last, end;482482+ loff_t holeoff, isize;483483+ int blkbits;484484+ int ret = 0;489485490486 mutex_lock(&inode->i_mutex);491491- if (offset >= inode->i_size) {487487+488488+ isize = i_size_read(inode);489489+ if (offset >= isize) {492490 mutex_unlock(&inode->i_mutex);493491 return -ENXIO;494492 }495493496496- fie.fi_flags = 0;497497- fie.fi_extents_max = 2;498498- fie.fi_extents_start = (struct fiemap_extent __user *)&ext;499499- while (1) {500500- mm_segment_t old_fs = get_fs();494494+ blkbits = inode->i_sb->s_blocksize_bits;495495+ start = offset >> blkbits;496496+ last = start;497497+ end = isize >> blkbits;498498+ holeoff = offset;501499502502- fie.fi_extents_mapped = 0;503503- memset(ext, 0, sizeof(*ext));500500+ do {501501+ map.m_lblk = last;502502+ map.m_len = end - last + 1;503503+ ret = ext4_map_blocks(NULL, inode, &map, 0);504504+ if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) {505505+ last += ret;506506+ holeoff = (loff_t)last << blkbits;507507+ continue;508508+ }504509505505- set_fs(get_ds());506506- ret = ext4_fiemap(inode, &fie, offset, maxsize - offset);507507- set_fs(old_fs);508508- if (ret)509509- break;510510+ /*511511+ * If there is a delay extent at this offset,512512+ * we will skip this extent.513513+ */514514+ ext4_es_find_delayed_extent_range(inode, last, last, &es);515515+ if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) {516516+ last = es.es_lblk + es.es_len;517517+ holeoff = (loff_t)last << blkbits;518518+ continue;519519+ }510520511511- /* No extents found */512512- if (!fie.fi_extents_mapped)513513- break;514514-515515- for (i = 0; i < fie.fi_extents_mapped; i++) {516516- next = (loff_t)(ext[i].fe_logical + ext[i].fe_length);517517- /*518518- * If extent is not unwritten, then it contains valid519519- * data, mapped or delayed.520520- */521521- if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN)) {522522- if (offset < (loff_t)ext[i].fe_logical)523523- goto out;524524- offset = next;521521+ /*522522+ * If there is a unwritten extent at this offset,523523+ * it will be as a data or a hole according to page524524+ * cache that has data or not.525525+ */526526+ if (map.m_flags & EXT4_MAP_UNWRITTEN) {527527+ int unwritten;528528+ unwritten = ext4_find_unwritten_pgoff(inode, SEEK_HOLE,529529+ &map, &holeoff);530530+ if (!unwritten) {531531+ last += ret;532532+ holeoff = (loff_t)last << blkbits;525533 continue;526534 }527527- /*528528- * If there is a unwritten extent at this offset,529529- * it will be as a data or a hole according to page530530- * cache that has data or not.531531- */532532- if (ext4_find_unwritten_pgoff(inode, SEEK_HOLE,533533- next, &offset))534534- goto out;535535-536536- offset = next;537537- if (ext[i].fe_flags & FIEMAP_EXTENT_LAST)538538- goto out;539535 }540540- }541541- if (offset > inode->i_size)542542- offset = inode->i_size;543543-out:544544- mutex_unlock(&inode->i_mutex);545545- if (ret)546546- return ret;547536548548- return vfs_setpos(file, offset, maxsize);537537+ /* find a hole */538538+ break;539539+ } while (last <= end);540540+541541+ mutex_unlock(&inode->i_mutex);542542+543543+ if (holeoff > isize)544544+ holeoff = isize;545545+546546+ return vfs_setpos(file, holeoff, maxsize);549547}550548551549/*
+12-12
fs/ext4/resize.c
···2424 return -EPERM;25252626 /*2727+ * If we are not using the primary superblock/GDT copy don't resize,2828+ * because the user tools have no way of handling this. Probably a2929+ * bad time to do it anyways.3030+ */3131+ if (EXT4_SB(sb)->s_sbh->b_blocknr !=3232+ le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {3333+ ext4_warning(sb, "won't resize using backup superblock at %llu",3434+ (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);3535+ return -EPERM;3636+ }3737+3838+ /*2739 * We are not allowed to do online-resizing on a filesystem mounted2840 * with error, because it can destroy the filesystem easily.2941 */···769757 printk(KERN_DEBUG770758 "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",771759 gdb_num);772772-773773- /*774774- * If we are not using the primary superblock/GDT copy don't resize,775775- * because the user tools have no way of handling this. Probably a776776- * bad time to do it anyways.777777- */778778- if (EXT4_SB(sb)->s_sbh->b_blocknr !=779779- le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {780780- ext4_warning(sb, "won't resize using backup superblock at %llu",781781- (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);782782- return -EPERM;783783- }784760785761 gdb_bh = sb_bread(sb, gdblock);786762 if (!gdb_bh)
+1-1
fs/ext4/super.c
···34823482 if (EXT4_HAS_RO_COMPAT_FEATURE(sb,34833483 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&34843484 EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM))34853485- ext4_warning(sb, KERN_INFO "metadata_csum and uninit_bg are "34853485+ ext4_warning(sb, "metadata_csum and uninit_bg are "34863486 "redundant flags; please run fsck.");3487348734883488 /* Check for a known checksum algorithm */
+3-2
fs/fcntl.c
···740740 * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY741741 * is defined as O_NONBLOCK on some platforms and not on others.742742 */743743- BUILD_BUG_ON(20 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(743743+ BUILD_BUG_ON(21 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(744744 O_RDONLY | O_WRONLY | O_RDWR |745745 O_CREAT | O_EXCL | O_NOCTTY |746746 O_TRUNC | O_APPEND | /* O_NONBLOCK | */747747 __O_SYNC | O_DSYNC | FASYNC |748748 O_DIRECT | O_LARGEFILE | O_DIRECTORY |749749 O_NOFOLLOW | O_NOATIME | O_CLOEXEC |750750- __FMODE_EXEC | O_PATH | __O_TMPFILE750750+ __FMODE_EXEC | O_PATH | __O_TMPFILE |751751+ __FMODE_NONOTIFY751752 ));752753753754 fasync_cache = kmem_cache_create("fasync_cache",
···9494 struct inode *inode,9595 const char *symname);96969797+static int ocfs2_double_lock(struct ocfs2_super *osb,9898+ struct buffer_head **bh1,9999+ struct inode *inode1,100100+ struct buffer_head **bh2,101101+ struct inode *inode2,102102+ int rename);103103+104104+static void ocfs2_double_unlock(struct inode *inode1, struct inode *inode2);97105/* An orphan dir name is an 8 byte value, printed as a hex string */98106#define OCFS2_ORPHAN_NAMELEN ((int)(2 * sizeof(u64)))99107···686678{687679 handle_t *handle;688680 struct inode *inode = old_dentry->d_inode;681681+ struct inode *old_dir = old_dentry->d_parent->d_inode;689682 int err;690683 struct buffer_head *fe_bh = NULL;684684+ struct buffer_head *old_dir_bh = NULL;691685 struct buffer_head *parent_fe_bh = NULL;692686 struct ocfs2_dinode *fe = NULL;693687 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);···706696707697 dquot_initialize(dir);708698709709- err = ocfs2_inode_lock_nested(dir, &parent_fe_bh, 1, OI_LS_PARENT);699699+ err = ocfs2_double_lock(osb, &old_dir_bh, old_dir,700700+ &parent_fe_bh, dir, 0);710701 if (err < 0) {711702 if (err != -ENOENT)712703 mlog_errno(err);713704 return err;705705+ }706706+707707+ /* make sure both dirs have bhs708708+ * get an extra ref on old_dir_bh if old==new */709709+ if (!parent_fe_bh) {710710+ if (old_dir_bh) {711711+ parent_fe_bh = old_dir_bh;712712+ get_bh(parent_fe_bh);713713+ } else {714714+ mlog(ML_ERROR, "%s: no old_dir_bh!\n", osb->uuid_str);715715+ err = -EIO;716716+ goto out;717717+ }714718 }715719716720 if (!dir->i_nlink) {···732708 goto out;733709 }734710735735- err = ocfs2_lookup_ino_from_name(dir, old_dentry->d_name.name,711711+ err = ocfs2_lookup_ino_from_name(old_dir, old_dentry->d_name.name,736712 old_dentry->d_name.len, &old_de_ino);737713 if (err) {738714 err = -ENOENT;···825801 ocfs2_inode_unlock(inode, 1);826802827803out:828828- ocfs2_inode_unlock(dir, 1);804804+ ocfs2_double_unlock(old_dir, dir);829805830806 brelse(fe_bh);831807 brelse(parent_fe_bh);808808+ brelse(old_dir_bh);832809833810 ocfs2_free_dir_lookup_result(&lookup);834811···10971072}1098107310991074/*11001100- * The only place this should be used is rename!10751075+ * The only place this should be used is rename and link!11011076 * if they have the same id, then the 1st one is the only one locked.11021077 */11031078static int ocfs2_double_lock(struct ocfs2_super *osb,11041079 struct buffer_head **bh1,11051080 struct inode *inode1,11061081 struct buffer_head **bh2,11071107- struct inode *inode2)10821082+ struct inode *inode2,10831083+ int rename)11081084{11091085 int status;11101086 int inode1_is_ancestor, inode2_is_ancestor;···11531127 }11541128 /* lock id2 */11551129 status = ocfs2_inode_lock_nested(inode2, bh2, 1,11561156- OI_LS_RENAME1);11301130+ rename == 1 ? OI_LS_RENAME1 : OI_LS_PARENT);11571131 if (status < 0) {11581132 if (status != -ENOENT)11591133 mlog_errno(status);···11621136 }1163113711641138 /* lock id1 */11651165- status = ocfs2_inode_lock_nested(inode1, bh1, 1, OI_LS_RENAME2);11391139+ status = ocfs2_inode_lock_nested(inode1, bh1, 1,11401140+ rename == 1 ? OI_LS_RENAME2 : OI_LS_PARENT);11661141 if (status < 0) {11671142 /*11681143 * An error return must mean that no cluster locks···1279125212801253 /* if old and new are the same, this'll just do one lock. */12811254 status = ocfs2_double_lock(osb, &old_dir_bh, old_dir,12821282- &new_dir_bh, new_dir);12551255+ &new_dir_bh, new_dir, 1);12831256 if (status < 0) {12841257 mlog_errno(status);12851258 goto bail;
···196196struct acpi_processor {197197 acpi_handle handle;198198 u32 acpi_id;199199- u32 apic_id;200200- u32 id;199199+ u32 phys_id; /* CPU hardware ID such as APIC ID for x86 */200200+ u32 id; /* CPU logical ID allocated by OS */201201 u32 pblk;202202 int performance_platform_limit;203203 int throttling_platform_limit;···310310#endif /* CONFIG_CPU_FREQ */311311312312/* in processor_core.c */313313-int acpi_get_apicid(acpi_handle, int type, u32 acpi_id);314314-int acpi_map_cpuid(int apic_id, u32 acpi_id);313313+int acpi_get_phys_id(acpi_handle, int type, u32 acpi_id);314314+int acpi_map_cpuid(int phys_id, u32 acpi_id);315315int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id);316316317317/* in processor_pdc.c */
···147147148148#ifdef CONFIG_ACPI_HOTPLUG_CPU149149/* Arch dependent functions for cpu hotplug support */150150-int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);151151-int acpi_unmap_lsapic(int cpu);150150+int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu);151151+int acpi_unmap_cpu(int cpu);152152#endif /* CONFIG_ACPI_HOTPLUG_CPU */153153154154int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
···215215 }216216}217217218218-static __always_inline void __assign_once_size(volatile void *p, void *res, int size)218218+static __always_inline void __write_once_size(volatile void *p, void *res, int size)219219{220220 switch (size) {221221 case 1: *(volatile __u8 *)p = *(__u8 *)res; break;···235235/*236236 * Prevent the compiler from merging or refetching reads or writes. The237237 * compiler is also forbidden from reordering successive instances of238238- * READ_ONCE, ASSIGN_ONCE and ACCESS_ONCE (see below), but only when the238238+ * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the239239 * compiler is aware of some particular ordering. One way to make the240240 * compiler aware of ordering is to put the two invocations of READ_ONCE,241241- * ASSIGN_ONCE or ACCESS_ONCE() in different C statements.241241+ * WRITE_ONCE or ACCESS_ONCE() in different C statements.242242 *243243 * In contrast to ACCESS_ONCE these two macros will also work on aggregate244244 * data types like structs or unions. If the size of the accessed data245245 * type exceeds the word size of the machine (e.g., 32 bits or 64 bits)246246- * READ_ONCE() and ASSIGN_ONCE() will fall back to memcpy and print a246246+ * READ_ONCE() and WRITE_ONCE() will fall back to memcpy and print a247247 * compile-time warning.248248 *249249 * Their two major use cases are: (1) Mediating communication between···257257#define READ_ONCE(x) \258258 ({ typeof(x) __val; __read_once_size(&x, &__val, sizeof(__val)); __val; })259259260260-#define ASSIGN_ONCE(val, x) \261261- ({ typeof(x) __val; __val = val; __assign_once_size(&x, &__val, sizeof(__val)); __val; })260260+#define WRITE_ONCE(x, val) \261261+ ({ typeof(x) __val; __val = val; __write_once_size(&x, &__val, sizeof(__val)); __val; })262262263263#endif /* __KERNEL__ */264264
+1-1
include/linux/fs.h
···135135#define FMODE_CAN_WRITE ((__force fmode_t)0x40000)136136137137/* File was opened by fanotify and shouldn't generate fanotify events */138138-#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)138138+#define FMODE_NONOTIFY ((__force fmode_t)0x4000000)139139140140/*141141 * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
+53-9
include/linux/kdb.h
···1313 * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com>1414 */15151616+/* Shifted versions of the command enable bits are be used if the command1717+ * has no arguments (see kdb_check_flags). This allows commands, such as1818+ * go, to have different permissions depending upon whether it is called1919+ * with an argument.2020+ */2121+#define KDB_ENABLE_NO_ARGS_SHIFT 102222+1623typedef enum {1717- KDB_REPEAT_NONE = 0, /* Do not repeat this command */1818- KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */1919- KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */2020-} kdb_repeat_t;2424+ KDB_ENABLE_ALL = (1 << 0), /* Enable everything */2525+ KDB_ENABLE_MEM_READ = (1 << 1),2626+ KDB_ENABLE_MEM_WRITE = (1 << 2),2727+ KDB_ENABLE_REG_READ = (1 << 3),2828+ KDB_ENABLE_REG_WRITE = (1 << 4),2929+ KDB_ENABLE_INSPECT = (1 << 5),3030+ KDB_ENABLE_FLOW_CTRL = (1 << 6),3131+ KDB_ENABLE_SIGNAL = (1 << 7),3232+ KDB_ENABLE_REBOOT = (1 << 8),3333+ /* User exposed values stop here, all remaining flags are3434+ * exclusively used to describe a commands behaviour.3535+ */3636+3737+ KDB_ENABLE_ALWAYS_SAFE = (1 << 9),3838+ KDB_ENABLE_MASK = (1 << KDB_ENABLE_NO_ARGS_SHIFT) - 1,3939+4040+ KDB_ENABLE_ALL_NO_ARGS = KDB_ENABLE_ALL << KDB_ENABLE_NO_ARGS_SHIFT,4141+ KDB_ENABLE_MEM_READ_NO_ARGS = KDB_ENABLE_MEM_READ4242+ << KDB_ENABLE_NO_ARGS_SHIFT,4343+ KDB_ENABLE_MEM_WRITE_NO_ARGS = KDB_ENABLE_MEM_WRITE4444+ << KDB_ENABLE_NO_ARGS_SHIFT,4545+ KDB_ENABLE_REG_READ_NO_ARGS = KDB_ENABLE_REG_READ4646+ << KDB_ENABLE_NO_ARGS_SHIFT,4747+ KDB_ENABLE_REG_WRITE_NO_ARGS = KDB_ENABLE_REG_WRITE4848+ << KDB_ENABLE_NO_ARGS_SHIFT,4949+ KDB_ENABLE_INSPECT_NO_ARGS = KDB_ENABLE_INSPECT5050+ << KDB_ENABLE_NO_ARGS_SHIFT,5151+ KDB_ENABLE_FLOW_CTRL_NO_ARGS = KDB_ENABLE_FLOW_CTRL5252+ << KDB_ENABLE_NO_ARGS_SHIFT,5353+ KDB_ENABLE_SIGNAL_NO_ARGS = KDB_ENABLE_SIGNAL5454+ << KDB_ENABLE_NO_ARGS_SHIFT,5555+ KDB_ENABLE_REBOOT_NO_ARGS = KDB_ENABLE_REBOOT5656+ << KDB_ENABLE_NO_ARGS_SHIFT,5757+ KDB_ENABLE_ALWAYS_SAFE_NO_ARGS = KDB_ENABLE_ALWAYS_SAFE5858+ << KDB_ENABLE_NO_ARGS_SHIFT,5959+ KDB_ENABLE_MASK_NO_ARGS = KDB_ENABLE_MASK << KDB_ENABLE_NO_ARGS_SHIFT,6060+6161+ KDB_REPEAT_NO_ARGS = 0x40000000, /* Repeat the command w/o arguments */6262+ KDB_REPEAT_WITH_ARGS = 0x80000000, /* Repeat the command with args */6363+} kdb_cmdflags_t;21642265typedef int (*kdb_func_t)(int, const char **);2366···10562#define KDB_BADLENGTH (-19)10663#define KDB_NOBP (-20)10764#define KDB_BADADDR (-21)6565+#define KDB_NOPERM (-22)1086610967/*11068 * kdb_diemsg···190146191147/* Dynamic kdb shell command registration */192148extern int kdb_register(char *, kdb_func_t, char *, char *, short);193193-extern int kdb_register_repeat(char *, kdb_func_t, char *, char *,194194- short, kdb_repeat_t);149149+extern int kdb_register_flags(char *, kdb_func_t, char *, char *,150150+ short, kdb_cmdflags_t);195151extern int kdb_unregister(char *);196152#else /* ! CONFIG_KGDB_KDB */197153static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; }198154static inline void kdb_init(int level) {}199155static inline int kdb_register(char *cmd, kdb_func_t func, char *usage,200156 char *help, short minlen) { return 0; }201201-static inline int kdb_register_repeat(char *cmd, kdb_func_t func, char *usage,202202- char *help, short minlen,203203- kdb_repeat_t repeat) { return 0; }157157+static inline int kdb_register_flags(char *cmd, kdb_func_t func, char *usage,158158+ char *help, short minlen,159159+ kdb_cmdflags_t flags) { return 0; }204160static inline int kdb_unregister(char *cmd) { return 0; }205161#endif /* CONFIG_KGDB_KDB */206162enum {
+1-1
include/linux/mm.h
···19521952#if VM_GROWSUP19531953extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);19541954#else19551955- #define expand_upwards(vma, address) do { } while (0)19551955+ #define expand_upwards(vma, address) (0)19561956#endif1957195719581958/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
+1
include/linux/mmc/sdhci.h
···137137#define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */138138#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */139139#define SDHCI_USE_64_BIT_DMA (1<<12) /* Use 64-bit DMA */140140+#define SDHCI_HS400_TUNING (1<<13) /* Tuning for HS400 */140141141142 unsigned int version; /* SDHCI spec. version */142143
+7-5
include/linux/perf_event.h
···7979 struct perf_branch_entry entries[0];8080};81818282-struct perf_regs {8383- __u64 abi;8484- struct pt_regs *regs;8585-};8686-8782struct task_struct;88838984/*···605610 u32 reserved;606611 } cpu_entry;607612 struct perf_callchain_entry *callchain;613613+614614+ /*615615+ * regs_user may point to task_pt_regs or to regs_user_copy, depending616616+ * on arch details.617617+ */608618 struct perf_regs regs_user;619619+ struct pt_regs regs_user_copy;620620+609621 struct perf_regs regs_intr;610622 u64 stack_user_size;611623} ____cacheline_aligned;
···3737 atomic_t refcount;38383939 /*4040+ * Count of child anon_vmas and VMAs which points to this anon_vma.4141+ *4242+ * This counter is used for making decision about reusing anon_vma4343+ * instead of forking new one. See comments in function anon_vma_clone.4444+ */4545+ unsigned degree;4646+4747+ struct anon_vma *parent; /* Parent of this anon_vma */4848+4949+ /*4050 * NOTE: the LSB of the rb_root.rb_node is set by4151 * mm_take_all_locks() _after_ taking the above lock. So the4252 * rb_root must only be read/written after taking the above lock
···12701270 *12711271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the12721272 * driver to indicate that it requires IV generation for this12731273- * particular key. Setting this flag does not necessarily mean that SKBs12741274- * will have sufficient tailroom for ICV or MIC.12731273+ * particular key.12751274 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by12761275 * the driver for a TKIP key if it requires Michael MIC12771276 * generation in software.···12821283 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver12831284 * if space should be prepared for the IV, but the IV12841285 * itself should not be generated. Do not set together with12851285- * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does12861286- * not necessarily mean that SKBs will have sufficient tailroom for ICV or12871287- * MIC.12861286+ * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key.12881287 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received12891288 * management frames. The flag can help drivers that have a hardware12901289 * crypto implementation that doesn't deal with management frames
···7777#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 07878/* Default max_write_same_len, disabled by default */7979#define DA_MAX_WRITE_SAME_LEN 08080-/* Default max transfer length */8181-#define DA_FABRIC_MAX_SECTORS 81928280/* Use a model alias based on the configfs backend device name */8381#define DA_EMULATE_MODEL_ALIAS 08482/* Emulation for Direct Page Out */···692694 u32 hw_block_size;693695 u32 block_size;694696 u32 hw_max_sectors;695695- u32 fabric_max_sectors;696697 u32 optimal_sectors;697698 u32 hw_queue_depth;698699 u32 queue_depth;
+1-1
include/uapi/asm-generic/fcntl.h
···5566/*77 * FMODE_EXEC is 0x2088- * FMODE_NONOTIFY is 0x100000088+ * FMODE_NONOTIFY is 0x400000099 * These cannot be used by userspace O_* until internal and external open1010 * flags are split.1111 * -Eric Paris
···11+/******************************************************************************22+ * nmi.h33+ *44+ * NMI callback registration and reason codes.55+ *66+ * Copyright (c) 2005, Keir Fraser <keir@xensource.com>77+ */88+99+#ifndef __XEN_PUBLIC_NMI_H__1010+#define __XEN_PUBLIC_NMI_H__1111+1212+#include <xen/interface/xen.h>1313+1414+/*1515+ * NMI reason codes:1616+ * Currently these are x86-specific, stored in arch_shared_info.nmi_reason.1717+ */1818+ /* I/O-check error reported via ISA port 0x61, bit 6. */1919+#define _XEN_NMIREASON_io_error 02020+#define XEN_NMIREASON_io_error (1UL << _XEN_NMIREASON_io_error)2121+ /* PCI SERR reported via ISA port 0x61, bit 7. */2222+#define _XEN_NMIREASON_pci_serr 12323+#define XEN_NMIREASON_pci_serr (1UL << _XEN_NMIREASON_pci_serr)2424+ /* Unknown hardware-generated NMI. */2525+#define _XEN_NMIREASON_unknown 22626+#define XEN_NMIREASON_unknown (1UL << _XEN_NMIREASON_unknown)2727+2828+/*2929+ * long nmi_op(unsigned int cmd, void *arg)3030+ * NB. All ops return zero on success, else a negative error code.3131+ */3232+3333+/*3434+ * Register NMI callback for this (calling) VCPU. Currently this only makes3535+ * sense for domain 0, vcpu 0. All other callers will be returned EINVAL.3636+ * arg == pointer to xennmi_callback structure.3737+ */3838+#define XENNMI_register_callback 03939+struct xennmi_callback {4040+ unsigned long handler_address;4141+ unsigned long pad;4242+};4343+DEFINE_GUEST_HANDLE_STRUCT(xennmi_callback);4444+4545+/*4646+ * Deregister NMI callback for this (calling) VCPU.4747+ * arg == NULL.4848+ */4949+#define XENNMI_unregister_callback 15050+5151+#endif /* __XEN_PUBLIC_NMI_H__ */
+28-24
kernel/debug/debug_core.c
···2727 * version 2. This program is licensed "as is" without any warranty of any2828 * kind, whether express or implied.2929 */3030+3131+#define pr_fmt(fmt) "KGDB: " fmt3232+3033#include <linux/pid_namespace.h>3134#include <linux/clocksource.h>3235#include <linux/serial_core.h>···199196 return err;200197 err = kgdb_arch_remove_breakpoint(&tmp);201198 if (err)202202- printk(KERN_ERR "KGDB: Critical breakpoint error, kernel "203203- "memory destroyed at: %lx", addr);199199+ pr_err("Critical breakpoint error, kernel memory destroyed at: %lx\n",200200+ addr);204201 return err;205202}206203···259256 error = kgdb_arch_set_breakpoint(&kgdb_break[i]);260257 if (error) {261258 ret = error;262262- printk(KERN_INFO "KGDB: BP install failed: %lx",263263- kgdb_break[i].bpt_addr);259259+ pr_info("BP install failed: %lx\n",260260+ kgdb_break[i].bpt_addr);264261 continue;265262 }266263···322319 continue;323320 error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);324321 if (error) {325325- printk(KERN_INFO "KGDB: BP remove failed: %lx\n",326326- kgdb_break[i].bpt_addr);322322+ pr_info("BP remove failed: %lx\n",323323+ kgdb_break[i].bpt_addr);327324 ret = error;328325 }329326···370367 goto setundefined;371368 error = kgdb_arch_remove_breakpoint(&kgdb_break[i]);372369 if (error)373373- printk(KERN_ERR "KGDB: breakpoint remove failed: %lx\n",370370+ pr_err("breakpoint remove failed: %lx\n",374371 kgdb_break[i].bpt_addr);375372setundefined:376373 kgdb_break[i].state = BP_UNDEFINED;···403400 if (print_wait) {404401#ifdef CONFIG_KGDB_KDB405402 if (!dbg_kdb_mode)406406- printk(KERN_CRIT "KGDB: waiting... or $3#33 for KDB\n");403403+ pr_crit("waiting... or $3#33 for KDB\n");407404#else408408- printk(KERN_CRIT "KGDB: Waiting for remote debugger\n");405405+ pr_crit("Waiting for remote debugger\n");409406#endif410407 }411408 return 1;···433430 exception_level = 0;434431 kgdb_skipexception(ks->ex_vector, ks->linux_regs);435432 dbg_activate_sw_breakpoints();436436- printk(KERN_CRIT "KGDB: re-enter error: breakpoint removed %lx\n",437437- addr);433433+ pr_crit("re-enter error: breakpoint removed %lx\n", addr);438434 WARN_ON_ONCE(1);439435440436 return 1;···446444 panic("Recursive entry to debugger");447445 }448446449449- printk(KERN_CRIT "KGDB: re-enter exception: ALL breakpoints killed\n");447447+ pr_crit("re-enter exception: ALL breakpoints killed\n");450448#ifdef CONFIG_KGDB_KDB451449 /* Allow kdb to debug itself one level */452450 return 0;···473471 int cpu;474472 int trace_on = 0;475473 int online_cpus = num_online_cpus();474474+ u64 time_left;476475477476 kgdb_info[ks->cpu].enter_kgdb++;478477 kgdb_info[ks->cpu].exception_state |= exception_state;···598595 /*599596 * Wait for the other CPUs to be notified and be waiting for us:600597 */601601- while (kgdb_do_roundup && (atomic_read(&masters_in_kgdb) +602602- atomic_read(&slaves_in_kgdb)) != online_cpus)598598+ time_left = loops_per_jiffy * HZ;599599+ while (kgdb_do_roundup && --time_left &&600600+ (atomic_read(&masters_in_kgdb) + atomic_read(&slaves_in_kgdb)) !=601601+ online_cpus)603602 cpu_relax();603603+ if (!time_left)604604+ pr_crit("KGDB: Timed out waiting for secondary CPUs.\n");604605605606 /*606607 * At this point the primary processor is completely···802795static void sysrq_handle_dbg(int key)803796{804797 if (!dbg_io_ops) {805805- printk(KERN_CRIT "ERROR: No KGDB I/O module available\n");798798+ pr_crit("ERROR: No KGDB I/O module available\n");806799 return;807800 }808801 if (!kgdb_connected) {809802#ifdef CONFIG_KGDB_KDB810803 if (!dbg_kdb_mode)811811- printk(KERN_CRIT "KGDB or $3#33 for KDB\n");804804+ pr_crit("KGDB or $3#33 for KDB\n");812805#else813813- printk(KERN_CRIT "Entering KGDB\n");806806+ pr_crit("Entering KGDB\n");814807#endif815808 }816809···952945{953946 kgdb_break_asap = 0;954947955955- printk(KERN_CRIT "kgdb: Waiting for connection from remote gdb...\n");948948+ pr_crit("Waiting for connection from remote gdb...\n");956949 kgdb_breakpoint();957950}958951···971964 if (dbg_io_ops) {972965 spin_unlock(&kgdb_registration_lock);973966974974- printk(KERN_ERR "kgdb: Another I/O driver is already "975975- "registered with KGDB.\n");967967+ pr_err("Another I/O driver is already registered with KGDB\n");976968 return -EBUSY;977969 }978970···987981988982 spin_unlock(&kgdb_registration_lock);989983990990- printk(KERN_INFO "kgdb: Registered I/O driver %s.\n",991991- new_dbg_io_ops->name);984984+ pr_info("Registered I/O driver %s\n", new_dbg_io_ops->name);992985993986 /* Arm KGDB now. */994987 kgdb_register_callbacks();···1022101710231018 spin_unlock(&kgdb_registration_lock);1024101910251025- printk(KERN_INFO10261026- "kgdb: Unregistered I/O driver %s, debugger disabled.\n",10201020+ pr_info("Unregistered I/O driver %s, debugger disabled\n",10271021 old_dbg_io_ops->name);10281022}10291023EXPORT_SYMBOL_GPL(kgdb_unregister_io_module);
···129129 ks->pass_exception = 1;130130 KDB_FLAG_SET(CATASTROPHIC);131131 }132132+ /* set CATASTROPHIC if the system contains unresponsive processors */133133+ for_each_online_cpu(i)134134+ if (!kgdb_info[i].enter_kgdb)135135+ KDB_FLAG_SET(CATASTROPHIC);132136 if (KDB_STATE(SSBPT) && reason == KDB_REASON_SSTEP) {133137 KDB_STATE_CLEAR(SSBPT);134138 KDB_STATE_CLEAR(DOING_SS);
+170-95
kernel/debug/kdb/kdb_main.c
···1212 */13131414#include <linux/ctype.h>1515+#include <linux/types.h>1516#include <linux/string.h>1617#include <linux/kernel.h>1718#include <linux/kmsg_dump.h>···2423#include <linux/vmalloc.h>2524#include <linux/atomic.h>2625#include <linux/module.h>2626+#include <linux/moduleparam.h>2727#include <linux/mm.h>2828#include <linux/init.h>2929#include <linux/kallsyms.h>···4341#include <linux/uaccess.h>4442#include <linux/slab.h>4543#include "kdb_private.h"4444+4545+#undef MODULE_PARAM_PREFIX4646+#define MODULE_PARAM_PREFIX "kdb."4747+4848+static int kdb_cmd_enabled = CONFIG_KDB_DEFAULT_ENABLE;4949+module_param_named(cmd_enable, kdb_cmd_enabled, int, 0600);46504751#define GREP_LEN 2564852char kdb_grep_string[GREP_LEN];···129121 KDBMSG(BADLENGTH, "Invalid length field"),130122 KDBMSG(NOBP, "No Breakpoint exists"),131123 KDBMSG(BADADDR, "Invalid address"),124124+ KDBMSG(NOPERM, "Permission denied"),132125};133126#undef KDBMSG134127···194185 p = krp->p;195186#endif196187 return p;188188+}189189+190190+/*191191+ * Check whether the flags of the current command and the permissions192192+ * of the kdb console has allow a command to be run.193193+ */194194+static inline bool kdb_check_flags(kdb_cmdflags_t flags, int permissions,195195+ bool no_args)196196+{197197+ /* permissions comes from userspace so needs massaging slightly */198198+ permissions &= KDB_ENABLE_MASK;199199+ permissions |= KDB_ENABLE_ALWAYS_SAFE;200200+201201+ /* some commands change group when launched with no arguments */202202+ if (no_args)203203+ permissions |= permissions << KDB_ENABLE_NO_ARGS_SHIFT;204204+205205+ flags |= KDB_ENABLE_ALL;206206+207207+ return permissions & flags;197208}198209199210/*···505476 kdb_symtab_t symtab;506477507478 /*479479+ * If the enable flags prohibit both arbitrary memory access480480+ * and flow control then there are no reasonable grounds to481481+ * provide symbol lookup.482482+ */483483+ if (!kdb_check_flags(KDB_ENABLE_MEM_READ | KDB_ENABLE_FLOW_CTRL,484484+ kdb_cmd_enabled, false))485485+ return KDB_NOPERM;486486+487487+ /*508488 * Process arguments which follow the following syntax:509489 *510490 * symbol | numeric-address [+/- numeric-offset]···679641 if (!s->count)680642 s->usable = 0;681643 if (s->usable)682682- kdb_register(s->name, kdb_exec_defcmd,683683- s->usage, s->help, 0);644644+ /* macros are always safe because when executed each645645+ * internal command re-enters kdb_parse() and is646646+ * safety checked individually.647647+ */648648+ kdb_register_flags(s->name, kdb_exec_defcmd, s->usage,649649+ s->help, 0,650650+ KDB_ENABLE_ALWAYS_SAFE);684651 return 0;685652 }686653 if (!s->usable)···1046100310471004 if (i < kdb_max_commands) {10481005 int result;10061006+10071007+ if (!kdb_check_flags(tp->cmd_flags, kdb_cmd_enabled, argc <= 1))10081008+ return KDB_NOPERM;10091009+10491010 KDB_STATE_SET(CMD);10501011 result = (*tp->cmd_func)(argc-1, (const char **)argv);10511012 if (result && ignore_errors && result > KDB_CMD_GO)10521013 result = 0;10531014 KDB_STATE_CLEAR(CMD);10541054- switch (tp->cmd_repeat) {10551055- case KDB_REPEAT_NONE:10561056- argc = 0;10571057- if (argv[0])10581058- *(argv[0]) = '\0';10591059- break;10601060- case KDB_REPEAT_NO_ARGS:10611061- argc = 1;10621062- if (argv[1])10631063- *(argv[1]) = '\0';10641064- break;10651065- case KDB_REPEAT_WITH_ARGS:10661066- break;10671067- }10151015+10161016+ if (tp->cmd_flags & KDB_REPEAT_WITH_ARGS)10171017+ return result;10181018+10191019+ argc = tp->cmd_flags & KDB_REPEAT_NO_ARGS ? 1 : 0;10201020+ if (argv[argc])10211021+ *(argv[argc]) = '\0';10681022 return result;10691023 }10701024···19611921 */19621922static int kdb_sr(int argc, const char **argv)19631923{19241924+ bool check_mask =19251925+ !kdb_check_flags(KDB_ENABLE_ALL, kdb_cmd_enabled, false);19261926+19641927 if (argc != 1)19651928 return KDB_ARGCOUNT;19291929+19661930 kdb_trap_printk++;19671967- __handle_sysrq(*argv[1], false);19311931+ __handle_sysrq(*argv[1], check_mask);19681932 kdb_trap_printk--;1969193319701934 return 0;···22012157 for (start_cpu = -1, i = 0; i < NR_CPUS; i++) {22022158 if (!cpu_online(i)) {22032159 state = 'F'; /* cpu is offline */21602160+ } else if (!kgdb_info[i].enter_kgdb) {21612161+ state = 'D'; /* cpu is online but unresponsive */22042162 } else {22052163 state = ' '; /* cpu is responding to kdb */22062164 if (kdb_task_state_char(KDB_TSK(i)) == 'I')···22562210 /*22572211 * Validate cpunum22582212 */22592259- if ((cpunum > NR_CPUS) || !cpu_online(cpunum))22132213+ if ((cpunum > NR_CPUS) || !kgdb_info[cpunum].enter_kgdb)22602214 return KDB_BADCPUNUM;2261221522622216 dbg_switch_cpu = cpunum;···24202374 if (KDB_FLAG(CMD_INTERRUPT))24212375 return 0;24222376 if (!kt->cmd_name)23772377+ continue;23782378+ if (!kdb_check_flags(kt->cmd_flags, kdb_cmd_enabled, true))24232379 continue;24242380 if (strlen(kt->cmd_usage) > 20)24252381 space = "\n ";···26772629}2678263026792631/*26802680- * kdb_register_repeat - This function is used to register a kernel26322632+ * kdb_register_flags - This function is used to register a kernel26812633 * debugger command.26822634 * Inputs:26832635 * cmd Command name···26892641 * zero for success, one if a duplicate command.26902642 */26912643#define kdb_command_extend 50 /* arbitrary */26922692-int kdb_register_repeat(char *cmd,26932693- kdb_func_t func,26942694- char *usage,26952695- char *help,26962696- short minlen,26972697- kdb_repeat_t repeat)26442644+int kdb_register_flags(char *cmd,26452645+ kdb_func_t func,26462646+ char *usage,26472647+ char *help,26482648+ short minlen,26492649+ kdb_cmdflags_t flags)26982650{26992651 int i;27002652 kdbtab_t *kp;···27422694 kp->cmd_func = func;27432695 kp->cmd_usage = usage;27442696 kp->cmd_help = help;27452745- kp->cmd_flags = 0;27462697 kp->cmd_minlen = minlen;27472747- kp->cmd_repeat = repeat;26982698+ kp->cmd_flags = flags;2748269927492700 return 0;27502701}27512751-EXPORT_SYMBOL_GPL(kdb_register_repeat);27022702+EXPORT_SYMBOL_GPL(kdb_register_flags);275227032753270427542705/*27552706 * kdb_register - Compatibility register function for commands that do27562707 * not need to specify a repeat state. Equivalent to27572757- * kdb_register_repeat with KDB_REPEAT_NONE.27082708+ * kdb_register_flags with flags set to 0.27582709 * Inputs:27592710 * cmd Command name27602711 * func Function to execute the command···27682721 char *help,27692722 short minlen)27702723{27712771- return kdb_register_repeat(cmd, func, usage, help, minlen,27722772- KDB_REPEAT_NONE);27242724+ return kdb_register_flags(cmd, func, usage, help, minlen, 0);27732725}27742726EXPORT_SYMBOL_GPL(kdb_register);27752727···28102764 for_each_kdbcmd(kp, i)28112765 kp->cmd_name = NULL;2812276628132813- kdb_register_repeat("md", kdb_md, "<vaddr>",27672767+ kdb_register_flags("md", kdb_md, "<vaddr>",28142768 "Display Memory Contents, also mdWcN, e.g. md8c1", 1,28152815- KDB_REPEAT_NO_ARGS);28162816- kdb_register_repeat("mdr", kdb_md, "<vaddr> <bytes>",28172817- "Display Raw Memory", 0, KDB_REPEAT_NO_ARGS);28182818- kdb_register_repeat("mdp", kdb_md, "<paddr> <bytes>",28192819- "Display Physical Memory", 0, KDB_REPEAT_NO_ARGS);28202820- kdb_register_repeat("mds", kdb_md, "<vaddr>",28212821- "Display Memory Symbolically", 0, KDB_REPEAT_NO_ARGS);28222822- kdb_register_repeat("mm", kdb_mm, "<vaddr> <contents>",28232823- "Modify Memory Contents", 0, KDB_REPEAT_NO_ARGS);28242824- kdb_register_repeat("go", kdb_go, "[<vaddr>]",28252825- "Continue Execution", 1, KDB_REPEAT_NONE);28262826- kdb_register_repeat("rd", kdb_rd, "",28272827- "Display Registers", 0, KDB_REPEAT_NONE);28282828- kdb_register_repeat("rm", kdb_rm, "<reg> <contents>",28292829- "Modify Registers", 0, KDB_REPEAT_NONE);28302830- kdb_register_repeat("ef", kdb_ef, "<vaddr>",28312831- "Display exception frame", 0, KDB_REPEAT_NONE);28322832- kdb_register_repeat("bt", kdb_bt, "[<vaddr>]",28332833- "Stack traceback", 1, KDB_REPEAT_NONE);28342834- kdb_register_repeat("btp", kdb_bt, "<pid>",28352835- "Display stack for process <pid>", 0, KDB_REPEAT_NONE);28362836- kdb_register_repeat("bta", kdb_bt, "[D|R|S|T|C|Z|E|U|I|M|A]",28372837- "Backtrace all processes matching state flag", 0, KDB_REPEAT_NONE);28382838- kdb_register_repeat("btc", kdb_bt, "",28392839- "Backtrace current process on each cpu", 0, KDB_REPEAT_NONE);28402840- kdb_register_repeat("btt", kdb_bt, "<vaddr>",27692769+ KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS);27702770+ kdb_register_flags("mdr", kdb_md, "<vaddr> <bytes>",27712771+ "Display Raw Memory", 0,27722772+ KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS);27732773+ kdb_register_flags("mdp", kdb_md, "<paddr> <bytes>",27742774+ "Display Physical Memory", 0,27752775+ KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS);27762776+ kdb_register_flags("mds", kdb_md, "<vaddr>",27772777+ "Display Memory Symbolically", 0,27782778+ KDB_ENABLE_MEM_READ | KDB_REPEAT_NO_ARGS);27792779+ kdb_register_flags("mm", kdb_mm, "<vaddr> <contents>",27802780+ "Modify Memory Contents", 0,27812781+ KDB_ENABLE_MEM_WRITE | KDB_REPEAT_NO_ARGS);27822782+ kdb_register_flags("go", kdb_go, "[<vaddr>]",27832783+ "Continue Execution", 1,27842784+ KDB_ENABLE_REG_WRITE | KDB_ENABLE_ALWAYS_SAFE_NO_ARGS);27852785+ kdb_register_flags("rd", kdb_rd, "",27862786+ "Display Registers", 0,27872787+ KDB_ENABLE_REG_READ);27882788+ kdb_register_flags("rm", kdb_rm, "<reg> <contents>",27892789+ "Modify Registers", 0,27902790+ KDB_ENABLE_REG_WRITE);27912791+ kdb_register_flags("ef", kdb_ef, "<vaddr>",27922792+ "Display exception frame", 0,27932793+ KDB_ENABLE_MEM_READ);27942794+ kdb_register_flags("bt", kdb_bt, "[<vaddr>]",27952795+ "Stack traceback", 1,27962796+ KDB_ENABLE_MEM_READ | KDB_ENABLE_INSPECT_NO_ARGS);27972797+ kdb_register_flags("btp", kdb_bt, "<pid>",27982798+ "Display stack for process <pid>", 0,27992799+ KDB_ENABLE_INSPECT);28002800+ kdb_register_flags("bta", kdb_bt, "[D|R|S|T|C|Z|E|U|I|M|A]",28012801+ "Backtrace all processes matching state flag", 0,28022802+ KDB_ENABLE_INSPECT);28032803+ kdb_register_flags("btc", kdb_bt, "",28042804+ "Backtrace current process on each cpu", 0,28052805+ KDB_ENABLE_INSPECT);28062806+ kdb_register_flags("btt", kdb_bt, "<vaddr>",28412807 "Backtrace process given its struct task address", 0,28422842- KDB_REPEAT_NONE);28432843- kdb_register_repeat("env", kdb_env, "",28442844- "Show environment variables", 0, KDB_REPEAT_NONE);28452845- kdb_register_repeat("set", kdb_set, "",28462846- "Set environment variables", 0, KDB_REPEAT_NONE);28472847- kdb_register_repeat("help", kdb_help, "",28482848- "Display Help Message", 1, KDB_REPEAT_NONE);28492849- kdb_register_repeat("?", kdb_help, "",28502850- "Display Help Message", 0, KDB_REPEAT_NONE);28512851- kdb_register_repeat("cpu", kdb_cpu, "<cpunum>",28522852- "Switch to new cpu", 0, KDB_REPEAT_NONE);28532853- kdb_register_repeat("kgdb", kdb_kgdb, "",28542854- "Enter kgdb mode", 0, KDB_REPEAT_NONE);28552855- kdb_register_repeat("ps", kdb_ps, "[<flags>|A]",28562856- "Display active task list", 0, KDB_REPEAT_NONE);28572857- kdb_register_repeat("pid", kdb_pid, "<pidnum>",28582858- "Switch to another task", 0, KDB_REPEAT_NONE);28592859- kdb_register_repeat("reboot", kdb_reboot, "",28602860- "Reboot the machine immediately", 0, KDB_REPEAT_NONE);28082808+ KDB_ENABLE_MEM_READ | KDB_ENABLE_INSPECT_NO_ARGS);28092809+ kdb_register_flags("env", kdb_env, "",28102810+ "Show environment variables", 0,28112811+ KDB_ENABLE_ALWAYS_SAFE);28122812+ kdb_register_flags("set", kdb_set, "",28132813+ "Set environment variables", 0,28142814+ KDB_ENABLE_ALWAYS_SAFE);28152815+ kdb_register_flags("help", kdb_help, "",28162816+ "Display Help Message", 1,28172817+ KDB_ENABLE_ALWAYS_SAFE);28182818+ kdb_register_flags("?", kdb_help, "",28192819+ "Display Help Message", 0,28202820+ KDB_ENABLE_ALWAYS_SAFE);28212821+ kdb_register_flags("cpu", kdb_cpu, "<cpunum>",28222822+ "Switch to new cpu", 0,28232823+ KDB_ENABLE_ALWAYS_SAFE_NO_ARGS);28242824+ kdb_register_flags("kgdb", kdb_kgdb, "",28252825+ "Enter kgdb mode", 0, 0);28262826+ kdb_register_flags("ps", kdb_ps, "[<flags>|A]",28272827+ "Display active task list", 0,28282828+ KDB_ENABLE_INSPECT);28292829+ kdb_register_flags("pid", kdb_pid, "<pidnum>",28302830+ "Switch to another task", 0,28312831+ KDB_ENABLE_INSPECT);28322832+ kdb_register_flags("reboot", kdb_reboot, "",28332833+ "Reboot the machine immediately", 0,28342834+ KDB_ENABLE_REBOOT);28612835#if defined(CONFIG_MODULES)28622862- kdb_register_repeat("lsmod", kdb_lsmod, "",28632863- "List loaded kernel modules", 0, KDB_REPEAT_NONE);28362836+ kdb_register_flags("lsmod", kdb_lsmod, "",28372837+ "List loaded kernel modules", 0,28382838+ KDB_ENABLE_INSPECT);28642839#endif28652840#if defined(CONFIG_MAGIC_SYSRQ)28662866- kdb_register_repeat("sr", kdb_sr, "<key>",28672867- "Magic SysRq key", 0, KDB_REPEAT_NONE);28412841+ kdb_register_flags("sr", kdb_sr, "<key>",28422842+ "Magic SysRq key", 0,28432843+ KDB_ENABLE_ALWAYS_SAFE);28682844#endif28692845#if defined(CONFIG_PRINTK)28702870- kdb_register_repeat("dmesg", kdb_dmesg, "[lines]",28712871- "Display syslog buffer", 0, KDB_REPEAT_NONE);28462846+ kdb_register_flags("dmesg", kdb_dmesg, "[lines]",28472847+ "Display syslog buffer", 0,28482848+ KDB_ENABLE_ALWAYS_SAFE);28722849#endif28732850 if (arch_kgdb_ops.enable_nmi) {28742874- kdb_register_repeat("disable_nmi", kdb_disable_nmi, "",28752875- "Disable NMI entry to KDB", 0, KDB_REPEAT_NONE);28512851+ kdb_register_flags("disable_nmi", kdb_disable_nmi, "",28522852+ "Disable NMI entry to KDB", 0,28532853+ KDB_ENABLE_ALWAYS_SAFE);28762854 }28772877- kdb_register_repeat("defcmd", kdb_defcmd, "name \"usage\" \"help\"",28782878- "Define a set of commands, down to endefcmd", 0, KDB_REPEAT_NONE);28792879- kdb_register_repeat("kill", kdb_kill, "<-signal> <pid>",28802880- "Send a signal to a process", 0, KDB_REPEAT_NONE);28812881- kdb_register_repeat("summary", kdb_summary, "",28822882- "Summarize the system", 4, KDB_REPEAT_NONE);28832883- kdb_register_repeat("per_cpu", kdb_per_cpu, "<sym> [<bytes>] [<cpu>]",28842884- "Display per_cpu variables", 3, KDB_REPEAT_NONE);28852885- kdb_register_repeat("grephelp", kdb_grep_help, "",28862886- "Display help on | grep", 0, KDB_REPEAT_NONE);28552855+ kdb_register_flags("defcmd", kdb_defcmd, "name \"usage\" \"help\"",28562856+ "Define a set of commands, down to endefcmd", 0,28572857+ KDB_ENABLE_ALWAYS_SAFE);28582858+ kdb_register_flags("kill", kdb_kill, "<-signal> <pid>",28592859+ "Send a signal to a process", 0,28602860+ KDB_ENABLE_SIGNAL);28612861+ kdb_register_flags("summary", kdb_summary, "",28622862+ "Summarize the system", 4,28632863+ KDB_ENABLE_ALWAYS_SAFE);28642864+ kdb_register_flags("per_cpu", kdb_per_cpu, "<sym> [<bytes>] [<cpu>]",28652865+ "Display per_cpu variables", 3,28662866+ KDB_ENABLE_MEM_READ);28672867+ kdb_register_flags("grephelp", kdb_grep_help, "",28682868+ "Display help on | grep", 0,28692869+ KDB_ENABLE_ALWAYS_SAFE);28872870}2888287128892872/* Execute any commands defined in kdb_cmds. */
+1-2
kernel/debug/kdb/kdb_private.h
···172172 kdb_func_t cmd_func; /* Function to execute command */173173 char *cmd_usage; /* Usage String for this command */174174 char *cmd_help; /* Help message for this command */175175- short cmd_flags; /* Parsing flags */176175 short cmd_minlen; /* Minimum legal # command177176 * chars required */178178- kdb_repeat_t cmd_repeat; /* Does command auto repeat on enter? */177177+ kdb_cmdflags_t cmd_flags; /* Command behaviour flags */179178} kdbtab_t;180179181180extern int kdb_bt(int, const char **); /* KDB display back trace */
+8-11
kernel/events/core.c
···44614461}4462446244634463static void perf_sample_regs_user(struct perf_regs *regs_user,44644464- struct pt_regs *regs)44644464+ struct pt_regs *regs,44654465+ struct pt_regs *regs_user_copy)44654466{44664466- if (!user_mode(regs)) {44674467- if (current->mm)44684468- regs = task_pt_regs(current);44694469- else44704470- regs = NULL;44714471- }44724472-44734473- if (regs) {44744474- regs_user->abi = perf_reg_abi(current);44674467+ if (user_mode(regs)) {44684468+ regs_user->abi = perf_reg_abi(current);44754469 regs_user->regs = regs;44704470+ } else if (current->mm) {44714471+ perf_get_regs_user(regs_user, regs, regs_user_copy);44764472 } else {44774473 regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE;44784474 regs_user->regs = NULL;···49474951 }4948495249494953 if (sample_type & (PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER))49504950- perf_sample_regs_user(&data->regs_user, regs);49544954+ perf_sample_regs_user(&data->regs_user, regs,49554955+ &data->regs_user_copy);4951495649524957 if (sample_type & PERF_SAMPLE_REGS_USER) {49534958 /* regs dump ABI info */
+9-3
kernel/exit.c
···12871287static int wait_consider_task(struct wait_opts *wo, int ptrace,12881288 struct task_struct *p)12891289{12901290+ /*12911291+ * We can race with wait_task_zombie() from another thread.12921292+ * Ensure that EXIT_ZOMBIE -> EXIT_DEAD/EXIT_TRACE transition12931293+ * can't confuse the checks below.12941294+ */12951295+ int exit_state = ACCESS_ONCE(p->exit_state);12901296 int ret;1291129712921292- if (unlikely(p->exit_state == EXIT_DEAD))12981298+ if (unlikely(exit_state == EXIT_DEAD))12931299 return 0;1294130012951301 ret = eligible_child(wo, p);···13161310 return 0;13171311 }1318131213191319- if (unlikely(p->exit_state == EXIT_TRACE)) {13131313+ if (unlikely(exit_state == EXIT_TRACE)) {13201314 /*13211315 * ptrace == 0 means we are the natural parent. In this case13221316 * we should clear notask_error, debugger will notify us.···13431337 }1344133813451339 /* slay zombie? */13461346- if (p->exit_state == EXIT_ZOMBIE) {13401340+ if (exit_state == EXIT_ZOMBIE) {13471341 /* we don't reap group leaders with subthreads */13481342 if (!delay_group_leader(p)) {13491343 /*
+1-1
kernel/locking/mutex-debug.c
···8080 DEBUG_LOCKS_WARN_ON(lock->owner != current);81818282 DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);8383- mutex_clear_owner(lock);8483 }85848685 /*8786 * __mutex_slowpath_needs_to_unlock() is explicitly 0 for debug8887 * mutexes so that we can do it here after we've verified state.8988 */8989+ mutex_clear_owner(lock);9090 atomic_set(&lock->count, 1);9191}9292
···570570static571571int dl_runtime_exceeded(struct rq *rq, struct sched_dl_entity *dl_se)572572{573573- int dmiss = dl_time_before(dl_se->deadline, rq_clock(rq));574574- int rorun = dl_se->runtime <= 0;575575-576576- if (!rorun && !dmiss)577577- return 0;578578-579579- /*580580- * If we are beyond our current deadline and we are still581581- * executing, then we have already used some of the runtime of582582- * the next instance. Thus, if we do not account that, we are583583- * stealing bandwidth from the system at each deadline miss!584584- */585585- if (dmiss) {586586- dl_se->runtime = rorun ? dl_se->runtime : 0;587587- dl_se->runtime -= rq_clock(rq) - dl_se->deadline;588588- }589589-590590- return 1;573573+ return (dl_se->runtime <= 0);591574}592575593576extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);···809826 * parameters of the task might need updating. Otherwise,810827 * we want a replenishment of its runtime.811828 */812812- if (!dl_se->dl_new && flags & ENQUEUE_REPLENISH)813813- replenish_dl_entity(dl_se, pi_se);814814- else829829+ if (dl_se->dl_new || flags & ENQUEUE_WAKEUP)815830 update_dl_entity(dl_se, pi_se);831831+ else if (flags & ENQUEUE_REPLENISH)832832+ replenish_dl_entity(dl_se, pi_se);816833817834 __enqueue_dl_entity(dl_se);818835}
+5-1
kernel/sched/fair.c
···4005400540064006static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b)40074007{40084008+ /* init_cfs_bandwidth() was not called */40094009+ if (!cfs_b->throttled_cfs_rq.next)40104010+ return;40114011+40084012 hrtimer_cancel(&cfs_b->period_timer);40094013 hrtimer_cancel(&cfs_b->slack_timer);40104014}···44284424 * wl = S * s'_i; see (2)44294425 */44304426 if (W > 0 && w < W)44314431- wl = (w * tg->shares) / W;44274427+ wl = (w * (long)tg->shares) / W;44324428 else44334429 wl = tg->shares;44344430
···7373 help7474 KDB frontend for kernel75757676+config KDB_DEFAULT_ENABLE7777+ hex "KDB: Select kdb command functions to be enabled by default"7878+ depends on KGDB_KDB7979+ default 0x18080+ help8181+ Specifiers which kdb commands are enabled by default. This may8282+ be set to 1 or 0 to enable all commands or disable almost all8383+ commands.8484+8585+ Alternatively the following bitmask applies:8686+8787+ 0x0002 - allow arbitrary reads from memory and symbol lookup8888+ 0x0004 - allow arbitrary writes to memory8989+ 0x0008 - allow current register state to be inspected9090+ 0x0010 - allow current register state to be modified9191+ 0x0020 - allow passive inspection (backtrace, process list, lsmod)9292+ 0x0040 - allow flow control management (breakpoint, single step)9393+ 0x0080 - enable signalling of processes9494+ 0x0100 - allow machine to be rebooted9595+9696+ The config option merely sets the default at boot time. Both9797+ issuing 'echo X > /sys/module/kdb/parameters/cmd_enable' or9898+ setting with kdb.cmd_enable=X kernel command line option will9999+ override the default settings.100100+76101config KDB_KEYBOARD77102 bool "KGDB_KDB: keyboard as input device"78103 depends on VT && KGDB_KDB
+1
lib/assoc_array.c
···1111 * 2 of the Licence, or (at your option) any later version.1212 */1313//#define DEBUG1414+#include <linux/rcupdate.h>1415#include <linux/slab.h>1516#include <linux/err.h>1617#include <linux/assoc_array_priv.h>
-9
mm/Kconfig.debug
···1414 depends on !KMEMCHECK1515 select PAGE_EXTENSION1616 select PAGE_POISONING if !ARCH_SUPPORTS_DEBUG_PAGEALLOC1717- select PAGE_GUARD if ARCH_SUPPORTS_DEBUG_PAGEALLOC1817 ---help---1918 Unmap pages from the kernel linear mapping after free_pages().2019 This results in a large slowdown, but helps to find certain types···2627 that would result in incorrect warnings of memory corruption after2728 a resume because free pages are not saved to the suspend image.28292929-config WANT_PAGE_DEBUG_FLAGS3030- bool3131-3230config PAGE_POISONING3331 bool3434- select WANT_PAGE_DEBUG_FLAGS3535-3636-config PAGE_GUARD3737- bool3838- select WANT_PAGE_DEBUG_FLAGS
+4-13
mm/memcontrol.c
···30433043 if (swap_cgroup_cmpxchg(entry, old_id, new_id) == old_id) {30443044 mem_cgroup_swap_statistics(from, false);30453045 mem_cgroup_swap_statistics(to, true);30463046- /*30473047- * This function is only called from task migration context now.30483048- * It postpones page_counter and refcount handling till the end30493049- * of task migration(mem_cgroup_clear_mc()) for performance30503050- * improvement. But we cannot postpone css_get(to) because if30513051- * the process that has been moved to @to does swap-in, the30523052- * refcount of @to might be decreased to 0.30533053- *30543054- * We are in attach() phase, so the cgroup is guaranteed to be30553055- * alive, so we can just call css_get().30563056- */30573057- css_get(&to->css);30583046 return 0;30593047 }30603048 return -EINVAL;···46674679 if (parent_css == NULL) {46684680 root_mem_cgroup = memcg;46694681 page_counter_init(&memcg->memory, NULL);46824682+ memcg->soft_limit = PAGE_COUNTER_MAX;46704683 page_counter_init(&memcg->memsw, NULL);46714684 page_counter_init(&memcg->kmem, NULL);46724685 }···4713472447144725 if (parent->use_hierarchy) {47154726 page_counter_init(&memcg->memory, &parent->memory);47274727+ memcg->soft_limit = PAGE_COUNTER_MAX;47164728 page_counter_init(&memcg->memsw, &parent->memsw);47174729 page_counter_init(&memcg->kmem, &parent->kmem);47184730···47234733 */47244734 } else {47254735 page_counter_init(&memcg->memory, NULL);47364736+ memcg->soft_limit = PAGE_COUNTER_MAX;47264737 page_counter_init(&memcg->memsw, NULL);47274738 page_counter_init(&memcg->kmem, NULL);47284739 /*···47984807 mem_cgroup_resize_limit(memcg, PAGE_COUNTER_MAX);47994808 mem_cgroup_resize_memsw_limit(memcg, PAGE_COUNTER_MAX);48004809 memcg_update_kmem_limit(memcg, PAGE_COUNTER_MAX);48014801- memcg->soft_limit = 0;48104810+ memcg->soft_limit = PAGE_COUNTER_MAX;48024811}4803481248044813#ifdef CONFIG_MMU
+23-16
mm/memory.c
···235235236236static void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb)237237{238238+ if (!tlb->end)239239+ return;240240+238241 tlb_flush(tlb);239242 mmu_notifier_invalidate_range(tlb->mm, tlb->start, tlb->end);240243#ifdef CONFIG_HAVE_RCU_TABLE_FREE···250247{251248 struct mmu_gather_batch *batch;252249253253- for (batch = &tlb->local; batch; batch = batch->next) {250250+ for (batch = &tlb->local; batch && batch->nr; batch = batch->next) {254251 free_pages_and_swap_cache(batch->pages, batch->nr);255252 batch->nr = 0;256253 }···259256260257void tlb_flush_mmu(struct mmu_gather *tlb)261258{262262- if (!tlb->end)263263- return;264264-265259 tlb_flush_mmu_tlbonly(tlb);266260 tlb_flush_mmu_free(tlb);267261}···21372137 if (!dirty_page)21382138 return ret;2139213921402140- /*21412141- * Yes, Virginia, this is actually required to prevent a race21422142- * with clear_page_dirty_for_io() from clearing the page dirty21432143- * bit after it clear all dirty ptes, but before a racing21442144- * do_wp_page installs a dirty pte.21452145- *21462146- * do_shared_fault is protected similarly.21472147- */21482140 if (!page_mkwrite) {21492149- wait_on_page_locked(dirty_page);21502150- set_page_dirty_balance(dirty_page);21412141+ struct address_space *mapping;21422142+ int dirtied;21432143+21442144+ lock_page(dirty_page);21452145+ dirtied = set_page_dirty(dirty_page);21462146+ VM_BUG_ON_PAGE(PageAnon(dirty_page), dirty_page);21472147+ mapping = dirty_page->mapping;21482148+ unlock_page(dirty_page);21492149+21502150+ if (dirtied && mapping) {21512151+ /*21522152+ * Some device drivers do not set page.mapping21532153+ * but still dirty their pages21542154+ */21552155+ balance_dirty_pages_ratelimited(mapping);21562156+ }21572157+21512158 /* file_update_time outside page_lock */21522159 if (vma->vm_file)21532160 file_update_time(vma->vm_file);···26002593 if (prev && prev->vm_end == address)26012594 return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;2602259526032603- expand_downwards(vma, address - PAGE_SIZE);25962596+ return expand_downwards(vma, address - PAGE_SIZE);26042597 }26052598 if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {26062599 struct vm_area_struct *next = vma->vm_next;···26092602 if (next && next->vm_start == address + PAGE_SIZE)26102603 return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;2611260426122612- expand_upwards(vma, address + PAGE_SIZE);26052605+ return expand_upwards(vma, address + PAGE_SIZE);26132606 }26142607 return 0;26152608}
+10-5
mm/mmap.c
···778778 if (exporter && exporter->anon_vma && !importer->anon_vma) {779779 int error;780780781781- error = anon_vma_clone(importer, exporter);782782- if (error)783783- return error;784781 importer->anon_vma = exporter->anon_vma;782782+ error = anon_vma_clone(importer, exporter);783783+ if (error) {784784+ importer->anon_vma = NULL;785785+ return error;786786+ }785787 }786788 }787789···21012099{21022100 struct mm_struct *mm = vma->vm_mm;21032101 struct rlimit *rlim = current->signal->rlim;21042104- unsigned long new_start;21022102+ unsigned long new_start, actual_size;2105210321062104 /* address space limit tests */21072105 if (!may_expand_vm(mm, grow))21082106 return -ENOMEM;2109210721102108 /* Stack limit test */21112111- if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))21092109+ actual_size = size;21102110+ if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))21112111+ actual_size -= PAGE_SIZE;21122112+ if (actual_size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))21122113 return -ENOMEM;2113211421142115 /* mlock limit tests */
+12-31
mm/page-writeback.c
···15411541 bdi_start_background_writeback(bdi);15421542}1543154315441544-void set_page_dirty_balance(struct page *page)15451545-{15461546- if (set_page_dirty(page)) {15471547- struct address_space *mapping = page_mapping(page);15481548-15491549- if (mapping)15501550- balance_dirty_pages_ratelimited(mapping);15511551- }15521552-}15531553-15541544static DEFINE_PER_CPU(int, bdp_ratelimits);1555154515561546/*···21132123 * page dirty in that case, but not all the buffers. This is a "bottom-up"21142124 * dirtying, whereas __set_page_dirty_buffers() is a "top-down" dirtying.21152125 *21162116- * Most callers have locked the page, which pins the address_space in memory.21172117- * But zap_pte_range() does not lock the page, however in that case the21182118- * mapping is pinned by the vma's ->vm_file reference.21192119- *21202120- * We take care to handle the case where the page was truncated from the21212121- * mapping by re-checking page_mapping() inside tree_lock.21262126+ * The caller must ensure this doesn't race with truncation. Most will simply21272127+ * hold the page lock, but e.g. zap_pte_range() calls with the page mapped and21282128+ * the pte lock held, which also locks out truncation.21222129 */21232130int __set_page_dirty_nobuffers(struct page *page)21242131{21252132 if (!TestSetPageDirty(page)) {21262133 struct address_space *mapping = page_mapping(page);21272127- struct address_space *mapping2;21282134 unsigned long flags;2129213521302136 if (!mapping)21312137 return 1;2132213821332139 spin_lock_irqsave(&mapping->tree_lock, flags);21342134- mapping2 = page_mapping(page);21352135- if (mapping2) { /* Race with truncate? */21362136- BUG_ON(mapping2 != mapping);21372137- WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page));21382138- account_page_dirtied(page, mapping);21392139- radix_tree_tag_set(&mapping->page_tree,21402140- page_index(page), PAGECACHE_TAG_DIRTY);21412141- }21402140+ BUG_ON(page_mapping(page) != mapping);21412141+ WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page));21422142+ account_page_dirtied(page, mapping);21432143+ radix_tree_tag_set(&mapping->page_tree, page_index(page),21442144+ PAGECACHE_TAG_DIRTY);21422145 spin_unlock_irqrestore(&mapping->tree_lock, flags);21432146 if (mapping->host) {21442147 /* !PageAnon && !swapper_space */···22882305 /*22892306 * We carefully synchronise fault handlers against22902307 * installing a dirty pte and marking the page dirty22912291- * at this point. We do this by having them hold the22922292- * page lock at some point after installing their22932293- * pte, but before marking the page dirty.22942294- * Pages are always locked coming in here, so we get22952295- * the desired exclusion. See mm/memory.c:do_wp_page()22962296- * for more comments.23082308+ * at this point. We do this by having them hold the23092309+ * page lock while dirtying the page, and pages are23102310+ * always locked coming in here, so we get the desired23112311+ * exclusion.22972312 */22982313 if (TestClearPageDirty(page)) {22992314 dec_zone_page_state(page, NR_FILE_DIRTY);
+41-1
mm/rmap.c
···7272 anon_vma = kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL);7373 if (anon_vma) {7474 atomic_set(&anon_vma->refcount, 1);7575+ anon_vma->degree = 1; /* Reference for first vma */7676+ anon_vma->parent = anon_vma;7577 /*7678 * Initialise the anon_vma root to point to itself. If called7779 * from fork, the root will be reset to the parents anon_vma.···190188 if (likely(!vma->anon_vma)) {191189 vma->anon_vma = anon_vma;192190 anon_vma_chain_link(vma, avc, anon_vma);191191+ /* vma reference or self-parent link for new root */192192+ anon_vma->degree++;193193 allocated = NULL;194194 avc = NULL;195195 }···240236/*241237 * Attach the anon_vmas from src to dst.242238 * Returns 0 on success, -ENOMEM on failure.239239+ *240240+ * If dst->anon_vma is NULL this function tries to find and reuse existing241241+ * anon_vma which has no vmas and only one child anon_vma. This prevents242242+ * degradation of anon_vma hierarchy to endless linear chain in case of243243+ * constantly forking task. On the other hand, an anon_vma with more than one244244+ * child isn't reused even if there was no alive vma, thus rmap walker has a245245+ * good chance of avoiding scanning the whole hierarchy when it searches where246246+ * page is mapped.243247 */244248int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)245249{···268256 anon_vma = pavc->anon_vma;269257 root = lock_anon_vma_root(root, anon_vma);270258 anon_vma_chain_link(dst, avc, anon_vma);259259+260260+ /*261261+ * Reuse existing anon_vma if its degree lower than two,262262+ * that means it has no vma and only one anon_vma child.263263+ *264264+ * Do not chose parent anon_vma, otherwise first child265265+ * will always reuse it. Root anon_vma is never reused:266266+ * it has self-parent reference and at least one child.267267+ */268268+ if (!dst->anon_vma && anon_vma != src->anon_vma &&269269+ anon_vma->degree < 2)270270+ dst->anon_vma = anon_vma;271271 }272272+ if (dst->anon_vma)273273+ dst->anon_vma->degree++;272274 unlock_anon_vma_root(root);273275 return 0;274276···306280 if (!pvma->anon_vma)307281 return 0;308282283283+ /* Drop inherited anon_vma, we'll reuse existing or allocate new. */284284+ vma->anon_vma = NULL;285285+309286 /*310287 * First, attach the new VMA to the parent VMA's anon_vmas,311288 * so rmap can find non-COWed pages in child processes.···316287 error = anon_vma_clone(vma, pvma);317288 if (error)318289 return error;290290+291291+ /* An existing anon_vma has been reused, all done then. */292292+ if (vma->anon_vma)293293+ return 0;319294320295 /* Then add our own anon_vma. */321296 anon_vma = anon_vma_alloc();···334301 * lock any of the anon_vmas in this anon_vma tree.335302 */336303 anon_vma->root = pvma->anon_vma->root;304304+ anon_vma->parent = pvma->anon_vma;337305 /*338306 * With refcounts, an anon_vma can stay around longer than the339307 * process it belongs to. The root anon_vma needs to be pinned until···345311 vma->anon_vma = anon_vma;346312 anon_vma_lock_write(anon_vma);347313 anon_vma_chain_link(vma, avc, anon_vma);314314+ anon_vma->parent->degree++;348315 anon_vma_unlock_write(anon_vma);349316350317 return 0;···376341 * Leave empty anon_vmas on the list - we'll need377342 * to free them outside the lock.378343 */379379- if (RB_EMPTY_ROOT(&anon_vma->rb_root))344344+ if (RB_EMPTY_ROOT(&anon_vma->rb_root)) {345345+ anon_vma->parent->degree--;380346 continue;347347+ }381348382349 list_del(&avc->same_vma);383350 anon_vma_chain_free(avc);384351 }352352+ if (vma->anon_vma)353353+ vma->anon_vma->degree--;385354 unlock_anon_vma_root(root);386355387356 /*···396357 list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) {397358 struct anon_vma *anon_vma = avc->anon_vma;398359360360+ BUG_ON(anon_vma->degree);399361 put_anon_vma(anon_vma);400362401363 list_del(&avc->same_vma);
+13-11
mm/vmscan.c
···29212921 return false;2922292229232923 /*29242924- * There is a potential race between when kswapd checks its watermarks29252925- * and a process gets throttled. There is also a potential race if29262926- * processes get throttled, kswapd wakes, a large process exits therby29272927- * balancing the zones that causes kswapd to miss a wakeup. If kswapd29282928- * is going to sleep, no process should be sleeping on pfmemalloc_wait29292929- * so wake them now if necessary. If necessary, processes will wake29302930- * kswapd and get throttled again29242924+ * The throttled processes are normally woken up in balance_pgdat() as29252925+ * soon as pfmemalloc_watermark_ok() is true. But there is a potential29262926+ * race between when kswapd checks the watermarks and a process gets29272927+ * throttled. There is also a potential race if processes get29282928+ * throttled, kswapd wakes, a large process exits thereby balancing the29292929+ * zones, which causes kswapd to exit balance_pgdat() before reaching29302930+ * the wake up checks. If kswapd is going to sleep, no process should29312931+ * be sleeping on pfmemalloc_wait, so wake them now if necessary. If29322932+ * the wake up is premature, processes will wake kswapd and get29332933+ * throttled again. The difference from wake ups in balance_pgdat() is29342934+ * that here we are under prepare_to_wait().29312935 */29322932- if (waitqueue_active(&pgdat->pfmemalloc_wait)) {29332933- wake_up(&pgdat->pfmemalloc_wait);29342934- return false;29352935- }29362936+ if (waitqueue_active(&pgdat->pfmemalloc_wait))29372937+ wake_up_all(&pgdat->pfmemalloc_wait);2936293829372939 return pgdat_balanced(pgdat, order, classzone_idx);29382940}
+7-4
net/batman-adv/multicast.c
···685685 if (orig_initialized)686686 atomic_dec(&bat_priv->mcast.num_disabled);687687 orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST;688688- /* If mcast support is being switched off increase the disabled689689- * mcast node counter.688688+ /* If mcast support is being switched off or if this is an initial689689+ * OGM without mcast support then increase the disabled mcast690690+ * node counter.690691 */691692 } else if (!orig_mcast_enabled &&692692- orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) {693693+ (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST ||694694+ !orig_initialized)) {693695 atomic_inc(&bat_priv->mcast.num_disabled);694696 orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST;695697 }···740738{741739 struct batadv_priv *bat_priv = orig->bat_priv;742740743743- if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST))741741+ if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) &&742742+ orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST)744743 atomic_dec(&bat_priv->mcast.num_disabled);745744746745 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
+1-1
net/batman-adv/network-coding.c
···133133 if (!bat_priv->nc.decoding_hash)134134 goto err;135135136136- batadv_hash_set_lock_class(bat_priv->nc.coding_hash,136136+ batadv_hash_set_lock_class(bat_priv->nc.decoding_hash,137137 &batadv_nc_decoding_hash_lock_class_key);138138139139 INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
···443443444444 router = batadv_orig_router_get(orig_node, recv_if);445445446446+ if (!router)447447+ return router;448448+446449 /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop)447450 * and if activated.448451 */449449- if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) ||450450- !router)452452+ if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding)))451453 return router;452454453455 /* bonding: loop through the list of possible routers found
···606606 struct kvec *head = buf->head;607607 struct kvec *tail = buf->tail;608608 int fraglen;609609- int new, old;609609+ int new;610610611611 if (len > buf->len) {612612 WARN_ON_ONCE(1);···629629 buf->len -= fraglen;630630631631 new = buf->page_base + buf->page_len;632632- old = new + fraglen;633633- xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT);632632+633633+ xdr->page_ptr = buf->pages + (new >> PAGE_SHIFT);634634635635 if (buf->page_len) {636636 xdr->p = page_address(*xdr->page_ptr);
+8-8
scripts/Makefile.clean
···42424343__clean-files := $(filter-out $(no-clean-files), $(__clean-files))44444545-# as clean-files is given relative to the current directory, this adds4646-# a $(obj) prefix, except for absolute paths4545+# clean-files is given relative to the current directory, unless it4646+# starts with $(objtree)/ (which means "./", so do not add "./" unless4747+# you want to delete a file from the toplevel object directory).47484849__clean-files := $(wildcard \4949- $(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \5050- $(filter /%, $(__clean-files)))5050+ $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(__clean-files))) \5151+ $(filter $(objtree)/%, $(__clean-files)))51525252-# as clean-dirs is given relative to the current directory, this adds5353-# a $(obj) prefix, except for absolute paths5353+# same as clean-files54545555__clean-dirs := $(wildcard \5656- $(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \5757- $(filter /%, $(clean-dirs)))5656+ $(addprefix $(obj)/, $(filter-out $(objtree)/%, $(clean-dirs))) \5757+ $(filter $(objtree)/%, $(clean-dirs)))58585959# ==========================================================================6060
+2-2
security/keys/gc.c
···148148 if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags))149149 atomic_dec(&key->user->nikeys);150150151151- key_user_put(key->user);152152-153151 /* now throw away the key memory */154152 if (key->type->destroy)155153 key->type->destroy(key);154154+155155+ key_user_put(key->user);156156157157 kfree(key->description);158158
···495495 }496496497497 if (ntevs == 0) { /* No error but failed to find probe point. */498498- pr_warning("Probe point '%s' not found.\n",498498+ pr_warning("Probe point '%s' not found in debuginfo.\n",499499 synthesize_perf_probe_point(&pev->point));500500- return -ENOENT;500500+ if (need_dwarf)501501+ return -ENOENT;502502+ return 0;501503 }502504 /* Error path : ntevs < 0 */503505 pr_debug("An error occurred in debuginfo analysis (%d).\n", ntevs);
+17-1
tools/perf/util/probe-finder.c
···989989 int ret = 0;990990991991#if _ELFUTILS_PREREQ(0, 142)992992+ Elf *elf;993993+ GElf_Ehdr ehdr;994994+ GElf_Shdr shdr;995995+992996 /* Get the call frame information from this dwarf */993993- pf->cfi = dwarf_getcfi_elf(dwarf_getelf(dbg->dbg));997997+ elf = dwarf_getelf(dbg->dbg);998998+ if (elf == NULL)999999+ return -EINVAL;10001000+10011001+ if (gelf_getehdr(elf, &ehdr) == NULL)10021002+ return -EINVAL;10031003+10041004+ if (elf_section_by_name(elf, &ehdr, &shdr, ".eh_frame", NULL) &&10051005+ shdr.sh_type == SHT_PROGBITS) {10061006+ pf->cfi = dwarf_getcfi_elf(elf);10071007+ } else {10081008+ pf->cfi = dwarf_getcfi(dbg->dbg);10091009+ }9941010#endif99510119961012 off = 0;
+13-6
tools/testing/selftests/exec/execveat.c
···6262}63636464static int check_execveat_invoked_rc(int fd, const char *path, int flags,6565- int expected_rc)6565+ int expected_rc, int expected_rc2)6666{6767 int status;6868 int rc;···9898 child, status);9999 return 1;100100 }101101- if (WEXITSTATUS(status) != expected_rc) {102102- printf("[FAIL] (child %d exited with %d not %d)\n",103103- child, WEXITSTATUS(status), expected_rc);101101+ if ((WEXITSTATUS(status) != expected_rc) &&102102+ (WEXITSTATUS(status) != expected_rc2)) {103103+ printf("[FAIL] (child %d exited with %d not %d nor %d)\n",104104+ child, WEXITSTATUS(status), expected_rc, expected_rc2);104105 return 1;105106 }106107 printf("[OK]\n");···110109111110static int check_execveat(int fd, const char *path, int flags)112111{113113- return check_execveat_invoked_rc(fd, path, flags, 99);112112+ return check_execveat_invoked_rc(fd, path, flags, 99, 99);114113}115114116115static char *concat(const char *left, const char *right)···193192 * Execute as a long pathname relative to ".". If this is a script,194193 * the interpreter will launch but fail to open the script because its195194 * name ("/dev/fd/5/xxx....") is bigger than PATH_MAX.195195+ *196196+ * The failure code is usually 127 (POSIX: "If a command is not found,197197+ * the exit status shall be 127."), but some systems give 126 (POSIX:198198+ * "If the command name is found, but it is not an executable utility,199199+ * the exit status shall be 126."), so allow either.196200 */197201 if (is_script)198198- fail += check_execveat_invoked_rc(dot_dfd, longpath, 0, 127);202202+ fail += check_execveat_invoked_rc(dot_dfd, longpath, 0,203203+ 127, 126);199204 else200205 fail += check_execveat(dot_dfd, longpath, 0);201206
+1-2
tools/testing/selftests/mqueue/mq_perf_tests.c
···536536{537537 struct mq_attr attr;538538 char *option, *next_option;539539- int i, cpu;539539+ int i, cpu, rc;540540 struct sigaction sa;541541 poptContext popt_context;542542- char rc;543542 void *retval;544543545544 main_thread = pthread_self();