mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sam@ravnborg.org
Cc: sparclinux@vger.kernel.org, jgarzik@pobox.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2]: sparc64: Add Niagara2 RNG driver.
Date: Tue, 03 Jun 2008 15:52:14 -0700 (PDT)	[thread overview]
Message-ID: <20080603.155214.34351559.davem@davemloft.net> (raw)
In-Reply-To: <20080517065437.GA8092@uranus.ravnborg.org>

From: Sam Ravnborg <sam@ravnborg.org>
Date: Sat, 17 May 2008 08:54:37 +0200

> > diff --git a/drivers/char/hw_random/Makefile b/drivers/char/hw_random/Makefile
> > index c8b7300..32b327b 100644
> > --- a/drivers/char/hw_random/Makefile
> > +++ b/drivers/char/hw_random/Makefile
> > @@ -7,6 +7,8 @@ rng-core-y := core.o
> >  obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o
> >  obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o
> >  obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o
> > +obj-$(CONFIG_HW_RANDOM_N2RNG) += n2-rng.o
> > +n2-rng-objs := n2-drv.o n2-asm.o
> 
> These days the preferred syntax is:
> 
> n2-rng-y := n2-drv.o n2-asm.o
> 
> Following this scheme in general allows us to easily
> introduce:
> n2-rng-$(CONFIG_FOO) += foo.o

Thanks I've fixed this.

> > +#include <asm/hypervisor.h>
> > +#include "n2rng.h"
> > +
> > +	.text
> 
> I had expected:
> 
> 	.section .text, "aw"
> 
> here??

".text" is used consistently for this in the first 5 assembler files
I tossed into my editor (arch/x86/kernel/head_{32,64},
arch/x86/kernel/entry_{32,64}.S, arch/powerpc/kernel/head_64.S)
I don't see any value in using the expanded version, especially is
"aw" is not the default on some platform for some reason, that
detail is hidden in the assembler's implementation of ".text"

> > +	.globl	sun4v_rng_get_diag_ctl
> > +	.type	sun4v_rng_get_diag_ctl,#function
> > +sun4v_rng_get_diag_ctl:
> > +	mov	HV_FAST_RNG_GET_DIAG_CTL, %o5
> > +	ta	HV_FAST_TRAP
> > +	retl
> > +	 nop
> > +	.size	sun4v_rng_get_diag_ctl,.-sun4v_rng_get_diag_ctl
> 
> Any specific reason why you do not use:
> 
> ENTRY(sun4v_rng_get_diag_ctl)
>      mov     HV_FAST_RNG_GET_DIAG_CTL, %o5
>      ta      HV_FAST_TRAP
>      retl
>       nop
> ENDPROC(sun4v_rng_get_diag_ctl)

I simply didn't know they existed and were usable. :-)
I've changed the assembler code to use them, thanks.

Longer term I'll need to define __ALIGN et al. on sparc
so that a more appropriate fill constant is used.  It
should be a NOP in sections that should contain instructions
and 0x90 is not a NOP on sparc :-)

But it's harmless to use what's there now, so there is no
need for me to define a specific __ALIGN before using
ENTRY and ENDPROC.

Thanks for your feedback.

      reply	other threads:[~2008-06-03 22:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16 23:53 David Miller
2008-05-17  6:54 ` Sam Ravnborg
2008-06-03 22:52   ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080603.155214.34351559.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®