Commit Graph

6050 Commits

Author SHA1 Message Date
Shuang Zheng 8fcd868a50 config_tools: enable features for default config on tgl-rvp and
ehl-crb-b

enable CDP_ENABLED for RT in scenarios, enable ivshmem for industry
scenario, disable vuart0 in launch settings, passthru SATA for RTVM,
set virtio-net and virtio-blk for post-launched WaaG and YaaGs.

Tracked-On: #5955
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-05-12 09:20:03 +08:00
Kunhui Li 15a9b854a6 doc: update ACRN qemu HV tag to v2.0
1. Add whitespace in the string "ubuntu18.04";
2. Update the Kernel version;
3. Update ACRN qemu HV tag format and add a note.

Tracked-On: #5928
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
2021-05-10 15:36:01 -07:00
Benjamin Fitch 8c8df1afb9 doc: copy edits in the developer reference
Signed-off-by: Benjamin Fitch <benjamin.fitch@intel.com>
2021-05-10 14:59:26 -07:00
Geoffroy Van Cutsem 86176a30a0 config-tools: fix a couple of typos in helper script
Fix a couple of typos in text displayed by a helper script
used when building ACRN. No functional change made to the
script itself.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-05-10 13:18:08 +08:00
Liang Yi 688a41c290 hv: mod: do not use explicit arch name when including headers
Instead of "#include <x86/foo.h>", use "#include <asm/foo.h>".

In other words, we are adopting the same practice in Linux kernel.

Tracked-On: #5920
Signed-off-by: Liang Yi <yi.liang@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2021-05-08 11:15:46 +08:00
Yang,Yu-chu f3305b6373 config-tools: update the generic_code with xform output
Replace folllowing python generated files with xslt transform outputs
which are formatted using clang-format:

misc/config_tools/data/generic_board/generic_code/
├── hybrid
│   ├── ivshmem_cfg.h
│   ├── misc_cfg.h
│   ├── pt_intx.c
│   ├── vm_configurations.c
│   └── vm_configurations.h
├── hybrid_rt
│   ├── ivshmem_cfg.h
│   ├── misc_cfg.h
│   ├── pt_intx.c
│   ├── vm_configurations.c
│   └── vm_configurations.h
├── industry
│   ├── ivshmem_cfg.h
│   ├── misc_cfg.h
│   ├── pt_intx.c
│   ├── vm_configurations.c
│   └── vm_configurations.h
└── logical_partition
    ├── ivshmem_cfg.h
    ├── misc_cfg.h
    ├── pt_intx.c
    ├── vm_configurations.c
    └── vm_configurations.h

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 5f2f82f4d8 config-tools: introduce xslt transform and clang-format in genconf.sh
Add "transform" to generate following files with xsltproc in genconf.sh:
  - ivshmem_cfg.h
  - misc_cfg.h
  - pt_intx.c
  - vm_configurations.c
  - vm_configurations.h

Add code formatter using clang-format. It formats the gernerated code
with customized condfiguration if clang-format package and configuraion
file ".clang-format" exist.

Add sed in genconf.sh "transform" to replace the copyright "YEAR" of generated files.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 6d81112428 config-tools: refine ivshmem devices in pci_dev_c.py
Add comma to the last member of ivshmem pci devices.

If the last element ends without comma, the clang-format would attach
the brackets to the first and last lines.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 982b4c1e0e config-tools: add the misc_cfg.h.xsl
Add a xslt file "misc_cfg.h.xsl". This file is used to
generate misc_cfg.h which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 4111ebb46a config-tools: add the ivshmem_cfg.h.xsl
Add a xslt file "ivshemem_cfg.h.xsl". This file is used to
generate ivshemem_cfg.h which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu ec11789894 config-tools: add the pt_intx.c.xsl
Add a xslt file "pt_intx.c.xsl". This file is used to
generate pt_intx.c which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu f8e1b1cd94 config-tools: add the vm_configurations.h.xsl
Add a xslt file "vm_configurations.h.xsl". This file is used to
generate vm_configurations.h which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 615552fadf config-tools: add the vm_configurations.c.xsl
Add a xslt file "vm_configurations.c.xsl". This file is used to
generate vm_configurations.c which is used by hypervisor.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 1c84d88b4a config-tools: add pio static allocator
This file allocates the resource of pio base.
The available pio base is in ['0x3F8', '0x2F8', '0x3E8', '0x2E8'] and it
cannot be used by native device.

When any of sos legacy vuarts are enabled, assign a pio base to legancy
vuarts' base.

The allocator follows rules:
1. An SOS legacy vuart only support PIO vuart.
2. To assign a pio base for sos legacy vuart 0:
   - If the hv/DEBUG_OPTIONS/SERIAL_CONSOLE is one of
     [ttys0, ttys1, ttys2, ttys3] and it's a pio vuart in the native
     environment, the pio base of SOS legacy vuart 0 would be the same as
     native one.
   - If the hv/DEBUG_OPTIONS/SERIAL_CONSOLE is not one of
     [ttys0, ttys1, ttys2, ttys3], assigns a pio base to SOS legacy vuart 0
     from avilable pio base.
   - If the hv/DEBUG_OPTIONS/SERIAL_CONSOLE is not one of
     [ttys0, ttys1, ttys2, ttys3] but a pio vuart, will assigns a pio
     base to SOS legacy vuart 0 from avilable pio base and raise a
     warning to user.
3. To assign a pio base for sos legacy vuart 1:
   - Assigns a pio base to SOS legacy vuart 1 from avilable pio base.
   - If all the available pio bases list is empty (which means all are
     in used by native), it assigns one of the pio base to SOS legacy
     vuart 1 anyway, but raise a warning to user.
4. Assigned pio bases must be unique.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 26a2aed19d config-tools: add intx static allocator
Create an intx.py which is a static allocator to allocate the irq
resources. The available irq list is based on the native irqs which
are in range [0, 15] and are not used by native os.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 9c85d70057 config-tools: add cpu affinity static allocator
If a cpu_affinity node of SOS is not present in the scenario.xml,
assign the native cpus which are not assigned to pre-launched vm to
SOS vm.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 3ed36ff02a config-tools: refine append_node and add get_node
Refine the "append_node" which can add new node with an attribute and
return the appended node.

The method "get_node" finds the xpath value and return it if there is an
unique node exists, otherwise it returns None.
It is used to get an xpath element node or can determine the xpath existence.

The "get_text" is replaced with "get_node". The only get_text in
hv_ram.py is modified accordingly.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 81a867bc57 config-tools: add lib.xsl to config_tools/xforms
Add lib.xsl under config_tools/xforms.

This lib.xsl contains the variables and customized functions for
xslt transformation.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 3b9426e1e6 config-tools: add lib.py to static_allocators/lib
Create lib.py which contains the common methods that are shared by static
allocators under misc/config_tools/static_allocators.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 160431096f config-tools: add user-defined errors
Create a file which contains user-defined errors for config-tools.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Yang,Yu-chu 4d0880ebec config-tools: replace <guest_flag/> with <guest_flag>
<guest_flag/> may be treated as either empty string or null in xslt
transformation and xsd schema validation. Replace it with:

<guest_flag></guest_flag>

to avoid the undefined behavior.

The duplicate guest_flag are removed.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-05-07 14:39:08 +08:00
Peter Fang 736a03222f OVMF temporary release
This temporary release is based on the following commit:

commit 83b4731bab0423e3f9ffccfb37a882090be2f44a
Author: Tao Yuhong <yuhong.tao@intel.com>
Date:   Wed Apr 14 07:43:11 2021 -0400

    Change 64-bit MMIO BAR window to 256G-512G

    DM maps 64-bit mmio BARs of vdev into 4G-5G, for post-launched VMs. At native
    platform, 64-bit MMIO BARs which have 39-bit address, are always mapped into
    256G-512G address space.
    DM will change the address window of 64-bit vdev BARs of post-launched VMs to
    256G-512G. That ask OVMF to do the same change, to boot from passthrough SATA/MVME
    disks, which have 64-bit MMIO BAR.

Tracked-On: #5913
Signed-off-by: Peter Fang <peter.fang@intel.com>
2021-05-07 14:16:37 +08:00
Tao Yuhong 8ed1d8aa5e DM: change high RAM start address to 4GB for post-launched VM
ACRN didn't support dynamic memory allocation. SO it would reserve
a big page pool and use the GPA as index to get a page to do EPT
mapping. In order to save memory, we put high MMIO windows to [4G, 5G].
AFter we support dynamic page allocation for EPT mapping, we move
high MMIO windows to where it used to ([256G, 512G]) for 39 bits physical
address), we could move high memory to where is used to too ([4G, 4G +
size]).

Tracked-On: #5913
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2021-05-07 14:16:37 +08:00
Tao Yuhong 5ceae97ab4 DM: change 64-bit mmio address space to 256G-512G for post-launched VM
DM maps 64-bit mmio BARs of vdev into 4G-5G, for post-launched VMs. At native
platform, 64-bit MMIO BARs which have 39-bit address, are always mapped into
256G-512G address space.
Change PCI_EMUL_MEMBASE64 to 256G, change PCI_EMUL_MEMLIMIT64 to 512G. So that
the 64-bit vdev BARs of post-launched VMs have same address space with native
platform.

Tracked-On: #5913
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-05-07 14:16:37 +08:00
David B. Kinder 50c1292365 doc: add clang-format to setup package list
clang-format is now used as part of the config tools creating c files
based on the XML configuration

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-05-06 16:14:11 -07:00
Geoffroy Van Cutsem 7c92ac425f doc: add note to emphasize the need to use --windows for WaaG
Add a note to the "Device Model Parameters" document to emphasize
the need to use the '--windows' parameter to use Windows-as-a-Guest
(WaaG), else Windows will not recognize the virtual disk it has
been assigned.

Tracked-On: #5962
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-05-05 18:50:50 -07:00
David B. Kinder 4c676acb9b doc: fix missing codeblock directive
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-05-02 17:20:13 -07:00
Li Fei1 f3327364c3 hv: mmu: fix a minor bug
We should only map [low32_max_ram, 4G) MMIO region as UC attribute,
not map [low32_max_ram, low32_max_ram + 4G) region as UC attribute.
Otherwise, the HV will complain [4G, low32_max_ram + 4G) region has
already mapped.

Tracked-On: #5830
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-04-29 08:57:13 +08:00
Geoffroy Van Cutsem 9e838248c3 hv: enable uart=bdf@ for PCI serial ports which bar0 is not MMIO
This patch fixes the 'uart=bdf@XXX' mechanism for the PCI serial
port devices which bar0 is not MMIO.

Tracked-On: #5968
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Signed-off-by: Li Fei <fei1.li@intel.com>
2021-04-29 08:56:33 +08:00
David B. Kinder 82e3d8341c doc: fix malformed code block in acrn config docs
Fix incorrect code-block notation and code-block language

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-04-27 20:13:12 -07:00
Yonghua Huang 8ec150e314 dm: bugfix in create_and_inject_vrtct
GPA of software SRAM is available only after
 build_vrtct() function is called and the return
 value of it is valid(Not NULL).

 This patch fix bug in create_and_inject_vrtct()
 function which violates above pre-condition when
 calling get_software_sram_base_gpa().

Tracked-On: #5973
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-04-28 09:32:19 +08:00
David B. Kinder a284123b72 doc: tweak known-issues for PDF processing
Update known-issues pattern for PDF processing to also work with updated
xelatex tools from Ubuntu 20.04

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-04-27 17:07:00 -07:00
David B. Kinder 0e317d56bf doc: clean up PDF generation for ACRN docs
PRs #5945 and #5949 introduced fixes to the doc building process to
support PDF generation of the documentation set.  This PR refines the
doc build process, cleaning up the Makefile, adding display of tool
version information, and updates the doc building documentation to
include additional dependencies needed for building the PDF and
instructions for how to build the PDF.  The latexpdf make target is
provided to just run the latex and PDF producing process that depends on
the HTML artifacts from a make html run.  A new make pdf target is
provided that combines the two steps into one.

