* DTC/dts modifications
From: Kumar Gala @ 2006-04-29 16:00 UTC (permalink / raw)
To: Jon Loeliger; +Cc: Jon Loeliger, linuxppc-dev@ozlabs.org list
All,
What evilness would it be to change the use of '#' in the .dts format
to some other character like '$' or '%'. The problem is the use of
'#' prevents use from using cpp which would make some aspects of
building up .dts for boards far more useful.
We can easily provide a one line script to convert people's .dts to
the new format.
- kumar
^ permalink raw reply
* Re: FT u-boot shim
From: Kumar Gala @ 2006-04-29 15:33 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Tom Rini, Paul Mackerras, linuxppc-dev@ozlabs.org list
In-Reply-To: <20060429083743.64CA7353A56@atlas.denx.de>
On Apr 29, 2006, at 3:37 AM, Wolfgang Denk wrote:
> In message <20060429005231.GH458@smtp.west.cox.net> you wrote:
>>
>>> In my understanding, 1. is with a shim; 2. is loading a separate
>>> dtb
>>> (probably as multi-file image), and 3. is when U-Boot provides
>>> the
>>> dtb. Am I missing something?
>>
>> I'm suggesting that we make 2 easier. U-Boot needs the file
>> mkuimage'd
>> anyways. Why not make it easier and make adding the dtb part of that
>> step instead of a seperate load? It's still quite easy to replace if
>> you're testing new dtb's out.
>
> But that's what I'm trying to tell you all the time. An U-Boot
> multi-file image is a single file (=no separate load) which combines
> several files (similar to a tarball), here the kernel + dtb (+
> eventually ramdisk).
This was my intent for #2. You could either provide an explicit
image or use a multi-file image. I was going to look at having the
default build target that we use for uImage create a multi file image
(kernel & dtb) so the user still only sees one image.
- kumar
^ permalink raw reply
* Re: please pull powerpc.git 'merge' branch
From: Olof Johansson @ 2006-04-29 15:19 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, torvalds
In-Reply-To: <17491.1134.565353.149941@cargo.ozlabs.ibm.com>
On Sat, Apr 29, 2006 at 04:15:10PM +1000, Paul Mackerras wrote:
> Anton Blanchard:
> powerpc: Add cputable entry for POWER6
I never saw this posted to the list.
+#define PPC_FEATURE_ARCH_2_05 0x00001000
Previously we've said implementation instead of specification
("PPC_FEATURE_POWER5_PLUS" etc). That's better than saying base
architecture version, since there are parts of the arch that might or
might not be implemented (i.e. optional features, etc).
> Paul Mackerras:
> powerpc/pseries: Tell firmware our capabilities on new machines
I never saw this one on the list either.
Don't you want to fall back to the ELF method if the prom call fails
(ret != 0)? Right you close and return.
-Olof
^ permalink raw reply
* Re: sign extension for 32bit syscalls on ppc64
From: Andreas Schwab @ 2006-04-29 13:46 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20060429131640.6f79e0d3.sfr@canb.auug.org.au>
Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Has any testing been done on these interfaces that involves 32 bit
> processes passing AT_FDCWD on 64 bit kernels (I realise that it will work
> for some architectures but I suspect not ppc64).
Appears to work fine for me (tested with openat).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [openib-general] Re: [PATCH 04/16] ehca: userspace support
From: Heiko Carstens @ 2006-04-29 7:08 UTC (permalink / raw)
To: Heiko J Schick
Cc: linux-kernel, openib-general, linuxppc-dev, Pekka Enberg,
Hoang-Nam Nguyen, Marcus Eder, Christoph Raisch, J?rn Engel
In-Reply-To: <4044CACC-FB5A-415E-8974-27136269B5C1@schihei.de>
> >>The problem I see with pr_debug() is that it could only activated via
> >>a compile flag. To use the debug outputs you have to re-compile /
> >>compile your own kernel.
> >
> >Do you really need this heavy debug logging in the first place? You
> >can use kprobes for arbitrary run-time inspection anyway, so logging
> >everything seems wasteful.
>
> The problem I see with kprobes is that you have to set several kernel
> configuration options (e.g. CONFIG_KPROBES, CONFIG_DEBUG_INFO, etc.)
> on compile time to use it. Same problem with pr_debug().
It might be worth to move the s390 debug feature to common code. At least
it has proven many times to be very useful in device driver debugging...
See Documentation/s390/s390dbf.txt and arch/s390/kernel/debug.c.
^ permalink raw reply
* Re: [PATCH] convert powermac ide blink to new led infrastructure
From: Johannes Berg @ 2006-04-29 9:27 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev list, Richard Purdie, debian-powerpc, John Lenz
In-Reply-To: <1146237326.19164.111.camel@localhost>
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
On Fri, 2006-04-28 at 17:15 +0200, Johannes Berg wrote:
>
> +config ADB_PMU_LED
> + bool "Support for the Power/iBook front LED"
> + depends on LEDS_CLASS && ADB_PMU
come to think of it, that should probably be
depends on ADB_PMU
select LEDS_CLASS
since we should imho consider the led stuff as infrastructure for other
stuff. Opinions?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: FT u-boot shim
From: Wolfgang Denk @ 2006-04-29 8:37 UTC (permalink / raw)
To: Tom Rini; +Cc: linuxppc-dev@ozlabs.org list, Paul Mackerras
In-Reply-To: <20060429005231.GH458@smtp.west.cox.net>
In message <20060429005231.GH458@smtp.west.cox.net> you wrote:
>
> > In my understanding, 1. is with a shim; 2. is loading a separate dtb
> > (probably as multi-file image), and 3. is when U-Boot provides the
> > dtb. Am I missing something?
>
> I'm suggesting that we make 2 easier. U-Boot needs the file mkuimage'd
> anyways. Why not make it easier and make adding the dtb part of that
> step instead of a seperate load? It's still quite easy to replace if
> you're testing new dtb's out.
But that's what I'm trying to tell you all the time. An U-Boot
multi-file image is a single file (=no separate load) which combines
several files (similar to a tarball), here the kernel + dtb (+
eventually ramdisk).
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Shakespeare's Law of Prototyping: (Hamlet III, iv, 156-160)
O, throw away the worser part of it,
And live the purer with the other half.
^ permalink raw reply
* Re: [patch 0/4] cell: support multi-platform image
From: Arnd Bergmann @ 2006-04-29 8:25 UTC (permalink / raw)
To: cbe-oss-dev; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <44528CC5.40307@am.sony.com>
On Friday 28 April 2006 23:44, Geoff Levand wrote:
> These patches apply to current powerpc.git, and should be
> considered for inclusion in 2.6.18
>
> They have already seen some review on the
> cbe-oss-dev@ozlabs.org ML.
I'll integrate them with my patches for 2.6.18 and send them
on.
Thanks!
Arnd <><
^ permalink raw reply
* Re: [PATCH 1/3] powerpc: Make rtas console _much_ faster
From: Arnd Bergmann @ 2006-04-29 8:00 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev, Paul Mackerras, cbe-oss-dev, linux-kernel
In-Reply-To: <1146275817.14733.2.camel@localhost.localdomain>
On Saturday 29 April 2006 03:56, Michael Ellerman wrote:
> I'll clean this one up a little before merging it as per Ryan's email of
> a week or two ago. New patch today or tomorrow.
Ok, I misremembered the discussion on that patch and it didn't occur
to me that a one-line patch needs cleanup ;-)
Thanks!
> Even though this is 1/3 the rest of the series should be fine to merge,
> right Arnd?
Yes.
Arnd <><
^ permalink raw reply
* Re: [PATCH]: powerpc/pseries: Print PCI slot location code on failure
From: Paul Mackerras @ 2006-04-29 8:00 UTC (permalink / raw)
To: Linas Vepstas; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20060428224218.GE22621@austin.ibm.com>
Linas Vepstas writes:
> + location = (char *) get_property(event->dn, "ibm,loc-code", NULL);
> + printk(KERN_ERR "EEH: Error: Cannot find partition endpoint "
> + "for location=%s pci addr=%s\n",
> + location, pci_name(event->dev));
If location is NULL, printk will fortunately save us from a null
pointer dereference; still, it might be nice to have the message say
"location=unknown" or something rather than "location=<NULL>".
Paul.
^ permalink raw reply
* Re: PCI init vs. memory init
From: Paul Mackerras @ 2006-04-29 7:48 UTC (permalink / raw)
To: Linas Vepstas; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20060428230401.GF22621@austin.ibm.com>
Linas Vepstas writes:
> You mentioned that the sequence of inits seemed wrong, that the
> PCI init should be done later, after the memory init. I think
> I agree; but when I took a very very quick look at the code, there
> was no obvious hook in later init to move the PCI init over to.
>
> Are you pursuing this further? Should I dig into it? Any bright
> ideas? Am I missing something obvious?
I assume you're talking about find_and_init_phbs() and eeh_init(),
which are currently called from pSeries_setup_arch().
Would a core_initcall be early enough for those? It seems to me that
it probably would be. What are the actual dependencies? Clearly it
needs to be before pcibios_init(), which is a subsys_initcall. Is
there anything else that they need to come before?
> There are several spots in in the powerpc PCI init code where
> a boot_mem alloc is used instead of kmalloc, and this boot_mem is
> then hacked around in the case of a PCI hotplug remove. It would
> be nice to fix this...
Indeed.
Paul.
^ permalink raw reply
* Re: [openib-general] Re: [PATCH 04/16] ehca: userspace support
From: Heiko J Schick @ 2006-04-29 6:38 UTC (permalink / raw)
To: Pekka Enberg
Cc: linux-kernel, openib-general, linuxppc-dev, Christoph Raisch,
Hoang-Nam Nguyen, Marcus Eder, Jörn Engel
In-Reply-To: <84144f020604272332s6101032cy6936096230f3637c@mail.gmail.com>
Hello,
On 28.04.2006, at 08:32, Pekka Enberg wrote:
>> The problem I see with pr_debug() is that it could only activated via
>> a compile flag. To use the debug outputs you have to re-compile /
>> compile your own kernel.
>
> Do you really need this heavy debug logging in the first place? You
> can use kprobes for arbitrary run-time inspection anyway, so logging
> everything seems wasteful.
The problem I see with kprobes is that you have to set several kernel
configuration options (e.g. CONFIG_KPROBES, CONFIG_DEBUG_INFO, etc.)
on compile time to use it. Same problem with pr_debug().
Regards,
Heiko
^ permalink raw reply
* please pull powerpc.git 'merge' branch
From: Paul Mackerras @ 2006-04-29 6:15 UTC (permalink / raw)
To: torvalds; +Cc: linuxppc-dev
Linus,
Please do a pull from the "merge" branch of
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
to get the following powerpc updates. They are mostly bug-fixes;
there is also a defconfig update for Cell, plus a couple of commits
that will enable the kernel to run on forthcoming IBM machines.
These don't affect anything on the current machines, since the
firmware properties and methods they use aren't present.
Thanks,
Paul.
Alan Modra:
powerpc64: Fix loading of modules without a .toc section
Andreas Schwab:
sound/ppc: snd_pmac_toonie_init should be __init
powerpc: Wire up *at syscalls
Anton Blanchard:
powerpc: Add cputable entry for POWER6
Arnd Bergmann:
spufs: Disable local interrupts for SPE hash_page calls.
powerpc: update cell_defconfig
David Gibson:
powerpc: Fix pagetable bloat for hugepages
David Woodhouse:
powerpc: Use check_legacy_ioport() on ppc32 too.
Eugene Surovegin:
ppc32: add 440GX erratum 440_43 workaround
Paul Mackerras:
powerpc/pseries: Tell firmware our capabilities on new machines
Vitaly Bordug:
ppc32: odd fixes and improvements in ppc_sys
ppc32 CPM_UART: Convert to use platform devices
ppc32: Update board-specific code of the CPM UART users
ppc32 CPM_UART: Fixed odd address translations
arch/powerpc/configs/cell_defconfig | 40 ++--
arch/powerpc/kernel/cputable.c | 16 +
arch/powerpc/kernel/module_64.c | 16 +
arch/powerpc/kernel/prom_init.c | 112 ++++++++++
arch/powerpc/kernel/setup-common.c | 8 +
arch/powerpc/kernel/setup_64.c | 8 -
arch/powerpc/kernel/systbl.S | 13 +
arch/powerpc/mm/hugetlbpage.c | 295 ++++++++++++++++++++++++---
arch/powerpc/mm/init_64.c | 7 +
arch/powerpc/platforms/cell/spu_base.c | 10 +
arch/powerpc/platforms/cell/spu_callbacks.c | 13 +
arch/ppc/platforms/4xx/ocotea.c | 2
arch/ppc/platforms/mpc8272ads_setup.c | 114 ++++++++++
arch/ppc/platforms/mpc866ads_setup.c | 140 +++++++++++++
arch/ppc/platforms/mpc885ads_setup.c | 131 ++++++++++++
arch/ppc/platforms/pq2ads.c | 31 +++
arch/ppc/syslib/ibm440gx_common.c | 13 +
arch/ppc/syslib/ibm440gx_common.h | 4
arch/ppc/syslib/mpc8xx_devices.c | 25 ++
arch/ppc/syslib/ppc_sys.c | 4
arch/ppc/syslib/pq2_sys.c | 8 -
drivers/block/floppy.c | 2
drivers/input/serio/i8042-io.h | 4
drivers/serial/cpm_uart/cpm_uart.h | 49 ++++
drivers/serial/cpm_uart/cpm_uart_core.c | 280 ++++++++++++++++++++------
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 54 -----
drivers/serial/cpm_uart/cpm_uart_cpm2.c | 14 -
fs/stat.c | 2
include/asm-powerpc/cputable.h | 14 +
include/asm-powerpc/io.h | 6 -
include/asm-powerpc/page_64.h | 1
include/asm-powerpc/pgalloc.h | 2
include/asm-powerpc/unistd.h | 20 ++
include/asm-ppc/ppc_sys.h | 2
include/asm-ppc/reg_booke.h | 1
sound/ppc/toonie.c | 2
36 files changed, 1234 insertions(+), 229 deletions(-)
^ permalink raw reply
* Re: [PATCH] [2.6.18] powerpc: kill union tce_entry
From: Olof Johansson @ 2006-04-29 3:51 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Olof Johansson, linuxppc-dev, paulus
In-Reply-To: <20060429114056.09928ba9.sfr@canb.auug.org.au>
On Sat, Apr 29, 2006 at 11:40:56AM +1000, Stephen Rothwell wrote:
> On Fri, 28 Apr 2006 09:08:35 -0500 Olof Johansson <olof@lixom.net> wrote:
> >
> > - struct {
> > - unsigned int tb_cacheBits :6; /* Cache hash bits - not used */
> > - unsigned int tb_rsvd :6;
> > - unsigned long tb_rpn :40; /* Real page number */
> > - unsigned int tb_valid :1; /* Tce is valid (vb only) */
> > - unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */
> > - unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */
> > - unsigned int tb_pciwr :1; /* Write allowed (pci only) */
> > - unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */
> > - } te_bits;
>
> > +#define TCE_RPN_MASK 0xfffffffffful /* 40-bit RPN (4K pages) */
> > +#define TCE_RPN_SHIFT 12
> > +#define TCE_VALID 0x200 /* TCE valid */
> > +#define TCE_ALLIO 0x100 /* TCE valid for all lpars */
>
> Shouldn't the above two be 0x800 and 0x400 respectively (or is my bit
> counting/ordering mucked up)?
Yes. Looks like it's only used for vio entries, which would explain why
my machines could still boot.
Nice catch. Revised patch below.
Thanks,
-Olof
---
It's been long overdue to kill the union tce_entry in the pSeries/iSeries
TCE code, especially since I asked the Summit guys to do it on the code
they copied from us.
Also, while I was at it, I cleaned up some whitespace.
Built and booted on pSeries, built on iSeries.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: powerpc/arch/powerpc/platforms/iseries/iommu.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/iseries/iommu.c
+++ powerpc/arch/powerpc/platforms/iseries/iommu.c
@@ -4,6 +4,7 @@
* Rewrite, cleanup:
*
* Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
+ * Copyright (C) 2006 Olof Johansson <olof@lixom.net>
*
* Dynamic DMA mapping support, iSeries-specific parts.
*
@@ -43,30 +44,28 @@ static void tce_build_iSeries(struct iom
unsigned long uaddr, enum dma_data_direction direction)
{
u64 rc;
- union tce_entry tce;
+ u64 tce, rpn;
index <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;
while (npages--) {
- tce.te_word = 0;
- tce.te_bits.tb_rpn = virt_to_abs(uaddr) >> TCE_SHIFT;
+ rpn = virt_to_abs(uaddr) >> TCE_SHIFT;
+ tce = (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
if (tbl->it_type == TCE_VB) {
/* Virtual Bus */
- tce.te_bits.tb_valid = 1;
- tce.te_bits.tb_allio = 1;
+ tce |= TCE_VALID|TCE_ALLIO;
if (direction != DMA_TO_DEVICE)
- tce.te_bits.tb_rdwr = 1;
+ tce |= TCE_VB_WRITE;
} else {
/* PCI Bus */
- tce.te_bits.tb_rdwr = 1; /* Read allowed */
+ tce |= TCE_PCI_READ; /* Read allowed */
if (direction != DMA_TO_DEVICE)
- tce.te_bits.tb_pciwr = 1;
+ tce |= TCE_PCI_WRITE;
}
- rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index,
- tce.te_word);
+ rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce);
if (rc)
panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n",
rc);
@@ -124,7 +123,7 @@ void iommu_table_getparms_iSeries(unsign
/* itc_size is in pages worth of table, it_size is in # of entries */
tbl->it_size = ((parms->itc_size * TCE_PAGE_SIZE) /
- sizeof(union tce_entry)) >> TCE_PAGE_FACTOR;
+ TCE_ENTRY_SIZE) >> TCE_PAGE_FACTOR;
tbl->it_busno = parms->itc_busno;
tbl->it_offset = parms->itc_offset >> TCE_PAGE_FACTOR;
tbl->it_index = parms->itc_index;
Index: powerpc/arch/powerpc/platforms/pseries/iommu.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/iommu.c
+++ powerpc/arch/powerpc/platforms/pseries/iommu.c
@@ -1,23 +1,24 @@
/*
* Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
*
- * Rewrite, cleanup:
+ * Rewrite, cleanup:
*
* Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
+ * Copyright (C) 2006 Olof Johansson <olof@lixom.net>
*
* Dynamic DMA mapping support, pSeries-specific parts, both SMP and LPAR.
*
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -49,52 +50,46 @@
#define DBG(fmt...)
-static void tce_build_pSeries(struct iommu_table *tbl, long index,
- long npages, unsigned long uaddr,
+static void tce_build_pSeries(struct iommu_table *tbl, long index,
+ long npages, unsigned long uaddr,
enum dma_data_direction direction)
{
- union tce_entry t;
- union tce_entry *tp;
+ u64 proto_tce;
+ u64 *tcep;
+ u64 rpn;
index <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;
- t.te_word = 0;
- t.te_rdwr = 1; // Read allowed
+ proto_tce = TCE_PCI_READ; // Read allowed
if (direction != DMA_TO_DEVICE)
- t.te_pciwr = 1;
+ proto_tce |= TCE_PCI_WRITE;
- tp = ((union tce_entry *)tbl->it_base) + index;
+ tcep = ((u64 *)tbl->it_base) + index;
while (npages--) {
/* can't move this out since we might cross LMB boundary */
- t.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
-
- tp->te_word = t.te_word;
+ rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
+ *tcep = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
uaddr += TCE_PAGE_SIZE;
- tp++;
+ tcep++;
}
}
static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
{
- union tce_entry t;
- union tce_entry *tp;
+ u64 *tcep;
npages <<= TCE_PAGE_FACTOR;
index <<= TCE_PAGE_FACTOR;
- t.te_word = 0;
- tp = ((union tce_entry *)tbl->it_base) + index;
-
- while (npages--) {
- tp->te_word = t.te_word;
-
- tp++;
- }
+ tcep = ((u64 *)tbl->it_base) + index;
+
+ while (npages--)
+ *(tcep++) = 0;
}
@@ -103,43 +98,44 @@ static void tce_build_pSeriesLP(struct i
enum dma_data_direction direction)
{
u64 rc;
- union tce_entry tce;
+ u64 proto_tce, tce;
+ u64 rpn;
tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;
- tce.te_word = 0;
- tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
- tce.te_rdwr = 1;
+ rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
+ proto_tce = TCE_PCI_READ;
if (direction != DMA_TO_DEVICE)
- tce.te_pciwr = 1;
+ proto_tce |= TCE_PCI_WRITE;
while (npages--) {
- rc = plpar_tce_put((u64)tbl->it_index,
- (u64)tcenum << 12,
- tce.te_word );
-
+ tce = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
+ rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, tce);
+
if (rc && printk_ratelimit()) {
printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
printk("\tindex = 0x%lx\n", (u64)tbl->it_index);
printk("\ttcenum = 0x%lx\n", (u64)tcenum);
- printk("\ttce val = 0x%lx\n", tce.te_word );
+ printk("\ttce val = 0x%lx\n", tce );
show_stack(current, (unsigned long *)__get_SP());
}
-
+
tcenum++;
- tce.te_rpn++;
+ rpn++;
}
}
-static DEFINE_PER_CPU(void *, tce_page) = NULL;
+static DEFINE_PER_CPU(u64 *, tce_page) = NULL;
static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
long npages, unsigned long uaddr,
enum dma_data_direction direction)
{
u64 rc;
- union tce_entry tce, *tcep;
+ u64 proto_tce;
+ u64 *tcep;
+ u64 rpn;
long l, limit;
if (TCE_PAGE_FACTOR == 0 && npages == 1)
@@ -152,7 +148,7 @@ static void tce_buildmulti_pSeriesLP(str
* from iommu_alloc{,_sg}()
*/
if (!tcep) {
- tcep = (void *)__get_free_page(GFP_ATOMIC);
+ tcep = (u64 *)__get_free_page(GFP_ATOMIC);
/* If allocation fails, fall back to the loop implementation */
if (!tcep)
return tce_build_pSeriesLP(tbl, tcenum, npages,
@@ -163,11 +159,10 @@ static void tce_buildmulti_pSeriesLP(str
tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;
- tce.te_word = 0;
- tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
- tce.te_rdwr = 1;
+ rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
+ proto_tce = TCE_PCI_READ;
if (direction != DMA_TO_DEVICE)
- tce.te_pciwr = 1;
+ proto_tce |= TCE_PCI_WRITE;
/* We can map max one pageful of TCEs at a time */
do {
@@ -175,11 +170,11 @@ static void tce_buildmulti_pSeriesLP(str
* Set up the page with TCE data, looping through and setting
* the values.
*/
- limit = min_t(long, npages, 4096/sizeof(union tce_entry));
+ limit = min_t(long, npages, 4096/TCE_ENTRY_SIZE);
for (l = 0; l < limit; l++) {
- tcep[l] = tce;
- tce.te_rpn++;
+ tcep[l] = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
+ rpn++;
}
rc = plpar_tce_put_indirect((u64)tbl->it_index,
@@ -195,7 +190,7 @@ static void tce_buildmulti_pSeriesLP(str
printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
printk("\tindex = 0x%lx\n", (u64)tbl->it_index);
printk("\tnpages = 0x%lx\n", (u64)npages);
- printk("\ttce[0] val = 0x%lx\n", tcep[0].te_word);
+ printk("\ttce[0] val = 0x%lx\n", tcep[0]);
show_stack(current, (unsigned long *)__get_SP());
}
}
@@ -203,23 +198,17 @@ static void tce_buildmulti_pSeriesLP(str
static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
{
u64 rc;
- union tce_entry tce;
tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;
- tce.te_word = 0;
-
while (npages--) {
- rc = plpar_tce_put((u64)tbl->it_index,
- (u64)tcenum << 12,
- tce.te_word);
+ rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
if (rc && printk_ratelimit()) {
printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
printk("\tindex = 0x%lx\n", (u64)tbl->it_index);
printk("\ttcenum = 0x%lx\n", (u64)tcenum);
- printk("\ttce val = 0x%lx\n", tce.te_word );
show_stack(current, (unsigned long *)__get_SP());
}
@@ -231,31 +220,24 @@ static void tce_free_pSeriesLP(struct io
static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
{
u64 rc;
- union tce_entry tce;
tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;
- tce.te_word = 0;
-
- rc = plpar_tce_stuff((u64)tbl->it_index,
- (u64)tcenum << 12,
- tce.te_word,
- npages);
+ rc = plpar_tce_stuff((u64)tbl->it_index, (u64)tcenum << 12, 0, npages);
if (rc && printk_ratelimit()) {
printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n");
printk("\trc = %ld\n", rc);
printk("\tindex = 0x%lx\n", (u64)tbl->it_index);
printk("\tnpages = 0x%lx\n", (u64)npages);
- printk("\ttce val = 0x%lx\n", tce.te_word );
show_stack(current, (unsigned long *)__get_SP());
}
}
static void iommu_table_setparms(struct pci_controller *phb,
struct device_node *dn,
- struct iommu_table *tbl)
+ struct iommu_table *tbl)
{
struct device_node *node;
unsigned long *basep;
@@ -275,16 +257,16 @@ static void iommu_table_setparms(struct
memset((void *)tbl->it_base, 0, *sizep);
tbl->it_busno = phb->bus->number;
-
+
/* Units of tce entries */
tbl->it_offset = phb->dma_window_base_cur >> PAGE_SHIFT;
-
+
/* Test if we are going over 2GB of DMA space */
if (phb->dma_window_base_cur + phb->dma_window_size > 0x80000000ul) {
udbg_printf("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
- panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
+ panic("PCI_DMA: Unexpected number of IOAs under this PHB.\n");
}
-
+
phb->dma_window_base_cur += phb->dma_window_size;
/* Set the tce table size - measured in entries */
@@ -442,7 +424,7 @@ static void iommu_bus_setup_pSeriesLP(st
tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
GFP_KERNEL);
-
+
iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
ppci->iommu_table = iommu_init_table(tbl);
Index: powerpc/include/asm-powerpc/tce.h
===================================================================
--- powerpc.orig/include/asm-powerpc/tce.h
+++ powerpc/include/asm-powerpc/tce.h
@@ -35,32 +35,15 @@
#define TCE_PAGE_SIZE (1 << TCE_SHIFT)
#define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT)
+#define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */
-/* tce_entry
- * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's
- * abstracted so layout is irrelevant.
- */
-union tce_entry {
- unsigned long te_word;
- struct {
- unsigned int tb_cacheBits :6; /* Cache hash bits - not used */
- unsigned int tb_rsvd :6;
- unsigned long tb_rpn :40; /* Real page number */
- unsigned int tb_valid :1; /* Tce is valid (vb only) */
- unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */
- unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */
- unsigned int tb_pciwr :1; /* Write allowed (pci only) */
- unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */
- } te_bits;
-#define te_cacheBits te_bits.tb_cacheBits
-#define te_rpn te_bits.tb_rpn
-#define te_valid te_bits.tb_valid
-#define te_allio te_bits.tb_allio
-#define te_lpindex te_bits.tb_lpindex
-#define te_pciwr te_bits.tb_pciwr
-#define te_rdwr te_bits.tb_rdwr
-};
-
+#define TCE_RPN_MASK 0xfffffffffful /* 40-bit RPN (4K pages) */
+#define TCE_RPN_SHIFT 12
+#define TCE_VALID 0x800 /* TCE valid */
+#define TCE_ALLIO 0x400 /* TCE valid for all lpars */
+#define TCE_PCI_WRITE 0x2 /* write from PCI allowed */
+#define TCE_PCI_READ 0x1 /* read from PCI allowed */
+#define TCE_VB_WRITE 0x1 /* write from VB allowed */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_TCE_H */
^ permalink raw reply
* Re: [RFC , PATCH] support for the ibm,pa_features cpu property
From: Olof Johansson @ 2006-04-29 3:46 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Olof Johansson, linuxppc-dev list
In-Reply-To: <17490.51212.357234.664398@cargo.ozlabs.ibm.com>
On Sat, Apr 29, 2006 at 11:57:32AM +1000, Paul Mackerras wrote:
> Olof Johansson writes:
>
> > Do you know why they went for this brand new extra architected bitfield
> > instead of continuing down the way that processor features always have
> > been documented before, by adding a property to the cpu device node?
>
> They wanted to cover basically everything that we have CPU feature
> bits for, plus some other things. That would have been a lot of new
> properties, so they went for one that had a bitmap in it, and made it
> extensible in two different directions for good measure while they
> were at it. :)
Sure, it might be a few, but we already have a handful. And having a
bitfield only gives you a chance to say here or not, no version numbers,
capacities, etc.
Anyway, I can't really debate it since I haven't seen the spec, just one
implementation.
> > (Now, the naming convention of calling it a "pa feature" is unfortunate,
> > but nothing I can really complain about since our stuff is not yet in
> > tree.)
>
> The "pa" is just "processor architecture", nothing to do with your
> employer. :)
Yes, I know. Just saying. :)
-Olof
^ permalink raw reply
* Re: sign extension for 32bit syscalls on ppc64
From: Stephen Rothwell @ 2006-04-29 3:42 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20060429131640.6f79e0d3.sfr@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
On Sat, 29 Apr 2006 13:16:40 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> AT_FDCWD (actually -100, sorry) is not protected by __KERNEL__ in
> include/linux/fcntl.h and sys_openat does not stop it being passed, so I
> assume it is part of the user ABI.
And AT_FDCWD is mentioned in the Solaris documentation for openat(2).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* RE: [PATCH] PCI Error Recovery: e1000 network device driver
From: Zhang, Yanmin @ 2006-04-29 3:26 UTC (permalink / raw)
To: Linas Vepstas, Greg KH
Cc: netdev, linux-kernel, Brandeburg, Jesse, linuxppc-dev,
Ronciak, John, Kirsher, Jeffrey T, linux-pci, Jeff Garzik,
Linux NICS
>>-----Original Message-----
>>From: linux-kernel-owner@vger.kernel.org =
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Linas Vepstas
>>Sent: 2006=C4=EA3=D4=C225=C8=D5 11:22
>>To: Greg KH
>>Cc: Jeff Garzik; Ronciak, John; Brandeburg, Jesse; Kirsher, Jeffrey T; =
linux-kernel@vger.kernel.org; netdev@vger.kernel.org;
>>linux-pci@atrey.karlin.mff.cuni.cz; linuxppc-dev@ozlabs.org; Linux =
NICS
>>Subject: Re: [PATCH] PCI Error Recovery: e1000 network device driver
>>
>>On Fri, Mar 24, 2006 at 06:22:06PM -0800, Greg KH wrote:
>>> ... a bit
>>> different from the traditional kernel coding style.
>>
>>Sorry, this is due to inattention on my part; I get cross-eyed
>>after staring at the same code for too long. The patch below should
>>fix things.
>>
>>--linas
>>
>>
>>[PATCH] PCI Error Recovery: e1000 network device driver
>>
>>Various PCI bus errors can be signaled by newer PCI controllers. This
>>patch adds the PCI error recovery callbacks to the intel gigabit
>>ethernet e1000 device driver. The patch has been tested, and appears
>>to work well.
>>
>>Signed-off-by: Linas Vepstas <linas@linas.org>
>>Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>>
>>----
>>
>> drivers/net/e1000/e1000_main.c | 114 =
++++++++++++++++++++++++++++++++++++++++-
>> 1 files changed, 113 insertions(+), 1 deletion(-)
>>
>>Index: linux-2.6.16-git6/drivers/net/e1000/e1000_main.c
>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>--- linux-2.6.16-git6.orig/drivers/net/e1000/e1000_main.c 2006-03-23 =
15:48:01.000000000 -0600
>>+++ linux-2.6.16-git6/drivers/net/e1000/e1000_main.c 2006-03-24 =
15:14:40.431371705 -0600
>>@@ -226,6 +226,16 @@ static int e1000_resume(struct pci_dev *
>>+/**
>>+ * e1000_io_error_detected - called when PCI error is detected
>>+ * @pdev: Pointer to PCI device
>>+ * @state: The current pci conneection state
>>+ *
>>+ * This function is called after a PCI bus error affecting
>>+ * this device has been detected.
>>+ */
>>+static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, =
pci_channel_state_t state)
>>+{
>>+ struct net_device *netdev =3D pci_get_drvdata(pdev);
>>+ struct e1000_adapter *adapter =3D netdev->priv;
>>+
>>+ netif_device_detach(netdev);
>>+
>>+ if (netif_running(netdev))
>>+ e1000_down(adapter);
[YM] e1000_down will do device IO. So it's not appropriate to do so =
here.
>>+
>>+ /* Request a slot slot reset. */
>>+ return PCI_ERS_RESULT_NEED_RESET;
>>+}
>>+
>>+/**
>>+ * e1000_io_slot_reset - called after the pci bus has been reset.
>>+ * @pdev: Pointer to PCI device
>>+ *
>>+ * Restart the card from scratch, as if from a cold-boot. =
Implementation
>>+ * resembles the first-half of the e1000_resume routine.
>>+ */
>>+static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
>>+{
>>+ struct net_device *netdev =3D pci_get_drvdata(pdev);
>>+ struct e1000_adapter *adapter =3D netdev->priv;
>>+
>>+ if (pci_enable_device(pdev)) {
>>+ printk(KERN_ERR "e1000: Cannot re-enable PCI device after =
reset.\n");
>>+ return PCI_ERS_RESULT_DISCONNECT;
>>+ }
>>+ pci_set_master(pdev);
>>+
>>+ pci_enable_wake(pdev, 3, 0);
>>+ pci_enable_wake(pdev, 4, 0); /* 4 =3D=3D D3 cold */
[YM] Suggest using PCI_D3hot and PCI_D3cold instead of hard-coded =
numbers.
^ permalink raw reply
* Re: sign extension for 32bit syscalls on ppc64
From: Stephen Rothwell @ 2006-04-29 3:16 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17490.53377.898206.21369@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
On Sat, 29 Apr 2006 12:33:37 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> Stephen Rothwell writes:
>
> > They do need to be sign extended for the new *at syscalls where you can pass
> > a sepecial value AT_FDCWD (-10) to represent the current directory ...
>
> So, compat_sys_openat() in fs/compat.c looks wrong to me then, if
> AT_FDCWD is part of the ABI and not just an internal thing. And I'm
> now not sure whether some of the other *at syscalls do in fact need
> compat wrappers...
AT_FDCWD (actually -100, sorry) is not protected by __KERNEL__ in
include/linux/fcntl.h and sys_openat does not stop it being passed, so I
assume it is part of the user ABI.
The existence of AT_FDCWD is what stopped me from wiring up all the *at
syscalls earlier. It also sparked another discussion to try to formulate
some generic wrappers for the compat routines.
Has any testing been done on these interfaces that involves 32 bit
processes passing AT_FDCWD on 64 bit kernels (I realise that it will work
for some architectures but I suspect not ppc64).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] PCI Error Recovery: e100 network device driver
From: Zhang, Yanmin @ 2006-04-29 2:48 UTC (permalink / raw)
To: Linas Vepstas
Cc: netdev, LKML, jesse.brandeburg, linuxppc-dev, john.ronciak,
jeffrey.t.kirsher, linux-pci, Jeff Garzik
In-Reply-To: <20060406222359.GA30037@austin.ibm.com>
On Fri, 2006-04-07 at 06:24, Linas Vepstas wrote:
> Please apply and forward upstream.
>
> --linas
>
> [PATCH] PCI Error Recovery: e100 network device driver
>
> Various PCI bus errors can be signaled by newer PCI controllers. This
> patch adds the PCI error recovery callbacks to the intel ethernet e100
> device driver. The patch has been tested, and appears to work well.
>
> Signed-off-by: Linas Vepstas <linas@linas.org>
> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
I am enabling PCI-Express AER (Advanced Error Reporting) in kernel and
glad to see many drivers to support pci error handling.
>
> ----
>
> drivers/net/e100.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 65 insertions(+)
>
> Index: linux-2.6.17-rc1/drivers/net/e100.c
> ===================================================================
> --- linux-2.6.17-rc1.orig/drivers/net/e100.c 2006-04-05 09:56:06.000000000 -0500
> +++ linux-2.6.17-rc1/drivers/net/e100.c 2006-04-06 15:17:29.000000000 -0500
> @@ -2781,6 +2781,70 @@ static void e100_shutdown(struct pci_dev
> }
>
>
> +/* ------------------ PCI Error Recovery infrastructure -------------- */
> +/** e100_io_error_detected() is called when PCI error is detected */
> +static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
> +{
> + struct net_device *netdev = pci_get_drvdata(pdev);
> +
> + /* Same as calling e100_down(netdev_priv(netdev)), but generic */
> + netdev->stop(netdev);
e100 stop method e100_close calls e100_down which would do IO. Does it
violate the rule defined in Documentation/pci-error-recovery.txt that
error_detected shouldn't do any IO?
Suggest to create a new function, such like e100_close_noreset.
> +
> + /* Detach; put netif into state similar to hotplug unplug */
> + netif_poll_enable(netdev);
> + netif_device_detach(netdev);
> +
> + /* Request a slot reset. */
> + return PCI_ERS_RESULT_NEED_RESET;
> +}
> +
> +/** e100_io_slot_reset is called after the pci bus has been reset.
> + * Restart the card from scratch. */
> +static pci_ers_result_t e100_io_slot_reset(struct pci_dev *pdev)
> +{
> + struct net_device *netdev = pci_get_drvdata(pdev);
> + struct nic *nic = netdev_priv(netdev);
> +
> + if(pci_enable_device(pdev)) {
> + printk(KERN_ERR "e100: Cannot re-enable PCI device after reset.\n");
> + return PCI_ERS_RESULT_DISCONNECT;
> + }
> + pci_set_master(pdev);
> +
> + /* Only one device per card can do a reset */
> + if (0 != PCI_FUNC (pdev->devfn))
> + return PCI_ERS_RESULT_RECOVERED;
> + e100_hw_reset(nic);
> + e100_phy_init(nic);
Should pci_set_master be called after e100_hw_reset like in function
e100_probe?
> +
> + return PCI_ERS_RESULT_RECOVERED;
> +}
> +
> +/** e100_io_resume is called when the error recovery driver
> + * tells us that its OK to resume normal operation.
> + */
> +static void e100_io_resume(struct pci_dev *pdev)
> +{
> + struct net_device *netdev = pci_get_drvdata(pdev);
> + struct nic *nic = netdev_priv(netdev);
> +
> + /* ack any pending wake events, disable PME */
> + pci_enable_wake(pdev, 0, 0);
> +
> + netif_device_attach(netdev);
> + if(netif_running(netdev)) {
> + e100_open (netdev);
> + mod_timer(&nic->watchdog, jiffies);
e100_open calls e100_up which already sets watchdog timer. Why to set
it again?
> + }
> +}
> +
^ permalink raw reply
* Re: [PATCH 0/4] NUMA support for spufs
From: Andrew Morton @ 2006-04-29 2:47 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev, arnd, linux-kernel
In-Reply-To: <17490.53283.417700.559725@cargo.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> wrote:
>
> Arnd Bergmann writes:
>
> > The current version of spufs breaks upon boot when NUMA support is enabled.
> > I'd like to fix that before 2.6.17 so we can use the same kernel image
> > on Cell that we use on other powerpc systems using NUMA.
>
> Andrew,
>
> If 2/4 of this series looks OK to you to go into 2.6.17,
OK by me. 1/4 touches __add_pages(), which it undergoing quite a bit of
churn at present, but we'll work it out.
> let me know
> and I'll push the others to Linus (or you can if you prefer).
I'll queue all four for the next batch (within the next 48 hours). If you
merge them first then no probs.
^ permalink raw reply
* Re: [RFC , PATCH] support for the ibm,pa_features cpu property
From: Stephen Rothwell @ 2006-04-29 2:38 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17490.52602.577587.524391@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
Hi Paul,
On Sat, 29 Apr 2006 12:20:42 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> + /* find descriptor with type == 0 */
> + for (;;) {
> + if (tablelen < 3 || tablelen < 2 + pa_feature_table[1])
^
Shouldn't that be 0?
> + goto out; /* not found */
> + if (pa_feature_table[0] == 0)
^
And this 1?
> + break;
> + tablelen -= 2 + pa_feature_table[1];
^
0
> + pa_feature_table += 2 + pa_feature_table[1];
^
0
> + }
> +
> + /* check if the specifier is long enough */
> + if (pabyte >= pa_feature_table[1])
^
0
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: alignment exceptionhandler sleeps in invalid context
From: Michael Ellerman @ 2006-04-29 2:34 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Olaf Hering
In-Reply-To: <17489.63055.968862.256370@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]
On Fri, 2006-04-28 at 21:02 +1000, Paul Mackerras wrote:
> Olaf Hering writes:
>
> > I'm not sure where the bug is. Does it mean the network stack does
> > something nasty, or is the exception handler itself broken? (probably the latter)
> > This is 2.6.16.9 on a p270.
>
> This patch should fix it, I hope. If you can verify that it fixes it
> I'll send it to Linus.
>
> Paul.
>
> diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h
> index 3872e92..b02d858 100644
> --- a/include/asm-powerpc/uaccess.h
> +++ b/include/asm-powerpc/uaccess.h
> @@ -179,7 +179,8 @@ do { \
> #define __put_user_nocheck(x, ptr, size) \
> ({ \
> long __pu_err; \
> - might_sleep(); \
> + if ((unsigned long)ptr < PAGE_OFFSET) \
> + might_sleep(); \
+ if (!is_kernel_addr((unsigned long)ptr)) \
+ might_sleep(); \
In asm/page.h :)
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: sign extension for 32bit syscalls on ppc64
From: Paul Mackerras @ 2006-04-29 2:33 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20060429113059.150cadd6.sfr@canb.auug.org.au>
Stephen Rothwell writes:
> They do need to be sign extended for the new *at syscalls where you can pass
> a sepecial value AT_FDCWD (-10) to represent the current directory ...
So, compat_sys_openat() in fs/compat.c looks wrong to me then, if
AT_FDCWD is part of the ABI and not just an internal thing. And I'm
now not sure whether some of the other *at syscalls do in fact need
compat wrappers...
Paul.
^ permalink raw reply
* Re: [PATCH 0/4] NUMA support for spufs
From: Paul Mackerras @ 2006-04-29 2:32 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, cbe-oss-dev, Arnd Bergmann, linux-kernel
In-Reply-To: <20060429011827.502138000@localhost.localdomain>
Arnd Bergmann writes:
> The current version of spufs breaks upon boot when NUMA support is enabled.
> I'd like to fix that before 2.6.17 so we can use the same kernel image
> on Cell that we use on other powerpc systems using NUMA.
Andrew,
If 2/4 of this series looks OK to you to go into 2.6.17, let me know
and I'll push the others to Linus (or you can if you prefer).
Thanks,
Paul.
^ permalink raw reply
* Re: [RFC , PATCH] support for the ibm,pa_features cpu property
From: Paul Mackerras @ 2006-04-29 2:20 UTC (permalink / raw)
To: will_schmidt; +Cc: linuxppc-dev list
In-Reply-To: <1146249684.27214.18.camel@localhost.localdomain>
Will Schmidt writes:
> This is an initial pass at the functionality. This has been tested in
> the case where the property is missing, but still needs to be tested
> against a system where the property actually exists. :-o
Some random comments, and a modified version of your patch...
- We may want to make a table giving the correspondence between
pa-features byte/bit numbers and our feature bits, and then just
have code that walks through the table and sets/clears feature bits
as appropriate.
- If we are setting/clearing feature bits that are used with the asm
feature macros, we'll have to do this much earlier, in prom.c,
before the device tree is unflattened.
Paul.
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4467c49..022b9b3 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -106,6 +106,78 @@ static struct notifier_block ppc64_panic
.priority = INT_MIN /* may not return; must be done last */
};
+/*
+ * ibm,pa-features is a per-cpu property that contains a string of
+ * attribute descriptors, each of which has a 2 byte header plus up
+ * to 254 bytes worth of processor attribute bits. First header
+ * byte specifies the number of bytes following the header.
+ * Second header byte is an "attribute-specifier" type, of which
+ * zero is the only currently-defined value.
+ * Implementation: Pass in the byte and bit offset for the feature
+ * that we are interested in. The function will return -1 if the
+ * pa-features property is missing, or a 1/0 to indicate if the feature
+ * is supported/not supported. Note that the bit numbers are
+ * big-endian to match the definition in PAPR.
+ */
+static int get_pa_feature(int pabyte, int pabit)
+{
+ struct device_node *cpu;
+ unsigned char *pa_feature_table;
+ int tablelen;
+ int ret = -1;
+
+ cpu = of_find_node_by_type(NULL, "cpu");
+ if (cpu == NULL)
+ return -1;
+
+ pa_feature_table = get_property(cpu, "ibm,pa-features", &tablelen);
+ if (pa_feature_table == NULL)
+ goto out;
+
+ /* find descriptor with type == 0 */
+ for (;;) {
+ if (tablelen < 3 || tablelen < 2 + pa_feature_table[1])
+ goto out; /* not found */
+ if (pa_feature_table[0] == 0)
+ break;
+ tablelen -= 2 + pa_feature_table[1];
+ pa_feature_table += 2 + pa_feature_table[1];
+ }
+
+ /* check if the specifier is long enough */
+ if (pabyte >= pa_feature_table[1])
+ goto out;
+
+ ret = (pa_feature_table[2 + pabyte] >> (7 - pabit)) & 1;
+
+ out:
+ of_node_put(cpu);
+ return ret;
+}
+
+/*
+ * set values within the cur_cpu_spec table according to
+ * the ibm,pa_features property.
+ * potential entries include:
+ * Byte 0, bit 1 - FPU available
+ * Byte 1, bit 2 - cache-inhibited large pages supported
+ * Byte 2, bit 3 - DAR set on alignment interrupt.
+ */
+static void check_cpu_features(void)
+{
+ int hasit;
+
+ /* test for support of cache-inhibited large pages */
+ hasit = get_pa_feature(1, 2);
+ if (hasit >= 0)
+ if (hasit)
+ cur_cpu_spec->cpu_features |= CPU_FTR_CI_LARGE_PAGE;
+ else
+ cur_cpu_spec->cpu_features &= ~CPU_FTR_CI_LARGE_PAGE;
+
+ /* add more here in future... */
+}
+
#ifdef CONFIG_SMP
static int smt_enabled_cmdline;
@@ -425,6 +497,8 @@ #endif
parse_early_param();
+ check_cpu_features();
+
check_smt_enabled();
smp_setup_cpu_maps();
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox