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 <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
Liu Long 2021-10-29 19:37:46 +08:00 committed by wenlingz
parent 14c6e21efa
commit c0554f9d99
7 changed files with 21 additions and 21 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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));

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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 ()