Re: [PATCH v2 2/2] efi: fix build error redeclaration of enumerator

2019-02-13 Thread Anders Roxell
On Tue, 12 Feb 2019 at 12:21, Anders Roxell wrote: > > Commit a893ea15d764 ("tpm: move tpm_chip definition to > include/linux/tpm.h") introduced a build error when both ima and efi is > enabled. What happens is that both headers (ima.h and efi.h) defines the > same 'NONE' constant, and it broke

Re: [PATCH 1/5] tpm: Copy calc_tpm2_event_size() to TPM library

2019-02-13 Thread Jarkko Sakkinen
On Mon, Feb 11, 2019 at 03:30:48PM +0100, b...@semihalf.com wrote: > From: Bartosz Szczepanek > > Function to calculate event size in TPM 2.0 log will also be needed in EFI > stub. Separate it to library to make it accessible out of TPM character > driver. > > It will be removed from tpm2.c in

Re: [PATCH 3/5] tpm: Use library version of calc_tpm2_event_size in sysfs code

2019-02-13 Thread Jarkko Sakkinen
On Mon, Feb 11, 2019 at 03:30:50PM +0100, b...@semihalf.com wrote: > From: Bartosz Szczepanek > > Expect negative values from calc_tpm2_event_size as error codes. > Pass efispecid instead of event header to calc_tpm2_event_size. > > Also, include tpm library in the build. > > Signed-off-by:

Re: [PATCH 1/5] tpm: Copy calc_tpm2_event_size() to TPM library

2019-02-13 Thread Jarkko Sakkinen
On Wed, Feb 13, 2019 at 01:14:43PM +0200, Jarkko Sakkinen wrote: > On Mon, Feb 11, 2019 at 03:30:48PM +0100, b...@semihalf.com wrote: > > From: Bartosz Szczepanek > > > > Function to calculate event size in TPM 2.0 log will also be needed in EFI > > stub. Separate it to library to make it

Re: [PATCH 2/5] tpm: Change calc_tpm2_event_size signature

