Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update From Base #11

Merged
merged 84 commits into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
838cda3
x86/PCI: Enable AMD 64-bit window on resume
Jan 16, 2018
cc01572
xfrm: Add SA to hardware at the end of xfrm_state_construct()
Jan 17, 2018
f61145f
drm/vc4: Flush the caches before the bin jobs, as well.
anholt Dec 21, 2017
17b11b7
drm/vc4: Fix NULL pointer dereference in vc4_save_hang_state()
Jan 18, 2018
aa5dd6f
xfrm: fix error flow in case of add state fails
aviadye Jan 18, 2018
f30fefd
Input: stmfts,s6sy671 - add SPDX identifier
Jan 22, 2018
e5c9c6a
Input: xpad - add support for PDP Xbox One controllers
TheUbuntuGuy Jan 22, 2018
f5d07b9
Input: trackpoint - force 3 buttons if 0 button is reported
pyma1 Jan 19, 2018
2a924d7
Input: trackpoint - only expose supported controls for Elan, ALPS and…
dtor Jan 5, 2018
5efec5c
xfrm: Fix eth_hdr(skb)->h_proto to reflect inner IP version
Jan 22, 2018
545d8ae
xfrm: fix boolean assignment in xfrm_get_type_offload
GustavoARSilva Jan 22, 2018
e2ac83d
x86/ftrace: Fix ORC unwinding from ftrace handlers
jpoimboe Jan 23, 2018
1f07476
Merge tag 'pci-v4.15-fixes-3' of git://git.kernel.org/pub/scm/linux/k…
torvalds Jan 23, 2018
6be7fa3
ftrace, orc, x86: Handle ftrace dynamically allocated trampolines
rostedt Jan 23, 2018
2ee5b92
tracing: Update stack trace skipping for ORC unwinder
rostedt Jan 23, 2018
02612bb
pppoe: take ->needed_headroom of lower device into account on xmit
Jan 22, 2018
e9191ff
ipv6: Fix getsockopt() for sockets with default IPV6_AUTOFLOWLABEL
bwh-ct Jan 22, 2018
848b159
vmxnet3: repair memory leak
nhorman Jan 22, 2018
a97cb0e
futex: Fix OWNER_DEAD fixup
Jan 22, 2018
88f1c87
locking/lockdep: Avoid triggering hardlockup from debug_show_all_locks()
htejun Jan 22, 2018
ce48c14
sched/core: Fix cpu.max vs. cpuhotplug deadlock
Jan 22, 2018
1df3738
x86/retpoline: Remove the esp/rsp thunk
Waiman-Long Jan 22, 2018
40d4071
perf/x86/amd/power: Do not load AMD power module on !AMD platforms
liangxiao1 Jan 22, 2018
7e702d1
x86/microcode/intel: Extend BDW late-loading further with LLC size check
jiazhang0 Jan 23, 2018
1d080f0
x86/microcode: Fix again accessing initrd after having been freed
suryasaimadhu Jan 23, 2018
1de1ea7
KVM: s390: add proper locking for CMMA migration bitmap
borntraeger Dec 22, 2017
bda646d
Merge tag 'kvm-s390-master-4.15-3' of git://git.kernel.org/pub/scm/li…
rkrcmar Jan 24, 2018
97edf7c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
davem330 Jan 24, 2018
1ecdaea
mlxsw: spectrum_router: Don't log an error on missing neighbor
Jan 24, 2018
5132ede
Revert "module: Add retpoline tag to VERMAGIC"
gregkh Jan 24, 2018
ce30f26
MAINTAINERS: clarify that only verified bugs should be submitted to s…
wtarreau Jan 4, 2018
03fae44
Merge tag 'trace-v4.15-rc9' of git://git.kernel.org/pub/scm/linux/ker…
torvalds Jan 24, 2018
e4fd493
Btrfs: fix stale entries in readdir
Jan 23, 2018
560a660
net: sched: em_nbyte: don't add the data offset twice
Blub Jan 18, 2018
d3303a6
net: sched: fix TCF_LAYER_LINK case in tcf_get_base_ptr
Blub Jan 18, 2018
3eab2ad
MAINTAINERS: update email address for James Morris
Jan 24, 2018
581e722
kcm: Only allow TCP sockets to be attached to a KCM mux
Jan 24, 2018
e557124
kcm: Check if sk_user_data already set in kcm_attach
Jan 24, 2018
88d1d76
Merge branch 'kcm-fix-two-syzcaller-issues'
davem330 Jan 24, 2018
4de4947
qed: Remove reserveration of dpi for kernel
mkalderon Jan 23, 2018
1fe280a
qed: Free reserved MR tid
mkalderon Jan 23, 2018
ee45bea
Merge branch 'qed-rdma-bug-fixes'
davem330 Jan 24, 2018
aebb48f
sparc64: fix typo in CONFIG_CRYPTO_DES_SPARC64 => CONFIG_CRYPTO_CAMEL…
montjoie Jan 23, 2018
b7051cb
i40e: flower: check if TC offload is enabled on a netdev
Jan 23, 2018
e9cb423
vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
jasowang Jan 23, 2018
6f3180a
vhost: do not try to access device IOTLB when not initialized
jasowang Jan 23, 2018
060403f
Revert "Input: synaptics_rmi4 - use devm_device_add_group() for attri…
ndyer Jan 24, 2018
45d6e54
net/ibm/emac: add 8192 rx/tx fifo size
Jan 24, 2018
624ca9c
net/ibm/emac: wrong bit is used for STA control register write
Jan 24, 2018
f165495
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
torvalds Jan 24, 2018
5b7d279
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
torvalds Jan 25, 2018
7e3f8e9
Merge tag 'drm-misc-fixes-2018-01-24' of git://anongit.freedesktop.or…
airlied Jan 25, 2018
82d9485
perf/core: Fix lock inversion between perf,trace,cpuhp
Jan 9, 2018
43fa87f
perf/core: Fix another perf,trace,cpuhp lock inversion
Jan 9, 2018
0c7296c
perf/core: Fix ctx::mutex deadlock
Jan 9, 2018
efe951d
perf/x86: Fix perf,x86,cpuhp deadlock
Jan 10, 2018
4ee806d
net: tcp: close sock if net namespace is exiting
ddstreet Jan 18, 2018
525273f
Merge tag 'for-4.15-tag' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Jan 25, 2018
6e20630
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
torvalds Jan 25, 2018
f15ca72
net: don't call update_pmtu unconditionally
NicolasDichtel Jan 25, 2018
0fd189a
drm/nouveau: Move irq setup/teardown to pci ctor/dtor
Lyude Jan 25, 2018
6793f1c
orangefs: fix deadlock; do not write i_size in read_iter
Jan 26, 2018
993ca20
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
torvalds Jan 26, 2018
a78e936
r8169: fix memory corruption on retrieval of hardware statistics.
Jan 26, 2018
1e19c4d
net: vrf: Add support for sends to local broadcast address
dsahern Jan 25, 2018
baa35cc
Merge branch 'linux-4.15' of git://github.com/skeggsb/linux into drm-…
airlied Jan 26, 2018
5beda7d
x86/mm/64: Fix vmapped stack syncing on very-large-memory 4-level sys…
amluto Jan 25, 2018
36b3a77
x86/mm/64: Tighten up vmalloc_fault() sanity checks on 5-level kernels
amluto Jan 25, 2018
6572cc2
Update the RISC-V MAINTAINERS file
palmer-dabbelt Jan 24, 2018
dd5684e
dccp: don't restart ccid2_hc_tx_rto_expire() if sk in closed state
akodanev Jan 26, 2018
ba3169f
VSOCK: set POLLOUT | POLLWRNORM for TCP_CLOSING
stefanhaRH Jan 26, 2018
db21854
Merge tag 'drm-fixes-for-v4.15-rc10-2' of git://people.freedesktop.or…
torvalds Jan 26, 2018
ba804bb
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
torvalds Jan 26, 2018
c4e0ca7
Merge tag 'riscv-for-linus-4.15-maintainers' of git://git.kernel.org/…
torvalds Jan 26, 2018
8a95b74
x86: Mark hpa as a "Designated Reviewer" for the time being
Jan 25, 2018
d5421ea
hrtimer: Reset hrtimer cpu base proper on CPU hotplug
KAGA-KOKO Jan 26, 2018
dd08516
x86/ftrace: Add one more ENDPROC annotation
jpoimboe Jan 28, 2018
8c76e31
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/s…
torvalds Jan 28, 2018
39e3836
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…
torvalds Jan 28, 2018
6244419
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm…
torvalds Jan 28, 2018
07b0137
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
torvalds Jan 28, 2018
32c6cdf
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/l…
torvalds Jan 28, 2018
24b1ccc
Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linu…
torvalds Jan 28, 2018
d8a5b80
Linux 4.15
torvalds Jan 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion arch/x86/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ KASAN_SANITIZE_stacktrace.o := n
KASAN_SANITIZE_paravirt.o := n

OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o := y
OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y
OBJECT_FILES_NON_STANDARD_test_nx.o := y
OBJECT_FILES_NON_STANDARD_paravirt_patch_$(BITS).o := y

ifdef CONFIG_FRAME_POINTER
OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y
endif

# If instrumentation of this dir is enabled, boot hangs during first second.
# Probably could be more selective here, but note that files related to irqs,
# boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
Expand Down
24 changes: 15 additions & 9 deletions arch/x86/kernel/ftrace_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <asm/ftrace.h>
#include <asm/export.h>
#include <asm/nospec-branch.h>
#include <asm/unwind_hints.h>

.code64
.section .entry.text, "ax"
Expand All @@ -20,7 +21,6 @@ EXPORT_SYMBOL(__fentry__)
EXPORT_SYMBOL(mcount)
#endif

/* All cases save the original rbp (8 bytes) */
#ifdef CONFIG_FRAME_POINTER
# ifdef CC_USING_FENTRY
/* Save parent and function stack frames (rip and rbp) */
Expand All @@ -31,7 +31,7 @@ EXPORT_SYMBOL(mcount)
# endif
#else
/* No need to save a stack frame */
# define MCOUNT_FRAME_SIZE 8
# define MCOUNT_FRAME_SIZE 0
#endif /* CONFIG_FRAME_POINTER */

/* Size of stack used to save mcount regs in save_mcount_regs */
Expand Down Expand Up @@ -64,10 +64,10 @@ EXPORT_SYMBOL(mcount)
*/
.macro save_mcount_regs added=0

/* Always save the original rbp */
#ifdef CONFIG_FRAME_POINTER
/* Save the original rbp */
pushq %rbp

#ifdef CONFIG_FRAME_POINTER
/*
* Stack traces will stop at the ftrace trampoline if the frame pointer
* is not set up properly. If fentry is used, we need to save a frame
Expand Down Expand Up @@ -105,7 +105,11 @@ EXPORT_SYMBOL(mcount)
* Save the original RBP. Even though the mcount ABI does not
* require this, it helps out callers.
*/
#ifdef CONFIG_FRAME_POINTER
movq MCOUNT_REG_SIZE-8(%rsp), %rdx
#else
movq %rbp, %rdx
#endif
movq %rdx, RBP(%rsp)

/* Copy the parent address into %rsi (second parameter) */
Expand Down Expand Up @@ -148,7 +152,7 @@ EXPORT_SYMBOL(mcount)

ENTRY(function_hook)
retq
END(function_hook)
ENDPROC(function_hook)

ENTRY(ftrace_caller)
/* save_mcount_regs fills in first two parameters */
Expand Down Expand Up @@ -184,7 +188,7 @@ GLOBAL(ftrace_graph_call)
/* This is weak to keep gas from relaxing the jumps */
WEAK(ftrace_stub)
retq
END(ftrace_caller)
ENDPROC(ftrace_caller)

