diff options
author | Joel Kitching <kitching@google.com> | 2019-11-05 18:36:42 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-13 14:45:18 +0000 |
commit | 92ea19ae091482484c84d7b09049f7dc74bf6f42 (patch) | |
tree | 9bf82bffc462019bfc9e2b496d923dd070f4efad /tests | |
parent | c48a593b26d2353eb8788dd85ba8618555180f55 (diff) | |
download | vboot-92ea19ae091482484c84d7b09049f7dc74bf6f42.tar.gz |
vboot: align workbuf to VB2_WORKBUF_ALIGN
Also standardize on position and spacing of __attribute__.
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Ic61d6193c2413824837a51af98eb2dcd9ea4ab85
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1902843
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'tests')
33 files changed, 51 insertions, 41 deletions
diff --git a/tests/vb20_api_kernel_tests.c b/tests/vb20_api_kernel_tests.c index a512201a..646f8ec4 100644 --- a/tests/vb20_api_kernel_tests.c +++ b/tests/vb20_api_kernel_tests.c @@ -19,7 +19,7 @@ /* Common context for tests */ static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_fw_preamble *fwpre; diff --git a/tests/vb20_common2_tests.c b/tests/vb20_common2_tests.c index 8f8b11ac..e938d79c 100644 --- a/tests/vb20_common2_tests.c +++ b/tests/vb20_common2_tests.c @@ -83,7 +83,7 @@ static void test_verify_data(const struct vb2_packed_key *key1, const struct vb2_signature *sig) { uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; struct vb2_public_key pubk, pubk_orig; diff --git a/tests/vb20_common3_tests.c b/tests/vb20_common3_tests.c index fb787d1f..2b0d1145 100644 --- a/tests/vb20_common3_tests.c +++ b/tests/vb20_common3_tests.c @@ -141,7 +141,7 @@ static void test_verify_keyblock(const struct vb2_public_key *public_key, const struct vb2_packed_key *data_key) { uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; struct vb2_keyblock *hdr; struct vb2_keyblock *h; @@ -206,7 +206,7 @@ static void test_verify_fw_preamble(struct vb2_packed_key *public_key, struct vb2_fw_preamble *h; struct vb2_public_key rsa; uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; uint32_t hsize; @@ -348,7 +348,7 @@ static void test_verify_kernel_preamble( struct vb2_public_key rsa; // TODO: how many workbuf bytes? uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; uint32_t hsize; diff --git a/tests/vb20_kernel_tests.c b/tests/vb20_kernel_tests.c index 5099cfd8..73cb3729 100644 --- a/tests/vb20_kernel_tests.c +++ b/tests/vb20_kernel_tests.c @@ -19,7 +19,7 @@ /* Common context for tests */ static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_workbuf wb; static struct vb2_context *ctx; static struct vb2_shared_data *sd; diff --git a/tests/vb20_misc_tests.c b/tests/vb20_misc_tests.c index 5531f59c..73fae538 100644 --- a/tests/vb20_misc_tests.c +++ b/tests/vb20_misc_tests.c @@ -19,7 +19,7 @@ /* Common context for tests */ static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vb20_rsa_padding_tests.c b/tests/vb20_rsa_padding_tests.c index 78fd05b2..be9d91b5 100644 --- a/tests/vb20_rsa_padding_tests.c +++ b/tests/vb20_rsa_padding_tests.c @@ -21,7 +21,7 @@ static void test_signatures(const struct vb2_public_key *key) { uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); uint8_t sig[RSA1024NUMBYTES]; struct vb2_workbuf wb; int unexpected_success; @@ -54,7 +54,7 @@ static void test_signatures(const struct vb2_public_key *key) */ static void test_verify_digest(struct vb2_public_key *key) { uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); uint8_t sig[RSA1024NUMBYTES]; struct vb2_workbuf wb; enum vb2_signature_algorithm orig_key_alg = key->sig_alg; diff --git a/tests/vb20_verify_fw.c b/tests/vb20_verify_fw.c index 52d24489..e7058054 100644 --- a/tests/vb20_verify_fw.c +++ b/tests/vb20_verify_fw.c @@ -145,7 +145,7 @@ static void print_help(const char *progname) int main(int argc, char *argv[]) { - uint8_t workbuf[16384] __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + uint8_t workbuf[16384] __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_context *ctx; struct vb2_shared_data *sd; vb2_error_t rv; diff --git a/tests/vb21_api_tests.c b/tests/vb21_api_tests.c index 5daeddb4..21de87d3 100644 --- a/tests/vb21_api_tests.c +++ b/tests/vb21_api_tests.c @@ -21,7 +21,7 @@ /* Common context for tests */ static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; diff --git a/tests/vb21_common2_tests.c b/tests/vb21_common2_tests.c index 448d3372..b98b1ac8 100644 --- a/tests/vb21_common2_tests.c +++ b/tests/vb21_common2_tests.c @@ -170,7 +170,7 @@ static void test_verify_data(const struct vb2_public_key *pubk_orig, const struct vb21_signature *sig) { uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; struct vb2_public_key pubk; diff --git a/tests/vb21_common_tests.c b/tests/vb21_common_tests.c index 797c934a..94fceadc 100644 --- a/tests/vb21_common_tests.c +++ b/tests/vb21_common_tests.c @@ -220,7 +220,7 @@ static void test_verify_hash(void) const struct vb2_private_key *prik; struct vb2_public_key pubk; uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; vb2_workbuf_init(&wb, workbuf, sizeof(workbuf)); @@ -260,7 +260,7 @@ static void test_verify_keyblock(void) uint8_t *buf, *buf2; uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; TEST_SUCC(vb2_public_key_hash(&pubk, VB2_HASH_SHA256), @@ -387,7 +387,7 @@ static void test_verify_fw_preamble(void) uint8_t *buf, *buf2; uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; /* diff --git a/tests/vb21_host_fw_preamble_tests.c b/tests/vb21_host_fw_preamble_tests.c index d46fd05b..c93f714f 100644 --- a/tests/vb21_host_fw_preamble_tests.c +++ b/tests/vb21_host_fw_preamble_tests.c @@ -37,7 +37,7 @@ static void preamble_tests(const char *keys_dir) int i; uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; vb2_workbuf_init(&wb, workbuf, sizeof(workbuf)); diff --git a/tests/vb21_host_keyblock_tests.c b/tests/vb21_host_keyblock_tests.c index 451e3d3e..3a5f0f58 100644 --- a/tests/vb21_host_keyblock_tests.c +++ b/tests/vb21_host_keyblock_tests.c @@ -29,7 +29,7 @@ static void keyblock_tests(const char *keys_dir) const char test_desc[] = "Test keyblock"; uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; vb2_workbuf_init(&wb, workbuf, sizeof(workbuf)); diff --git a/tests/vb21_host_sig_tests.c b/tests/vb21_host_sig_tests.c index f275d2f3..b116c5ce 100644 --- a/tests/vb21_host_sig_tests.c +++ b/tests/vb21_host_sig_tests.c @@ -47,7 +47,7 @@ static void sig_tests(const struct alg_combo *combo, uint32_t size; uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_workbuf wb; uint8_t *buf; diff --git a/tests/vb21_misc_tests.c b/tests/vb21_misc_tests.c index f86d3f2e..f76ff292 100644 --- a/tests/vb21_misc_tests.c +++ b/tests/vb21_misc_tests.c @@ -18,7 +18,7 @@ /* Common context for tests */ static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vb2_api_tests.c b/tests/vb2_api_tests.c index 40cd160e..a7143b7f 100644 --- a/tests/vb2_api_tests.c +++ b/tests/vb2_api_tests.c @@ -21,7 +21,7 @@ /* Common context for tests */ static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vb2_common_tests.c b/tests/vb2_common_tests.c index 61ce1338..11c97635 100644 --- a/tests/vb2_common_tests.c +++ b/tests/vb2_common_tests.c @@ -148,7 +148,7 @@ static void test_align(void) */ static void test_workbuf(void) { - uint64_t buf[8] __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + uint64_t buf[8] __attribute__((aligned(VB2_WORKBUF_ALIGN))); uint8_t *p0 = (uint8_t *)buf, *ptr; struct vb2_workbuf wb; diff --git a/tests/vb2_ec_sync_tests.c b/tests/vb2_ec_sync_tests.c index ecc00f37..a9060b00 100644 --- a/tests/vb2_ec_sync_tests.c +++ b/tests/vb2_ec_sync_tests.c @@ -48,7 +48,8 @@ static int mock_ec_rw_hash_size; static uint8_t want_ec_hash[32]; static uint8_t update_hash; static int want_ec_hash_size; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vb2_gbb_tests.c b/tests/vb2_gbb_tests.c index 25691643..047fa423 100644 --- a/tests/vb2_gbb_tests.c +++ b/tests/vb2_gbb_tests.c @@ -15,7 +15,8 @@ static struct vb2_gbb_header *gbb = (struct vb2_gbb_header *)gbb_data; static struct vb2_packed_key *rootkey; static struct vb2_context *ctx; static struct vb2_workbuf wb; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static void set_gbb_hwid(const char *hwid, size_t size) { diff --git a/tests/vb2_keyblock_fuzzer.c b/tests/vb2_keyblock_fuzzer.c index 53f2e7c5..9996afaf 100644 --- a/tests/vb2_keyblock_fuzzer.c +++ b/tests/vb2_keyblock_fuzzer.c @@ -11,8 +11,8 @@ #include "vboot_test.h" static struct vb2_context *ctx; -__attribute__((aligned(VB2_WORKBUF_ALIGN))) -static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct { struct vb2_gbb_header h; uint8_t rootkey[4096]; diff --git a/tests/vb2_misc_tests.c b/tests/vb2_misc_tests.c index 26cf21e3..5f2b6c85 100644 --- a/tests/vb2_misc_tests.c +++ b/tests/vb2_misc_tests.c @@ -15,9 +15,9 @@ /* Common context for tests */ static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static uint8_t workbuf2[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vb2_nvstorage_tests.c b/tests/vb2_nvstorage_tests.c index 9909d7c4..269caa21 100644 --- a/tests/vb2_nvstorage_tests.c +++ b/tests/vb2_nvstorage_tests.c @@ -82,7 +82,7 @@ static void nv_storage_test(uint32_t ctxflags) struct nv_field *vnf; uint8_t goodcrc; uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); struct vb2_context *ctx; TEST_SUCC(vb2api_init(workbuf, sizeof(workbuf), &ctx), diff --git a/tests/vb2_preamble_fuzzer.c b/tests/vb2_preamble_fuzzer.c index edc429a4..9568f45f 100644 --- a/tests/vb2_preamble_fuzzer.c +++ b/tests/vb2_preamble_fuzzer.c @@ -12,8 +12,8 @@ #include "vboot_test.h" static struct vb2_context *ctx; -__attribute__((aligned(VB2_WORKBUF_ALIGN))) -static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static const uint8_t *mock_preamble; static size_t mock_preamble_size; diff --git a/tests/vb2_secdata_firmware_tests.c b/tests/vb2_secdata_firmware_tests.c index 68a5ce21..c2d8e273 100644 --- a/tests/vb2_secdata_firmware_tests.c +++ b/tests/vb2_secdata_firmware_tests.c @@ -16,7 +16,7 @@ #include "vboot_common.h" static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_secdata_firmware *sec; diff --git a/tests/vb2_secdata_fwmp_tests.c b/tests/vb2_secdata_fwmp_tests.c index 6c433db5..699f3fa7 100644 --- a/tests/vb2_secdata_fwmp_tests.c +++ b/tests/vb2_secdata_fwmp_tests.c @@ -12,7 +12,7 @@ #include "test_common.h" static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_gbb_header gbb; static struct vb2_shared_data *sd; diff --git a/tests/vb2_secdata_kernel_tests.c b/tests/vb2_secdata_kernel_tests.c index d4ad3d2f..44d0603a 100644 --- a/tests/vb2_secdata_kernel_tests.c +++ b/tests/vb2_secdata_kernel_tests.c @@ -16,7 +16,7 @@ #include "vboot_common.h" static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE] - __attribute__ ((aligned (VB2_WORKBUF_ALIGN))); + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_secdata_kernel *sec; diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c index 03454890..6cbcedec 100644 --- a/tests/vboot_api_devmode_tests.c +++ b/tests/vboot_api_devmode_tests.c @@ -92,7 +92,8 @@ test_case_t test[] = { }; /* Mock data */ -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c index 627a804c..2017b419 100644 --- a/tests/vboot_api_kernel2_tests.c +++ b/tests/vboot_api_kernel2_tests.c @@ -25,7 +25,8 @@ static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE]; static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data; static LoadKernelParams lkp; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c index ed0758f8..584a134e 100644 --- a/tests/vboot_api_kernel4_tests.c +++ b/tests/vboot_api_kernel4_tests.c @@ -24,7 +24,8 @@ #include "vboot_struct.h" /* Mock data */ -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_context ctx_nvram_backend; static struct vb2_shared_data *sd; diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c index 35d8ee9d..b5586801 100644 --- a/tests/vboot_api_kernel_tests.c +++ b/tests/vboot_api_kernel_tests.c @@ -302,7 +302,8 @@ static const char *got_find_disk; static const char *got_load_disk; static uint32_t got_return_val; static uint32_t got_external_mismatch; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; /** diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c index 5e040753..7ff49ee8 100644 --- a/tests/vboot_detach_menu_tests.c +++ b/tests/vboot_detach_menu_tests.c @@ -27,7 +27,8 @@ static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE]; static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data; static LoadKernelParams lkp; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; static struct vb2_gbb_header gbb; diff --git a/tests/vboot_display_tests.c b/tests/vboot_display_tests.c index 592c7850..58ccda07 100644 --- a/tests/vboot_display_tests.c +++ b/tests/vboot_display_tests.c @@ -27,7 +27,8 @@ static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data; static char debug_info[4096]; static struct vb2_context *ctx; static struct vb2_shared_data *sd; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static uint32_t mock_localization_count; static uint32_t mock_altfw_mask; diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c index 3273b9f9..b43a2acd 100644 --- a/tests/vboot_kernel_tests.c +++ b/tests/vboot_kernel_tests.c @@ -70,7 +70,8 @@ static GptHeader *mock_gpt_primary = static GptHeader *mock_gpt_secondary = (GptHeader*)&mock_disk[MOCK_SECTOR_SIZE * (MOCK_SECTOR_COUNT - 1)]; static uint8_t mock_digest[VB2_SHA256_DIGEST_SIZE] = {12, 34, 56, 78}; -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_packed_key mock_key; diff --git a/tests/verify_kernel.c b/tests/verify_kernel.c index fffd102c..051e629d 100644 --- a/tests/verify_kernel.c +++ b/tests/verify_kernel.c @@ -19,7 +19,8 @@ #include "vboot_api.h" #include "vboot_kernel.h" -static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]; +static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] + __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; static struct vb2_shared_data *sd; |