2019-02-13 Thread Jarkko Sakkinen
On Mon, Feb 11, 2019 at 03:30:49PM +0100, b...@semihalf.com wrote: > From: Bartosz Szczepanek > > Pass tcg_efi_specid_event as an argument instead of tcg_pcr_event, as the > former is what is actually needed to compute event size. tcg_pcr_event > structure describes TPM event log header (even

Re: [PATCH 4/5] efi/libstub/tpm: Retrieve TPM event log in 2.0 format

2019-02-13 Thread Jarkko Sakkinen
On Mon, Feb 11, 2019 at 03:30:51PM +0100, b...@semihalf.com wrote: > From: Bartosz Szczepanek > > Currently, the only way to get TPM 2.0 event log from firmware is to use > device tree. Introduce efi_retrieve_tpm2_eventlog_2 function to enable > retrieving it from EFI structures. > > Include

[PATCH 1/2] arm64: account for GICv3 LPI tables in static memblock reserve table

2019-02-13 Thread Ard Biesheuvel
In the irqchip and EFI code, we have what basically amounts to a quirk to work around a peculiarity in the GICv3 architecture, which permits the system memory address of LPI tables to be programmable only once after a CPU reset. This means kexec kernels must use the same memory as the first

[PATCH 2/2] efi/arm: Revert "Defer persistent reservations until after paging_init()"

2019-02-13 Thread Ard Biesheuvel
This reverts commit eff896288872d687d9662000ec9ae11b6d61766f, which deferred the processing of persistent memory reservations to a point where the memory may have already been allocated and overwritten, defeating the purpose. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/setup.c

[PATCH 0/2] efi/arm/gicv3: implement fix for memory reservation issue

2019-02-13 Thread Ard Biesheuvel
Another attempt at fixing the chicked-and-egg issue where the number of memblock reservations for GICv3 LPI tables overflow the statically allocated table, and reallocating it involves allocating memory pages that may turn out to be the ones we were attempting to reserve in the first place. If

Re: [PATCH 4/5] efi/libstub/tpm: Retrieve TPM event log in 2.0 format

2019-02-13 Thread Bartosz Szczepanek
On Wed, Feb 13, 2019 at 12:26 PM Jarkko Sakkinen wrote: > Collides with Matthew's changes. I want to land those change first > because they are almost production ready. > > Maybe you should consider reviewing those changes to make sure that > they make sense to you so that you can build these on

Re: [PATCH 4/5] efi/libstub/tpm: Retrieve TPM event log in 2.0 format

2019-02-13 Thread Ard Biesheuvel
On Wed, 13 Feb 2019 at 15:21, Bartosz Szczepanek wrote: > > On Wed, Feb 13, 2019 at 12:26 PM Jarkko Sakkinen > wrote: > > Collides with Matthew's changes. I want to land those change first > > because they are almost production ready. > > > > Maybe you should consider reviewing those changes to

[Patch v3 3/4] x86/platform/UV: use efi_enabled() instead of test_bit()

2019-02-13 Thread Hedi Berriche
Use ad hoc efi_enabled() instead of fiddling with test_bit(). Cleanup, no functional changes. Cc: Russ Anderson Cc: Mike Travis Cc: Dimitri Sivanich Cc: Steve Wahl Cc: sta...@vger.kernel.org # v4.9+ Signed-off-by: Hedi Berriche --- arch/x86/platform/uv/bios_uv.c | 2 +- 1 file changed, 1

[Patch v3 1/4] x86/platform/UV: remove unnecessary #ifdef CONFIG_EFI

2019-02-13 Thread Hedi Berriche
CONFIG_EFI is implied by CONFIG_X86_UV and x86/platform/uv/bios_uv.c requires the latter, get rid of the redundant #ifdef CONFIG_EFI directives. Cleanup, no functional changes. Cc: Russ Anderson Cc: Mike Travis Cc: Dimitri Sivanich Cc: Steve Wahl Cc: sta...@vger.kernel.org # v4.9+

[Patch v3 0/4] Protect against concurrent calls into UV BIOS

2019-02-13 Thread Hedi Berriche
- Changes since v2 Addressed comments from Ard Biesheuvel: * expose efi_runtime_lock to UV platform only instead of globally * remove unnecessary #ifdef CONFIG_EFI from bios_uv.c - Changes since v1: Addressed comments from Bhupesh Sharma, Thomas Gleixner, and Ard Biesheuvel: * made

[Patch v3 2/4] x86/platform/UV: kill uv_bios_call_reentrant()

2019-02-13 Thread Hedi Berriche
uv_bios_call_reentrant() has no callers nor is it exported, kill it. Cleanup, no functional changes. Cc: Russ Anderson Cc: Mike Travis Cc: Dimitri Sivanich Cc: Steve Wahl Cc: sta...@vger.kernel.org # v4.9+ Signed-off-by: Hedi Berriche --- arch/x86/include/asm/uv/bios.h | 1 -

[Patch v3 4/4] x86/platform/UV: use efi_runtime_lock to serialise BIOS calls

2019-02-13 Thread Hedi Berriche
Calls into UV firmware must be protected against concurrency, expose the efi_runtime_lock to the UV platform, and use it to serialise UV BIOS calls. Cc: Russ Anderson Cc: Mike Travis Cc: Dimitri Sivanich Cc: Steve Wahl Cc: sta...@vger.kernel.org # v4.9+ Signed-off-by: Hedi Berriche ---

[PATCH v3 1/2] ima: fix build error redeclaration of enumerator

2019-02-13 Thread Anders Roxell
Commit a893ea15d764 ("tpm: move tpm_chip definition to include/linux/tpm.h") introduced a build error when both ima and efi is enabled. What happens is that both headers (ima.h and efi.h) defines the same 'NONE' constant, and it broke when they started getting included from the same file. In file

[PATCH v3 2/2] efi: fix build error redeclaration of enumerator

2019-02-13 Thread Anders Roxell
Commit a893ea15d764 ("tpm: move tpm_chip definition to include/linux/tpm.h") introduced a build error when both ima and efi is enabled. What happens is that both headers (ima.h and efi.h) defines the same 'NONE' constant, and it broke when they started getting included from the same file. In file