hv: implement ivshmem memory regions initialization

The ivshmem memory regions use the memory of the hypervisor and
they are continuous and page aligned.

this patch is used to initialize each memory region hpa.

v2: 1) if CONFIG_IVSHMEM_SHARED_MEMORY_ENABLED is not defined, the
       entire code of ivshmem will not be compiled.
    2) change ivshmem shared memory unit from byte to page to avoid
       misconfiguration.
    3) add ivshmem configuration and vm configuration references

v3: 1) change CONFIG_IVSHMEM_SHARED_MEMORY_ENABLED to CONFIG_IVSHMEM_ENABLED
    2) remove the ivshmem configuration sample, offline tool provides default
       ivshmem configuration.
    3) refine code style.

v4: 1) make ivshmem_base 2M aligned.

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yuan Liu
2020-07-28 15:02:49 +08:00
committed by wenlingz
parent 088cd62d8b
commit d6f563c4eb
5 changed files with 70 additions and 0 deletions

View File

@@ -336,3 +336,11 @@ config ENFORCE_TURNOFF_AC
help
If CPU has #AC for split-locked access, HV enable it and VMs can't disable.
Set this to enforce turn off that #AC, for community developer only.
config IVSHMEM_ENABLED
bool "Enable ivshmem inter-vm communication based on hypervisor shared memory"
default n
help
Ivshmem shared memory is located in the hypervisor, it can provide multiple
memory regions as communication channels between pre-launched or post-launched
VMs.