Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490782 > unrolled thread

RE: [PATCH][v10] PM / hibernate: Verify the consistent of e820 memory map by md5 digest

Started by"Chen, Yu C" <yu.c.chen@intel.com>
First post2016-09-25 05:50 +0200
Last post2016-09-25 05:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH][v10] PM / hibernate: Verify the consistent of e820  memory map by md5 digest "Chen, Yu C" <yu.c.chen@intel.com> - 2016-09-25 05:50 +0200

#1490782 — RE: [PATCH][v10] PM / hibernate: Verify the consistent of e820 memory map by md5 digest

From"Chen, Yu C" <yu.c.chen@intel.com>
Date2016-09-25 05:50 +0200
SubjectRE: [PATCH][v10] PM / hibernate: Verify the consistent of e820 memory map by md5 digest
Message-ID<sl8BY-1o5-9@gated-at.bofh.it>
Hi,
Sorry for late response, I missed this thread in mailbox,

> -----Original Message-----
> From: rjwysocki@gmail.com [mailto:rjwysocki@gmail.com] On Behalf Of
> Rafael J. Wysocki
> Sent: Monday, September 19, 2016 7:46 PM
> To: Chen, Yu C
> Cc: Linux PM; the arch/x86 maintainers; Linux Kernel Mailing List; Thomas
> Gleixner; Ingo Molnar; H. Peter Anvin; Wysocki, Rafael J; Pavel Machek; Lee
> Chun-Yi; Borislav Petkov
> Subject: Re: [PATCH][v10] PM / hibernate: Verify the consistent of e820
> memory map by md5 digest
> 
> On Fri, Sep 9, 2016 at 2:21 PM, Chen Yu <yu.c.chen@intel.com> wrote:
> > On some platforms, there is occasional panic triggered when trying to
> > resume from hibernation, a typical panic looks like:
> 
> [cut]
> 
> > @@ -211,10 +292,15 @@ int arch_hibernation_header_save(void *addr,
> unsigned int max_size)
> >   */
> >  int arch_hibernation_header_restore(void *addr)  {
> > +       bool e820_mismatch = false;
> 
> The extra local variable can be avoided if you structure the code slightly
> differently.
> 
> >         struct restore_data_record *rdr = addr;
> >
> >         restore_jump_address = rdr->jump_address;
> >         jump_address_phys = rdr->jump_address_phys;
> >         restore_cr3 = rdr->cr3;
> > -       return (rdr->magic == RESTORE_MAGIC) ? 0 : -EINVAL;
> > +
> > +       e820_mismatch = hibernation_e820_mismatch(rdr->e820_digest);
> 
> Also calling hibernation_e820_mismatch() before checking rdr->magic may not
> be useful at all.
Yes.
> 
> > +
> > +       return (rdr->magic == RESTORE_MAGIC) ?
> > +               (e820_mismatch ? -ENODEV : 0) : -EINVAL;
> 
> So what about:
> 
> if (rdr->magic != RESTORE_MAGIC)
>         return -EINVAL;
> 
> if (hibernation_e820_mismatch(rdr->e820_digest))
>         return -ENODEV;
> 
> return 0;
> 
OK, will change it to this one. Thanks!
> >  }
> > --
> 
> Thanks,
> Rafael

Thanks,
Yu

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web