HV: guest: cleanup of remaining integral type violations
Clean up most reported integral-type-related violations still existing under arch/x86/guest/. The remaining reports that are not trivial to suppress will be explained in separate documents. Also move acpi_info outside acrn_common.h as the structure is no longer shared with DM. v1 -> v2: * Move struct acpi_info to bsp_extern.h Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
1a1ee93656
commit
112b5b820c
|
@ -146,7 +146,7 @@ static int _gva2gpa_common(struct vcpu *vcpu, struct page_walk_info *pw_info,
|
|||
int ret = 0;
|
||||
int fault = 0;
|
||||
|
||||
if (pw_info->level < 1) {
|
||||
if (pw_info->level < 1U) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ static int _gva2gpa_common(struct vcpu *vcpu, struct page_walk_info *pw_info,
|
|||
fault = 1;
|
||||
}
|
||||
|
||||
if (pw_info->pse && (i > 0 && ((entry & MMU_32BIT_PDE_PS) != 0U))) {
|
||||
if (pw_info->pse && (i > 0U && ((entry & MMU_32BIT_PDE_PS) != 0U))) {
|
||||
break;
|
||||
}
|
||||
addr = entry;
|
||||
|
|
|
@ -1435,7 +1435,7 @@ emulate_bittest(struct vcpu *vcpu, uint64_t gpa, struct vie *vie,
|
|||
{
|
||||
uint64_t val, rflags, bitmask;
|
||||
int error;
|
||||
uint32_t bitoff;
|
||||
uint64_t bitoff;
|
||||
uint8_t size;
|
||||
|
||||
/*
|
||||
|
@ -1602,7 +1602,7 @@ vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum cpu_reg_name seg,
|
|||
"%s: invalid segment %d", __func__, seg);
|
||||
ASSERT(length == 1U || length == 2U || length == 4U || length == 8U,
|
||||
"%s: invalid operand size %hhu", __func__, length);
|
||||
ASSERT((prot & ~(PROT_READ | PROT_WRITE)) == 0,
|
||||
ASSERT((prot & ~(PROT_READ | PROT_WRITE)) == 0U,
|
||||
"%s: invalid prot %#x", __func__, prot);
|
||||
|
||||
firstoff = offset;
|
||||
|
|
|
@ -270,7 +270,7 @@ int start_vm(struct vm *vm)
|
|||
vm->state = VM_STARTED;
|
||||
|
||||
/* Only start BSP (vid = 0) and let BSP start other APs */
|
||||
vcpu = vcpu_from_vid(vm, 0);
|
||||
vcpu = vcpu_from_vid(vm, 0U);
|
||||
ASSERT(vcpu != NULL, "vm%d, vcpu0", vm->attr.id);
|
||||
schedule_vcpu(vcpu);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#define vm_pic(vm) (vm->vpic)
|
||||
|
||||
#define ACRN_DBG_PIC 6
|
||||
#define ACRN_DBG_PIC 6U
|
||||
|
||||
enum irqstate {
|
||||
IRQSTATE_ASSERT,
|
||||
|
@ -232,7 +232,7 @@ static void vpic_notify_intr(struct vpic *vpic)
|
|||
*/
|
||||
pic->intr_raised = true;
|
||||
if (vpic->vm->vpic_wire_mode == VPIC_WIRE_INTR) {
|
||||
struct vcpu *vcpu = vcpu_from_vid(vpic->vm, 0);
|
||||
struct vcpu *vcpu = vcpu_from_vid(vpic->vm, 0U);
|
||||
|
||||
ASSERT(vcpu != NULL, "vm%d, vcpu0", vpic->vm->attr.id);
|
||||
vcpu_inject_extint(vcpu);
|
||||
|
@ -423,7 +423,7 @@ static int vpic_ocw2(struct vpic *vpic, struct pic *pic, uint8_t val)
|
|||
/* if level ack PTDEV */
|
||||
if ((pic->elc & (1U << (isr_bit & 0x7U))) != 0U) {
|
||||
ptdev_intx_ack(vpic->vm,
|
||||
master_pic(vpic, pic) ? isr_bit : isr_bit + 8U,
|
||||
(master_pic(vpic, pic) ? isr_bit : isr_bit + 8U),
|
||||
PTDEV_VPIN_PIC);
|
||||
}
|
||||
} else if ((val & OCW2_SL) != 0U && pic->rotate) {
|
||||
|
|
|
@ -19,6 +19,14 @@
|
|||
#define BSP_EXTERN_H
|
||||
|
||||
#define UOS_DEFAULT_START_ADDR (0x100000000UL)
|
||||
|
||||
struct acpi_info {
|
||||
uint8_t x86_family;
|
||||
uint8_t x86_model;
|
||||
struct pm_s_state_data pm_s_state;
|
||||
/* TODO: we can add more acpi info field here if needed. */
|
||||
};
|
||||
|
||||
/**********************************/
|
||||
/* EXTERNAL VARIABLES */
|
||||
/**********************************/
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
#include <hypervisor.h>
|
||||
|
||||
const struct acpi_info host_acpi_info = {
|
||||
-1, /* x86 family */
|
||||
-1, /* x86 model */
|
||||
0, /* x86 family */
|
||||
0, /* x86 model */
|
||||
{
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1a EVT */
|
||||
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b EVT */
|
||||
|
|
|
@ -340,13 +340,6 @@ struct pm_s_state_data {
|
|||
uint64_t *wake_vector_64;
|
||||
}__attribute__((aligned(8)));
|
||||
|
||||
struct acpi_info {
|
||||
int16_t x86_family;
|
||||
int16_t x86_model;
|
||||
struct pm_s_state_data pm_s_state;
|
||||
/* TODO: we can add more acpi info field here if needed. */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Info PM command from DM/VHM.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue