mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-06 09:06:30 +00:00
hv: allocate vpid based on vm_id and vcpu_id mapping
Currently vpid is not released in reset_vcpu() hence the vpid resource could be exhausted easily if guests are re-launched. This patch assigns vpid according to the fixed mapping of runtime vm_id and vcpu_id to guarantee the uniqueness of vpid. Tracked-On: #2700 Signed-off-by: Zide Chen <zide.chen@intel.com> Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -16,6 +16,11 @@
|
||||
#define CTASSERT(expr) \
|
||||
typedef int32_t CAT_(CTA_DummyType,__LINE__)[(expr) ? 1 : -1]
|
||||
|
||||
/* This is to make sure the 16 bits vpid won't overflow */
|
||||
#if ((CONFIG_MAX_VM_NUM * CONFIG_MAX_VCPUS_PER_VM) > 0xffffU)
|
||||
#error "VM number or VCPU number are too big"
|
||||
#endif
|
||||
|
||||
/* Build time sanity checks to make sure hard-coded offset
|
||||
* is matching the actual offset!
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user