···11-/*22- * Copyright (C) Cort Dougan 1999.33- *44- * This program is free software; you can redistribute it and/or55- * modify it under the terms of the GNU General Public License66- * as published by the Free Software Foundation; either version77- * 2 of the License, or (at your option) any later version.88- *99- * Generate a note section as per the CHRP specification.1010- *1111- */1212-1313-#include <stdio.h>1414-1515-#define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );1616-1717-int main(void)1818-{1919-/* header */2020- /* namesz */2121- PL(strlen("PowerPC")+1);2222- /* descrsz */2323- PL(6*4);2424- /* type */2525- PL(0x1275);2626- /* name */2727- printf("PowerPC"); printf("%c", 0);2828-2929-/* descriptor */3030- /* real-mode */3131- PL(0xffffffff);3232- /* real-base */3333- PL(0x00c00000);3434- /* real-size */3535- PL(0xffffffff);3636- /* virt-base */3737- PL(0xffffffff);3838- /* virt-size */3939- PL(0xffffffff);4040- /* load-base */4141- PL(0x4000);4242- return 0;4343-}
-83
arch/ppc64/boot/piggyback.c
···11-/*22- * Copyright 2001 IBM Corp 33- *44- * This program is free software; you can redistribute it and/or55- * modify it under the terms of the GNU General Public License66- * as published by the Free Software Foundation; either version77- * 2 of the License, or (at your option) any later version.88- */99-#include <stdio.h>1010-#include <unistd.h>1111-#include <string.h>1212-1313-extern long ce_exec_config[];1414-1515-int main(int argc, char *argv[])1616-{1717- int i, cnt, pos, len;1818- unsigned int cksum, val;1919- unsigned char *lp;2020- unsigned char buf[8192];2121- char *varname;2222- if (argc != 2)2323- {2424- fprintf(stderr, "usage: %s name <in-file >out-file\n",2525- argv[0]);2626- exit(1);2727- }2828-2929- varname = strrchr(argv[1], '/');3030- if (varname)3131- varname++;3232- else3333- varname = argv[1];3434-3535- fprintf(stdout, "#\n");3636- fprintf(stdout, "# Miscellaneous data structures:\n");3737- fprintf(stdout, "# WARNING - this file is automatically generated!\n");3838- fprintf(stdout, "#\n");3939- fprintf(stdout, "\n");4040- fprintf(stdout, "\t.data\n");4141- fprintf(stdout, "\t.globl %s_data\n", varname);4242- fprintf(stdout, "%s_data:\n", varname);4343- pos = 0;4444- cksum = 0;4545- while ((len = read(0, buf, sizeof(buf))) > 0)4646- {4747- cnt = 0;4848- lp = (unsigned char *)buf;4949- len = (len + 3) & ~3; /* Round up to longwords */5050- for (i = 0; i < len; i += 4)5151- {5252- if (cnt == 0)5353- {5454- fprintf(stdout, "\t.long\t");5555- }5656- fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);5757- val = *(unsigned long *)lp;5858- cksum ^= val;5959- lp += 4;6060- if (++cnt == 4)6161- {6262- cnt = 0;6363- fprintf(stdout, " # %x \n", pos+i-12);6464- fflush(stdout);6565- } else6666- {6767- fprintf(stdout, ",");6868- }6969- }7070- if (cnt)7171- {7272- fprintf(stdout, "0\n");7373- }7474- pos += len;7575- }7676- fprintf(stdout, "\t.globl %s_len\n", varname);7777- fprintf(stdout, "%s_len:\t.long\t0x%x\n", varname, pos);7878- fflush(stdout);7979- fclose(stdout);8080- fprintf(stderr, "cksum = %x\n", cksum);8181- exit(0);8282-}8383-
+2-14
arch/ppc64/boot/prom.c
···4040int getprop(void *phandle, const char *name, void *buf, int buflen);4141void chrpboot(int a1, int a2, void *prom); /* in main.c */42424343-void printk(char *fmt, ...);4343+int printf(char *fmt, ...);44444545/* there is no convenient header to get this from... -- paulus */4646extern unsigned long strlen(const char *);···220220 case 1:221221 return ch;222222 case -1:223223- printk("read(stdin) returned -1\r\n");223223+ printf("read(stdin) returned -1\r\n");224224 return -1;225225 }226226 }···626626}627627628628static char sprint_buf[1024];629629-630630-void631631-printk(char *fmt, ...)632632-{633633- va_list args;634634- int n;635635-636636- va_start(args, fmt);637637- n = vsprintf(sprint_buf, fmt, args);638638- va_end(args);639639- write(stdout, sprint_buf, n);640640-}641629642630int643631printf(char *fmt, ...)
+196-100
arch/ppc64/kernel/ItLpQueue.c
···11/*22 * ItLpQueue.c33 * Copyright (C) 2001 Mike Corrigan IBM Corporation44- * 44+ *55 * This program is free software; you can redistribute it and/or modify66 * it under the terms of the GNU General Public License as published by77 * the Free Software Foundation; either version 2 of the License, or···1111#include <linux/stddef.h>1212#include <linux/kernel.h>1313#include <linux/sched.h>1414+#include <linux/bootmem.h>1515+#include <linux/seq_file.h>1616+#include <linux/proc_fs.h>1417#include <asm/system.h>1518#include <asm/paca.h>1619#include <asm/iSeries/ItLpQueue.h>1720#include <asm/iSeries/HvLpEvent.h>1821#include <asm/iSeries/HvCallEvent.h>19222020-static __inline__ int set_inUse( struct ItLpQueue * lpQueue )2121-{2222- int t;2323- u32 * inUseP = &(lpQueue->xInUseWord);2323+/*2424+ * The LpQueue is used to pass event data from the hypervisor to2525+ * the partition. This is where I/O interrupt events are communicated.2626+ *2727+ * It is written to by the hypervisor so cannot end up in the BSS.2828+ */2929+struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data")));24302525- __asm__ __volatile__("\n\2626-1: lwarx %0,0,%2 \n\2727- cmpwi 0,%0,0 \n\2828- li %0,0 \n\2929- bne- 2f \n\3030- addi %0,%0,1 \n\3131- stwcx. %0,0,%2 \n\3232- bne- 1b \n\3333-2: eieio"3434- : "=&r" (t), "=m" (lpQueue->xInUseWord)3535- : "r" (inUseP), "m" (lpQueue->xInUseWord)3636- : "cc");3131+DEFINE_PER_CPU(unsigned long[HvLpEvent_Type_NumTypes], hvlpevent_counts);37323838- return t;3939-}4040-4141-static __inline__ void clear_inUse( struct ItLpQueue * lpQueue )4242-{4343- lpQueue->xInUseWord = 0;4444-}3333+static char *event_types[HvLpEvent_Type_NumTypes] = {3434+ "Hypervisor",3535+ "Machine Facilities",3636+ "Session Manager",3737+ "SPD I/O",3838+ "Virtual Bus",3939+ "PCI I/O",4040+ "RIO I/O",4141+ "Virtual Lan",4242+ "Virtual I/O"4343+};45444645/* Array of LpEvent handler functions */4746extern LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes];4848-unsigned long ItLpQueueInProcess = 0;49475050-struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * lpQueue )4848+static struct HvLpEvent * get_next_hvlpevent(void)5149{5252- struct HvLpEvent * nextLpEvent = 5353- (struct HvLpEvent *)lpQueue->xSlicCurEventPtr;5454- if ( nextLpEvent->xFlags.xValid ) {5050+ struct HvLpEvent * event;5151+ event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;5252+5353+ if (event->xFlags.xValid) {5554 /* rmb() needed only for weakly consistent machines (regatta) */5655 rmb();5756 /* Set pointer to next potential event */5858- lpQueue->xSlicCurEventPtr += ((nextLpEvent->xSizeMinus1 +5959- LpEventAlign ) /6060- LpEventAlign ) *6161- LpEventAlign;5757+ hvlpevent_queue.xSlicCurEventPtr += ((event->xSizeMinus1 +5858+ LpEventAlign) / LpEventAlign) * LpEventAlign;5959+6260 /* Wrap to beginning if no room at end */6363- if (lpQueue->xSlicCurEventPtr > lpQueue->xSlicLastValidEventPtr)6464- lpQueue->xSlicCurEventPtr = lpQueue->xSlicEventStackPtr;6161+ if (hvlpevent_queue.xSlicCurEventPtr >6262+ hvlpevent_queue.xSlicLastValidEventPtr) {6363+ hvlpevent_queue.xSlicCurEventPtr =6464+ hvlpevent_queue.xSlicEventStackPtr;6565+ }6666+ } else {6767+ event = NULL;6568 }6666- else 6767- nextLpEvent = NULL;68696969- return nextLpEvent;7070+ return event;7071}71727272-int ItLpQueue_isLpIntPending( struct ItLpQueue * lpQueue )7373+static unsigned long spread_lpevents = NR_CPUS;7474+7575+int hvlpevent_is_pending(void)7376{7474- int retval = 0;7575- struct HvLpEvent * nextLpEvent;7676- if ( lpQueue ) {7777- nextLpEvent = (struct HvLpEvent *)lpQueue->xSlicCurEventPtr;7878- retval = nextLpEvent->xFlags.xValid | lpQueue->xPlicOverflowIntPending;7979- }8080- return retval;7777+ struct HvLpEvent *next_event;7878+7979+ if (smp_processor_id() >= spread_lpevents)8080+ return 0;8181+8282+ next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;8383+8484+ return next_event->xFlags.xValid |8585+ hvlpevent_queue.xPlicOverflowIntPending;8186}82878383-void ItLpQueue_clearValid( struct HvLpEvent * event )8888+static void hvlpevent_clear_valid(struct HvLpEvent * event)8489{8585- /* Clear the valid bit of the event8686- * Also clear bits within this event that might8787- * look like valid bits (on 64-byte boundaries)8888- */8989- unsigned extra = (( event->xSizeMinus1 + LpEventAlign ) /9090- LpEventAlign ) - 1;9191- switch ( extra ) {9292- case 3:9393- ((struct HvLpEvent*)((char*)event+3*LpEventAlign))->xFlags.xValid=0;9494- case 2:9595- ((struct HvLpEvent*)((char*)event+2*LpEventAlign))->xFlags.xValid=0;9696- case 1:9797- ((struct HvLpEvent*)((char*)event+1*LpEventAlign))->xFlags.xValid=0;9898- case 0:9999- ; 9090+ /* Tell the Hypervisor that we're done with this event.9191+ * Also clear bits within this event that might look like valid bits.9292+ * ie. on 64-byte boundaries.9393+ */9494+ struct HvLpEvent *tmp;9595+ unsigned extra = ((event->xSizeMinus1 + LpEventAlign) /9696+ LpEventAlign) - 1;9797+9898+ switch (extra) {9999+ case 3:100100+ tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);101101+ tmp->xFlags.xValid = 0;102102+ case 2:103103+ tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);104104+ tmp->xFlags.xValid = 0;105105+ case 1:106106+ tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);107107+ tmp->xFlags.xValid = 0;100108 }109109+101110 mb();111111+102112 event->xFlags.xValid = 0;103113}104114105105-unsigned ItLpQueue_process( struct ItLpQueue * lpQueue, struct pt_regs *regs )115115+void process_hvlpevents(struct pt_regs *regs)106116{107107- unsigned numIntsProcessed = 0;108108- struct HvLpEvent * nextLpEvent;117117+ struct HvLpEvent * event;109118110119 /* If we have recursed, just return */111111- if ( !set_inUse( lpQueue ) )112112- return 0;113113-114114- if (ItLpQueueInProcess == 0)115115- ItLpQueueInProcess = 1;116116- else117117- BUG();120120+ if (!spin_trylock(&hvlpevent_queue.lock))121121+ return;118122119123 for (;;) {120120- nextLpEvent = ItLpQueue_getNextLpEvent( lpQueue );121121- if ( nextLpEvent ) {122122- /* Count events to return to caller123123- * and count processed events in lpQueue124124- */125125- ++numIntsProcessed;126126- lpQueue->xLpIntCount++; 127127- /* Call appropriate handler here, passing 124124+ event = get_next_hvlpevent();125125+ if (event) {126126+ /* Call appropriate handler here, passing128127 * a pointer to the LpEvent. The handler129128 * must make a copy of the LpEvent if it130129 * needs it in a bottom half. (perhaps for131130 * an ACK)132132- * 133133- * Handlers are responsible for ACK processing 131131+ *132132+ * Handlers are responsible for ACK processing134133 *135134 * The Hypervisor guarantees that LpEvents will136135 * only be delivered with types that we have137136 * registered for, so no type check is necessary138137 * here!139139- */140140- if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes )141141- lpQueue->xLpIntCountByType[nextLpEvent->xType]++;142142- if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes &&143143- lpEventHandler[nextLpEvent->xType] ) 144144- lpEventHandler[nextLpEvent->xType](nextLpEvent, regs);138138+ */139139+ if (event->xType < HvLpEvent_Type_NumTypes)140140+ __get_cpu_var(hvlpevent_counts)[event->xType]++;141141+ if (event->xType < HvLpEvent_Type_NumTypes &&142142+ lpEventHandler[event->xType])143143+ lpEventHandler[event->xType](event, regs);145144 else146146- printk(KERN_INFO "Unexpected Lp Event type=%d\n", nextLpEvent->xType );147147-148148- ItLpQueue_clearValid( nextLpEvent );149149- } else if ( lpQueue->xPlicOverflowIntPending )145145+ printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType );146146+147147+ hvlpevent_clear_valid(event);148148+ } else if (hvlpevent_queue.xPlicOverflowIntPending)150149 /*151150 * No more valid events. If overflow events are152151 * pending process them153152 */154154- HvCallEvent_getOverflowLpEvents( lpQueue->xIndex);153153+ HvCallEvent_getOverflowLpEvents(hvlpevent_queue.xIndex);155154 else156155 break;157156 }158157159159- ItLpQueueInProcess = 0;160160- mb();161161- clear_inUse( lpQueue );162162-163163- get_paca()->lpevent_count += numIntsProcessed;164164-165165- return numIntsProcessed;158158+ spin_unlock(&hvlpevent_queue.lock);166159}160160+161161+static int set_spread_lpevents(char *str)162162+{163163+ unsigned long val = simple_strtoul(str, NULL, 0);164164+165165+ /*166166+ * The parameter is the number of processors to share in processing167167+ * lp events.168168+ */169169+ if (( val > 0) && (val <= NR_CPUS)) {170170+ spread_lpevents = val;171171+ printk("lpevent processing spread over %ld processors\n", val);172172+ } else {173173+ printk("invalid spread_lpevents %ld\n", val);174174+ }175175+176176+ return 1;177177+}178178+__setup("spread_lpevents=", set_spread_lpevents);179179+180180+void setup_hvlpevent_queue(void)181181+{182182+ void *eventStack;183183+184184+ /*185185+ * Allocate a page for the Event Stack. The Hypervisor needs the186186+ * absolute real address, so we subtract out the KERNELBASE and add187187+ * in the absolute real address of the kernel load area.188188+ */189189+ eventStack = alloc_bootmem_pages(LpEventStackSize);190190+ memset(eventStack, 0, LpEventStackSize);191191+192192+ /* Invoke the hypervisor to initialize the event stack */193193+ HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);194194+195195+ hvlpevent_queue.xSlicEventStackPtr = (char *)eventStack;196196+ hvlpevent_queue.xSlicCurEventPtr = (char *)eventStack;197197+ hvlpevent_queue.xSlicLastValidEventPtr = (char *)eventStack +198198+ (LpEventStackSize - LpEventMaxSize);199199+ hvlpevent_queue.xIndex = 0;200200+}201201+202202+static int proc_lpevents_show(struct seq_file *m, void *v)203203+{204204+ int cpu, i;205205+ unsigned long sum;206206+ static unsigned long cpu_totals[NR_CPUS];207207+208208+ /* FIXME: do we care that there's no locking here? */209209+ sum = 0;210210+ for_each_online_cpu(cpu) {211211+ cpu_totals[cpu] = 0;212212+ for (i = 0; i < HvLpEvent_Type_NumTypes; i++) {213213+ cpu_totals[cpu] += per_cpu(hvlpevent_counts, cpu)[i];214214+ }215215+ sum += cpu_totals[cpu];216216+ }217217+218218+ seq_printf(m, "LpEventQueue 0\n");219219+ seq_printf(m, " events processed:\t%lu\n", sum);220220+221221+ for (i = 0; i < HvLpEvent_Type_NumTypes; ++i) {222222+ sum = 0;223223+ for_each_online_cpu(cpu) {224224+ sum += per_cpu(hvlpevent_counts, cpu)[i];225225+ }226226+227227+ seq_printf(m, " %-20s %10lu\n", event_types[i], sum);228228+ }229229+230230+ seq_printf(m, "\n events processed by processor:\n");231231+232232+ for_each_online_cpu(cpu) {233233+ seq_printf(m, " CPU%02d %10lu\n", cpu, cpu_totals[cpu]);234234+ }235235+236236+ return 0;237237+}238238+239239+static int proc_lpevents_open(struct inode *inode, struct file *file)240240+{241241+ return single_open(file, proc_lpevents_show, NULL);242242+}243243+244244+static struct file_operations proc_lpevents_operations = {245245+ .open = proc_lpevents_open,246246+ .read = seq_read,247247+ .llseek = seq_lseek,248248+ .release = single_release,249249+};250250+251251+static int __init proc_lpevents_init(void)252252+{253253+ struct proc_dir_entry *e;254254+255255+ e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);256256+ if (e)257257+ e->proc_fops = &proc_lpevents_operations;258258+259259+ return 0;260260+}261261+__initcall(proc_lpevents_init);262262+
+2-9
arch/ppc64/kernel/LparData.c
···2828#include <asm/iSeries/IoHriProcessorVpd.h>2929#include <asm/iSeries/ItSpCommArea.h>30303131-/* The LpQueue is used to pass event data from the hypervisor to3232- * the partition. This is where I/O interrupt events are communicated.3333- */3434-3535-/* May be filled in by the hypervisor so cannot end up in the BSS */3636-struct ItLpQueue xItLpQueue __attribute__((__section__(".data")));3737-38313932/* The HvReleaseData is the root of the information shared between 4033 * the hypervisor and Linux. ···193200 0,0,0, /* 13 - 15 */194201 sizeof(struct IoHriProcessorVpd),/* 16 length of Proc Vpd */195202 0,0,0,0,0,0, /* 17 - 22 */196196- sizeof(struct ItLpQueue),/* 23 length of Lp Queue */203203+ sizeof(struct hvlpevent_queue), /* 23 length of Lp Queue */197204 0,0 /* 24 - 25 */198205 },199206 .xSlicVpdAdrs = { /* VPD addresses */···211218 0,0,0, /* 13 - 15 */212219 &xIoHriProcessorVpd, /* 16 Proc Vpd */213220 0,0,0,0,0,0, /* 17 - 22 */214214- &xItLpQueue, /* 23 Lp Queue */221221+ &hvlpevent_queue, /* 23 Lp Queue */215222 0,0216223 }217224};
-48
arch/ppc64/kernel/iSeries_proc.c
···4040}4141core_initcall(iseries_proc_create);42424343-static char *event_types[9] = {4444- "Hypervisor\t\t",4545- "Machine Facilities\t",4646- "Session Manager\t",4747- "SPD I/O\t\t",4848- "Virtual Bus\t\t",4949- "PCI I/O\t\t",5050- "RIO I/O\t\t",5151- "Virtual Lan\t\t",5252- "Virtual I/O\t\t"5353-};5454-5555-static int proc_lpevents_show(struct seq_file *m, void *v)5656-{5757- unsigned int i;5858-5959- seq_printf(m, "LpEventQueue 0\n");6060- seq_printf(m, " events processed:\t%lu\n",6161- (unsigned long)xItLpQueue.xLpIntCount);6262-6363- for (i = 0; i < 9; ++i)6464- seq_printf(m, " %s %10lu\n", event_types[i],6565- (unsigned long)xItLpQueue.xLpIntCountByType[i]);6666-6767- seq_printf(m, "\n events processed by processor:\n");6868-6969- for_each_online_cpu(i)7070- seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count);7171-7272- return 0;7373-}7474-7575-static int proc_lpevents_open(struct inode *inode, struct file *file)7676-{7777- return single_open(file, proc_lpevents_show, NULL);7878-}7979-8080-static struct file_operations proc_lpevents_operations = {8181- .open = proc_lpevents_open,8282- .read = seq_read,8383- .llseek = seq_lseek,8484- .release = single_release,8585-};8686-8743static unsigned long startTitan = 0;8844static unsigned long startTb = 0;8945···103147static int __init iseries_proc_init(void)104148{105149 struct proc_dir_entry *e;106106-107107- e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);108108- if (e)109109- e->proc_fops = &proc_lpevents_operations;110150111151 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL);112152 if (e)
+1-42
arch/ppc64/kernel/iSeries_setup.c
···2424#include <linux/smp.h>2525#include <linux/param.h>2626#include <linux/string.h>2727-#include <linux/bootmem.h>2827#include <linux/initrd.h>2928#include <linux/seq_file.h>3029#include <linux/kdev_t.h>···675676 */676677static void __init iSeries_setup_arch(void)677678{678678- void *eventStack;679679 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;680680681681 /* Add an eye catcher and the systemcfg layout version number */···683685 systemcfg->version.minor = SYSTEMCFG_MINOR;684686685687 /* Setup the Lp Event Queue */686686-687687- /* Allocate a page for the Event Stack688688- * The hypervisor wants the absolute real address, so689689- * we subtract out the KERNELBASE and add in the690690- * absolute real address of the kernel load area691691- */692692- eventStack = alloc_bootmem_pages(LpEventStackSize);693693- memset(eventStack, 0, LpEventStackSize);694694-695695- /* Invoke the hypervisor to initialize the event stack */696696- HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);697697-698698- /* Initialize fields in our Lp Event Queue */699699- xItLpQueue.xSlicEventStackPtr = (char *)eventStack;700700- xItLpQueue.xSlicCurEventPtr = (char *)eventStack;701701- xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +702702- (LpEventStackSize - LpEventMaxSize);703703- xItLpQueue.xIndex = 0;688688+ setup_hvlpevent_queue();704689705690 /* Compute processor frequency */706691 procFreqHz = ((1UL << 34) * 1000000) /···833852}834853835854late_initcall(iSeries_src_init);836836-837837-static int set_spread_lpevents(char *str)838838-{839839- unsigned long i;840840- unsigned long val = simple_strtoul(str, NULL, 0);841841-842842- /*843843- * The parameter is the number of processors to share in processing844844- * lp events.845845- */846846- if (( val > 0) && (val <= NR_CPUS)) {847847- for (i = 1; i < val; ++i)848848- paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;849849-850850- printk("lpevent processing spread over %ld processors\n", val);851851- } else {852852- printk("invalid spread_lpevents %ld\n", val);853853- }854854-855855- return 1;856856-}857857-__setup("spread_lpevents=", set_spread_lpevents);858855859856#ifndef CONFIG_PCI860857void __init iSeries_init_IRQ(void) { }
+2-2
arch/ppc64/kernel/idle.c
···88888989 while (1) {9090 if (lpaca->lppaca.shared_proc) {9191- if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr))9191+ if (hvlpevent_is_pending())9292 process_iSeries_events();9393 if (!need_resched())9494 yield_shared_processor();···100100101101 while (!need_resched()) {102102 HMT_medium();103103- if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr))103103+ if (hvlpevent_is_pending())104104 process_iSeries_events();105105 HMT_low();106106 }
···801801 return rc;802802 /* We need to poll here as we are not yet taking interrupts */803803 while (rtc_data.busy) {804804- extern unsigned long lpevent_count;805805- struct ItLpQueue *lpq = get_paca()->lpqueue_ptr;806806- if (lpq && ItLpQueue_isLpIntPending(lpq))807807- lpevent_count += ItLpQueue_process(lpq, NULL);804804+ if (hvlpevent_is_pending())805805+ process_hvlpevents(NULL);808806 }809807 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);810808}
+3-5
arch/ppc64/kernel/nvram.c
···338338 */339339static int nvram_create_os_partition(void)340340{341341- struct list_head * p;342342- struct nvram_partition *part = NULL;343343- struct nvram_partition *new_part = NULL;341341+ struct nvram_partition *part;342342+ struct nvram_partition *new_part;344343 struct nvram_partition *free_part = NULL;345344 int seq_init[2] = { 0, 0 };346345 loff_t tmp_index;···348349349350 /* Find a free partition that will give us the maximum needed size 350351 If can't find one that will give us the minimum size needed */351351- list_for_each(p, &nvram_part->partition) {352352- part = list_entry(p, struct nvram_partition, partition);352352+ list_for_each_entry(part, &nvram_part->partition, partition) {353353 if (part->header.signature != NVRAM_SIG_FREE)354354 continue;355355
···400400 struct cpu *c = &per_cpu(cpu_devices, cpu);401401402402#ifdef CONFIG_NUMA403403- parent = &node_devices[cpu_to_node(cpu)];403403+ /* The node to which a cpu belongs can't be known404404+ * until the cpu is made present.405405+ */406406+ parent = NULL;407407+ if (cpu_present(cpu))408408+ parent = &node_devices[cpu_to_node(cpu)];404409#endif405410 /*406411 * For now, we just see if the system supports making
+2-6
arch/ppc64/kernel/time.c
···9999struct gettimeofday_struct do_gtod;100100101101extern unsigned long wall_jiffies;102102-extern unsigned long lpevent_count;103102extern int smp_tb_synchronized;104103105104extern struct timezone sys_tz;···366367 set_dec(next_dec);367368368369#ifdef CONFIG_PPC_ISERIES369369- {370370- struct ItLpQueue *lpq = lpaca->lpqueue_ptr;371371- if (lpq && ItLpQueue_isLpIntPending(lpq))372372- lpevent_count += ItLpQueue_process(lpq, regs);373373- }370370+ if (hvlpevent_is_pending())371371+ process_hvlpevents(regs);374372#endif375373376374/* collect purr register values often, for accurate calculations */
+6-9
include/asm-ppc64/iSeries/ItLpQueue.h
···4141#define LpEventMaxSize 2564242#define LpEventAlign 6443434444-struct ItLpQueue {4444+struct hvlpevent_queue {4545/*4646 * The xSlicCurEventPtr is the pointer to the next event stack entry4747 * that will become valid. The OS must peek at this entry to determine···6969 char *xSlicEventStackPtr; // 0x207070 u8 xIndex; // 0x28 unique sequential index.7171 u8 xSlicRsvd[3]; // 0x29-2b7272- u32 xInUseWord; // 0x2C7373- u64 xLpIntCount; // 0x30 Total Lp Int msgs processed7474- u64 xLpIntCountByType[9]; // 0x38-0x7F Event counts by type7272+ spinlock_t lock;7573};76747777-extern struct ItLpQueue xItLpQueue;7575+extern struct hvlpevent_queue hvlpevent_queue;78767979-extern struct HvLpEvent *ItLpQueue_getNextLpEvent(struct ItLpQueue *);8080-extern int ItLpQueue_isLpIntPending(struct ItLpQueue *);8181-extern unsigned ItLpQueue_process(struct ItLpQueue *, struct pt_regs *);8282-extern void ItLpQueue_clearValid(struct HvLpEvent *);7777+extern int hvlpevent_is_pending(void);7878+extern void process_hvlpevents(struct pt_regs *);7979+extern void setup_hvlpevent_queue(void);83808481#endif /* _ITLPQUEUE_H */
-3
include/asm-ppc64/paca.h
···2020#include <asm/types.h>2121#include <asm/lppaca.h>2222#include <asm/iSeries/ItLpRegSave.h>2323-#include <asm/iSeries/ItLpQueue.h>2423#include <asm/mmu.h>25242625register struct paca_struct *local_paca asm("r13");···6162 u16 paca_index; /* Logical processor number */62636364 u32 default_decr; /* Default decrementer value */6464- struct ItLpQueue *lpqueue_ptr; /* LpQueue handled by this CPU */6565 u64 kernel_toc; /* Kernel TOC address */6666 u64 stab_real; /* Absolute address of segment table */6767 u64 stab_addr; /* Virtual address of segment table */···8991 u64 next_jiffy_update_tb; /* TB value for next jiffy update */9092 u64 saved_r1; /* r1 save for RTAS calls */9193 u64 saved_msr; /* MSR saved here by enter_rtas */9292- u32 lpevent_count; /* lpevents processed */9394 u8 proc_enabled; /* irq soft-enable flag */94959596 /* not yet used */