Commit 3dbdb149 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://lia64.bkbits.net/to-linus-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents 2f57572d 7baf73ec
...@@ -48,13 +48,14 @@ CONFIG_64BIT=y ...@@ -48,13 +48,14 @@ CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_TIME_INTERPOLATION=y CONFIG_TIME_INTERPOLATION=y
CONFIG_EFI=y
# CONFIG_ITANIUM is not set # CONFIG_ITANIUM is not set
CONFIG_MCKINLEY=y CONFIG_MCKINLEY=y
# CONFIG_IA64_GENERIC is not set # CONFIG_IA64_GENERIC is not set
# CONFIG_IA64_DIG is not set # CONFIG_IA64_DIG is not set
# CONFIG_IA64_HP_SIM is not set
CONFIG_IA64_HP_ZX1=y CONFIG_IA64_HP_ZX1=y
# CONFIG_IA64_SGI_SN2 is not set # CONFIG_IA64_SGI_SN2 is not set
# CONFIG_IA64_HP_SIM is not set
# CONFIG_IA64_PAGE_SIZE_4KB is not set # CONFIG_IA64_PAGE_SIZE_4KB is not set
# CONFIG_IA64_PAGE_SIZE_8KB is not set # CONFIG_IA64_PAGE_SIZE_8KB is not set
CONFIG_IA64_PAGE_SIZE_16KB=y CONFIG_IA64_PAGE_SIZE_16KB=y
...@@ -80,15 +81,14 @@ CONFIG_HUGETLB_PAGE_SIZE_64MB=y ...@@ -80,15 +81,14 @@ CONFIG_HUGETLB_PAGE_SIZE_64MB=y
# CONFIG_HUGETLB_PAGE_SIZE_256KB is not set # CONFIG_HUGETLB_PAGE_SIZE_256KB is not set
# CONFIG_IA64_PAL_IDLE is not set # CONFIG_IA64_PAL_IDLE is not set
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_NR_CPUS=16
# CONFIG_PREEMPT is not set # CONFIG_PREEMPT is not set
CONFIG_HAVE_DEC_LOCK=y
CONFIG_IA32_SUPPORT=y CONFIG_IA32_SUPPORT=y
CONFIG_COMPAT=y CONFIG_COMPAT=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_PERFMON=y CONFIG_PERFMON=y
CONFIG_IA64_PALINFO=y CONFIG_IA64_PALINFO=y
CONFIG_EFI=y
CONFIG_EFI_VARS=y CONFIG_EFI_VARS=y
CONFIG_NR_CPUS=16
CONFIG_BINFMT_ELF=y CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=y CONFIG_BINFMT_MISC=y
...@@ -140,7 +140,6 @@ CONFIG_HOTPLUG=y ...@@ -140,7 +140,6 @@ CONFIG_HOTPLUG=y
# #
# Plug and Play support # Plug and Play support
# #
# CONFIG_PNP is not set
# #
# Block devices # Block devices
...@@ -179,6 +178,7 @@ CONFIG_IDE_TASKFILE_IO=y ...@@ -179,6 +178,7 @@ CONFIG_IDE_TASKFILE_IO=y
# #
# IDE chipset support/bugfixes # IDE chipset support/bugfixes
# #
# CONFIG_IDE_GENERIC is not set
CONFIG_BLK_DEV_IDEPCI=y CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_IDEPCI_SHARE_IRQ=y
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
...@@ -223,7 +223,6 @@ CONFIG_IDEDMA_AUTO=y ...@@ -223,7 +223,6 @@ CONFIG_IDEDMA_AUTO=y
# #
# I2O device support # I2O device support
# #
# CONFIG_I2O is not set
# #
# Multi-device support (RAID and LVM) # Multi-device support (RAID and LVM)
...@@ -234,6 +233,7 @@ CONFIG_MD_LINEAR=m ...@@ -234,6 +233,7 @@ CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m CONFIG_MD_RAID1=m
CONFIG_MD_RAID5=m CONFIG_MD_RAID5=m
# CONFIG_MD_RAID6 is not set
CONFIG_MD_MULTIPATH=m CONFIG_MD_MULTIPATH=m
CONFIG_BLK_DEV_DM=m CONFIG_BLK_DEV_DM=m
CONFIG_DM_IOCTL_V4=y CONFIG_DM_IOCTL_V4=y
...@@ -303,9 +303,15 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 ...@@ -303,9 +303,15 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_ISP is not set
# CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_FC is not set
CONFIG_SCSI_QLOGIC_1280=y CONFIG_SCSI_QLOGIC_1280=y
CONFIG_SCSI_QLA2XXX=y
# CONFIG_SCSI_QLA21XX is not set
# CONFIG_SCSI_QLA22XX is not set
# CONFIG_SCSI_QLA2300 is not set
# CONFIG_SCSI_QLA2322 is not set
# CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA6322 is not set
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DEBUG is not set # CONFIG_SCSI_DEBUG is not set
# #
...@@ -414,6 +420,7 @@ CONFIG_NET_PCI=y ...@@ -414,6 +420,7 @@ CONFIG_NET_PCI=y
# CONFIG_AMD8111_ETH is not set # CONFIG_AMD8111_ETH is not set
# CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_B44 is not set # CONFIG_B44 is not set
# CONFIG_FORCEDETH is not set
# CONFIG_DGRS is not set # CONFIG_DGRS is not set
CONFIG_EEPRO100=y CONFIG_EEPRO100=y
# CONFIG_EEPRO100_PIO is not set # CONFIG_EEPRO100_PIO is not set
...@@ -539,8 +546,8 @@ CONFIG_HW_CONSOLE=y ...@@ -539,8 +546,8 @@ CONFIG_HW_CONSOLE=y
# #
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_ACPI=y
CONFIG_SERIAL_8250_HCDP=y CONFIG_SERIAL_8250_HCDP=y
CONFIG_SERIAL_8250_ACPI=y
CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_NR_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SERIAL_8250_EXTENDED is not set
...@@ -552,24 +559,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y ...@@ -552,24 +559,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256 CONFIG_UNIX98_PTY_COUNT=256
#
# I2C support
#
# CONFIG_I2C is not set
#
# I2C Algorithms
#
#
# I2C Hardware Bus support
#
#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set
# #
# Mice # Mice
# #
...@@ -609,6 +598,11 @@ CONFIG_DRM_RADEON=m ...@@ -609,6 +598,11 @@ CONFIG_DRM_RADEON=m
# CONFIG_DRM_SIS is not set # CONFIG_DRM_SIS is not set
# CONFIG_RAW_DRIVER is not set # CONFIG_RAW_DRIVER is not set
#
# I2C support
#
# CONFIG_I2C is not set
# #
# Multimedia devices # Multimedia devices
# #
...@@ -789,6 +783,7 @@ CONFIG_FB_RADEON=y ...@@ -789,6 +783,7 @@ CONFIG_FB_RADEON=y
# CONFIG_FB_ATY is not set # CONFIG_FB_ATY is not set
# CONFIG_FB_SIS is not set # CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set # CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set # CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_TRIDENT is not set # CONFIG_FB_TRIDENT is not set
...@@ -844,6 +839,7 @@ CONFIG_SND_SEQUENCER=m ...@@ -844,6 +839,7 @@ CONFIG_SND_SEQUENCER=m
# #
# CONFIG_SND_ALI5451 is not set # CONFIG_SND_ALI5451 is not set
# CONFIG_SND_AZT3328 is not set # CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CS46XX is not set # CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS4281 is not set # CONFIG_SND_CS4281 is not set
# CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1 is not set
...@@ -927,7 +923,6 @@ CONFIG_USB_HIDDEV=y ...@@ -927,7 +923,6 @@ CONFIG_USB_HIDDEV=y
# USB Imaging devices # USB Imaging devices
# #
# CONFIG_USB_MDC800 is not set # CONFIG_USB_MDC800 is not set
# CONFIG_USB_SCANNER is not set
# CONFIG_USB_MICROTEK is not set # CONFIG_USB_MICROTEK is not set
# CONFIG_USB_HPUSBSCSI is not set # CONFIG_USB_HPUSBSCSI is not set
...@@ -961,12 +956,19 @@ CONFIG_USB_HIDDEV=y ...@@ -961,12 +956,19 @@ CONFIG_USB_HIDDEV=y
# #
# USB Miscellaneous drivers # USB Miscellaneous drivers
# #
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_TIGL is not set # CONFIG_USB_TIGL is not set
# CONFIG_USB_AUERSWALD is not set # CONFIG_USB_AUERSWALD is not set
# CONFIG_USB_RIO500 is not set # CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_BRLVGER is not set # CONFIG_USB_BRLVGER is not set
# CONFIG_USB_LCD is not set # CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set # CONFIG_USB_GADGET is not set
# #
...@@ -988,10 +990,6 @@ CONFIG_DEBUG_KERNEL=y ...@@ -988,10 +990,6 @@ CONFIG_DEBUG_KERNEL=y
CONFIG_IA64_PRINT_HAZARDS=y CONFIG_IA64_PRINT_HAZARDS=y
# CONFIG_DISABLE_VHPT is not set # CONFIG_DISABLE_VHPT is not set
CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ=y
CONFIG_IA64_EARLY_PRINTK=y
CONFIG_IA64_EARLY_PRINTK_UART=y
CONFIG_IA64_EARLY_PRINTK_UART_BASE=0xff5e0000
CONFIG_IA64_EARLY_PRINTK_VGA=y
# CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
......
This diff is collapsed.
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
* *
* Changelog: * Changelog:
* *
* 10 Feb 2004 - Stephane Eranian <eranian@hpl.hp.com>
* Provide FPSWA version number via /proc/efi/fpswa
*
* 10 Dec 2002 - Matt Domsch <Matt_Domsch@dell.com> * 10 Dec 2002 - Matt Domsch <Matt_Domsch@dell.com>
* fix locking per Peter Chubb's findings * fix locking per Peter Chubb's findings
* *
...@@ -70,6 +73,7 @@ ...@@ -70,6 +73,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/efi.h> #include <linux/efi.h>
#include <asm/fpswa.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>"); MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
...@@ -407,6 +411,37 @@ static struct file_operations efi_systab_fops = { ...@@ -407,6 +411,37 @@ static struct file_operations efi_systab_fops = {
.read = efi_systab_read, .read = efi_systab_read,
}; };
static ssize_t
efi_fpswa_read (struct file *file, char *buffer, size_t count, loff_t *ppos)
{
ssize_t size, length;
char str[32];
void *data;
snprintf(str, sizeof(str), "revision=%u.%u\n",
fpswa_interface->revision >> 16, fpswa_interface->revision & 0xffff);
length = strlen(str);
if (*ppos >= length)
return 0;
data = str + file->f_pos;
size = length - file->f_pos;
if (size > count)
size = count;
if (copy_to_user(buffer, data, size))
return -EFAULT;
*ppos += size;
return size;
}
static struct proc_dir_entry *efi_fpswa_entry;
static struct file_operations efi_fpswa_fops = {
.read = efi_fpswa_read,
};
static int __init static int __init
efivars_init(void) efivars_init(void)
{ {
...@@ -429,6 +464,12 @@ efivars_init(void) ...@@ -429,6 +464,12 @@ efivars_init(void)
if (efi_systab_entry) if (efi_systab_entry)
efi_systab_entry->proc_fops = &efi_systab_fops; efi_systab_entry->proc_fops = &efi_systab_fops;
if (fpswa_interface) {
efi_fpswa_entry = create_proc_entry("fpswa", S_IRUGO, efi_dir);
if (efi_fpswa_entry)
efi_fpswa_entry->proc_fops = &efi_fpswa_fops;
}
efi_vars_dir = proc_mkdir("vars", efi_dir); efi_vars_dir = proc_mkdir("vars", efi_dir);
/* Per EFI spec, the maximum storage allocated for both /* Per EFI spec, the maximum storage allocated for both
......
This diff is collapsed.
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
* Cache the record across multi-block reads from user space. * Cache the record across multi-block reads from user space.
* Support > 64 cpus. * Support > 64 cpus.
* Delete module_exit and MOD_INC/DEC_COUNT, salinfo cannot be a module. * Delete module_exit and MOD_INC/DEC_COUNT, salinfo cannot be a module.
*
* Jan 28 2004 kaos@sgi.com
* Periodically check for outstanding MCA or INIT records.
*/ */
#include <linux/types.h> #include <linux/types.h>
...@@ -23,6 +26,7 @@ ...@@ -23,6 +26,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/timer.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
...@@ -179,6 +183,8 @@ shift1_data_saved (struct salinfo_data *data, int shift) ...@@ -179,6 +183,8 @@ shift1_data_saved (struct salinfo_data *data, int shift)
/* This routine is invoked in interrupt context. Note: mca.c enables /* This routine is invoked in interrupt context. Note: mca.c enables
* interrupts before calling this code for CMC/CPE. MCA and INIT events are * interrupts before calling this code for CMC/CPE. MCA and INIT events are
* not irq safe, do not call any routines that use spinlocks, they may deadlock. * not irq safe, do not call any routines that use spinlocks, they may deadlock.
* MCA and INIT records are recorded, a timer event will look for any
* outstanding events and wake up the user space code.
* *
* The buffer passed from mca.c points to the output from ia64_log_get. This is * The buffer passed from mca.c points to the output from ia64_log_get. This is
* a persistent buffer but its contents can change between the interrupt and * a persistent buffer but its contents can change between the interrupt and
...@@ -186,12 +192,12 @@ shift1_data_saved (struct salinfo_data *data, int shift) ...@@ -186,12 +192,12 @@ shift1_data_saved (struct salinfo_data *data, int shift)
* changes. * changes.
*/ */
void void
salinfo_log_wakeup(int type, u8 *buffer, u64 size) salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe)
{ {
struct salinfo_data *data = salinfo_data + type; struct salinfo_data *data = salinfo_data + type;
struct salinfo_data_saved *data_saved; struct salinfo_data_saved *data_saved;
unsigned long flags = 0; unsigned long flags = 0;
int i, irqsafe = type != SAL_INFO_TYPE_MCA && type != SAL_INFO_TYPE_INIT; int i;
int saved_size = ARRAY_SIZE(data->data_saved); int saved_size = ARRAY_SIZE(data->data_saved);
BUG_ON(type >= ARRAY_SIZE(salinfo_log_name)); BUG_ON(type >= ARRAY_SIZE(salinfo_log_name));
...@@ -224,6 +230,35 @@ salinfo_log_wakeup(int type, u8 *buffer, u64 size) ...@@ -224,6 +230,35 @@ salinfo_log_wakeup(int type, u8 *buffer, u64 size)
} }
} }
/* Check for outstanding MCA/INIT records every 5 minutes (arbitrary) */
#define SALINFO_TIMER_DELAY (5*60*HZ)
static struct timer_list salinfo_timer;
static void
salinfo_timeout_check(struct salinfo_data *data)
{
int i;
if (!data->open)
return;
for (i = 0; i < NR_CPUS; ++i) {
if (test_bit(i, &data->cpu_event)) {
/* double up() is not a problem, user space will see no
* records for the additional "events".
*/
up(&data->sem);
}
}
}
static void
salinfo_timeout (unsigned long arg)
{
salinfo_timeout_check(salinfo_data + SAL_INFO_TYPE_MCA);
salinfo_timeout_check(salinfo_data + SAL_INFO_TYPE_INIT);
salinfo_timer.expires = jiffies + SALINFO_TIMER_DELAY;
add_timer(&salinfo_timer);
}
static int static int
salinfo_event_open(struct inode *inode, struct file *file) salinfo_event_open(struct inode *inode, struct file *file)
{ {
...@@ -563,6 +598,11 @@ salinfo_init(void) ...@@ -563,6 +598,11 @@ salinfo_init(void)
*sdir++ = salinfo_dir; *sdir++ = salinfo_dir;
init_timer(&salinfo_timer);
salinfo_timer.expires = jiffies + SALINFO_TIMER_DELAY;
salinfo_timer.function = &salinfo_timeout;
add_timer(&salinfo_timer);
return 0; return 0;
} }
......
...@@ -77,7 +77,6 @@ extern void __init calibrate_delay (void); ...@@ -77,7 +77,6 @@ extern void __init calibrate_delay (void);
extern void start_ap (void); extern void start_ap (void);
extern unsigned long ia64_iobase; extern unsigned long ia64_iobase;
int cpucount;
task_t *task_for_booting_cpu; task_t *task_for_booting_cpu;
/* Bitmask of currently online CPUs */ /* Bitmask of currently online CPUs */
......
...@@ -46,21 +46,14 @@ register double f30 asm ("f30"); register double f31 asm ("f31"); ...@@ -46,21 +46,14 @@ register double f30 asm ("f30"); register double f31 asm ("f31");
extern spinlock_t timerlist_lock; extern spinlock_t timerlist_lock;
static fpswa_interface_t *fpswa_interface; fpswa_interface_t *fpswa_interface;
void __init void __init
trap_init (void) trap_init (void)
{ {
int major = 0, minor = 0; if (ia64_boot_param->fpswa)
if (ia64_boot_param->fpswa) {
/* FPSWA fixup: make the interface pointer a kernel virtual address: */ /* FPSWA fixup: make the interface pointer a kernel virtual address: */
fpswa_interface = __va(ia64_boot_param->fpswa); fpswa_interface = __va(ia64_boot_param->fpswa);
major = fpswa_interface->revision >> 16;
minor = fpswa_interface->revision & 0xffff;
}
printk(KERN_INFO "fpswa interface at %lx (rev %d.%d)\n",
ia64_boot_param->fpswa, major, minor);
} }
/* /*
......
...@@ -740,6 +740,7 @@ static int ...@@ -740,6 +740,7 @@ static int
emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs) emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
{ {
unsigned int len = 1 << ld.x6_sz; unsigned int len = 1 << ld.x6_sz;
unsigned long val = 0;
/* /*
* r0, as target, doesn't need to be checked because Illegal Instruction * r0, as target, doesn't need to be checked because Illegal Instruction
...@@ -750,11 +751,9 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs) ...@@ -750,11 +751,9 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
*/ */
/* /*
* ldX.a we don't try to emulate anything but we must invalidate the ALAT entry. * ldX.a we will emulate load and also invalidate the ALAT entry.
* See comment below for explanation on how we handle ldX.a * See comment below for explanation on how we handle ldX.a
*/ */
if (ld.x6_op != 0x2) {
unsigned long val = 0;
if (len != 2 && len != 4 && len != 8) { if (len != 2 && len != 4 && len != 8) {
DPRINT("unknown size: x6=%d\n", ld.x6_sz); DPRINT("unknown size: x6=%d\n", ld.x6_sz);
...@@ -764,7 +763,6 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs) ...@@ -764,7 +763,6 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
if (copy_from_user(&val, (void *) ifa, len)) if (copy_from_user(&val, (void *) ifa, len))
return -1; return -1;
setreg(ld.r1, val, 0, regs); setreg(ld.r1, val, 0, regs);
}
/* /*
* check for updates on any kind of loads * check for updates on any kind of loads
...@@ -817,7 +815,7 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs) ...@@ -817,7 +815,7 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
* store & shift to temporary; * store & shift to temporary;
* r1=temporary * r1=temporary
* *
* So int this case, you would get the right value is r1 but the wrong info in * So in this case, you would get the right value is r1 but the wrong info in
* the ALAT. Notice that you could do it in reverse to finish with address 3 * the ALAT. Notice that you could do it in reverse to finish with address 3
* but you would still get the size wrong. To get the size right, one needs to * but you would still get the size wrong. To get the size right, one needs to
* execute exactly the same kind of load. You could do it from a aligned * execute exactly the same kind of load. You could do it from a aligned
...@@ -826,9 +824,12 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs) ...@@ -826,9 +824,12 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
* So no matter what, it is not possible to emulate an advanced load * So no matter what, it is not possible to emulate an advanced load
* correctly. But is that really critical ? * correctly. But is that really critical ?
* *
* We will always convert ld.a into a normal load with ALAT invalidated. This
* will enable compiler to do optimization where certain code path after ld.a
* is not required to have ld.c/chk.a, e.g., code path with no intervening stores.
* *
* Now one has to look at how ld.a is used, one must either do a ld.c.* or * If there is a store after the advanced load, one must either do a ld.c.* or
* chck.a.* to reuse the value stored in the ALAT. Both can "fail" (meaning no * chk.a.* to reuse the value stored in the ALAT. Both can "fail" (meaning no
* entry found in ALAT), and that's perfectly ok because: * entry found in ALAT), and that's perfectly ok because:
* *
* - ld.c.*, if the entry is not present a normal load is executed * - ld.c.*, if the entry is not present a normal load is executed
...@@ -836,19 +837,8 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs) ...@@ -836,19 +837,8 @@ emulate_load_int (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
* *
* In either case, the load can be potentially retried in another form. * In either case, the load can be potentially retried in another form.
* *
* So it's okay NOT to do any actual load on an unaligned ld.a. However the ALAT * ALAT must be invalidated for the register (so that chk.a or ld.c don't pick
* must be invalidated for the register (so that's chck.a.*,ld.c.* don't pick up * up a stale entry later). The register base update MUST also be performed.
* a stale entry later) The register base update MUST also be performed.
*
* Now what is the content of the register and its NaT bit in the case we don't
* do the load ? EAS2.4, says (in case an actual load is needed)
*
* - r1 = [r3], Nat = 0 if succeeds
* - r1 = 0 Nat = 0 if trying to access non-speculative memory
*
* For us, there is nothing to do, because both ld.c.* and chk.a.* are going to
* retry and thus eventually reload the register thereby changing Nat and
* register content.
*/ */
/* /*
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
* This needs to be optimized. * This needs to be optimized.
*/ */
void void
__ia64_memcpy_fromio (void * to, unsigned long from, long count) __ia64_memcpy_fromio (void *to, unsigned long from, long count)
{ {
char *dst = to;
while (count) { while (count) {
count--; count--;
*(char *) to = readb(from); *dst++ = readb(from++);
((char *) to)++;
from++;
} }
} }
EXPORT_SYMBOL(__ia64_memcpy_fromio); EXPORT_SYMBOL(__ia64_memcpy_fromio);
...@@ -25,13 +25,13 @@ EXPORT_SYMBOL(__ia64_memcpy_fromio); ...@@ -25,13 +25,13 @@ EXPORT_SYMBOL(__ia64_memcpy_fromio);
* This needs to be optimized. * This needs to be optimized.
*/ */
void void
__ia64_memcpy_toio (unsigned long to, void * from, long count) __ia64_memcpy_toio (unsigned long to, void *from, long count)
{ {
char *src = from;
while (count) { while (count) {
count--; count--;
writeb(*(char *) from, to); writeb(*src++, to++);
((char *) from)++;
to++;
} }
} }
EXPORT_SYMBOL(__ia64_memcpy_toio); EXPORT_SYMBOL(__ia64_memcpy_toio);
......
...@@ -68,20 +68,6 @@ print_hook(const char *fmt, ...) ...@@ -68,20 +68,6 @@ print_hook(const char *fmt, ...)
} }
/*
* ia64_sn2_platform_plat_specific_err_print
*
* Called by the MCA handler to log platform-specific errors.
*/
void
ia64_sn2_platform_plat_specific_err_print(int header_len, int sect_len, u8 *p_data, prfunc_t prfunc)
{
ia64_sn_plat_specific_err_print(print_hook, p_data - sect_len);
}
static void static void
sn_cpei_handler(int irq, void *devid, struct pt_regs *regs) sn_cpei_handler(int irq, void *devid, struct pt_regs *regs)
{ {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* License. See the file "COPYING" in the main directory of this archive * License. See the file "COPYING" in the main directory of this archive
* for more details. * for more details.
* *
* Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved. * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
*/ */
#include <linux/init.h> #include <linux/init.h>
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/numa.h>
#include <asm/bitops.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include <asm/current.h> #include <asm/current.h>
#include <asm/sn/sn_cpuid.h> #include <asm/sn/sn_cpuid.h>
...@@ -67,14 +69,56 @@ wait_piowc(void) ...@@ -67,14 +69,56 @@ wait_piowc(void)
* *
* Purges the translation caches of all processors of the given virtual address * Purges the translation caches of all processors of the given virtual address
* range. * range.
*
* Note:
* - cpu_vm_mask is a bit mask that indicates which cpus have loaded the context.
* - cpu_vm_mask is converted into a nodemask of the nodes containing the
* cpus in cpu_vm_mask.
* - if only one bit is set in cpu_vm_mask & it is the current cpu,
* then only the local TLB needs to be flushed. This flushing can be done
* using ptc.l. This is the common case & avoids the global spinlock.
* - if multiple cpus have loaded the context, then flushing has to be
* done with ptc.g/MMRs under protection of the global ptc_lock.
*/ */
void void
sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits) sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbits)
{ {
int cnode, mycnode, nasid, flushed=0; int i, cnode, mynasid, cpu, lcpu=0, nasid, flushed=0;
volatile unsigned long *ptc0, *ptc1; volatile unsigned long *ptc0, *ptc1;
unsigned long flags=0, data0, data1; unsigned long flags=0, data0, data1;
struct mm_struct *mm=current->active_mm;
short nasids[NR_NODES], nix;
DECLARE_BITMAP(nodes_flushed, NR_NODES);
CLEAR_BITMAP(nodes_flushed, NR_NODES);
i = 0;
for_each_cpu_mask(cpu, mm->cpu_vm_mask) {
cnode = cpu_to_node(cpu);
__set_bit(cnode, nodes_flushed);
lcpu = cpu;
i++;
}
preempt_disable();
if (likely(i == 1 && lcpu == smp_processor_id())) {
do {
ia64_ptcl(start, nbits<<2);
start += (1UL << nbits);
} while (start < end);
ia64_srlz_i();
preempt_enable();
return;
}
nix = 0;
for (cnode=find_first_bit(&nodes_flushed, NR_NODES); cnode < NR_NODES;
cnode=find_next_bit(&nodes_flushed, NR_NODES, ++cnode))
nasids[nix++] = cnodeid_to_nasid(cnode);
data0 = (1UL<<SH_PTC_0_A_SHFT) | data0 = (1UL<<SH_PTC_0_A_SHFT) |
(nbits<<SH_PTC_0_PS_SHFT) | (nbits<<SH_PTC_0_PS_SHFT) |
...@@ -84,20 +128,19 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit ...@@ -84,20 +128,19 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit
ptc0 = (long*)GLOBAL_MMR_PHYS_ADDR(0, SH_PTC_0); ptc0 = (long*)GLOBAL_MMR_PHYS_ADDR(0, SH_PTC_0);
ptc1 = (long*)GLOBAL_MMR_PHYS_ADDR(0, SH_PTC_1); ptc1 = (long*)GLOBAL_MMR_PHYS_ADDR(0, SH_PTC_1);
mycnode = numa_node_id();
mynasid = smp_physical_node_id();
spin_lock_irqsave(&sn2_global_ptc_lock, flags); spin_lock_irqsave(&sn2_global_ptc_lock, flags);
do { do {
data1 = start | (1UL<<SH_PTC_1_START_SHFT); data1 = start | (1UL<<SH_PTC_1_START_SHFT);
for (cnode = 0; cnode < numnodes; cnode++) { for (i=0; i<nix; i++) {
if (is_headless_node(cnode)) nasid = nasids[i];
continue; if (likely(nasid == mynasid)) {
if (cnode == mycnode) {
ia64_ptcga(start, nbits<<2); ia64_ptcga(start, nbits<<2);
ia64_srlz_i(); ia64_srlz_i();
} else { } else {
nasid = cnodeid_to_nasid(cnode);
ptc0 = CHANGE_NASID(nasid, ptc0); ptc0 = CHANGE_NASID(nasid, ptc0);
ptc1 = CHANGE_NASID(nasid, ptc1); ptc1 = CHANGE_NASID(nasid, ptc1);
pio_atomic_phys_write_mmrs(ptc0, data0, ptc1, data1); pio_atomic_phys_write_mmrs(ptc0, data0, ptc1, data1);
...@@ -115,6 +158,7 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit ...@@ -115,6 +158,7 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit
spin_unlock_irqrestore(&sn2_global_ptc_lock, flags); spin_unlock_irqrestore(&sn2_global_ptc_lock, flags);
preempt_enable();
} }
/* /*
......
...@@ -68,4 +68,6 @@ typedef struct { ...@@ -68,4 +68,6 @@ typedef struct {
efi_fpswa_t fpswa; efi_fpswa_t fpswa;
} fpswa_interface_t; } fpswa_interface_t;
extern fpswa_interface_t *fpswa_interface;
#endif /* _ASM_IA64_FPSWA_H */ #endif /* _ASM_IA64_FPSWA_H */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* File: mca.h * File: mca.h
* Purpose: Machine check handling specific defines * Purpose: Machine check handling specific defines
* *
* Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
* Copyright (C) Vijay Chander (vijay@engr.sgi.com) * Copyright (C) Vijay Chander (vijay@engr.sgi.com)
* Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
*/ */
...@@ -20,23 +20,8 @@ ...@@ -20,23 +20,8 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mca_asm.h> #include <asm/mca_asm.h>
/* These are the return codes from all the IA64_MCA specific interfaces */
typedef int ia64_mca_return_code_t;
enum {
IA64_MCA_SUCCESS = 0,
IA64_MCA_FAILURE = 1
};
#define IA64_MCA_RENDEZ_TIMEOUT (20 * 1000) /* value in milliseconds - 20 seconds */ #define IA64_MCA_RENDEZ_TIMEOUT (20 * 1000) /* value in milliseconds - 20 seconds */
#define IA64_CMC_INT_DISABLE 0
#define IA64_CMC_INT_ENABLE 1
typedef u32 int_vector_t;
typedef u64 millisec_t;
typedef union cmcv_reg_u { typedef union cmcv_reg_u {
u64 cmcv_regval; u64 cmcv_regval;
struct { struct {
...@@ -53,10 +38,6 @@ typedef union cmcv_reg_u { ...@@ -53,10 +38,6 @@ typedef union cmcv_reg_u {
#define cmcv_mask cmcv_reg_s.cmcr_mask #define cmcv_mask cmcv_reg_s.cmcr_mask
#define cmcv_vector cmcv_reg_s.cmcr_vector #define cmcv_vector cmcv_reg_s.cmcr_vector
#define IA64_MCA_UCMC_HANDLER_SIZE 0x10
#define IA64_INIT_HANDLER_SIZE 0x10
enum { enum {
IA64_MCA_RENDEZ_CHECKIN_NOTDONE = 0x0, IA64_MCA_RENDEZ_CHECKIN_NOTDONE = 0x0,
IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1 IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1
...@@ -85,16 +66,6 @@ typedef struct ia64_mc_info_s { ...@@ -85,16 +66,6 @@ typedef struct ia64_mc_info_s {
} ia64_mc_info_t; } ia64_mc_info_t;
/* Possible rendez states passed from SAL to OS during MCA
* handoff
*/
enum {
IA64_MCA_RENDEZ_NOT_RQD = 0x0,
IA64_MCA_RENDEZ_DONE_WITHOUT_INIT = 0x1,
IA64_MCA_RENDEZ_DONE_WITH_INIT = 0x2,
IA64_MCA_RENDEZ_FAILURE = -1
};
typedef struct ia64_mca_sal_to_os_state_s { typedef struct ia64_mca_sal_to_os_state_s {
u64 imsto_os_gp; /* GP of the os registered with the SAL */ u64 imsto_os_gp; /* GP of the os registered with the SAL */
u64 imsto_pal_proc; /* PAL_PROC entry point - physical addr */ u64 imsto_pal_proc; /* PAL_PROC entry point - physical addr */
...@@ -136,41 +107,14 @@ typedef struct ia64_mca_os_to_sal_state_s { ...@@ -136,41 +107,14 @@ typedef struct ia64_mca_os_to_sal_state_s {
*/ */
} ia64_mca_os_to_sal_state_t; } ia64_mca_os_to_sal_state_t;
typedef int (*prfunc_t)(const char * fmt, ...);
extern void ia64_mca_init(void); extern void ia64_mca_init(void);
extern void ia64_os_mca_dispatch(void); extern void ia64_os_mca_dispatch(void);
extern void ia64_os_mca_dispatch_end(void); extern void ia64_os_mca_dispatch_end(void);
extern void ia64_mca_ucmc_handler(void); extern void ia64_mca_ucmc_handler(void);
extern void ia64_monarch_init_handler(void); extern void ia64_monarch_init_handler(void);
extern void ia64_slave_init_handler(void); extern void ia64_slave_init_handler(void);
extern irqreturn_t ia64_mca_rendez_int_handler(int,void *,struct pt_regs *);
extern irqreturn_t ia64_mca_wakeup_int_handler(int,void *,struct pt_regs *);
extern irqreturn_t ia64_mca_cmc_int_handler(int,void *,struct pt_regs *);
extern irqreturn_t ia64_mca_cmc_int_caller(int,void *,struct pt_regs *);
extern irqreturn_t ia64_mca_cpe_int_handler(int,void *,struct pt_regs *);
extern irqreturn_t ia64_mca_cpe_int_caller(int,void *,struct pt_regs *);
extern int ia64_log_print(int,prfunc_t);
extern void ia64_mca_cmc_vector_setup(void); extern void ia64_mca_cmc_vector_setup(void);
extern int ia64_mca_check_errors(void); extern int ia64_mca_check_errors(void);
#define PLATFORM_CALL(fn, args) printk("Platform call TBD\n")
#define platform_mem_dev_err_print ia64_log_prt_oem_data
#define platform_pci_bus_err_print ia64_log_prt_oem_data
#define platform_pci_comp_err_print ia64_log_prt_oem_data
#define platform_plat_specific_err_print ia64_log_prt_oem_data
#define platform_host_ctlr_err_print ia64_log_prt_oem_data
#define platform_plat_bus_err_print ia64_log_prt_oem_data
#undef MCA_TEST
#undef IA64_MCA_DEBUG_INFO
#if defined(IA64_MCA_DEBUG_INFO)
# define IA64_MCA_DEBUG(fmt...) printk(fmt)
#else
# define IA64_MCA_DEBUG(fmt...)
#endif
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_MCA_H */ #endif /* _ASM_IA64_MCA_H */
...@@ -106,6 +106,7 @@ get_mmu_context (struct mm_struct *mm) ...@@ -106,6 +106,7 @@ get_mmu_context (struct mm_struct *mm)
/* re-check, now that we've got the lock: */ /* re-check, now that we've got the lock: */
context = mm->context; context = mm->context;
if (context == 0) { if (context == 0) {
cpus_clear(mm->cpu_vm_mask);
if (ia64_ctx.next >= ia64_ctx.limit) if (ia64_ctx.next >= ia64_ctx.limit)
wrap_mmu_context(mm); wrap_mmu_context(mm);
mm->context = context = ia64_ctx.next++; mm->context = context = ia64_ctx.next++;
...@@ -170,6 +171,8 @@ activate_context (struct mm_struct *mm) ...@@ -170,6 +171,8 @@ activate_context (struct mm_struct *mm)
do { do {
context = get_mmu_context(mm); context = get_mmu_context(mm);
MMU_TRACE('A', smp_processor_id(), mm, context); MMU_TRACE('A', smp_processor_id(), mm, context);
if (!cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
cpu_set(smp_processor_id(), mm->cpu_vm_mask);
reload_context(context); reload_context(context);
MMU_TRACE('a', smp_processor_id(), mm, context); MMU_TRACE('a', smp_processor_id(), mm, context);
/* in the unlikely event of a TLB-flush by another thread, redo the load: */ /* in the unlikely event of a TLB-flush by another thread, redo the load: */
......
...@@ -50,7 +50,7 @@ extern void *per_cpu_init(void); ...@@ -50,7 +50,7 @@ extern void *per_cpu_init(void);
#else /* ! SMP */ #else /* ! SMP */
#define per_cpu(var, cpu) ((void)cpu, per_cpu__##var) #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
#define __get_cpu_var(var) per_cpu__##var #define __get_cpu_var(var) per_cpu__##var
#define per_cpu_init() (__phys_per_cpu_start) #define per_cpu_init() (__phys_per_cpu_start)
......
...@@ -294,7 +294,7 @@ struct thread_struct { ...@@ -294,7 +294,7 @@ struct thread_struct {
.on_ustack = 0, \ .on_ustack = 0, \
.ksp = 0, \ .ksp = 0, \
.map_base = DEFAULT_MAP_BASE, \ .map_base = DEFAULT_MAP_BASE, \
.rbs_bot = DEFAULT_USER_STACK_SIZE, \ .rbs_bot = STACK_TOP - DEFAULT_USER_STACK_SIZE, \
.task_size = DEFAULT_TASK_SIZE, \ .task_size = DEFAULT_TASK_SIZE, \
.last_fph_cpu = -1, \ .last_fph_cpu = -1, \
INIT_THREAD_IA32 \ INIT_THREAD_IA32 \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment