summary refs log tree commit diff stats
path: root/include/hw/misc/aspeed_hace.h
diff options
context:
space:
mode:
authorJamin Lin <jamin_lin@aspeedtech.com>2025-05-15 16:09:33 +0800
committerCédric Le Goater <clg@redhat.com>2025-05-25 23:39:11 +0200
commitf05cc69c6ce0242e2eeae3cd1513454006b8f040 (patch)
tree59b7008aea60513285934b10d2a6013f7ccf55ff /include/hw/misc/aspeed_hace.h
parentd09c0939c97061fca0faa842184171f2f94b3339 (diff)
downloadfocaccia-qemu-f05cc69c6ce0242e2eeae3cd1513454006b8f040.tar.gz
focaccia-qemu-f05cc69c6ce0242e2eeae3cd1513454006b8f040.zip
hw/misc/aspeed_hace: Remove unused code for better readability
In the previous design of the hash framework, accumulative hashing was not
supported. To work around this limitation, commit 5cd7d85 introduced an
iov_cache array to store all the hash data from firmware.
Once the ASPEED HACE model collected all the data, it passed the iov_cache to
the hash API to calculate the final digest.

However, with commit e3c0752, the hash framework now supports accumulative
hashing. This allows us to refactor the ASPEED HACE model, removing redundant
logic and simplifying the implementation for better readability and
maintainability.

As a result, the iov_count variable is no longer needed—it was previously used
to track how many cached entries were used for hashing.
To maintain VMSTATE compatibility after removing this field, the VMSTATE_VERSION
is bumped to 2

This cleanup follows significant changes in commit 4c1d0af4a28d, making the
model more readable.

- Deleted "iov_cache" and "iov_count" from "AspeedHACEState".
- Removed "reconstruct_iov" function and related logic.
- Simplified "do_hash_operation" by eliminating redundant checks.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250515081008.583578-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include/hw/misc/aspeed_hace.h')
-rw-r--r--include/hw/misc/aspeed_hace.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/include/hw/misc/aspeed_hace.h b/include/hw/misc/aspeed_hace.h
index 5d4aa19cfe..b69a038d35 100644
--- a/include/hw/misc/aspeed_hace.h
+++ b/include/hw/misc/aspeed_hace.h
@@ -31,10 +31,8 @@ struct AspeedHACEState {
     MemoryRegion iomem;
     qemu_irq irq;
 
-    struct iovec iov_cache[ASPEED_HACE_MAX_SG];
     uint32_t regs[ASPEED_HACE_NR_REGS];
     uint32_t total_req_len;
-    uint32_t iov_count;
 
     MemoryRegion *dram_mr;
     AddressSpace dram_as;