提交 58ae9c0d 编写于 作者: L Linus Torvalds

Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 debug update from Ingo Molnar:
 "Various small enhancements"

* 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/debug: Dump family, model, stepping of the boot CPU
  x86/iommu: Use NULL instead of plain 0 for __IOMMU_INIT
  x86/iommu: Drop duplicate const in __IOMMU_INIT
  x86/fpu/xsave: Keep __user annotation in casts
  x86/pci/probe_roms: Add missing __iomem annotation to pci_map_biosrom()
  x86/signals: ia32_signal.c: add __user casts to fix sparse warnings
  x86/vdso: Add __user annotation to VDSO32_SYMBOL
  x86: Fix __user annotations in asm/sys_ia32.h
...@@ -162,7 +162,8 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr, ...@@ -162,7 +162,8 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
} }
seg = get_fs(); seg = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp); ret = do_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL),
(stack_t __force __user *) &uoss, regs->sp);
set_fs(seg); set_fs(seg);
if (ret >= 0 && uoss_ptr) { if (ret >= 0 && uoss_ptr) {
if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t))) if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
...@@ -361,7 +362,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc, ...@@ -361,7 +362,7 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
*/ */
static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
size_t frame_size, size_t frame_size,
void **fpstate) void __user **fpstate)
{ {
unsigned long sp; unsigned long sp;
...@@ -382,7 +383,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, ...@@ -382,7 +383,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
if (used_math()) { if (used_math()) {
sp = sp - sig_xstate_ia32_size; sp = sp - sig_xstate_ia32_size;
*fpstate = (struct _fpstate_ia32 *) sp; *fpstate = (struct _fpstate_ia32 __user *) sp;
if (save_i387_xstate_ia32(*fpstate) < 0) if (save_i387_xstate_ia32(*fpstate) < 0)
return (void __user *) -1L; return (void __user *) -1L;
} }
...@@ -448,7 +449,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, ...@@ -448,7 +449,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
* These are actually not used anymore, but left because some * These are actually not used anymore, but left because some
* gdb versions depend on them as a marker. * gdb versions depend on them as a marker.
*/ */
put_user_ex(*((u64 *)&code), (u64 *)frame->retcode); put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode);
} put_user_catch(err); } put_user_catch(err);
if (err) if (err)
...@@ -529,7 +530,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -529,7 +530,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
* Not actually used anymore, but left because some gdb * Not actually used anymore, but left because some gdb
* versions need it. * versions need it.
*/ */
put_user_ex(*((u64 *)&code), (u64 *)frame->retcode); put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode);
} put_user_catch(err); } put_user_catch(err);
if (err) if (err)
......
...@@ -287,7 +287,7 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act, ...@@ -287,7 +287,7 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
return ret; return ret;
} }
asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int __user *stat_addr,
int options) int options)
{ {
return compat_sys_wait4(pid, stat_addr, options, NULL); return compat_sys_wait4(pid, stat_addr, options, NULL);
......
...@@ -48,7 +48,7 @@ struct iommu_table_entry { ...@@ -48,7 +48,7 @@ struct iommu_table_entry {
#define __IOMMU_INIT(_detect, _depend, _early_init, _late_init, _finish)\ #define __IOMMU_INIT(_detect, _depend, _early_init, _late_init, _finish)\
static const struct iommu_table_entry const \ static const struct iommu_table_entry \
__iommu_entry_##_detect __used \ __iommu_entry_##_detect __used \
__attribute__ ((unused, __section__(".iommu_table"), \ __attribute__ ((unused, __section__(".iommu_table"), \
aligned((sizeof(void *))))) \ aligned((sizeof(void *))))) \
...@@ -63,10 +63,10 @@ struct iommu_table_entry { ...@@ -63,10 +63,10 @@ struct iommu_table_entry {
* to stop detecting the other IOMMUs after yours has been detected. * to stop detecting the other IOMMUs after yours has been detected.
*/ */
#define IOMMU_INIT_POST(_detect) \ #define IOMMU_INIT_POST(_detect) \
__IOMMU_INIT(_detect, pci_swiotlb_detect_4gb, 0, 0, 0) __IOMMU_INIT(_detect, pci_swiotlb_detect_4gb, NULL, NULL, 0)
#define IOMMU_INIT_POST_FINISH(detect) \ #define IOMMU_INIT_POST_FINISH(detect) \
__IOMMU_INIT(_detect, pci_swiotlb_detect_4gb, 0, 0, 1) __IOMMU_INIT(_detect, pci_swiotlb_detect_4gb, NULL, NULL, 1)
/* /*
* A more sophisticated version of IOMMU_INIT. This variant requires: * A more sophisticated version of IOMMU_INIT. This variant requires:
......
...@@ -40,7 +40,7 @@ asmlinkage long sys32_sigaction(int, struct old_sigaction32 __user *, ...@@ -40,7 +40,7 @@ asmlinkage long sys32_sigaction(int, struct old_sigaction32 __user *,
struct old_sigaction32 __user *); struct old_sigaction32 __user *);
asmlinkage long sys32_alarm(unsigned int); asmlinkage long sys32_alarm(unsigned int);
asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int); asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int);
asmlinkage long sys32_sysfs(int, u32, u32); asmlinkage long sys32_sysfs(int, u32, u32);
asmlinkage long sys32_sched_rr_get_interval(compat_pid_t, asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
......
...@@ -11,7 +11,8 @@ extern const char VDSO32_PRELINK[]; ...@@ -11,7 +11,8 @@ extern const char VDSO32_PRELINK[];
#define VDSO32_SYMBOL(base, name) \ #define VDSO32_SYMBOL(base, name) \
({ \ ({ \
extern const char VDSO32_##name[]; \ extern const char VDSO32_##name[]; \
(void *)(VDSO32_##name - VDSO32_PRELINK + (unsigned long)(base)); \ (void __user *)(VDSO32_##name - VDSO32_PRELINK + \
(unsigned long)(base)); \
}) })
#endif #endif
......
...@@ -1023,14 +1023,16 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) ...@@ -1023,14 +1023,16 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c)
printk(KERN_CONT "%s ", vendor); printk(KERN_CONT "%s ", vendor);
if (c->x86_model_id[0]) if (c->x86_model_id[0])
printk(KERN_CONT "%s", c->x86_model_id); printk(KERN_CONT "%s", strim(c->x86_model_id));
else else
printk(KERN_CONT "%d86", c->x86); printk(KERN_CONT "%d86", c->x86);
printk(KERN_CONT " (fam: %02x, model: %02x", c->x86, c->x86_model);
if (c->x86_mask || c->cpuid_level >= 0) if (c->x86_mask || c->cpuid_level >= 0)
printk(KERN_CONT " stepping %02x\n", c->x86_mask); printk(KERN_CONT ", stepping: %02x)\n", c->x86_mask);
else else
printk(KERN_CONT "\n"); printk(KERN_CONT ")\n");
print_cpu_msr(c); print_cpu_msr(c);
} }
......
...@@ -150,7 +150,7 @@ static struct resource *find_oprom(struct pci_dev *pdev) ...@@ -150,7 +150,7 @@ static struct resource *find_oprom(struct pci_dev *pdev)
return oprom; return oprom;
} }
void *pci_map_biosrom(struct pci_dev *pdev) void __iomem *pci_map_biosrom(struct pci_dev *pdev)
{ {
struct resource *oprom = find_oprom(pdev); struct resource *oprom = find_oprom(pdev);
......
...@@ -132,9 +132,9 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf, ...@@ -132,9 +132,9 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
fx_sw_user->xstate_size > fx_sw_user->extended_size) fx_sw_user->xstate_size > fx_sw_user->extended_size)
return -EINVAL; return -EINVAL;
err = __get_user(magic2, (__u32 *) (((void *)fpstate) + err = __get_user(magic2, (__u32 __user *) (fpstate +
fx_sw_user->extended_size - fx_sw_user->extended_size -
FP_XSTATE_MAGIC2_SIZE)); FP_XSTATE_MAGIC2_SIZE));
if (err) if (err)
return err; return err;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册