[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/40] hvf: Determine slot count from struct layout
From: |
Paolo Bonzini |
Subject: |
[PULL 31/40] hvf: Determine slot count from struct layout |
Date: |
Wed, 13 Oct 2021 11:07:19 +0200 |
From: Alexander Graf <agraf@csgraf.de>
We can handle up to a static amount of memory slots, capped by the size of
an internal array.
Let's make sure that array size is the only source of truth for the number
of elements in that array.
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211008054616.43828-1-agraf@csgraf.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
accel/hvf/hvf-accel-ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index 6cbd2c3f97..2b2c411076 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -321,7 +321,7 @@ static int hvf_accel_init(MachineState *ms)
s = g_new0(HVFState, 1);
- s->num_slots = 32;
+ s->num_slots = ARRAY_SIZE(s->slots);
for (x = 0; x < s->num_slots; ++x) {
s->slots[x].size = 0;
s->slots[x].slot_id = x;
--
2.31.1
- [PULL 12/40] target/i386/cpu: Add missing 'qapi/error.h' header, (continued)
- [PULL 12/40] target/i386/cpu: Add missing 'qapi/error.h' header, Paolo Bonzini, 2021/10/13
- [PULL 13/40] target/i386/sev_i386.h: Remove unused headers, Paolo Bonzini, 2021/10/13
- [PULL 18/40] target/i386/sev: Restrict SEV to system emulation, Paolo Bonzini, 2021/10/13
- [PULL 16/40] target/i386/sev: sev_get_attestation_report use g_autofree, Paolo Bonzini, 2021/10/13
- [PULL 24/40] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c, Paolo Bonzini, 2021/10/13
- [PULL 27/40] monitor: Reduce hmp_info_sev() declaration, Paolo Bonzini, 2021/10/13
- [PULL 23/40] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c, Paolo Bonzini, 2021/10/13
- [PULL 39/40] target/i386/sev: Use local variable for kvm_sev_launch_measure, Paolo Bonzini, 2021/10/13
- [PULL 34/40] hw/i386/sgx: Move qmp_query_sgx_capabilities() to hw/i386/sgx.c, Paolo Bonzini, 2021/10/13
- [PULL 35/40] hw/i386/sgx: Move qmp_query_sgx() and hmp_info_sgx() to hw/i386/sgx.c, Paolo Bonzini, 2021/10/13
- [PULL 31/40] hvf: Determine slot count from struct layout,
Paolo Bonzini <=
- [PULL 37/40] monitor: Tidy up find_device_state(), Paolo Bonzini, 2021/10/13
- Re: [PULL 37/40] monitor: Tidy up find_device_state(), Markus Armbruster, 2021/10/18
- Re: [PULL 37/40] monitor: Tidy up find_device_state(), Markus Armbruster, 2021/10/19
[PULL 32/40] MAINTAINERS: Cover SGX documentation file with X86/KVM section, Paolo Bonzini, 2021/10/13
[PULL 36/40] Revert "hw/misc: applesmc: use host osk as default on macs", Paolo Bonzini, 2021/10/13
[PULL 38/40] target/i386/sev: Use local variable for kvm_sev_launch_start, Paolo Bonzini, 2021/10/13