Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/mattst88/alpha

Pull alpha updates from Al Viro:
 "Mostly small janitorial fixes but there's also more important ones: a
  patch to fix loading large modules from Edward Humes, and some fixes
  from Al Viro"

[ The fixes from Al mostly came in separately through Al's trees too and
  are now duplicated..   - Linus ]

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
  alpha: in_irq() cleanup
  alpha: lazy FPU switching
  alpha/boot/misc: trim unused declarations
  alpha/boot/tools/objstrip: fix the check for ELF header
  alpha/boot: fix the breakage from -isystem series...
  alpha: fix FEN fault handling
  alpha: Avoid comma separated statements
  alpha: fixed a typo in core_cia.c
  alpha: remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions
  alpha: update config files
  alpha: fix R_ALPHA_LITERAL reloc for large modules
  alpha: Add some spaces to ensure format specification
  alpha: replace NR_SYSCALLS by NR_syscalls
  alpha: Remove redundant local asm header redirections
  alpha: Implement "current_stack_pointer"
  alpha: remove redundant err variable
  alpha: osf_sys: reduce kernel log spamming on invalid osf_mount call typenr
  • Loading branch information
torvalds committed Feb 25, 2023
2 parents cac85e4 + 290ec1d commit e534a58
Show file tree
Hide file tree
Showing 26 changed files with 217 additions and 154 deletions.
1 change: 1 addition & 0 deletions arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ config ALPHA
bool
default y
select ARCH_32BIT_USTAT_F_TINODE
select ARCH_HAS_CURRENT_STACK_POINTER
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
select ARCH_NO_PREEMPT
Expand Down
12 changes: 6 additions & 6 deletions arch/alpha/boot/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ static int skip_atoi(const char **s)

static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
char c, sign, tmp[66];
const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
int i;