ENTRY(ftrace_regs_caller)
/* Save the current flags before any operations that can change them */
Expand Down Expand Up @@ -255,7 +259,7 @@ GLOBAL(ftrace_regs_caller_end)

jmp ftrace_epilogue

END(ftrace_regs_caller)
ENDPROC(ftrace_regs_caller)


#else /* ! CONFIG_DYNAMIC_FTRACE */
Expand Down Expand Up @@ -313,9 +317,10 @@ ENTRY(ftrace_graph_caller)
restore_mcount_regs

retq
END(ftrace_graph_caller)
ENDPROC(ftrace_graph_caller)

GLOBAL(return_to_handler)
ENTRY(return_to_handler)
UNWIND_HINT_EMPTY
subq $24, %rsp

/* Save the return values */
Expand All @@ -330,4 +335,5 @@ GLOBAL(return_to_handler)
movq (%rsp), %rax
addq $24, %rsp
JMP_NOSPEC %rdi
END(return_to_handler)
#endif
48 changes: 47 additions & 1 deletion arch/x86/kernel/unwind_orc.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,50 @@ static struct orc_entry *orc_module_find(unsigned long ip)
}
#endif

#ifdef CONFIG_DYNAMIC_FTRACE
static struct orc_entry *orc_find(unsigned long ip);

/*
* Ftrace dynamic trampolines do not have orc entries of their own.
* But they are copies of the ftrace entries that are static and
* defined in ftrace_*.S, which do have orc entries.
*
* If the undwinder comes across a ftrace trampoline, then find the
* ftrace function that was used to create it, and use that ftrace
* function's orc entrie, as the placement of the return code in
* the stack will be identical.
*/
static struct orc_entry *orc_ftrace_find(unsigned long ip)
{
struct ftrace_ops *ops;
unsigned long caller;

ops = ftrace_ops_trampoline(ip);
if (!ops)
return NULL;

if (ops->flags & FTRACE_OPS_FL_SAVE_REGS)
caller = (unsigned long)ftrace_regs_call;
else
caller = (unsigned long)ftrace_call;

/* Prevent unlikely recursion */
if (ip == caller)
return NULL;

return orc_find(caller);
}
#else
static struct orc_entry *orc_ftrace_find(unsigned long ip)
{
return NULL;
}
#endif

static struct orc_entry *orc_find(unsigned long ip)
{
static struct orc_entry *orc;

if (!orc_init)
return NULL;

Expand Down Expand Up @@ -111,7 +153,11 @@ static struct orc_entry *orc_find(unsigned long ip)
__stop_orc_unwind_ip - __start_orc_unwind_ip, ip);

/* Module lookup: */
return orc_module_find(ip);
orc = orc_module_find(ip);
if (orc)
return orc;

return orc_ftrace_find(ip);
}

static void orc_sort_swap(void *_a, void *_b, int size)
Expand Down
2 changes: 2 additions & 0 deletions include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ extern int ftrace_text_reserved(const void *start, const void *end);

extern int ftrace_nr_registered_ops(void);

struct ftrace_ops *ftrace_ops_trampoline(unsigned long addr);

bool is_ftrace_trampoline(unsigned long addr);

