svn commit: r361754 - head/stand/efi/gptboot

Mitchell Horne mhorne at FreeBSD.org
Wed Jun 3 16:38:17 UTC 2020


Author: mhorne
Date: Wed Jun  3 16:38:16 2020
New Revision: 361754
URL: https://svnweb.freebsd.org/changeset/base/361754

Log:
  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

Modified:
  head/stand/efi/gptboot/proto.c

Modified: head/stand/efi/gptboot/proto.c
==============================================================================
--- head/stand/efi/gptboot/proto.c	Wed Jun  3 14:54:54 2020	(r361753)
+++ head/stand/efi/gptboot/proto.c	Wed Jun  3 16:38:16 2020	(r361754)
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
 #include "gpt.h"
 #include <sys/gpt.h>
 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;


More information about the svn-src-all mailing list