acrn-hypervisor/hypervisor/arch/x86
Shiqing Gao 6744a179fc hv: treewide: fix 'Shifting value too far'
MISRA-C requires that shift operation cannot exceed the word length.

What this patch does:
- Add the pre condition for 'init_lapic' regarding to 'pcpu_id'
  Currently, max 8 physical cpus are supported.
  Re-design will be required if we would like to support more physical
   cpus.
  So, add the pre condition here to avoid the unintentional shift
   operation mistakes.

- Replace the id type with uint8_t in 'vlapic_build_id'
  - For VM0, it uses 'lapic_id' as its id, which is uint8_t.
  - For non VM0, it uses 'vcpu_id' as its id, which is uint16_t.
    Cast this id to uint8_t to make sure there is no loss of data after
     left shifting 24U.

Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-14 13:05:44 +08:00
..
configs HV: config: add Kconfig and defconfigs for sbl & uefi 2018-06-08 17:21:13 +08:00
guest hv: treewide: fix 'Shifting value too far' 2018-08-14 13:05:44 +08:00
assign.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
cpu_primary.S hv: init: save boot context from bootloader/bios 2018-08-09 16:43:58 +08:00
cpu_save_boot_ctx.S hv: move boot_ctx offset definitions 2018-08-14 13:05:06 +08:00
cpu_state_tbl.c fix x86 dir integer violations 2018-07-25 15:29:34 +08:00
cpu.c hv: add compile time assert for static checks 2018-08-14 13:05:06 +08:00
cpuid.c HV: Add the emulation of CPUID with 0x16 leaf 2018-08-14 13:04:21 +08:00
ept.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
gdt.c HV:treewide:fix value outside range of underlying type 2018-08-06 16:07:41 +08:00
idt.S hv: Interrupt handling in ACRN partition mode 2018-08-10 10:26:00 +08:00
io.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
ioapic.c hv: pirq: do not indicate priority when allocate vector 2018-08-10 10:20:31 +08:00
irq.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
Kconfig HV: Add Partitioning mode option for ACRN 2018-08-02 12:58:09 +08:00
lapic.c hv: treewide: fix 'Shifting value too far' 2018-08-14 13:05:44 +08:00
mmu.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
mtrr.c hv:cleanup vmid related code 2018-08-06 12:27:53 +08:00
notify.c HV: Fix new MISRAC violations for brackets 2018-07-16 11:02:38 +08:00
pagetable.c hv: ept: add lookup_address to lookup the page table 2018-07-26 12:46:34 +08:00
pm.c pm: use cpu_context for s3 save/restore 2018-08-07 09:55:13 +08:00
retpoline-thunk.S license: Replace license text with SPDX tag 2018-06-01 10:43:06 +08:00
static_checks.c hv: add compile time assert for static checks 2018-08-14 13:05:06 +08:00
timer.c HV: Use the CPUID(0x16) to obtain tsc_hz when zero tsc_hz is returned by 0x15 cpuid 2018-08-14 13:04:21 +08:00
trampoline.S HV:treewide:Replace HOST_GDT_RING0_CODE/DATA_SEL with constant 2018-07-18 12:31:42 +08:00
trusty.c hv:Refine destroy_secure_world API 2018-08-10 10:17:09 +08:00
virq.c HV: add pcpu id check before send IPI 2018-08-13 14:07:30 +08:00
vmexit.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
vmx_asm.S vcpu: add ext context support for world switch 2018-08-07 09:55:13 +08:00
vmx.c HV: Logical conjunction needs brackets 2018-08-14 09:53:32 +08:00
vtd.c hv: pirq: do not indicate priority when allocate vector 2018-08-10 10:20:31 +08:00
wakeup.S pm: use cpu_context for s3 save/restore 2018-08-07 09:55:13 +08:00