mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Evgeniy Baskov <baskov@ispras.ru>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Peter Jones <pjones@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Andy Lutomirski <luto@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alexey Khoroshilov <khoroshilov@ispras.ru>,
	"Limonciello, Mario" <mario.limonciello@amd.com>,
	joeyli <jlee@suse.com>,
	lvc-project@linuxtesting.org, x86@kernel.org,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3 00/24] x86_64: Improvements at compressed kernel stage
Date: Wed, 14 Dec 2022 14:49:01 +0300	[thread overview]
Message-ID: <e2c8e3ce6cb7a1aca156186946b22eb0@ispras.ru> (raw)
In-Reply-To: <CAMj1kXEVffE8nm5qP_tGzQ9zGaXP11RtdFQhhwQc_DDyAk6qOw@mail.gmail.com>

On 2022-12-14 13:09, Ard Biesheuvel wrote:
> On Tue, 13 Dec 2022 at 23:16, Evgeniy Baskov <baskov@ispras.ru> wrote:
>> 
>> On 2022-12-13 21:13, Peter Jones wrote:
>> > On Tue, Dec 13, 2022 at 01:03:17PM -0500, Peter Jones wrote:
>> >> On Tue, Nov 22, 2022 at 02:12:09PM +0300, Evgeniy Baskov wrote:
>> >> > This patchset is aimed
>> >> > * to improve UEFI compatibility of compressed kernel code for x86_64
>> >> > * to setup proper memory access attributes for code and rodata sections
>> >> > * to implement W^X protection policy throughout the whole execution
>> >> >   of compressed kernel for EFISTUB code path.
>> >>
>> >> Hi Evgeniy,
>> >>
>> >> I've tested this patch set on hardware and QEMU+MU firmware, and it
>> >> works for me with a couple of minor issues:
>> >>
>> >> - on one machine that has the DXE protocol but not the EFI one, we get
>> >>   an error because the firmware doesn't support EFI_MEMORY_RP
>> >> - on QEMU I'm seeing the size of "(unsigned long)_head - image_base"
>> >>   wind up as 0, which leads to an EFI_INVALID_PARAMETER on the
>> >>   clear_memory_attributes() call.
>> >>
>> >> In both cases the system winds up working, but with unnecessary
>> >> console
>> >> output.
>> >
>> > I just realized I've overstated here - I haven't actually hit the first
>> > problem on x86, only on ARM, where we don't currently use this code.  I
>> > discovered it in grub, and checked your patch set to see if you had the
>> > same issue I did.  That said, "in both cases the system winds up
>> > working" is probably still true - in that the edk2 code supports
>> > EFI_MEMORY_RP on x86 but not ARM, so x86 won't hit the issue when using
>> > DXE unless someone cooks up another implementation.  Nevertheless I
>> > believe the patch to fix it is correct and should be applied.
>> >
>> > Thanks!
>> 
>> Hi,
>> 
>> Thank you for testing and fixes!
>> 
>> I have also discovered one issue with v3, that can only be hit when
>> booting with grub -- there's one kernel_add_identity_map() missing in
>> the get_acpi_srat_table() function, before header->length is read.
>> So I'll prepare the v4 soon and include your new patches there.
>> 
> 
> Happy to see this is converging. Please rebase onto latest mainline as
> well - some cleanups to the early boot code have landed there
> yesterday.

Will do, thanks!

      reply	other threads:[~2022-12-14 11:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 11:12 Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 01/24] x86/boot: Align vmlinuz sections on page size Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 02/24] x86/build: Remove RWX sections and align on 4KB Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 03/24] x86/boot: Set cr0 to known state in trampoline Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 04/24] x86/boot: Increase boot page table size Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 05/24] x86/boot: Support 4KB pages for identity mapping Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 06/24] x86/boot: Setup memory protection for bzImage code Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 07/24] x86/build: Check W^X of vmlinux during build Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 08/24] x86/boot: Map memory explicitly Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 09/24] x86/boot: Remove mapping from page fault handler Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 10/24] efi/libstub: Move helper function to related file Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 11/24] x86/boot: Make console interface more abstract Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 12/24] x86/boot: Make kernel_add_identity_map() a pointer Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 13/24] x86/boot: Split trampoline and pt init code Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 14/24] x86/boot: Add EFI kernel extraction interface Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 15/24] efi/x86: Support extracting kernel from libstub Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 16/24] x86/boot: Reduce lower limit of physical KASLR Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 17/24] x86/boot: Reduce size of the DOS stub Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 18/24] tools/include: Add simplified version of pe.h Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 19/24] x86/build: Cleanup tools/build.c Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 20/24] x86/build: Make generated PE more spec compliant Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 21/24] efi/x86: Explicitly set sections memory attributes Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 22/24] efi/libstub: Add memory attribute protocol definitions Evgeniy Baskov
2023-01-31  8:37   ` Ard Biesheuvel
2023-01-31 10:00     ` Evgeniy Baskov
2023-01-31 10:01       ` Ard Biesheuvel
2022-11-22 11:12 ` [PATCH v3 23/24] efi/libstub: Use memory attribute protocol Evgeniy Baskov
2022-11-22 11:12 ` [PATCH v3 24/24] efi/libstub: Make memory protection warnings include newlines Evgeniy Baskov
2022-12-13 18:03 ` [PATCH v3 00/24] x86_64: Improvements at compressed kernel stage Peter Jones
2022-12-13 18:04   ` [PATCH 1/2] efi/x86: don't set unsupported memory attributes Peter Jones
2022-12-13 18:04     ` [PATCH 2/2] efi/x86: don't try to set page attributes on 0-sized regions Peter Jones
2022-12-13 18:13   ` [PATCH v3 00/24] x86_64: Improvements at compressed kernel stage Peter Jones
2022-12-13 22:16     ` Evgeniy Baskov
2022-12-14 10:09       ` Ard Biesheuvel
2022-12-14 11:49         ` Evgeniy Baskov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e2c8e3ce6cb7a1aca156186946b22eb0@ispras.ru \
    --to=baskov@ispras.ru \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=jlee@suse.com \
    --cc=khoroshilov@ispras.ru \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pjones@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®