From 6071234337ab33255bf9db936466ab198f4d6c9b Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Fri, 12 Apr 2019 10:16:57 +0800 Subject: [PATCH] HV: use term of UUID The code mixed the usage on term of UUID and GUID, now use UUID to make code more consistent, also will use lowercase (i.e. uuid) in variable name definition. Tracked-On: #2291 Signed-off-by: Victor Sun Acked-by: Eddie Dong --- devicemodel/core/vmmapi.c | 2 +- hypervisor/arch/x86/guest/trusty.c | 2 +- hypervisor/arch/x86/guest/vm.c | 4 ++-- hypervisor/common/hypercall.c | 2 +- hypervisor/debug/profiling.c | 4 ++-- hypervisor/include/arch/x86/guest/vm.h | 2 +- hypervisor/include/arch/x86/vm_config.h | 2 +- hypervisor/include/debug/profiling_internal.h | 2 +- hypervisor/include/public/acrn_common.h | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/devicemodel/core/vmmapi.c b/devicemodel/core/vmmapi.c index 202f02faa..ebd3e0b7f 100644 --- a/devicemodel/core/vmmapi.c +++ b/devicemodel/core/vmmapi.c @@ -126,7 +126,7 @@ vm_create(const char *name, uint64_t req_buf) uuid_copy(ctx->vm_uuid, vm_uuid); /* Pass uuid as parameter of create vm*/ - uuid_copy(create_vm.GUID, vm_uuid); + uuid_copy(create_vm.uuid, vm_uuid); ctx->fd = devfd; ctx->lowmem_limit = 2 * GB; diff --git a/hypervisor/arch/x86/guest/trusty.c b/hypervisor/arch/x86/guest/trusty.c index 508ce9829..9fe38f84a 100644 --- a/hypervisor/arch/x86/guest/trusty.c +++ b/hypervisor/arch/x86/guest/trusty.c @@ -331,7 +331,7 @@ static bool setup_trusty_info(struct acrn_vcpu *vcpu, uint32_t mem_size, uint64_ /* Derive dvseed from dseed for Trusty */ if (derive_virtual_seed(&key_info.dseed_list[0U], &key_info.num_seeds, NULL, 0U, - vcpu->vm->GUID, sizeof(vcpu->vm->GUID))) { + vcpu->vm->uuid, sizeof(vcpu->vm->uuid))) { /* Derive encryption key of attestation keybox from dseed */ if (derive_attkb_enc_key(key_info.attkb_enc_key)) { /* Prepare trusty startup param */ diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index 09b95e563..c981a3c3d 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -392,8 +392,8 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_ snprintf(vm_config->name, 16, "ACRN VM_%d", vm_id); } - (void)memcpy_s(&vm->GUID[0], sizeof(vm->GUID), - &vm_config->GUID[0], sizeof(vm_config->GUID)); + (void)memcpy_s(&vm->uuid[0], sizeof(vm->uuid), + &vm_config->uuid[0], sizeof(vm_config->uuid)); if (vm_config->type == PRE_LAUNCHED_VM) { create_prelaunched_vm_e820(vm); diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index ed8d8ec1e..1d6e0a9b6 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -134,7 +134,7 @@ int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param) /* TODO: set by DM */ vm_config->type = NORMAL_VM; vm_config->guest_flags |= cv.vm_flag; - (void)memcpy_s(&vm_config->GUID[0], 16U, &cv.GUID[0], 16U); + (void)memcpy_s(&vm_config->uuid[0], 16U, &cv.uuid[0], 16U); /* GUEST_FLAG_RT must be set if we have GUEST_FLAG_LAPIC_PASSTHROUGH set in guest_flags */ if (((vm_config->guest_flags & GUEST_FLAG_LAPIC_PASSTHROUGH) != 0U) diff --git a/hypervisor/debug/profiling.c b/hypervisor/debug/profiling.c index 7c5c5c627..5e0600e81 100644 --- a/hypervisor/debug/profiling.c +++ b/hypervisor/debug/profiling.c @@ -888,8 +888,8 @@ int32_t profiling_vm_list_info(struct acrn_vm *vm, uint64_t addr) vm_idx++; vm_info_list.vm_list[vm_idx].vm_id_num = tmp_vm->vm_id; - (void)memcpy_s((void *)vm_info_list.vm_list[vm_idx].guid, - 16U, tmp_vm->GUID, 16U); + (void)memcpy_s((void *)vm_info_list.vm_list[vm_idx].uuid, + 16U, tmp_vm->uuid, 16U); snprintf(vm_info_list.vm_list[vm_idx].vm_name, 16U, "vm_%d", tmp_vm->vm_id, 16U); vm_info_list.vm_list[vm_idx].num_vcpus = 0; diff --git a/hypervisor/include/arch/x86/guest/vm.h b/hypervisor/include/arch/x86/guest/vm.h index 3ebdf7a7b..c309ecec1 100644 --- a/hypervisor/include/arch/x86/guest/vm.h +++ b/hypervisor/include/arch/x86/guest/vm.h @@ -137,7 +137,7 @@ struct acrn_vm { io_read_fn_t default_io_read; io_write_fn_t default_io_write; - uint8_t GUID[16]; + uint8_t uuid[16]; struct secure_world_control sworld_control; /* Secure World's snapshot diff --git a/hypervisor/include/arch/x86/vm_config.h b/hypervisor/include/arch/x86/vm_config.h index 46cf78ca5..faa8728a5 100644 --- a/hypervisor/include/arch/x86/vm_config.h +++ b/hypervisor/include/arch/x86/vm_config.h @@ -45,7 +45,7 @@ struct acrn_vm_pci_ptdev_config { struct acrn_vm_config { enum acrn_vm_type type; /* specify the type of VM */ char name[MAX_VM_OS_NAME_LEN]; /* VM name identifier, useful for debug. */ - uint8_t GUID[16]; /* GUID of the VM */ + uint8_t uuid[16]; /* UUID of the VM */ uint64_t pcpu_bitmap; /* from pcpu bitmap, we could know VM core number */ uint64_t guest_flags; /* VM flags that we want to configure for guest * Now we have two flags: diff --git a/hypervisor/include/debug/profiling_internal.h b/hypervisor/include/debug/profiling_internal.h index afbca0c2f..32daffa04 100644 --- a/hypervisor/include/debug/profiling_internal.h +++ b/hypervisor/include/debug/profiling_internal.h @@ -111,7 +111,7 @@ struct profiling_vcpu_pcpu_map { struct profiling_vm_info { uint16_t vm_id_num; - uint8_t guid[16]; + uint8_t uuid[16]; char vm_name[16]; uint16_t num_vcpus; struct profiling_vcpu_pcpu_map cpu_map[CONFIG_MAX_VCPUS_PER_VM]; diff --git a/hypervisor/include/public/acrn_common.h b/hypervisor/include/public/acrn_common.h index 192254015..70454bebb 100644 --- a/hypervisor/include/public/acrn_common.h +++ b/hypervisor/include/public/acrn_common.h @@ -351,8 +351,8 @@ struct acrn_create_vm { /** Reserved */ uint16_t reserved1; - /** the GUID of this VM */ - uint8_t GUID[16]; + /** the UUID of this VM */ + uint8_t uuid[16]; /* VM flag bits from Guest OS, now used * GUEST_FLAG_SECURE_WORLD_ENABLED (1UL<<0)