Skip to contentSkip to conversation

why no call to add_interrupt_randomness() on PPC?

DISCUSSION Andi Kleen 3 participants 3 messages Aug 22, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 7 lines · Chris Friesen

With all the talk about randomness, I went to see where my current system (2.2.19 on PPC) was getting random numbers from. I was kind of surprised to see that there is no call to add_interrupt_randomness() in arch/ppc/kernel/irq.c.

Does anyone know why this call is not present in ppc_irq_dispatch_handler()? Would it be appropriate for me to make a patch for this? Who would be the appropriate person to send this to?

Nobody except for a few really obscure drivers use SA_SAMPLE_RANDOM with their interrupt handlers (none on ppc as far as I can see) On i386 all the gathering is normally done via the keyboard/mouse drivers and the blk interface. The reason e.g. Macs normally do not gather entropy is that they're using the new input layer for keyboard and mouse which for some reason doesn't feed its events into the entropy pool. I believe Wojtech did a patch for it, but I don't know if it has been merged into the ppc tree yet.

-Andi

#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Andi Kleen

Nobody except for a few really obscure drivers use SA_SAMPLE_RANDOM with their interrupt handlers (none on ppc as far as I can see) On i386 all the gathering is normally done via the keyboard/mouse drivers and the blk interface. The reason e.g. Macs normally do not gather entropy is that they're using the new input layer for keyboard and mouse which for some reason doesn't feed its events into the entropy pool. I believe Wojtech did a patch for it, but I don't know if it has been merged into the ppc tree yet.

The reason I'm looking at this is because I'm on a headless net-booting device. We properly save and restore the entropy pool on startup/shutdown, but without using network interrupts we have no way to generate more entropy. I was looking at turning on SA_SAMPLE_RANDOM in our network driver, but then I realized that it would have no effect because it isn't even supported on PPC.

So the upshot seems to be that there is no real reason why it isn't there, it just hasn't been seen as required. Am I right?

Chris

Signature · 4 lines
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: [email protected]
#3 lore raw
Quoted 3 lines

I was looking at turning on SA_SAMPLE_RANDOM in
our network driver, but then I realized that it would have no effect because it isn't even supported on PPC.

adding a call to add_interrupt_randomness() sounds like a good idea if only for consistency and certainly does no harm (especially if no net drivers use it), except that the timing is very coarsely grained (jiffies) on PPC. It would be even better if you added some cycle clock reading code to random.c for the PPC (in addition to the i386 specific stuff) or better abstracted it all out into arch directories.

Adding SA_SAMPLE_RANDOM to net devices: well, see other thread ad-nauseam & make up your own mind :-)

--
Alex Bligh