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

2015-08-19 Thread Matt Fleming
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 page table between boot kernel and image kernel. Hey Joey, did

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] 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

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

2015-07-30 Thread Matt Fleming
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 is the workaround of some buggy BIOS. But why should kernel mapping Boot regions

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

2015-07-30 Thread Matt Fleming
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 space and calling SetVirtualAddressMap() on hibernate resume there is no

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

2015-07-30 Thread Matt Fleming
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-aa0d-00e098032b8c Killed [ 257.856185] BUG: unable to handle kernel

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 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 is the

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

2015-07-30 Thread H. Peter Anvin
On 07/29/2015 09:32 PM, Lee, Chun-Yi wrote: When testing hibernate, I found the EFI runtime services was broken on some old EFI machines on my hand, Intel DQ57TM development board and Acer Gateway Z5WT2 notebook. After printing the EFI memmap and virtual address mapping on -4G area, found

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

2015-07-30 Thread Borislav Petkov
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 1 GB will be sufficient forever. Right, before we do anything, I'd like for us to figure out first why this is a problem

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

2015-07-30 Thread Matt Fleming
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 1 GB will be sufficient forever. Right, before we do

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

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

2015-07-29 Thread Lee, Chun-Yi
When testing hibernate, I found the EFI runtime services was broken on some old EFI machines on my hand, Intel DQ57TM development board and Acer Gateway Z5WT2 notebook. After printing the EFI memmap and virtual address mapping on -4G area, found those issue machines keep the physical address of