Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-09-12 Thread joeyli
On Wed, Sep 09, 2015 at 01:24:08PM +0100, Matt Fleming wrote: > On Thu, 27 Aug, at 06:21:44PM, joeyli wrote: > > On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote: > > > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote: > > > > +static int __i

Re: [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-09-12 Thread joeyli
On Wed, Sep 09, 2015 at 01:15:45PM +0100, Matt Fleming wrote: > On Thu, 27 Aug, at 05:04:52PM, joeyli wrote: > > > > The purpose of checking attribute of hibernation key variable is > > in case someone created a key variable on runtime environment _before_ > > this

Re: [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-09-12 Thread joeyli
On Wed, Sep 09, 2015 at 01:15:45PM +0100, Matt Fleming wrote: > On Thu, 27 Aug, at 05:04:52PM, joeyli wrote: > > > > The purpose of checking attribute of hibernation key variable is > > in case someone created a key variable on runtime environment _before_ > > this

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-09-12 Thread joeyli
On Wed, Sep 09, 2015 at 01:24:08PM +0100, Matt Fleming wrote: > On Thu, 27 Aug, at 06:21:44PM, joeyli wrote: > > On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote: > > > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote: > > > > +static int __i

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-09 Thread joeyli
Hi, On Wed, Sep 09, 2015 at 12:21:23PM +0100, Matt Fleming wrote: > On Wed, 09 Sep, at 08:33:07AM, joeyli wrote: > > > > Yes, the machine on my hand has EFI_PROPERTIES_TABLE enabled, and it doesn't > > boot without your patch. > > Awesome. Could you test

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-09 Thread joeyli
Hi, On Wed, Sep 09, 2015 at 12:21:23PM +0100, Matt Fleming wrote: > On Wed, 09 Sep, at 08:33:07AM, joeyli wrote: > > > > Yes, the machine on my hand has EFI_PROPERTIES_TABLE enabled, and it doesn't > > boot without your patch. > > Awesome. Could you test

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-08 Thread joeyli
Hi Matt, On Tue, Sep 08, 2015 at 09:41:47PM +0100, Matt Fleming wrote: > On Mon, 07 Sep, at 12:07:52PM, joeyli wrote: > > > > This patch works to me on Intel S1200V3RPS to fix issue: > > DMI: Intel Corporation (uefidk.com) Intel Server Board S1200V3RPS UEFI > > Devel

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-08 Thread joeyli
Hi Matt, On Tue, Sep 08, 2015 at 09:41:47PM +0100, Matt Fleming wrote: > On Mon, 07 Sep, at 12:07:52PM, joeyli wrote: > > > > This patch works to me on Intel S1200V3RPS to fix issue: > > DMI: Intel Corporation (uefidk.com) Intel Server Board S1200V3RPS UEFI > > Devel

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-06 Thread joeyli
Hi, On Fri, Sep 04, 2015 at 02:14:07PM +0100, Matt Fleming wrote: > From: Matt Fleming > > Beginning with UEFI v2.5 EFI_PROPERTIES_TABLE was introduced that > signals that the firmware PE/COFF loader supports splitting code and > data sections of PE/COFF images into separate EFI memory map

Re: [PATCH] x86/efi: Map EFI memmap entries in-order at runtime

2015-09-06 Thread joeyli
Hi, On Fri, Sep 04, 2015 at 02:14:07PM +0100, Matt Fleming wrote: > From: Matt Fleming > > Beginning with UEFI v2.5 EFI_PROPERTIES_TABLE was introduced that > signals that the firmware PE/COFF loader supports splitting code and > data sections of PE/COFF images into

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-27 Thread joeyli
On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote: > > Add handler to parse the setup data that carrying hibernation key, it > > reserves hibernation key by memblock then copies key to a allocated page > > in later initcall stage. > >

Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data

2015-08-27 Thread joeyli
On Fri, Aug 21, 2015 at 01:40:26PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:28PM, Lee, Chun-Yi wrote: > > For forwarding hibernation key from EFI stub to boot kernel, this patch > > allocates setup data for carrying hibernation key, size and the status > > of efi operating. > > This

Re: [PATCH v2 07/16] efi: Make efi_status_to_err() public

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 04:07:06PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:27PM, Lee, Chun-Yi wrote: > > Moved the function of transferring EFI status to kernel error for > > later used by EFI stub. > > Might I suggest: > > "Move the function for converting EFI status to kernel

Re: [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 09:40:44PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:26PM, Lee, Chun-Yi wrote: > > This patch adds codes in EFI stub for generating and storing the > > HMAC key in EFI boot service variable for signing hibernate image. > > > > Per rcf2104, the length of

Re: [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 09:26:20PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:25PM, Lee, Chun-Yi wrote: > > + > > +static unsigned long efi_get_rng64(efi_system_table_t *sys_table, > > + void **rng_handle) > > +{ > > + const struct efi_config *efi_early =

Re: [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 09:26:20PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:25PM, Lee, Chun-Yi wrote: + +static unsigned long efi_get_rng64(efi_system_table_t *sys_table, + void **rng_handle) +{ + const struct efi_config *efi_early =

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-27 Thread joeyli
On Fri, Aug 21, 2015 at 02:27:53PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:29PM, Lee, Chun-Yi wrote: Add handler to parse the setup data that carrying hibernation key, it reserves hibernation key by memblock then copies key to a allocated page in later initcall stage. And

Re: [PATCH v2 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 09:40:44PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:26PM, Lee, Chun-Yi wrote: This patch adds codes in EFI stub for generating and storing the HMAC key in EFI boot service variable for signing hibernate image. Per rcf2104, the length of HMAC-SHA1 hash

Re: [PATCH v2 07/16] efi: Make efi_status_to_err() public

2015-08-27 Thread joeyli
On Thu, Aug 20, 2015 at 04:07:06PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:27PM, Lee, Chun-Yi wrote: Moved the function of transferring EFI status to kernel error for later used by EFI stub. Might I suggest: Move the function for converting EFI status to kernel error

Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data

2015-08-27 Thread joeyli
On Fri, Aug 21, 2015 at 01:40:26PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:28PM, Lee, Chun-Yi wrote: For forwarding hibernation key from EFI stub to boot kernel, this patch allocates setup data for carrying hibernation key, size and the status of efi operating. This could do

Re: [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-08-26 Thread joeyli
On Thu, Aug 20, 2015 at 03:47:06PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:25PM, Lee, Chun-Yi wrote: > > To grab random numbers through EFI protocol as one of the entropies > > source of swsusp key, this patch adds the logic for accessing EFI RNG > > (random number generator)

Re: [PATCH v2 04/16] x86/efi: Generating random number in EFI stub

2015-08-26 Thread joeyli
Hi Matt, Thanks for your reviewing and sorry for my delay. On Thu, Aug 20, 2015 at 03:12:21PM +0100, Matt Fleming wrote: > On Tue, 11 Aug, at 02:16:24PM, Lee, Chun-Yi wrote: > > This patch adds the codes for generating random number array as the > > HMAC key that will used by later EFI stub

Re: [PATCH v2 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-08-26 Thread joeyli
On Thu, Aug 20, 2015 at 03:47:06PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:25PM, Lee, Chun-Yi wrote: To grab random numbers through EFI protocol as one of the entropies source of swsusp key, this patch adds the logic for accessing EFI RNG (random number generator) protocol

Re: [PATCH v2 04/16] x86/efi: Generating random number in EFI stub

2015-08-26 Thread joeyli
Hi Matt, Thanks for your reviewing and sorry for my delay. On Thu, Aug 20, 2015 at 03:12:21PM +0100, Matt Fleming wrote: On Tue, 11 Aug, at 02:16:24PM, Lee, Chun-Yi wrote: This patch adds the codes for generating random number array as the HMAC key that will used by later EFI stub codes.

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-08-19 Thread joeyli
On Wed, Aug 19, 2015 at 05:31:45PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 10:16:01PM, joeyli wrote: > > > > Thanks for your explanation. > > > > For my issue, I will check if rewriting the VA of runtime services can fix > > issue. > > If no

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-08-19 Thread joeyli
On Wed, Aug 19, 2015 at 05:31:45PM +0100, Matt Fleming wrote: On Thu, 30 Jul, at 10:16:01PM, joeyli wrote: Thanks for your explanation. For my issue, I will check if rewriting the VA of runtime services can fix issue. If not, then I think need find a way to sync the mapping in EFI

Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data

2015-08-15 Thread joeyli
On Sat, Aug 15, 2015 at 07:07:38PM +0200, Pavel Machek wrote: > On Tue 2015-08-11 14:16:28, Lee, Chun-Yi wrote: > > For forwarding hibernation key from EFI stub to boot kernel, this patch > > allocates setup data for carrying hibernation key, size and the status > > of efi operating. > > > >

Re: [PATCH v2 08/16] x86/efi: Carrying hibernation key by setup data

2015-08-15 Thread joeyli
On Sat, Aug 15, 2015 at 07:07:38PM +0200, Pavel Machek wrote: On Tue 2015-08-11 14:16:28, Lee, Chun-Yi wrote: For forwarding hibernation key from EFI stub to boot kernel, this patch allocates setup data for carrying hibernation key, size and the status of efi operating. Reviewed-by:

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-13 Thread joeyli
On Tue, Aug 11, 2015 at 02:16:29PM +0800, Lee, Chun-Yi wrote: > Add handler to parse the setup data that carrying hibernation key, it > reserves hibernation key by memblock then copies key to a allocated page > in later initcall stage. > [...snip] > diff --git a/arch/x86/power/hibernate_keys.c

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-13 Thread joeyli
On Tue, Aug 11, 2015 at 02:16:29PM +0800, Lee, Chun-Yi wrote: Add handler to parse the setup data that carrying hibernation key, it reserves hibernation key by memblock then copies key to a allocated page in later initcall stage. [...snip] diff --git a/arch/x86/power/hibernate_keys.c

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-12 Thread joeyli
Hi Yu, Thanks for your reviewing. On Thu, Aug 13, 2015 at 02:45:32AM +, Chen, Yu C wrote: > Hi Chun-yi, > On Tue, 2015-08-11 at 14:16 +0800, Lee, Chun-Yi wrote: > > > +/* A page used to keep hibernation keys */ > > +static struct hibernation_keys *hibernation_keys; > > + > > +void __init

Re: [PATCH v2 09/16] PM / hibernate: Reserve hibernation key and erase footprints

2015-08-12 Thread joeyli
Hi Yu, Thanks for your reviewing. On Thu, Aug 13, 2015 at 02:45:32AM +, Chen, Yu C wrote: Hi Chun-yi, On Tue, 2015-08-11 at 14:16 +0800, Lee, Chun-Yi wrote: +/* A page used to keep hibernation keys */ +static struct hibernation_keys *hibernation_keys; + +void __init

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 01:01:18PM +0100, Matt Fleming wrote: > On Fri, 2015-07-31 at 17:58 +0800, joeyli wrote: > > > > > > Can you do something to avoid each function having two very similar > > > versions of these functions? > > > > > >

Re: [RFC PATCH 01/16] PM / hibernate: define HMAC algorithm and digest size of swsusp

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 02:49:36PM +0200, Pavel Machek wrote: > On Fri 2015-07-31 18:08:12, joeyli wrote: > > On Tue, Jul 28, 2015 at 02:01:56PM +0200, Pavel Machek wrote: > > > On Thu 2015-07-16 22:25:15, Lee, Chun-Yi wrote: > > > > Using HMAC-SHA1 to be the HMAC

Re: [RFC PATCH 09/16] PM / hibernate: Reserve swsusp key and earse footprints

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:35:23PM +0200, Pavel Machek wrote: > Typo in patch subject. > > > And for earsing footbprints, the codes in this patch remove setup > > And two typos here. > Sorry for subject and above typos, I will fix it. Thanks. > > data that carried swsusp key, and clean the

Re: [RFC PATCH 08/16] x86/efi: Carrying swsusp key by setup data

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:30:09PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > For forwarding swsusp key from EFI stub to boot kernel, this patch > > allocates setup data for carrying swsusp key, size and the status > > of efi operating. > > > >

Re: [RFC PATCH 07/16] efi: Public the function of transferring EFI status to kernel error

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:23:22PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > Moved the function of transferring EFI status to kernel error for > > later used by EFI stub. > > > > Signed-off-by: Lee, Chun-Yi > > --- > > drivers/firmware/efi/vars.c |

Re: [RFC PATCH 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:20:46PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > This patch adds codes in EFI stub for generating and storing the > > HMAC key in EFI boot service variable for signing hibernate image. > > > > Per rcf2104, the length of

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 10:59:12PM +0800, joeyli wrote: > On Thu, Jul 30, 2015 at 05:11:44PM +0100, Matt Fleming wrote: > > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > > To grab random numbers through EFI protocol as one of the entropies > > > source of

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:11:44PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > To grab random numbers through EFI protocol as one of the entropies > > source of swsusp key, this patch adds the logic for accessing EFI RNG > > (random number generator)

Re: [RFC PATCH 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:30:26PM +0200, Pavel Machek wrote: > > > For generating a messy number as a 20 bytes key, the codes in EFI > > stub gets u32 random number five time and every random number is > > rolling that last u32 random number as entropy. > > Parse error here. > Sorry for I

Re: [RFC PATCH 03/16] x86/boot: Public getting random boot function

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:21:33PM +0200, Pavel Machek wrote: > Hi! > > > int cmdline_find_option_bool(const char *option); > > #endif > > > > +#if CONFIG_RANDOMIZE_BASE > > Not ifdef? > > > +extern u16 i8254(void); > > That's rather poor name for global function... This i8254 function

Re: [RFC PATCH 02/16] x86/efi: Add get and set variable to EFI services pointer table

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 04:19:58PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > Add get variable and set variable function to EFI services pointer > > table for supporting later functions of hibernate signature > > verification to keep the HMAC key in efi

Re: [RFC PATCH 01/16] PM / hibernate: define HMAC algorithm and digest size of swsusp

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:01:56PM +0200, Pavel Machek wrote: > On Thu 2015-07-16 22:25:15, Lee, Chun-Yi wrote: > > Using HMAC-SHA1 to be the HMAC algorithm of signing hibernate > > snapshot image. The digest size of HMAC-SHA1 is 160 bits (20 bytes), > > this size will be also applied to the

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:28:53PM +0200, Pavel Machek wrote: > On Thu 2015-07-16 22:25:19, Lee, Chun-Yi wrote: > > To grab random numbers through EFI protocol as one of the entropies > > source of swsusp key, this patch adds the logic for accessing EFI RNG > > (random number generator) protocol

Re: [RFC PATCH 04/16] x86/efi: Generating random number in EFI stub

2015-07-31 Thread joeyli
Hi Matt, Thanks for your review! On Thu, Jul 30, 2015 at 04:37:42PM +0100, Matt Fleming wrote: > On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: > > This patch adds the codes for generating random number array as the > > HMAC key that will used by later EFI stub codes. > > > > The

Re: [RFC PATCH 04/16] x86/efi: Generating random number in EFI stub

2015-07-31 Thread joeyli
Hi Pavel, Thanks for your review. On Tue, Jul 28, 2015 at 02:01:12PM +0200, Pavel Machek wrote: > Hi! > > > This patch adds the codes for generating random number array as the > > HMAC key that will used by later EFI stub codes. > > > > The original codes in efi_random copied from aslr and

Re: [RFC PATCH 07/16] efi: Public the function of transferring EFI status to kernel error

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:23:22PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: Moved the function of transferring EFI status to kernel error for later used by EFI stub. Signed-off-by: Lee, Chun-Yi j...@suse.com --- drivers/firmware/efi/vars.c |

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 10:59:12PM +0800, joeyli wrote: On Thu, Jul 30, 2015 at 05:11:44PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: To grab random numbers through EFI protocol as one of the entropies source of swsusp key, this patch adds the logic

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:11:44PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: To grab random numbers through EFI protocol as one of the entropies source of swsusp key, this patch adds the logic for accessing EFI RNG (random number generator) protocol

Re: [RFC PATCH 01/16] PM / hibernate: define HMAC algorithm and digest size of swsusp

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 02:49:36PM +0200, Pavel Machek wrote: On Fri 2015-07-31 18:08:12, joeyli wrote: On Tue, Jul 28, 2015 at 02:01:56PM +0200, Pavel Machek wrote: On Thu 2015-07-16 22:25:15, Lee, Chun-Yi wrote: Using HMAC-SHA1 to be the HMAC algorithm of signing hibernate snapshot

Re: [RFC PATCH 08/16] x86/efi: Carrying swsusp key by setup data

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:30:09PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: For forwarding swsusp key from EFI stub to boot kernel, this patch allocates setup data for carrying swsusp key, size and the status of efi operating. Signed-off-by:

Re: [RFC PATCH 09/16] PM / hibernate: Reserve swsusp key and earse footprints

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:35:23PM +0200, Pavel Machek wrote: Typo in patch subject. And for earsing footbprints, the codes in this patch remove setup And two typos here. Sorry for subject and above typos, I will fix it. Thanks. data that carried swsusp key, and clean the memory

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Fri, Jul 31, 2015 at 01:01:18PM +0100, Matt Fleming wrote: On Fri, 2015-07-31 at 17:58 +0800, joeyli wrote: Can you do something to avoid each function having two very similar versions of these functions? They are similar but I want follow the style in eboot.c. On the other

Re: [RFC PATCH 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 05:20:46PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: This patch adds codes in EFI stub for generating and storing the HMAC key in EFI boot service variable for signing hibernate image. Per rcf2104, the length of HMAC-SHA1

Re: [RFC PATCH 04/16] x86/efi: Generating random number in EFI stub

2015-07-31 Thread joeyli
Hi Matt, Thanks for your review! On Thu, Jul 30, 2015 at 04:37:42PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: This patch adds the codes for generating random number array as the HMAC key that will used by later EFI stub codes. The original codes

Re: [RFC PATCH 04/16] x86/efi: Generating random number in EFI stub

2015-07-31 Thread joeyli
Hi Pavel, Thanks for your review. On Tue, Jul 28, 2015 at 02:01:12PM +0200, Pavel Machek wrote: Hi! This patch adds the codes for generating random number array as the HMAC key that will used by later EFI stub codes. The original codes in efi_random copied from aslr and add the

Re: [RFC PATCH 06/16] x86/efi: Generating random HMAC key for siging hibernate image

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:30:26PM +0200, Pavel Machek wrote: For generating a messy number as a 20 bytes key, the codes in EFI stub gets u32 random number five time and every random number is rolling that last u32 random number as entropy. Parse error here. Sorry for I didn't remove

Re: [RFC PATCH 01/16] PM / hibernate: define HMAC algorithm and digest size of swsusp

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:01:56PM +0200, Pavel Machek wrote: On Thu 2015-07-16 22:25:15, Lee, Chun-Yi wrote: Using HMAC-SHA1 to be the HMAC algorithm of signing hibernate snapshot image. The digest size of HMAC-SHA1 is 160 bits (20 bytes), this size will be also applied to the length of

Re: [RFC PATCH 02/16] x86/efi: Add get and set variable to EFI services pointer table

2015-07-31 Thread joeyli
On Thu, Jul 30, 2015 at 04:19:58PM +0100, Matt Fleming wrote: On Thu, 2015-07-16 at 22:25 +0800, Lee, Chun-Yi wrote: Add get variable and set variable function to EFI services pointer table for supporting later functions of hibernate signature verification to keep the HMAC key in efi boot

Re: [RFC PATCH 05/16] x86/efi: Get entropy through EFI random number generator protocol

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:28:53PM +0200, Pavel Machek wrote: On Thu 2015-07-16 22:25:19, Lee, Chun-Yi wrote: To grab random numbers through EFI protocol as one of the entropies source of swsusp key, this patch adds the logic for accessing EFI RNG (random number generator) protocol that's

Re: [RFC PATCH 03/16] x86/boot: Public getting random boot function

2015-07-31 Thread joeyli
On Tue, Jul 28, 2015 at 02:21:33PM +0200, Pavel Machek wrote: Hi! int cmdline_find_option_bool(const char *option); #endif +#if CONFIG_RANDOMIZE_BASE Not ifdef? +extern u16 i8254(void); That's rather poor name for global function... This i8254 function only used by aslr

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 03:05:42PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 09:39:47PM, joeyli wrote: > > > > OK, understood! Thanks for your suggestion! > > > > But, I have a question about mapping Boot Code/Data to -4G area. I > > understand > > w

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 02:17:23PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 08:31:16PM, joeyli wrote: > > > > I think hibernate overwrite it. > > We absolutely must get a more detailed answer before going any further. > > Simply put, if we're remapping the E

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 01:09:16PM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 07:18:19PM, joeyli wrote: > > > > In the above case, just simply accessing EFI variable through efivars to > > reproduce issue: > > > > linux-aiip:~ # hexdump -C > > /sys/f

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 07:09:59PM +0800, joeyli wrote: > On Thu, Jul 30, 2015 at 11:11:31AM +0100, Matt Fleming wrote: > > On Thu, 30 Jul, at 10:03:23AM, Borislav Petkov wrote: > > > On Thu, Jul 30, 2015 at 12:53:42AM -0700, H. Peter Anvin wrote: > > > > This c

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 11:11:31AM +0100, Matt Fleming wrote: > On Thu, 30 Jul, at 10:03:23AM, Borislav Petkov wrote: > > On Thu, Jul 30, 2015 at 12:53:42AM -0700, H. Peter Anvin wrote: > > > This changelog is at least partially incomprehensive. It also seems > > > more than a bit aggressive to

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 02:17:23PM +0100, Matt Fleming wrote: On Thu, 30 Jul, at 08:31:16PM, joeyli wrote: I think hibernate overwrite it. We absolutely must get a more detailed answer before going any further. Simply put, if we're remapping the EFI regions into the virtual address

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 01:09:16PM +0100, Matt Fleming wrote: On Thu, 30 Jul, at 07:18:19PM, joeyli wrote: In the above case, just simply accessing EFI variable through efivars to reproduce issue: linux-aiip:~ # hexdump -C /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 03:05:42PM +0100, Matt Fleming wrote: On Thu, 30 Jul, at 09:39:47PM, joeyli wrote: OK, understood! Thanks for your suggestion! But, I have a question about mapping Boot Code/Data to -4G area. I understand we need Runtime regions, and 1:1 mapping

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 11:11:31AM +0100, Matt Fleming wrote: On Thu, 30 Jul, at 10:03:23AM, Borislav Petkov wrote: On Thu, Jul 30, 2015 at 12:53:42AM -0700, H. Peter Anvin wrote: This changelog is at least partially incomprehensive. It also seems more than a bit aggressive to expect that

Re: [PATCH] x86_64/efi: Mapping Boot and Runtime EFI memory regions to different starting virtual address

2015-07-30 Thread joeyli
On Thu, Jul 30, 2015 at 07:09:59PM +0800, joeyli wrote: On Thu, Jul 30, 2015 at 11:11:31AM +0100, Matt Fleming wrote: On Thu, 30 Jul, at 10:03:23AM, Borislav Petkov wrote: On Thu, Jul 30, 2015 at 12:53:42AM -0700, H. Peter Anvin wrote: This changelog is at least partially incomprehensive

Re: [RFC PATCH 00/16] Signature verification of hibernate snapshot

2015-07-25 Thread joeyli
Hi Jiri, On Fri, Jul 24, 2015 at 07:08:18PM +0200, Jiri Kosina wrote: > On Thu, 16 Jul 2015, Lee, Chun-Yi wrote: > > > This patchset is the implementation of signature verification of hibernate > > snapshot image. The origin idea is from Jiri Kosina: Let EFI bootloader > > generate key-pair in

Re: [RFC PATCH 00/16] Signature verification of hibernate snapshot

2015-07-25 Thread joeyli
Hi Jiri, On Fri, Jul 24, 2015 at 07:08:18PM +0200, Jiri Kosina wrote: On Thu, 16 Jul 2015, Lee, Chun-Yi wrote: This patchset is the implementation of signature verification of hibernate snapshot image. The origin idea is from Jiri Kosina: Let EFI bootloader generate key-pair in UEFI

Re: [PATCH] ACPI / init: Switch over platform to the ACPI mode later

2015-06-09 Thread joeyli
On Wed, Jun 10, 2015 at 01:48:29AM +0200, Rafael J. Wysocki wrote: > On Wednesday, June 03, 2015 11:13:57 AM Toshi Kani wrote: > > On Sat, 2015-05-30 at 14:21 +0200, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > > > Commit 73f7d1ca3263 "ACPI / init: Run acpi_early_init() before

Re: [PATCH] ACPI / init: Switch over platform to the ACPI mode later

2015-06-09 Thread joeyli
On Wed, Jun 10, 2015 at 01:48:29AM +0200, Rafael J. Wysocki wrote: On Wednesday, June 03, 2015 11:13:57 AM Toshi Kani wrote: On Sat, 2015-05-30 at 14:21 +0200, Rafael J. Wysocki wrote: From: Rafael J. Wysocki rafael.j.wyso...@intel.com Commit 73f7d1ca3263 ACPI / init: Run

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-05 Thread joeyli
On Fri, Apr 03, 2015 at 11:43:30PM +0200, Rafael J. Wysocki wrote: > On Friday, April 03, 2015 05:58:25 PM rhn wrote: > > On Thu, 2 Apr 2015 17:28:05 +0200 > > Pavel Machek wrote: > > > > > On Wed 2015-04-01 21:47:43, rhn wrote: > > > > Hello, > > > > > > > > Between kernel 3.16 and 3.17, a

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-05 Thread joeyli
Hi Rafael, On Sat, Apr 04, 2015 at 10:12:43AM +0200, rhn wrote: > On Fri, 03 Apr 2015 23:43:30 +0200 > "Rafael J. Wysocki" wrote: > > > On Friday, April 03, 2015 05:58:25 PM rhn wrote: > > > On Thu, 2 Apr 2015 17:28:05 +0200 > > > Pavel Machek wrote: > > > > > > > On Wed 2015-04-01 21:47:43,

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-05 Thread joeyli
Hi Rafael, On Sat, Apr 04, 2015 at 10:12:43AM +0200, rhn wrote: On Fri, 03 Apr 2015 23:43:30 +0200 Rafael J. Wysocki r...@rjwysocki.net wrote: On Friday, April 03, 2015 05:58:25 PM rhn wrote: On Thu, 2 Apr 2015 17:28:05 +0200 Pavel Machek pa...@ucw.cz wrote: On Wed 2015-04-01

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-05 Thread joeyli
On Fri, Apr 03, 2015 at 11:43:30PM +0200, Rafael J. Wysocki wrote: On Friday, April 03, 2015 05:58:25 PM rhn wrote: On Thu, 2 Apr 2015 17:28:05 +0200 Pavel Machek pa...@ucw.cz wrote: On Wed 2015-04-01 21:47:43, rhn wrote: Hello, Between kernel 3.16 and 3.17, a regression

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-02 Thread joeyli
On Thu, Apr 02, 2015 at 08:12:00PM +0200, rhn wrote: > On Fri, 3 Apr 2015 01:22:21 +0800 > joeyli wrote: > > > On Fri, Apr 03, 2015 at 12:50:54AM +0800, joeyli wrote: > > > Hi, > > > > > > On Thu, Apr 02, 2015 at 05:28:05PM +0200, Pavel Machek wrot

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-02 Thread joeyli
On Fri, Apr 03, 2015 at 12:50:54AM +0800, joeyli wrote: > Hi, > > On Thu, Apr 02, 2015 at 05:28:05PM +0200, Pavel Machek wrote: > > On Wed 2015-04-01 21:47:43, rhn wrote: > > > Hello, > > > > > > Between kernel 3.16 and 3.17, a regression has been int

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-02 Thread joeyli
Hi, On Thu, Apr 02, 2015 at 05:28:05PM +0200, Pavel Machek wrote: > On Wed 2015-04-01 21:47:43, rhn wrote: > > Hello, > > > > Between kernel 3.16 and 3.17, a regression has been introduced where the > > first hibernation after regular shutdown always fails to resume. Subsequent > >

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-02 Thread joeyli
On Thu, Apr 02, 2015 at 08:12:00PM +0200, rhn wrote: On Fri, 3 Apr 2015 01:22:21 +0800 joeyli j...@suse.com wrote: On Fri, Apr 03, 2015 at 12:50:54AM +0800, joeyli wrote: Hi, On Thu, Apr 02, 2015 at 05:28:05PM +0200, Pavel Machek wrote: On Wed 2015-04-01 21:47:43, rhn wrote

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-02 Thread joeyli
Hi, On Thu, Apr 02, 2015 at 05:28:05PM +0200, Pavel Machek wrote: On Wed 2015-04-01 21:47:43, rhn wrote: Hello, Between kernel 3.16 and 3.17, a regression has been introduced where the first hibernation after regular shutdown always fails to resume. Subsequent hibernations succeed.

Re: Unreliable hibernation on Lenovo x230 (regression)

2015-04-02 Thread joeyli
On Fri, Apr 03, 2015 at 12:50:54AM +0800, joeyli wrote: Hi, On Thu, Apr 02, 2015 at 05:28:05PM +0200, Pavel Machek wrote: On Wed 2015-04-01 21:47:43, rhn wrote: Hello, Between kernel 3.16 and 3.17, a regression has been introduced where the first hibernation after regular

Re: Trusted kernel patchset

2015-03-18 Thread joeyli
On Mon, Mar 16, 2015 at 10:54:54PM +0100, Jiri Kosina wrote: > On Mon, 16 Mar 2015, Matthew Garrett wrote: > > > > - All suspend/resumes allow modifying the kernel. I can boot Linux > > > suspend, boot windows, modify the Linux restore image, boot Linux and > > > own the box. You would need

Re: Trusted kernel patchset

2015-03-18 Thread joeyli
On Mon, Mar 16, 2015 at 10:54:54PM +0100, Jiri Kosina wrote: On Mon, 16 Mar 2015, Matthew Garrett wrote: - All suspend/resumes allow modifying the kernel. I can boot Linux suspend, boot windows, modify the Linux restore image, boot Linux and own the box. You would need to sign the

Re: [PATCH 3/3] e820: Add the unknown-12 Memory type (DDR3-NvDIMM)

2015-03-09 Thread joeyli
Hi, On Mon, Mar 09, 2015 at 02:10:37PM +0200, Boaz Harrosh wrote: > On 03/06/2015 01:09 AM, Andy Lutomirski wrote: > <> > > > > I will be shocked if a standard of this form ever appears. Modern > > systems *don't have e820*. The BIOSes that are using this type 12 > > hack are awful

Re: [PATCH 3/3] e820: Add the unknown-12 Memory type (DDR3-NvDIMM)

2015-03-09 Thread joeyli
Hi, On Mon, Mar 09, 2015 at 02:10:37PM +0200, Boaz Harrosh wrote: On 03/06/2015 01:09 AM, Andy Lutomirski wrote: I will be shocked if a standard of this form ever appears. Modern systems *don't have e820*. The BIOSes that are using this type 12 hack are awful throwbacks. So far

Re: [PATCH v3 1/8] x86: Kill E820_RESERVED_KERN

2015-03-08 Thread joeyli
On Sat, Mar 07, 2015 at 05:59:14PM -0800, David Rientjes wrote: > On Sat, 7 Mar 2015, Yinghai Lu wrote: > > > Now we are using memblock to do early resource reserver/allocation > > instead of using e820 map directly, and setup_data is reserved in > > memblock early already. > > Also kexec

Re: [PATCH v3 1/8] x86: Kill E820_RESERVED_KERN

2015-03-08 Thread joeyli
On Sat, Mar 07, 2015 at 05:59:14PM -0800, David Rientjes wrote: On Sat, 7 Mar 2015, Yinghai Lu wrote: Now we are using memblock to do early resource reserver/allocation instead of using e820 map directly, and setup_data is reserved in memblock early already. Also kexec generate

Re: [PATCH v2 04/15] x86, kaslr: get kaslr_enabled back correctly

2015-03-04 Thread joeyli
Hi Yinghai, On Wed, Mar 04, 2015 at 10:12:58AM -0800, Yinghai Lu wrote: > On Wed, Mar 4, 2015 at 7:54 AM, Jiri Kosina wrote: > > > > > Also this 15-patch series needs to be separated into two patchsets. The > > whole series is not appropriate for -rc3, but this particular one at least > > is a

Re: [PATCH v2 04/15] x86, kaslr: get kaslr_enabled back correctly

2015-03-04 Thread joeyli
Hi Yinghai, On Wed, Mar 04, 2015 at 10:12:58AM -0800, Yinghai Lu wrote: On Wed, Mar 4, 2015 at 7:54 AM, Jiri Kosina jkos...@suse.cz wrote: Also this 15-patch series needs to be separated into two patchsets. The whole series is not appropriate for -rc3, but this particular one at least

Re: [PATCH] x86/mm, hibernate: Fix misjudgment of register setup_data page to nosave region

2015-01-30 Thread joeyli
On Fri, Jan 30, 2015 at 10:46:48PM +0800, joeyli wrote: > On Fri, Jan 30, 2015 at 12:30:00AM -0800, Yinghai Lu wrote: > > On Thu, Jan 29, 2015 at 7:58 PM, Lee, Chun-Yi > > wrote: > > > The reserve setup_data action break usable regions to not align to > >

Re: [PATCH] x86/mm, hibernate: Fix misjudgment of register setup_data page to nosave region

2015-01-30 Thread joeyli
On Fri, Jan 30, 2015 at 12:30:00AM -0800, Yinghai Lu wrote: > On Thu, Jan 29, 2015 at 7:58 PM, Lee, Chun-Yi wrote: > > The reserve setup_data action break usable regions to not align to > > page size. As following case: > > > > BIOS-e820: [mem 0x00088000-0x000b] reserved > >

Re: [PATCH] x86/mm, hibernate: Fix misjudgment of register setup_data page to nosave region

2015-01-30 Thread joeyli
Hi, On Thu, Jan 29, 2015 at 11:35:49PM -0800, Yinghai Lu wrote: > On Thu, Jan 29, 2015 at 7:58 PM, Lee, Chun-Yi wrote: > > > > diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c > > index 49f8864..6eae021 100644 > > --- a/arch/x86/kernel/e820.c > > +++ b/arch/x86/kernel/e820.c > > @@

Re: [PATCH] x86/mm, hibernate: Fix misjudgment of register setup_data page to nosave region

2015-01-30 Thread joeyli
On Fri, Jan 30, 2015 at 10:46:48PM +0800, joeyli wrote: On Fri, Jan 30, 2015 at 12:30:00AM -0800, Yinghai Lu wrote: On Thu, Jan 29, 2015 at 7:58 PM, Lee, Chun-Yi joeyli.ker...@gmail.com wrote: The reserve setup_data action break usable regions to not align to page size. As following

Re: [PATCH] x86/mm, hibernate: Fix misjudgment of register setup_data page to nosave region

2015-01-30 Thread joeyli
Hi, On Thu, Jan 29, 2015 at 11:35:49PM -0800, Yinghai Lu wrote: On Thu, Jan 29, 2015 at 7:58 PM, Lee, Chun-Yi joeyli.ker...@gmail.com wrote: diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 49f8864..6eae021 100644 --- a/arch/x86/kernel/e820.c +++

Re: [PATCH] x86/mm, hibernate: Fix misjudgment of register setup_data page to nosave region

2015-01-30 Thread joeyli
On Fri, Jan 30, 2015 at 12:30:00AM -0800, Yinghai Lu wrote: On Thu, Jan 29, 2015 at 7:58 PM, Lee, Chun-Yi joeyli.ker...@gmail.com wrote: The reserve setup_data action break usable regions to not align to page size. As following case: BIOS-e820: [mem 0x00088000-0x000b]

<    1   2   3   4   5   6   7   8   >