[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/40] hw/i386/sgx: Have sgx_epc_get_section() return a boolean
From: |
Paolo Bonzini |
Subject: |
[PULL 33/40] hw/i386/sgx: Have sgx_epc_get_section() return a boolean |
Date: |
Wed, 13 Oct 2021 11:07:21 +0200 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007175612.496366-3-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/sgx-stub.c | 2 +-
hw/i386/sgx.c | 6 +++---
include/hw/i386/sgx-epc.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c
index 3be9f5ca32..45c473119e 100644
--- a/hw/i386/sgx-stub.c
+++ b/hw/i386/sgx-stub.c
@@ -20,7 +20,7 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState));
}
-int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
+bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
{
g_assert_not_reached();
}
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index e481e9358f..29724ff8f0 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -115,13 +115,13 @@ SGXInfo *sgx_get_info(Error **errp)
return info;
}
-int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
+bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
{
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
SGXEPCDevice *epc;
if (pcms->sgx_epc.size == 0 || pcms->sgx_epc.nr_sections <= section_nr) {
- return 1;
+ return true;
}
epc = pcms->sgx_epc.sections[section_nr];
@@ -129,7 +129,7 @@ int sgx_epc_get_section(int section_nr, uint64_t *addr,
uint64_t *size)
*addr = epc->addr;
*size = memory_device_get_region_size(MEMORY_DEVICE(epc), &error_fatal);
- return 0;
+ return false;
}
void pc_machine_init_sgx_epc(PCMachineState *pcms)
diff --git a/include/hw/i386/sgx-epc.h b/include/hw/i386/sgx-epc.h
index 65a68ca753..a6a65be854 100644
--- a/include/hw/i386/sgx-epc.h
+++ b/include/hw/i386/sgx-epc.h
@@ -55,7 +55,7 @@ typedef struct SGXEPCState {
int nr_sections;
} SGXEPCState;
-int sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size);
+bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size);
static inline uint64_t sgx_epc_above_4g_end(SGXEPCState *sgx_epc)
{
--
2.31.1
- [PULL 37/40] monitor: Tidy up find_device_state(), (continued)
[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
[PULL 33/40] hw/i386/sgx: Have sgx_epc_get_section() return a boolean,
Paolo Bonzini <=
[PULL 40/40] ebpf: really include it only in system emulators, Paolo Bonzini, 2021/10/13
Re: [PULL 00/40] Misc patches for 2021-10-13, Richard Henderson, 2021/10/13