From cadd7992e2cd3d1b6615a584de0751e11454a84e Mon Sep 17 00:00:00 2001 From: Mitchell Horne Date: Wed, 3 Jun 2020 16:38:16 +0000 Subject: [PATCH] gptboot.efi: align secbuf to 4K The u-boot EFI implementation of the ReadBlocks and WriteBlocks methods requires that the provided buffer meet the IO alignment requirements of the underlying disk. Unlike loader.efi, gptboot.efi doesn't check this requirement, and therefore fails to perform a successful read. Adjust secbuf's alignment to 4K in hopes that we will always meet this requirement. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25111 --- stand/efi/gptboot/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/efi/gptboot/proto.c b/stand/efi/gptboot/proto.c index e58313708409..38ccb5023c16 100644 --- a/stand/efi/gptboot/proto.c +++ b/stand/efi/gptboot/proto.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "gpt.h" #include static const uuid_t freebsd_ufs_uuid = GPT_ENT_TYPE_FREEBSD_UFS; -static char secbuf[4096]; +static char secbuf[4096] __aligned(4096); static struct dsk dsk; static dev_info_t *devices = NULL; static dev_info_t *raw_device = NULL;