mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
Merge branches 'x86-asm-for-linus', 'x86-cleanups-for-linus', 'x86-cpu-for-linus', 'x86-debug-for-linus' and 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull initial trivial x86 stuff from Ingo Molnar. Various random cleanups and trivial fixes. * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86-64: Eliminate dead ia32 syscall handlers * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pci-calgary_64.c: Remove obsoleted simple_strtoul() usage x86: Don't continue booting if we can't load the specified initrd x86: kernel/dumpstack.c simple_strtoul cleanup x86: kernel/check.c simple_strtoul cleanup debug: Add CONFIG_READABLE_ASM x86: spinlock.h: Remove REG_PTR_MODE * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cache_info: Fix setup of l2/l3 ids * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Avoid double stack traces with show_regs() * 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, microcode: microcode_core.c simple_strtoul cleanup
This commit is contained in:
commit
19bec32d7f
16 changed files with 72 additions and 60 deletions
10
Makefile
10
Makefile
|
@ -566,6 +566,16 @@ else
|
||||||
KBUILD_CFLAGS += -O2
|
KBUILD_CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_READABLE_ASM
|
||||||
|
# Disable optimizations that make assembler listings hard to read.
|
||||||
|
# reorder blocks reorders the control in the function
|
||||||
|
# ipa clone creates specialized cloned functions
|
||||||
|
# partial inlining inlines only parts of functions
|
||||||
|
KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
|
||||||
|
$(call cc-option,-fno-ipa-cp-clone,) \
|
||||||
|
$(call cc-option,-fno-partial-inlining)
|
||||||
|
endif
|
||||||
|
|
||||||
include $(srctree)/arch/$(SRCARCH)/Makefile
|
include $(srctree)/arch/$(SRCARCH)/Makefile
|
||||||
|
|
||||||
ifneq ($(CONFIG_FRAME_WARN),0)
|
ifneq ($(CONFIG_FRAME_WARN),0)
|
||||||
|
|
|
@ -287,11 +287,6 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
asmlinkage long sys32_alarm(unsigned int seconds)
|
|
||||||
{
|
|
||||||
return alarm_setitimer(seconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr,
|
asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr,
|
||||||
int options)
|
int options)
|
||||||
{
|
{
|
||||||
|
@ -300,11 +295,6 @@ asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr,
|
||||||
|
|
||||||
/* 32-bit timeval and related flotsam. */
|
/* 32-bit timeval and related flotsam. */
|
||||||
|
|
||||||
asmlinkage long sys32_sysfs(int option, u32 arg1, u32 arg2)
|
|
||||||
{
|
|
||||||
return sys_sysfs(option, arg1, arg2);
|
|
||||||
}
|
|
||||||
|
|
||||||
asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
|
asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
|
||||||
struct compat_timespec __user *interval)
|
struct compat_timespec __user *interval)
|
||||||
{
|
{
|
||||||
|
@ -375,19 +365,6 @@ asmlinkage long sys32_pwrite(unsigned int fd, const char __user *ubuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
asmlinkage long sys32_personality(unsigned long personality)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (personality(current->personality) == PER_LINUX32 &&
|
|
||||||
personality == PER_LINUX)
|
|
||||||
personality = PER_LINUX32;
|
|
||||||
ret = sys_personality(personality);
|
|
||||||
if (ret == PER_LINUX32)
|
|
||||||
ret = PER_LINUX;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
asmlinkage long sys32_sendfile(int out_fd, int in_fd,
|
asmlinkage long sys32_sendfile(int out_fd, int in_fd,
|
||||||
compat_off_t __user *offset, s32 count)
|
compat_off_t __user *offset, s32 count)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,6 @@ enum die_val {
|
||||||
extern void printk_address(unsigned long address, int reliable);
|
extern void printk_address(unsigned long address, int reliable);
|
||||||
extern void die(const char *, struct pt_regs *,long);
|
extern void die(const char *, struct pt_regs *,long);
|
||||||
extern int __must_check __die(const char *, struct pt_regs *, long);
|
extern int __must_check __die(const char *, struct pt_regs *, long);
|
||||||
extern void show_registers(struct pt_regs *regs);
|
|
||||||
extern void show_trace(struct task_struct *t, struct pt_regs *regs,
|
extern void show_trace(struct task_struct *t, struct pt_regs *regs,
|
||||||
unsigned long *sp, unsigned long bp);
|
unsigned long *sp, unsigned long bp);
|
||||||
extern void __show_regs(struct pt_regs *regs, int all);
|
extern void __show_regs(struct pt_regs *regs, int all);
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
# define LOCK_PTR_REG "a"
|
# define LOCK_PTR_REG "a"
|
||||||
# define REG_PTR_MODE "k"
|
|
||||||
#else
|
#else
|
||||||
# define LOCK_PTR_REG "D"
|
# define LOCK_PTR_REG "D"
|
||||||
# define REG_PTR_MODE "q"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_X86_32) && \
|
#if defined(CONFIG_X86_32) && \
|
||||||
|
|
|
@ -27,21 +27,29 @@ static int num_scan_areas;
|
||||||
|
|
||||||
static __init int set_corruption_check(char *arg)
|
static __init int set_corruption_check(char *arg)
|
||||||
{
|
{
|
||||||
char *end;
|
ssize_t ret;
|
||||||
|
unsigned long val;
|
||||||
|
|
||||||
memory_corruption_check = simple_strtol(arg, &end, 10);
|
ret = kstrtoul(arg, 10, &val);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return (*end == 0) ? 0 : -EINVAL;
|
memory_corruption_check = val;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
early_param("memory_corruption_check", set_corruption_check);
|
early_param("memory_corruption_check", set_corruption_check);
|
||||||
|
|
||||||
static __init int set_corruption_check_period(char *arg)
|
static __init int set_corruption_check_period(char *arg)
|
||||||
{
|
{
|
||||||
char *end;
|
ssize_t ret;
|
||||||
|
unsigned long val;
|
||||||
|
|
||||||
corruption_check_period = simple_strtoul(arg, &end, 10);
|
ret = kstrtoul(arg, 10, &val);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return (*end == 0) ? 0 : -EINVAL;
|
corruption_check_period = val;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
early_param("memory_corruption_check_period", set_corruption_check_period);
|
early_param("memory_corruption_check_period", set_corruption_check_period);
|
||||||
|
|
||||||
|
|
|
@ -615,14 +615,14 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
|
||||||
new_l2 = this_leaf.size/1024;
|
new_l2 = this_leaf.size/1024;
|
||||||
num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
|
num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
|
||||||
index_msb = get_count_order(num_threads_sharing);
|
index_msb = get_count_order(num_threads_sharing);
|
||||||
l2_id = c->apicid >> index_msb;
|
l2_id = c->apicid & ~((1 << index_msb) - 1);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
new_l3 = this_leaf.size/1024;
|
new_l3 = this_leaf.size/1024;
|
||||||
num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
|
num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
|
||||||
index_msb = get_count_order(
|
index_msb = get_count_order(
|
||||||
num_threads_sharing);
|
num_threads_sharing);
|
||||||
l3_id = c->apicid >> index_msb;
|
l3_id = c->apicid & ~((1 << index_msb) - 1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -271,7 +271,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
|
||||||
current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
|
current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
show_registers(regs);
|
show_regs(regs);
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
if (user_mode_vm(regs)) {
|
if (user_mode_vm(regs)) {
|
||||||
sp = regs->sp;
|
sp = regs->sp;
|
||||||
|
@ -311,16 +311,33 @@ void die(const char *str, struct pt_regs *regs, long err)
|
||||||
|
|
||||||
static int __init kstack_setup(char *s)
|
static int __init kstack_setup(char *s)
|
||||||
{
|
{
|
||||||
|
ssize_t ret;
|
||||||
|
unsigned long val;
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
kstack_depth_to_print = simple_strtoul(s, NULL, 0);
|
|
||||||
|
ret = kstrtoul(s, 0, &val);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
kstack_depth_to_print = val;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
early_param("kstack", kstack_setup);
|
early_param("kstack", kstack_setup);
|
||||||
|
|
||||||
static int __init code_bytes_setup(char *s)
|
static int __init code_bytes_setup(char *s)
|
||||||
{
|
{
|
||||||
code_bytes = simple_strtoul(s, NULL, 0);
|
ssize_t ret;
|
||||||
|
unsigned long val;
|
||||||
|
|
||||||
|
if (!s)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
ret = kstrtoul(s, 0, &val);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
code_bytes = val;
|
||||||
if (code_bytes > 8192)
|
if (code_bytes > 8192)
|
||||||
code_bytes = 8192;
|
code_bytes = 8192;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void show_registers(struct pt_regs *regs)
|
void show_regs(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
|
||||||
show_trace_log_lvl(task, regs, sp, bp, log_lvl);
|
show_trace_log_lvl(task, regs, sp, bp, log_lvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_registers(struct pt_regs *regs)
|
void show_regs(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned long sp;
|
unsigned long sp;
|
||||||
|
|
|
@ -1037,9 +1037,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
|
||||||
"current sp %p does not match saved sp %p\n",
|
"current sp %p does not match saved sp %p\n",
|
||||||
stack_addr(regs), kcb->jprobe_saved_sp);
|
stack_addr(regs), kcb->jprobe_saved_sp);
|
||||||
printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
|
printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
|
||||||
show_registers(saved_regs);
|
show_regs(saved_regs);
|
||||||
printk(KERN_ERR "Current registers\n");
|
printk(KERN_ERR "Current registers\n");
|
||||||
show_registers(regs);
|
show_regs(regs);
|
||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
*regs = kcb->jprobe_saved_regs;
|
*regs = kcb->jprobe_saved_regs;
|
||||||
|
|
|
@ -299,12 +299,11 @@ static ssize_t reload_store(struct device *dev,
|
||||||
{
|
{
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int cpu = dev->id;
|
int cpu = dev->id;
|
||||||
int ret = 0;
|
ssize_t ret = 0;
|
||||||
char *end;
|
|
||||||
|
|
||||||
val = simple_strtoul(buf, &end, 0);
|
ret = kstrtoul(buf, 0, &val);
|
||||||
if (end == buf)
|
if (ret)
|
||||||
return -EINVAL;
|
return ret;
|
||||||
|
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
get_online_cpus();
|
get_online_cpus();
|
||||||
|
|
|
@ -209,7 +209,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
|
||||||
pr_emerg(
|
pr_emerg(
|
||||||
"NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n",
|
"NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n",
|
||||||
reason, smp_processor_id());
|
reason, smp_processor_id());
|
||||||
show_registers(regs);
|
show_regs(regs);
|
||||||
|
|
||||||
if (panic_on_io_nmi)
|
if (panic_on_io_nmi)
|
||||||
panic("NMI IOCK error: Not continuing");
|
panic("NMI IOCK error: Not continuing");
|
||||||
|
|
|
@ -1480,8 +1480,9 @@ cleanup:
|
||||||
static int __init calgary_parse_options(char *p)
|
static int __init calgary_parse_options(char *p)
|
||||||
{
|
{
|
||||||
unsigned int bridge;
|
unsigned int bridge;
|
||||||
|
unsigned long val;
|
||||||
size_t len;
|
size_t len;
|
||||||
char* endp;
|
ssize_t ret;
|
||||||
|
|
||||||
while (*p) {
|
while (*p) {
|
||||||
if (!strncmp(p, "64k", 3))
|
if (!strncmp(p, "64k", 3))
|
||||||
|
@ -1512,10 +1513,11 @@ static int __init calgary_parse_options(char *p)
|
||||||
++p;
|
++p;
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
break;
|
break;
|
||||||
bridge = simple_strtoul(p, &endp, 0);
|
ret = kstrtoul(p, 0, &val);
|
||||||
if (p == endp)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
bridge = val;
|
||||||
if (bridge < MAX_PHB_BUS_NUM) {
|
if (bridge < MAX_PHB_BUS_NUM) {
|
||||||
printk(KERN_INFO "Calgary: disabling "
|
printk(KERN_INFO "Calgary: disabling "
|
||||||
"translation for PHB %#x\n", bridge);
|
"translation for PHB %#x\n", bridge);
|
||||||
|
|
|
@ -113,12 +113,6 @@ void exit_thread(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_regs(struct pt_regs *regs)
|
|
||||||
{
|
|
||||||
show_registers(regs);
|
|
||||||
show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void show_regs_common(void)
|
void show_regs_common(void)
|
||||||
{
|
{
|
||||||
const char *vendor, *product, *board;
|
const char *vendor, *product, *board;
|
||||||
|
|
|
@ -393,10 +393,9 @@ static void __init reserve_initrd(void)
|
||||||
initrd_start = 0;
|
initrd_start = 0;
|
||||||
|
|
||||||
if (ramdisk_size >= (end_of_lowmem>>1)) {
|
if (ramdisk_size >= (end_of_lowmem>>1)) {
|
||||||
memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
|
panic("initrd too large to handle, "
|
||||||
printk(KERN_ERR "initrd too large to handle, "
|
"disabling initrd (%lld needed, %lld available)\n",
|
||||||
"disabling initrd\n");
|
ramdisk_size, end_of_lowmem>>1);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(KERN_INFO "RAMDISK: %08llx - %08llx\n", ramdisk_image,
|
printk(KERN_INFO "RAMDISK: %08llx - %08llx\n", ramdisk_image,
|
||||||
|
|
|
@ -74,6 +74,15 @@ config STRIP_ASM_SYMS
|
||||||
that look like '.Lxxx') so they don't pollute the output of
|
that look like '.Lxxx') so they don't pollute the output of
|
||||||
get_wchan() and suchlike.
|
get_wchan() and suchlike.
|
||||||
|
|
||||||
|
config READABLE_ASM
|
||||||
|
bool "Generate readable assembler code"
|
||||||
|
depends on DEBUG_KERNEL
|
||||||
|
help
|
||||||
|
Disable some compiler optimizations that tend to generate human unreadable
|
||||||
|
assembler output. This may make the kernel slightly slower, but it helps
|
||||||
|
to keep kernel developers who have to stare a lot at assembler listings
|
||||||
|
sane.
|
||||||
|
|
||||||
config UNUSED_SYMBOLS
|
config UNUSED_SYMBOLS
|
||||||
bool "Enable unused/obsolete exported symbols"
|
bool "Enable unused/obsolete exported symbols"
|
||||||
default y if X86
|
default y if X86
|
||||||
|
|
Loading…
Add table
Reference in a new issue