A new know-issues pattern file is added that verifies the expected
output from the latexpdf process is returned, as it can't be completely
eliminated without losing potential error messages that need to be
resolved.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-04-26 19:50:44 -07:00
Shuang Zheng b96d23a68f config_tools: update IVSHMEM_SHM_SIZE part for HV_RAM_SIZE calculation
add 2 * max (IVSHMEM_SHM_SIZE, 2M) in HV_RAM_SIZE calculation to
avoid ram overflow caused by additional memory usage for shared
memory alignment.

Tracked-On: #5955

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2021-04-23 11:23:55 +08:00
Shuo A Liu dc88c2e397 hv: Save/restore MSR_IA32_CSTAR during context switch
Both Windows guest and Linux guest use the MSR MSR_IA32_CSTAR, while
Linux uses it rarely. Now vcpu context switch doesn't save/restore it.
Windows detects the change of the MSR and rises a exception.

Do the save/resotre MSR_IA32_CSTAR during context switch.

Tracked-On: #5899
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-04-23 11:21:52 +08:00
Jian Jun Chen 31b8b698ce hv: TLFS: Add tsc_offset support for reference time
TLFS spec defines that when a VM is created, the value of
HV_X64_MSR_TIME_REF_COUNT is set to zero. Now tsc_offset is not
supported properly, so guest get a drifted reference time.

This patch implements tsc_offset. tsc_scale and tsc_offset
are calculated when a VM is launched and are saved in
struct acrn_hyperv of struct acrn_vm.

Tracked-On: #5956
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-04-23 10:48:07 +08:00
Jian Jun Chen b4312efbd7 hv: TLFS: inject #GP to guest VM for writing of read-only MSRs
TLFS spec defines that HV_X64_MSR_VP_INDEX and HV_X64_MSR_TIME_REF_COUNT
are read-only MSRs. Any attempt to write to them results in a #GP fault.

Fix the issue by returning error in handler hyperv_wrmsr() of MSRs
HV_X64_MSR_VP_INDEX/HV_X64_MSR_TIME_REF_COUNT emulation.

Tracked-On: #5956
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-04-23 10:48:07 +08:00
Jian Jun Chen dd524d076d hv: TLFS: Setup hypercall page according to the vcpu mode
TLFS spec defines different hypercall ABIs for X86 and x64. Currently
x64 hypercall interface is not supported well.

Setup the hypercall interface page according to the vcpu mode.

Tracked-On: #5956
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-04-23 10:48:07 +08:00
Yonghua Huang 6d5759a260 hv: bugfix in min() and max() MACROs
These two MACROs shall be wrapped as a single
 value respectively, hence brackets should be used.

Tracked-On: #5951
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-04-23 09:58:21 +08:00
Jiang, Yanting afd0b7e8db acrn-config: add adl-rvp xml
Add board xml and industry config xml for ADL-P.

Tracked-On: #5941
Signed-off-by: Jiang, Yanting <yanting.jiang@intel.com>
2021-04-23 09:08:06 +08:00
David B. Kinder f596b6df13 doc: tweaks for latexpdf build
Update missing captions on figures to remove remaining broken references
during latexpdf building.  Also, require doing a "make html" before
doing a "make latexpdf" to build all the artifacts needed for running
the latexpdf build.  (We might change that later if needed.)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-04-22 11:12:07 -07:00
Li Fei1 628bca5cad hv: pgtable: use new algo to calculate PPT/EPT_PD_PAGE_NUM
In order to support platform (such as Ander Lake) which physical address width
bits is 46, the current code need to reserve 2^16 PD page ((2^46) / (2^30)).
This is a complete waste of memory.

This patch would reserve PD page by three parts:
1. DRAM - may take PD_PAGE_NUM(CONFIG_PLATFORM_RAM_SIZE) PD pages at most;
2. low MMIO - may take PD_PAGE_NUM(MEM_1G << 2U) PD pages at most;
3. high MMIO - may takes (CONFIG_MAX_PCI_DEV_NUM * 6U) PD pages (may plus
PDPT entries if its size is larger than 1GB ) at most for:
(a) MMIO BAR size must be a power of 2 from 16 bytes;
(b) MMIO BAR base address must be power of two in size and are aligned with
its size.

Tracked-On: #5929
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-04-22 14:35:57 +08:00
Li Fei1 053c09e764 hv: cpu_cap: PAW over 39 bits must support 1GB large page
The platform which physical-address width over 39 bits must support
1GB large page (Both MMU and VMX sides ). This could save lots of
page table pages for EPT MMIO mapping.

Tracked-On: #5929
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-04-22 14:35:57 +08:00
Junjie Mao affe858d02 doc/conf.py: enable formatting docs in a PDF file
This patch tweaks the settings in doc/conf.py to allow formatting the
documentation to a PDF file by Sphinx. The changes include:

 - Use `xelatex` rather than the default `pdflatex` as the LaTeX engine, as
   `pdflatex` is not that good at formatting non-ascii characters out of
   the box.
 - Use DejaVu fonts (which are available in common Linux distributions) in
   the generated PDF.
 - Restrict the depths of the table of contents to 3.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-04-21 09:29:37 -07:00
Li Fei1 41e2d40d1f hv: e820: remove get_mem_range_info
No one uses get_mem_range_info to get the top/bottom/size of the physical memory.
We could get these informations by e820 table easily.

Tracked-On: #5830
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: eddie Dong <eddie.dong@intel.com>
2021-04-21 14:00:44 +08:00
Li Fei1 3a465388d4 hv: guest: remove get_mem_range_info in prepare_sos_vm_memmap
We used get_mem_range_info to get the top memory address and then use this address
as the high 64 bits max memory address of SOS. This assumes the platform must have
high memory space.

This patch removes the assumption. It will set high 64 bits max memory address of
SOS to 4G by default (Which means there's no 64 bits high memory), then update
the high 64 bits max memory address if the SOS really has high memory space.

Tracked-On: #5830
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: eddie Dong <eddie.dong@intel.com>
2021-04-21 14:00:44 +08:00
Li Fei1 901e8c869e hv: vE820: calculate SOS memory size by vE820 tables
SOS's memory size could be calculated by its vE820 Tables easily.

Tracked-On: #5830
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: eddie Dong <eddie.dong@intel.com>
2021-04-21 14:00:44 +08:00
Li Fei1 ad15053304 hv: mmu: remove get_mem_range_info in init_paging
We used get_mem_range_info to get the top memory address and then use this address
as the high 64 bits max memory address. This assumes the platform must have high
memory space.

This patch calculates the high 64 bits max memory address according the e820 tables
and removes the assumption "The platform must have high memory space" by map the
low RAM region and high RAM region separately.

Tracked-On: #5830
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: eddie Dong <eddie.dong@intel.com>
2021-04-21 14:00:44 +08:00
Li Fei1 6137347411 hv: smp: fix an isuue about SMP sync
Now BSP may launch VMs before APs have not done its initilization,
for example, sched_control for per-cpu. However, when we initilize
the vcpu thread data, it will access the object (scheduler) of the
sched_control of APs. As a result, it will trigger the PF.

This patch would waits each physical has done its initilization before
to continue to execute.

Tracked-On: #5929
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-04-21 10:54:48 +08:00
Li Fei1 5f281df548 hv: serializng: use mfence to ensure trampoline code was updated
Using the MFENCE to make sure trampoline code
has been updated (clflush) into memory beforing start APs.

Tracked-On: #5929
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2021-04-21 10:54:48 +08:00