Remove padding from memory region constituent.
This was removed from the SPCI spec at some point. This means that the
addresses are no longer 64-bit aligned.
Bug: 132420445
Change-Id: Ic6759041243fcfd77c51e0d12e7441518406b1fd
diff --git a/src/spci_architected_message.c b/src/spci_architected_message.c
index dd24aee..61cd9cf 100644
--- a/src/spci_architected_message.c
+++ b/src/spci_architected_message.c
@@ -227,7 +227,9 @@
}
for (i = 0; i < memory_region->constituent_count; ++i) {
- ipaddr_t begin = ipa_init(constituents[i].address);
+ ipaddr_t begin =
+ ipa_init(spci_memory_region_constituent_get_address(
+ &constituents[i]));
size_t size = constituents[i].page_count * PAGE_SIZE;
ipaddr_t end = ipa_add(begin, size);
uint32_t current_from_mode;
@@ -327,8 +329,9 @@
/* Iterate over the memory region constituents. */
for (uint32_t index = 0; index < memory_constituent_count; index++) {
size_t size = constituents[index].page_count * PAGE_SIZE;
- paddr_t pa_begin =
- pa_from_ipa(ipa_init(constituents[index].address));
+ paddr_t pa_begin = pa_from_ipa(
+ ipa_init(spci_memory_region_constituent_get_address(
+ &constituents[index])));
paddr_t pa_end = pa_add(pa_begin, size);
if (commit) {
@@ -408,7 +411,9 @@
/* Iterate over the memory region constituents. */
for (uint32_t i = 0; i < memory_constituent_count; ++i) {
size_t size = constituents[i].page_count * PAGE_SIZE;
- paddr_t begin = pa_from_ipa(ipa_init(constituents[i].address));
+ paddr_t begin = pa_from_ipa(
+ ipa_init(spci_memory_region_constituent_get_address(
+ &constituents[i])));
paddr_t end = pa_add(begin, size);
if (!clear_memory(begin, end, &local_page_pool)) {
@@ -465,11 +470,10 @@
spci_memory_region_get_constituents(memory_region);
/*
- * Make sure constituents are properly aligned to a 64-bit boundary. If
- * not we would get alignment faults trying to read (64-bit) page
- * addresses.
+ * Make sure constituents are properly aligned to a 32-bit boundary. If
+ * not we would get alignment faults trying to read (32-bit) values.
*/
- if (!is_aligned(constituents, 8)) {
+ if (!is_aligned(constituents, 4)) {
return spci_error(SPCI_INVALID_PARAMETERS);
}