[patch 08/18] PS3: Kexec support
Michael Ellerman
michael at ellerman.id.au
Thu Jun 7 12:31:08 EST 2007
On Wed, 2007-06-06 at 14:55 -0700, Geoff Levand wrote:
> Michael Ellerman wrote:
> >> --- a/arch/powerpc/platforms/ps3/htab.c
> >> +++ b/arch/powerpc/platforms/ps3/htab.c
> >> @@ -234,10 +234,18 @@ static void ps3_hpte_invalidate(unsigned
> >>
> >> static void ps3_hpte_clear(void)
> >> {
> >> - /* Make sure to clean up the frame buffer device first */
> >> - ps3fb_cleanup();
> >> + int result;
> >>
> >> - lv1_unmap_htab(htab_addr);
> >> + DBG(" -> %s:%d\n", __func__, __LINE__);
> >> +
> >> + result = lv1_unmap_htab(htab_addr);
> >> + BUG_ON(result);
> >> +
> >> + ps3_mm_shutdown();
> >> +
> >> + ps3_mm_vas_destroy();
> >> +
> >> + DBG(" <- %s:%d\n", __func__, __LINE__);
> >> }
> >
> > Do you really want to be calling DBG() here? Hmm, it looks like it
> > doesn't actually do anything?
>
>
> Sure, it uses udbg_printf, and works OK.
Which is hooked up to what?
> >> +static void ps3_chip_mask(unsigned int virq)
> >> +{
> >> + struct ps3_private *pd = get_irq_chip_data(virq);
> >> + u64 bit = 0x8000000000000000UL >> virq;
> >> + u64 *p = &pd->bmp.mask;
> >> + u64 old;
> >> + unsigned long flags;
> >> +
> >> + pr_debug("%s:%d: cpu %u, virq %d\n", __func__, __LINE__, pd->cpu, virq);
> >> +
> >> + local_irq_save(flags);
> >> + asm volatile(
> >> + "1: ldarx %0,0,%3\n"
> >> + "andc %0,%0,%2\n"
> >> + "stdcx. %0,0,%3\n"
> >> + "bne- 1b"
> >> + : "=&r" (old), "+m" (*p)
> >> + : "r" (bit), "r" (p)
> >> + : "cc" );
> >> +
> >> + lv1_did_update_interrupt_mask(pd->node, pd->cpu);
> >> + local_irq_restore(flags);
> >
> > How is this different from set_bit() ? (asm-powerpc/bitops.h)
> >
> > ps. now that I see you're just moving this code around someone's
> > probably already asked that question.
>
>
> This was contributed by Ben H as the fastest way. I think the
> reason was that we could minimize the time between local_irq_save
> and local_irq_restore?
To save ~10 instructions? Followed by a HV call? I guess Ben has some
really good benchmark data to support it ;)
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070607/0ef9b640/attachment.pgp>
More information about the Linuxppc-dev
mailing list