if (type & LARGE)
Expand Down Expand Up @@ -83,14 +83,14 @@ static char * number(char * str, unsigned long long num, int base, int size, int
precision = i;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
while(size-->0)
while (size-- > 0)
*str++ = ' ';
if (sign)
*str++ = sign;
if (type & SPECIAL) {
if (base==8)
*str++ = '0';
else if (base==16) {
else if (base == 16) {
*str++ = '0';
*str++ = digits[33];
}
Expand Down Expand Up @@ -125,7 +125,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
/* 'z' changed to 'Z' --davidm 1/25/99 */


for (str=buf ; *fmt ; ++fmt) {
for (str = buf ; *fmt ; ++fmt) {
if (*fmt != '%') {
*str++ = *fmt;
continue;
Expand Down Expand Up @@ -296,7 +296,7 @@ int sprintf(char * buf, const char *fmt, ...)
int i;

va_start(args, fmt);
i=vsprintf(buf,fmt,args);
i = vsprintf(buf, fmt, args);
va_end(args);
return i;
}
2 changes: 0 additions & 2 deletions arch/alpha/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ CONFIG_PATA_CYPRESS=y
CONFIG_ATA_GENERIC=y
CONFIG_NETDEVICES=y
CONFIG_DUMMY=m
CONFIG_NET_ETHERNET=y
CONFIG_NET_VENDOR_3COM=y
CONFIG_VORTEX=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_TULIP=y
CONFIG_TULIP_MMIO=y
CONFIG_NET_PCI=y
CONFIG_YELLOWFIN=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
Expand Down
1 change: 1 addition & 0 deletions arch/alpha/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

generated-y += syscall_table.h
generic-y += agp.h
generic-y += asm-offsets.h
generic-y += export.h
generic-y += kvm_para.h
generic-y += mcs_spinlock.h
1 change: 0 additions & 1 deletion arch/alpha/include/asm/asm-offsets.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/alpha/include/asm/div64.h

This file was deleted.

61 changes: 37 additions & 24 deletions arch/alpha/include/asm/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,27 @@ rdfpcr(void)
{
unsigned long tmp, ret;

preempt_disable();
if (current_thread_info()->status & TS_SAVED_FP) {
ret = current_thread_info()->fp[31];
} else {
#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
__asm__ __volatile__ (
"ftoit $f0,%0\n\t"
"mf_fpcr $f0\n\t"
"ftoit $f0,%1\n\t"
"itoft %0,$f0"
: "=r"(tmp), "=r"(ret));
__asm__ __volatile__ (
"ftoit $f0,%0\n\t"
"mf_fpcr $f0\n\t"
"ftoit $f0,%1\n\t"
"itoft %0,$f0"
: "=r"(tmp), "=r"(ret));
#else
__asm__ __volatile__ (
"stt $f0,%0\n\t"
"mf_fpcr $f0\n\t"
"stt $f0,%1\n\t"
"ldt $f0,%0"
: "=m"(tmp), "=m"(ret));
__asm__ __volatile__ (
"stt $f0,%0\n\t"
"mf_fpcr $f0\n\t"
"stt $f0,%1\n\t"
"ldt $f0,%0"
: "=m"(tmp), "=m"(ret));
#endif
}
preempt_enable();

return ret;
}
Expand All @@ -39,21 +45,28 @@ wrfpcr(unsigned long val)
{
unsigned long tmp;

preempt_disable();
if (current_thread_info()->status & TS_SAVED_FP) {
current_thread_info()->status |= TS_RESTORE_FP;
current_thread_info()->fp[31] = val;
} else {
#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
__asm__ __volatile__ (
"ftoit $f0,%0\n\t"
"itoft %1,$f0\n\t"
"mt_fpcr $f0\n\t"
"itoft %0,$f0"
: "=&r"(tmp) : "r"(val));
__asm__ __volatile__ (
"ftoit $f0,%0\n\t"
"itoft %1,$f0\n\t"
"mt_fpcr $f0\n\t"
"itoft %0,$f0"
: "=&r"(tmp) : "r"(val));
#else
__asm__ __volatile__ (
"stt $f0,%0\n\t"
"ldt $f0,%1\n\t"
"mt_fpcr $f0\n\t"
"ldt $f0,%0"
: "=m"(tmp) : "m"(val));
__asm__ __volatile__ (
"stt $f0,%0\n\t"
"ldt $f0,%1\n\t"
"mt_fpcr $f0\n\t"
"ldt $f0,%0"
: "=m"(tmp) : "m"(val));
#endif
}
preempt_enable();
}

static inline unsigned long
Expand Down
4 changes: 0 additions & 4 deletions arch/alpha/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
the implementation we have here matches that interface. */
#include <asm-generic/iomap.h>

/* We don't use IO slowdowns on the Alpha, but.. */
#define __SLOW_DOWN_IO do { } while (0)
#define SLOW_DOWN_IO do { } while (0)

/*
* Virtual -> physical identity mapping starts at this offset
*/
Expand Down
1 change: 0 additions & 1 deletion arch/alpha/include/asm/irq_regs.h

This file was deleted.

1 change: 0 additions & 1 deletion arch/alpha/include/asm/kdebug.h

This file was deleted.

18 changes: 18 additions & 0 deletions arch/alpha/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct thread_info {
int bpt_nsaved;
unsigned long bpt_addr[2]; /* breakpoint handling */
unsigned int bpt_insn[2];
unsigned long fp[32];
};

/*
Expand All @@ -41,6 +42,8 @@ struct thread_info {
register struct thread_info *__current_thread_info __asm__("$8");
#define current_thread_info() __current_thread_info

register unsigned long *current_stack_pointer __asm__ ("$30");

#endif /* __ASSEMBLY__ */

/* Thread information allocation. */
Expand Down Expand Up @@ -81,6 +84,9 @@ register struct thread_info *__current_thread_info __asm__("$8");
#define TS_UAC_NOFIX 0x0002 /* ! flags as they match */
#define TS_UAC_SIGBUS 0x0004 /* ! userspace part of 'osf_sysinfo' */

#define TS_SAVED_FP 0x0008
#define TS_RESTORE_FP 0x0010

#define SET_UNALIGN_CTL(task,value) ({ \
__u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \
if (value & PR_UNALIGN_NOPRINT) \
Expand All @@ -104,5 +110,17 @@ register struct thread_info *__current_thread_info __asm__("$8");
put_user(res, (int __user *)(value)); \
})

#ifndef __ASSEMBLY__
extern void __save_fpu(void);

static inline void save_fpu(void)
{
if (!(current_thread_info()->status & TS_SAVED_FP)) {
current_thread_info()->status |= TS_SAVED_FP;
__save_fpu();
}
}
#endif

#endif /* __KERNEL__ */
#endif /* _ALPHA_THREAD_INFO_H */
2 changes: 1 addition & 1 deletion arch/alpha/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <uapi/asm/unistd.h>

#define NR_SYSCALLS __NR_syscalls
#define NR_syscalls __NR_syscalls

#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR
Expand Down
2 changes: 2 additions & 0 deletions arch/alpha/include/uapi/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ struct switch_stack {
unsigned long r14;
unsigned long r15;
unsigned long r26;
#ifndef __KERNEL__
unsigned long fp[32]; /* fp[31] is fpcr */
#endif
};


Expand Down
2 changes: 2 additions & 0 deletions arch/alpha/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ void foo(void)
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
DEFINE(TI_FP, offsetof(struct thread_info, fp));
DEFINE(TI_STATUS, offsetof(struct thread_info, status));
BLANK();

DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/core_cia.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ verify_tb_operation(void)
if (use_tbia_try2) {
alpha_mv.mv_pci_tbi = cia_pci_tbi_try2;

/* Tags 0-3 must be disabled if we use this workaraund. */
/* Tags 0-3 must be disabled if we use this workaround. */
wmb();
*(vip)CIA_IOC_TB_TAGn(0) = 2;
*(vip)CIA_IOC_TB_TAGn(1) = 2;
Expand Down
Loading

0 comments on commit e534a58

Please sign in to comment.