/*
Expand Down
29 changes: 17 additions & 12 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,15 +1119,11 @@ static struct ftrace_ops global_ops = {
};

/*
* This is used by __kernel_text_address() to return true if the
* address is on a dynamically allocated trampoline that would
* not return true for either core_kernel_text() or
* is_module_text_address().
* Used by the stack undwinder to know about dynamic ftrace trampolines.
*/
bool is_ftrace_trampoline(unsigned long addr)
struct ftrace_ops *ftrace_ops_trampoline(unsigned long addr)
{
struct ftrace_ops *op;
bool ret = false;
struct ftrace_ops *op = NULL;

/*
* Some of the ops may be dynamically allocated,
Expand All @@ -1144,15 +1140,24 @@ bool is_ftrace_trampoline(unsigned long addr)
if (op->trampoline && op->trampoline_size)
if (addr >= op->trampoline &&
addr < op->trampoline + op->trampoline_size) {
ret = true;
goto out;
preempt_enable_notrace();
return op;
}
} while_for_each_ftrace_op(op);

out:
preempt_enable_notrace();

return ret;
return NULL;
}

/*
* This is used by __kernel_text_address() to return true if the
* address is on a dynamically allocated trampoline that would
* not return true for either core_kernel_text() or
* is_module_text_address().
*/
bool is_ftrace_trampoline(unsigned long addr)
{
return ftrace_ops_trampoline(addr) != NULL;
}

struct ftrace_page {
Expand Down
34 changes: 20 additions & 14 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2374,6 +2374,15 @@ void trace_event_buffer_commit(struct trace_event_buffer *fbuffer)
}
EXPORT_SYMBOL_GPL(trace_event_buffer_commit);

/*
* Skip 3:
*
* trace_buffer_unlock_commit_regs()
* trace_event_buffer_commit()
* trace_event_raw_event_xxx()
*/
# define STACK_SKIP 3

void trace_buffer_unlock_commit_regs(struct trace_array *tr,
struct ring_buffer *buffer,
struct ring_buffer_event *event,
Expand All @@ -2383,16 +2392,12 @@ void trace_buffer_unlock_commit_regs(struct trace_array *tr,
__buffer_unlock_commit(buffer, event);

/*
* If regs is not set, then skip the following callers:
* trace_buffer_unlock_commit_regs
* event_trigger_unlock_commit
* trace_event_buffer_commit
* trace_event_raw_event_sched_switch
* If regs is not set, then skip the necessary functions.
* Note, we can still get here via blktrace, wakeup tracer
* and mmiotrace, but that's ok if they lose a function or
* two. They are that meaningful.
* two. They are not that meaningful.
*/
ftrace_trace_stack(tr, buffer, flags, regs ? 0 : 4, pc, regs);
ftrace_trace_stack(tr, buffer, flags, regs ? 0 : STACK_SKIP, pc, regs);
ftrace_trace_userstack(buffer, flags, pc);
}

Expand Down Expand Up @@ -2579,11 +2584,13 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer,
trace.skip = skip;

/*
* Add two, for this function and the call to save_stack_trace()
* Add one, for this function and the call to save_stack_trace()
* If regs is set, then these functions will not be in the way.
*/
#ifndef CONFIG_UNWINDER_ORC
if (!regs)
trace.skip += 2;
trace.skip++;
#endif

/*
* Since events can happen in NMIs there's no safe way to
Expand Down Expand Up @@ -2711,11 +2718,10 @@ void trace_dump_stack(int skip)

local_save_flags(flags);

/*
* Skip 3 more, seems to get us at the caller of
* this function.
*/
skip += 3;
#ifndef CONFIG_UNWINDER_ORC
/* Skip 1 to skip this function. */
skip++;
#endif
__ftrace_trace_stack(global_trace.trace_buffer.buffer,
flags, skip, preempt_count(), NULL);
}
Expand Down
13 changes: 11 additions & 2 deletions kernel/trace/trace_events_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,13 +1123,22 @@ static __init int register_trigger_snapshot_cmd(void) { return 0; }
#endif /* CONFIG_TRACER_SNAPSHOT */

#ifdef CONFIG_STACKTRACE
#ifdef CONFIG_UNWINDER_ORC
/* Skip 2:
* event_triggers_post_call()
* trace_event_raw_event_xxx()
*/
# define STACK_SKIP 2
#else
/*
* Skip 3:
* Skip 4:
* stacktrace_trigger()
* event_triggers_post_call()
* trace_event_buffer_commit()
* trace_event_raw_event_xxx()
*/
#define STACK_SKIP 3
#define STACK_SKIP 4
#endif

static void
stacktrace_trigger(struct event_trigger_data *data, void *rec)
Expand Down
Loading