From c0554f9d995037362584ca330c4a0aca2dfefcc4 Mon Sep 17 00:00:00 2001 From: Liu Long Date: Fri, 29 Oct 2021 19:37:46 +0800 Subject: [PATCH] ACRN: misc: Unify terminology for uos in macro Rename uos_rpmb_size to user_vm_rpmb_size. rename get_uos_count to get_user_vm_count. rename get_uos_id to get_user_vmid. rename uos_id to user_vmid. Tracked-On: #6744 Signed-off-by: Liu Long Reviewed-by: Geoffroy Van Cutsem --- devicemodel/core/pm_vuart.c | 2 +- devicemodel/hw/pci/core.c | 2 +- devicemodel/hw/pci/virtio/virtio_console.c | 4 +-- devicemodel/hw/pci/virtio/virtio_rpmb.c | 2 +- devicemodel/hw/pci/wdt_i6300esb.c | 2 +- devicemodel/hw/platform/rpmb/rpmb_backend.c | 28 ++++++++++----------- devicemodel/include/att_keybox.h | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/devicemodel/core/pm_vuart.c b/devicemodel/core/pm_vuart.c index 15aaee26a..6af320efe 100644 --- a/devicemodel/core/pm_vuart.c +++ b/devicemodel/core/pm_vuart.c @@ -332,7 +332,7 @@ static int vm_stop_handler(void *arg) pthread_mutex_unlock(&pm_vuart_lock); if (ret != sizeof(SHUTDOWN_CMD)) { /* no need to resend shutdown here, will resend in pm_monitor thread */ - pr_err("send shutdown command to uos failed\r\n"); + pr_err("send shutdown command to User VM failed\r\n"); } return 0; diff --git a/devicemodel/hw/pci/core.c b/devicemodel/hw/pci/core.c index 66b0c0b0a..eeac295d3 100644 --- a/devicemodel/hw/pci/core.c +++ b/devicemodel/hw/pci/core.c @@ -701,7 +701,7 @@ update_bar_address(struct vmctx *ctx, struct pci_vdev *dev, uint64_t addr, * need remove pcibar_type != PCIBAR_IO condition */ if(type != PCIBAR_IO && ctx->gvt_enabled) - /* uos kernel may update gvt bars' value, + /* User VM kernel may update gvt bars' value, * but ACRN-DM doesn't know this update. * When other pci devices write bar address, * ACRN-DM need update vgpu bars' info. diff --git a/devicemodel/hw/pci/virtio/virtio_console.c b/devicemodel/hw/pci/virtio/virtio_console.c index 75dbe6a88..2fc42af8f 100644 --- a/devicemodel/hw/pci/virtio/virtio_console.c +++ b/devicemodel/hw/pci/virtio/virtio_console.c @@ -487,7 +487,7 @@ virtio_console_backend_read(int fd __attribute__((unused)), if (len == -1 && errno == EAGAIN) return; - /* when client uos reboot or shutdown, + /* when client User VM reboot or shutdown, * be->fd will be closed, then the return * value of readv function will be 0 */ if (len == 0 || errno == ECONNRESET) @@ -667,7 +667,7 @@ virtio_console_accept_new_connection(int fd __attribute__((unused)), addr.sun_path[sizeof(addr.sun_path) - 1] = '\0'; len = sizeof(addr); - /* be->server_fd is kept for client uos reconnect again */ + /* be->server_fd is kept for client User VM reconnect again */ accepted_fd = accept(be->server_fd, (struct sockaddr *)&addr, &len); if (accepted_fd == -1) { WPRINTF(("accept error= %d, addr.sun_path=%s\n", errno, addr.sun_path)); diff --git a/devicemodel/hw/pci/virtio/virtio_rpmb.c b/devicemodel/hw/pci/virtio/virtio_rpmb.c index 24dee10e7..f7b83910c 100644 --- a/devicemodel/hw/pci/virtio/virtio_rpmb.c +++ b/devicemodel/hw/pci/virtio/virtio_rpmb.c @@ -746,7 +746,7 @@ virtio_rpmb_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) rc = get_virt_rpmb_key(); if (rc == 0) { - DPRINTF(("%s: get uos key failed!\n", __func__)); + DPRINTF(("%s: get User VM key failed!\n", __func__)); goto out; } diff --git a/devicemodel/hw/pci/wdt_i6300esb.c b/devicemodel/hw/pci/wdt_i6300esb.c index 8e13e382a..8b6977822 100644 --- a/devicemodel/hw/pci/wdt_i6300esb.c +++ b/devicemodel/hw/pci/wdt_i6300esb.c @@ -134,7 +134,7 @@ wdt_expired_handler(void *arg, uint64_t nexp) wdt_state.stage = 1; wdt_timeout = 1; - /* watchdog timer out, set the uos to reboot */ + /* watchdog timer out, set the User VM to reboot */ #ifdef DM_DEBUG pr_info("%s: setting VM state to %s\n", __func__, vm_state_to_str(VM_SUSPEND_SYSTEM_RESET)); vm_set_suspend_mode(VM_SUSPEND_SYSTEM_RESET); diff --git a/devicemodel/hw/platform/rpmb/rpmb_backend.c b/devicemodel/hw/platform/rpmb/rpmb_backend.c index 66b254a86..21742c443 100644 --- a/devicemodel/hw/platform/rpmb/rpmb_backend.c +++ b/devicemodel/hw/platform/rpmb/rpmb_backend.c @@ -54,7 +54,7 @@ static const char READ_DATA_STR[READ_STR_LEN] = "read data"; static const char WRITE_DATA_STR[WRITE_STR_LEN] = "write data"; //TODO: will be read from config file. -static uint16_t get_uos_count(void) +static uint16_t get_user_vm_count(void) { return 1; } @@ -80,17 +80,17 @@ static uint16_t get_common_blocks(void) static uint16_t get_accessible_blocks(void) { return (get_rpmb_blocks() - get_common_blocks()) / - get_uos_count() + get_common_blocks(); + get_user_vm_count() + get_common_blocks(); } -/* Todo: To get the uos number, e.g. No.0 or No.1, which is +/* Todo: To get the User VM number, e.g. No.0 or No.1, which is used for calculating User VM RPMB range address. But this will be removed after config file is supported. We plan to predefine such info and save to config file. */ -static uint8_t get_uos_id(void) +static uint8_t get_user_vmid(void) { - return (get_uos_count() - 1); + return (get_user_vm_count() - 1); } void rpmb_mode_init(uint16_t mode) @@ -117,7 +117,7 @@ static bool is_key_programmed(void) return false; } -static uint16_t get_phy_addr(uint8_t uos_id, uint16_t vaddr) +static uint16_t get_phy_addr(uint8_t user_vmid, uint16_t vaddr) { uint16_t common_blocks = get_common_blocks(); uint16_t accessible_blocks = get_accessible_blocks(); @@ -125,7 +125,7 @@ static uint16_t get_phy_addr(uint8_t uos_id, uint16_t vaddr) if (vaddr < get_common_blocks()) { return vaddr; } else { - return (((accessible_blocks - common_blocks) * uos_id) + vaddr); + return (((accessible_blocks - common_blocks) * user_vmid) + vaddr); } } @@ -136,7 +136,7 @@ int get_virt_rpmb_key(void) rc = get_vrpmb_key(key, sizeof(key)); if (rc == 0){ - DPRINTF(("%s: get uos key fail\n", __func__)); + DPRINTF(("%s: get User VM key fail\n", __func__)); } memcpy(virt_rpmb_key, key, RPMB_KEY_32_LEN); @@ -301,7 +301,7 @@ static int rpmb_virt_write(uint32_t ioc_cmd, void* seq_data, uint16_t vaddr; uint16_t paddr; uint16_t block_count; - uint8_t uos_id; + uint8_t user_vmid; __u16 rpmb_result = 0; int rc; @@ -317,7 +317,7 @@ static int rpmb_virt_write(uint32_t ioc_cmd, void* seq_data, return -1; } - uos_id = get_uos_id(); + user_vmid = get_user_vmid(); vaddr = swap16(in_frame->addr); block_count = in_cnt; @@ -325,7 +325,7 @@ static int rpmb_virt_write(uint32_t ioc_cmd, void* seq_data, virt_rpmb_key, &virt_counter, &vaddr, &block_count)) goto out; - paddr = get_phy_addr(uos_id, vaddr); + paddr = get_phy_addr(user_vmid, vaddr); if (rpmb_replace_frame(in_frame, in_cnt, rpmb_key, NULL, &phy_counter, &paddr, NULL, NULL, NULL)) @@ -386,7 +386,7 @@ static int rpmb_virt_read(uint32_t ioc_cmd, void* seq_data, uint16_t vaddr; uint16_t paddr; uint16_t block_count; - uint8_t uos_id; + uint8_t user_vmid; if (in_cnt == 0 || in_frame == NULL) { DPRINTF(("%s: in_frame, in_cnt or seq_data is not available\n", __func__)); @@ -398,7 +398,7 @@ static int rpmb_virt_read(uint32_t ioc_cmd, void* seq_data, return -1; } - uos_id = get_uos_id(); + user_vmid = get_user_vmid(); memset(out_frame, 0, out_cnt * RPMB_FRAME_SIZE); vaddr = swap16(in_frame->addr); @@ -408,7 +408,7 @@ static int rpmb_virt_read(uint32_t ioc_cmd, void* seq_data, in_cnt, NULL, NULL, &vaddr, &block_count)) goto out; - paddr = get_phy_addr(uos_id, vaddr); + paddr = get_phy_addr(user_vmid, vaddr); if (rpmb_replace_frame(in_frame, in_cnt, NULL, NULL, NULL, &paddr, NULL, NULL, NULL )) { err = RPMB_RES_GENERAL_FAILURE; diff --git a/devicemodel/include/att_keybox.h b/devicemodel/include/att_keybox.h index d4cd6772f..19cd41bff 100644 --- a/devicemodel/include/att_keybox.h +++ b/devicemodel/include/att_keybox.h @@ -71,7 +71,7 @@ typedef struct rpmb_block { uint16_t attkb_addr; uint32_t attkb_size; uint16_t attkb_svn; - uint16_t uos_rpmb_size; + uint16_t user_vm_rpmb_size; uint8_t reserved[230]; } rpmb_block_t; #pragma pack ()