Re: [REGRESSION] suspend to ram fails in 6.2-rc1 due to tpm errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 14, 2023 at 04:23:54PM +0200, Jarkko Sakkinen wrote:
> > diff --git a/drivers/char/random.c b/drivers/char/random.c
> > index ce3ccd172cc8..708110c780aa 100644
> > --- a/drivers/char/random.c
> > +++ b/drivers/char/random.c
> > @@ -934,20 +934,20 @@ EXPORT_SYMBOL(add_device_randomness);
> >  void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy, bool sleep_after)
> >  {
> >  	mix_pool_bytes(buf, len);
> >  	credit_init_bits(entropy);
> > 
> >  	/*
> >  	 * Throttle writing to once every reseed interval, unless we're not yet
> >  	 * initialized or no entropy is credited.
> >  	 */
> > -	if (sleep_after && !kthread_should_stop() && (crng_ready() || !entropy))
> > -		schedule_timeout_interruptible(crng_reseed_interval());
> > +//	if (sleep_after && !kthread_should_stop() && (crng_ready() || !entropy))
> > +//		schedule_timeout_interruptible(crng_reseed_interval());
> >  }
> >  EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
> > 
> >  /*
> >   * Handle random seed passed by bootloader, and credit it depending
> >   * on the command line option 'random.trust_bootloader'.
> >   */
> >  void __init add_bootloader_randomness(const void *buf, size_t len)
> >  {
> > 
> > Then I hooked the tpm emulator up to qemu and put it in tpm1 mode. I had
> > userspace `echo mem > /sys/power/state` every couple of seconds (or
> > continuously maybe?), and then I used the qemu monitor interface to wake
> > the system from sleep. And kaboom.
> 
> Thanks for the tips! I'll try various patch combinations and see what
> happens.

I created a VM using libvirt with the following configuration [*]

<tpm model='tpm-tis'>
  <backend type='emulator' version='1.2'/>
  <alias name='tpm0'/>
</tpm>

I do not have issues with suspend so far with unmodified v6.3-rc7.

It would be nice to have a script that gives a guaranteed crash with
unmodified kernel even if run for some hours.

Instead of using QEMU monitor interface and /sys/power/state, I wonder
if a stress test could be based on looping rtcwake for easier comparison
of results?

[*] full description: https://gist.github.com/jarkkojs/66ea0d8d6a927311e8abb8b35e1ddbcd

BR, Jarkko



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux