Commit Graph

6621 Commits

Author SHA1 Message Date
Victor Sun 28824c1e74 HV: init e820 before init paging
In the commit of 4e1deab3d9, we changed the
init sequence that init paging first and then init e820 because we worried
about the efi memory map could be beyond 4GB space on some platform.

After we double checked multiboot2 spec, when system boot from multiboot2
protocol, the efi memory map info will be embedded in multiboot info so it
is guaranteed that the efi memory map must be under 4GB space. Consider that
the page table will be allocated in free memory space in future, we have
to change the init sequence back that init e820 first and then init paging.

If we need to support other boot protocol in future that the efi memory map
might be put beyond 4GB, we could have below options:
	1. Request bootloader put efi memory map below 4GB;
	2. Call EFI_BOOT_SERVICES.GetMemoryMap() before ExitBootServices();
	3. Enable a early 64bit page table to get the efi memory map only;

Tracked-On: #5626

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-09-27 09:03:15 +08:00
Yang,Yu-chu 8f2ede9cfd config-tools: pci devices' io-ports passthrough
Pass through the io-ports for the passthrough pci devices of
pre-launched VM.

Three parts to support this feature:
1. Identical map the pci devices io-port address for pre-launched VM
2. Set the io-ports address range to DSDT
3. Avoid to allocate the bar index for VMSIX

Tracked-On: #6620
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-09-26 09:21:11 +08:00
Zide Chen a62dd6ad8a hv: nested: fixed vmxoff_vmexit_handler() issue
In VMXOFF vmexit handler, it's supposed to remove VMCS shadowing.

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
2021-09-26 08:49:35 +08:00
Zide Chen 45b036e028 hv: nested: enable multiple active VMCS12 support
This patch changes the size of vvmcs[] array from 1 to
PER_VCPU_ACTIVE_VVMCS_NUM, and actually enables multiple active VMCS12
support in ACRN.  The basic operations:

- if L1 VMPTRLDs a VMCS12 without previously VMCLEAR the current
  VMCS12, ACRN no longer unconditionally flushes the current VMCS12
  back to L1.  Instead, it tries to keep both the current and the newly
  loaded VMCS12 in the nested->vvmcs[] array, unless:

- if there is no more available vvmcs[] entry, ACRN flushes one active
  VMCS12 to make room for this new VMCS12.

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-26 08:49:35 +08:00
David B. Kinder ce8d69333a doc: remove enable ptm tutorial
Enabling PTM requires some additional engineering work, so we're
removing these instructions for now.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-24 16:08:10 -07:00
David B. Kinder bd57475854 doc: add iomem kernel parameter for board inspector
Without this ``iomem=relaxed`` kernel parameter, the generated board XML
is essentially the same as having ``--basic`` when executing the board
inspector, i.e. the ACPI namespace will not be parsed. The generated
board XML may still work, but some functionality (e.g. passthru of TPM
and other PCI devices that need INTx) will no longer work due to lack of
hardware information.

Replacing PR #6618

Tracked-On: #5692

Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-24 11:40:24 -07:00
Mingqiang Chi f39c882359 hv:change log level for check_vmx_ctrl
Some processors don't support VMX_PROCBASED_CTLS_TERTIARY bit
and VMX_PROCBASED_CTLS2_UWAIT_PAUSE bit in MSRs
(IA32_VMX_PROCBASED_CTLS & IA32_VMX_PROCBASED_CTLS2),
HV will output error log which will cause confusion,
change the log level from pr_err to pr_info.

Tracked-On: #6397

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2021-09-24 10:17:19 +08:00
Jie Deng 064fd7647f hv: add priority based scheduler
This patch adds a new priority based scheduler to support
vCPU scheduling based on their pre-configured priorities.
A vCPU can be running only if there is no higher priority
vCPU running on the same pCPU.

Tracked-On: #6571
Signed-off-by: Jie Deng <jie.deng@intel.com>
2021-09-24 09:32:18 +08:00
David B. Kinder dfe49ee972 doc: update serial port instructions in scenario GSGs
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-23 16:28:12 -07:00
jackwhich f591a249e2 doc: Steps to update hybrid and logical_Partition documents
1.Modify hybrid update ubuntu grub Note: The syntax is easy for users to understand.
2.Add to view the serial port number, enter the serial hybrid verification mode.
3.Delete the kernel, because the config_uos file has been abandoned for maintenance,
  now the Ubuntu native kernel image is used and added to the document.
4.Add to view the serial port number, enter the serial port logic_partition verification method.

Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-23 11:43:38 -07:00
fuzhongl 7ca0d97ee9 Doc: launch L2 guest with ovmf for ACRN on QEMU
ACRN will not maintain User VM kernel config any more;
ovmf will be used to launch L2 guest by default.

Signed-off-by: fuzhongl <fuzhong.liu@eintel.com>
Reviewed-by:   gvancuts <geoffroy.vancutsem@intel.com>
2021-09-23 07:10:40 -07:00
David B. Kinder 722570d728 doc: update release notes with new features
Add new features information provided by engineering.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-23 07:06:14 -07:00
David B. Kinder 6cfa9252c1 doc: Add CODE_OF_CONDUCT to project repo
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-22 20:13:58 -07:00
Yang,Yu-chu 3cf525725c config-tools: remove acrn:is-tpm-passthrough-board
Simplify the statement by TPM2 enablement detection and present TPM2 device.
Remove the function and move the statement to misc_cfg.h.xsl

Tracked-On: #6562
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-09-23 09:20:59 +08:00
Junjie Mao bd28e548d0 config_tools: populate default values to all nodes
The default value population algorithm introduced by commit
2bfaa34 ("config_tools: populate default values in scenario XML") only
populates default values to the first occurrence of a tag when the tag is
specified to allow multiple occurrences under an xs:all node. This may lead
to incomplete scenario XML as some of the default values are missed.

This patch fixes this issue by checking **all** nodes having the same tag
under a node specified by an xs:all schema.

Fixes: 2bfaa34 ("config_tools: populate default values in scenario XML")

Tracked-On: #6292
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-23 09:15:44 +08:00
David B. Kinder 824d4a21cb doc: remove unreferenced images
Over time, and after deleting or moving documents around, we've left
behind quite the collection of unreferenced images.  It's time to clean
them out of the doc folders.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-22 16:29:57 -07:00
David B. Kinder 6d352ba4e6 doc: remove remaining GVT-g documentation
When GVT-g support was removed from ACRN some documentation changes were
missed. Delete the GVT-g HLD docs and the images it used.  Also fix
references in the old release notes so they don't depend on this deleted
document.  (The original release notes are still in the archived release
docs.)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-22 16:08:14 -07:00
Junjie Mao e2bf4a90b4 doc: update release notes for v2.6 on configuration upgrades
This patch updates recommendations to upgrade from a prior ACRN version for
v2.6.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-22 16:03:39 -07:00
Liu,Junming 858e7b2464 doc: remove "gpu" parameter when pass-thru IGD
remove "gpu" parameter when pass-thru IGD

Tracked-On: #6357

Signed-off-by: Liu,Junming <junming.liu@intel.com>
2021-09-22 15:32:01 +08:00
Liu,Junming 97d4485455 config_tool: remove "gpu" parameter when pass-thru IGD
remove "gpu" parameter when pass-thru IGD

Tracked-On: #6357

Signed-off-by: Liu,Junming <junming.liu@intel.com>
2021-09-22 15:32:01 +08:00
Liu,Junming 345ad0a010 dm: refine the logic and UX for IGD pass-thru
Previously, when pass-thru IGD,
need to use the extra parameter "gpu",
it isn't friendly to user.
So remove the "gpu" paramater here.

Refine the logic for the judgment of IGD
check the following three conditions:
1. Physical BDF is 00:02.0
2. VGA class
3. vendor id is 0x8086
Then we can assume it's IGD.

Tracked-On: #6357

Signed-off-by: Liu,Junming <junming.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-09-22 15:32:01 +08:00
Liu,Junming d56442bed5 dm: set pass-thru dev virtual class id
For pass-thru PCI dev,
get the class id from the physical pci config space,
then set the value in virtual config space class id.

Tracked-On: #6357

Signed-off-by: Liu,Junming <junming.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-09-22 15:32:01 +08:00
David B. Kinder 1013b291d3 doc: cleanup obsolete nocl redirect doc
When we removed Clear Linux documentation in the v2.2 release, we
created redirect pages for the deleted /latest document referring folks
to the v2.1 documentation that last supported Clear Linunx.  It's time
to remove this common redirect page.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-21 12:52:31 -07:00
David B. Kinder 9c1c6b80a5 doc: finish renaming vmh to hsm
Fixed some additional doc references missed in PR #6283

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-21 11:18:37 -07:00
David B. Kinder 0d03224070 doc: fix mispellings and formatting
* General scan for misspellings, "smart quotes", and formatting errors
  missed during regular review. Also removed used of "please".

* Fix old XML examples that had desc="..." comments. These comments were
  moved to to xsd files instead of being in the XML files themselves.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-21 10:46:12 -07:00
Shuang Zheng ac67051ab5 doc: add virtio input element in config doc
add virtio input element in the description of elements for
launch XMLs in config doc.

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
2021-09-20 08:23:51 -07:00
jackwhich 4f2e3384b1 Add sample diagrams for user reference. 2021-09-20 08:22:58 -07:00
jackwhich 321653e3c7 doc: update documentation and grub file
1. Because the < > in the document will mislead users to copy and paste directly,
       modify the < > to " ".
       Add sample diagrams for user reference.
    2. Because there is a problem with the user adding the GRUB_CMDLINE_LINUX=text
       parameter, delete this parameter.
    3. The script generation of launch_uos_id3.sh does not match the GitHub and doc,
       modify the parameters.

    Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2021-09-20 08:22:58 -07:00
Junjie Mao efcb9e2fdf Makefile: fix wrong reference to board XML and skip binary in diffconfig
The current config.mk uses the variable BOARD_FILE as the path to the board
XML when generating an unmodified copy of configuration files for
comparison, which is incorrect. The right variable is HV_BOARD_XML which is
the path to the copy of board XML that is actually used for the build.

This patch corrects the bug above.

In addition, this patch also skips binary files (which are not meant to be
edited manually) when calculating the differences.

Tracked-On: #6592
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-09-19 20:23:44 +08:00
David B. Kinder 4315ae26b6 doc: updated What is ACRN introduction
* Update and simplify our What is ACRN document.
* Removed SDC disussion and out-of-date best known configuration
  descriptions and scenario block diagrams
* Removed I/O Mediator discussion from "What is ACRN" and move
  referenced label to content in the HLD overview (that was duplicated in
  "What is ACRN")
* Updated images for scenarios and removed obsolete images
* Add references to new overview docs and GSG
* Add general description of VMs in example scenarios

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-18 15:24:46 -07:00
David B. Kinder 306d624795 doc: Add project CONTRIBUTING repo page
Summarize the ACRN contributing guidelines (fully documented in a
separate document) and add to the top level of our project repo (as
expected by GitHub and our Technical Steering Committee)

Also, tweak the mailing list reference to recommend acrn-users instead
of acrn-dev

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-17 19:18:34 -07:00
Fei Li 53fe6d63be hv: vioapic: update remote IRR for lapic-pt
For local APIC passthrough case, EOI would not trigger VM-exit. So virtual
'Remote IRR' would not be updated. Needs to read physical IOxAPIC RTE to
update virtual 'Remote IRR' field each time when guest wants to read I/O
REDIRECTION TABLE REGISTERS

Tracked-On: #5923
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-09-18 09:42:44 +08:00
Zide Chen 94cbe909ee hv: irq: identical vector mapping if LAPIC passthough
In local APIC passthrough case, when devices triggered a INTx interrupt, this
interrupt would be delivered to vCPU directly. For this case, need to set the
virtual vector in
the 'Interrupt Vector' field of physical IOxAPIC I/O REDIRECTION TABLE REGISTER
(bits 7:0) and 'Vector' field of vt-d Interrupt Remapping Table Entry (IRTE)
for Remapped Interrupts.

Assumption:
(a) IOAPIC pins won't be shared between LAPIC PT guest and other guests;
(b) The guest would not trigger this IRQ before it switched to x2 APIC mode.

Tracked-On: #5923
Signed-off-by: Zide Chen <zide.chen@intel.com>
2021-09-18 09:42:44 +08:00
Mingqiang Chi db98f01b6e add vmx capability check
check some essential vmx capablility,
will panic if processor doesn't support it.

Tracked-On: #6584

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-18 08:44:30 +08:00
David B. Kinder 2b3c4b6d49 doc: update README for TCM meeting change
TCM (Technical comunity meetings) are monthly not weekly...

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-17 08:45:34 -07:00
dongshen 08d4517431 hv: fix bugs in RDT's CDP code
In current RDT code, if CDP is configured, L2/L3 resources' num_closids calculation
is wrong:
res_cap_info[res].num_closids = (uint16_t)((edx & 0xffffU) >> 1U) + 1U;

Should be:
res_cap_info[res].num_closids = (uint16_t)((edx & 0xffffU) >> 1U + 1) >> 1U;

Aslo, in order to enable CDP system-wide, need to enable the CDP bit (bit 0) on all pcpus,
not just on pcpu 0.

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2021-09-17 16:29:05 +08:00
dongshen f4cdbba0bd hv: some cosmetic fixes to rdt.c/rdt.h
Rename the clos_max field in struct rdt_info to num_closids

Rename variable valid_clos_num to common_num_closids and make it static

Tracked-On: #5917
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2021-09-17 16:29:05 +08:00
Liu Long 2de395b6f6 HV: Normalize hypervisor help output format
Normalize hypervisor help command output format, remove the 10 lines
limit for one screen, fix the misspelled words.

Tracked-On: #5112
Signed-off-by: Liu Long <long.liu@intel.com>
Reviewed-by: VanCutsem, Geoffroy <geoffroy.vancutsem@intel.com>
2021-09-17 11:06:18 +08:00
Zide Chen 0466d7055f hv: nested: move the VMCS12 dirty flags to struct acrn_vvmcs
These dirty flags are supposed to be per VMCS12, so move them from the
per vCPU acrn_nested struct to the newly added acrn_vvmcs struct.

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-17 10:58:43 +08:00
Zide Chen 4e54c3880b hv: nested: remove vcpu->arch.nested.current_vmcs12_ptr
This variable represents the L1 GPA of the current VMCS12.  But it's
no longer needed in the multiple active VMCS12 case, which uses the
following variables for this purpose.

- nested->current_vvmcs refers to the vvmcs[] entry which contains the
  cached current VMCS12, its associated VMCS02, and other context info.

- nested->current_vvmcs->vmcs12_gpa refers to the L1 GPA of this
  current VMCS12.

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-17 10:58:43 +08:00
Zide Chen 799a4d332a hv: nested: initial implementation of struct acrn_vvmcs
Add an array of struct acrn_vvmcs to struct acrn_nested, so it is
possible to cache multiple active VMCS12s.

This patch declares the size of this array to 1, meaning that there is
only one active VMCS12.  This is to minimize the logical code changes.

Add pointer current_vvmcs to struct acrn_nested, which refers to the
current vvmcs[] entry.  In this patch, if any VMCS12 is active, it
always points to vvmcs[0].

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-17 10:58:43 +08:00
Zide Chen cf697e753d hv: nested: some API signature changes
No any logical changes, this patch is preparing for multiple active
VMCS12 support.

- currently it's easy to get the vmcs12 pointer from the vcpu pointer.
  In multiple active vmcs12 case, we need to explicitly add "struct
  acrn_vmcs12 *vmcs12" to certain APIs' input argument list, in order to
  get the desired vmcs12 pointer.

- merge flush_current_vmcs12() into clear_vmcs02() for multiple reasons:
  a) it's called only once; b) we don't wrap the opposite operation
  (loading vmcs12) in an API; c) this API has simple and clear logic.

Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-17 10:58:43 +08:00
Zide Chen e4c69546a0 doc: add VPID allocation to nested virtualization tutorial
Tracked-On: #6289
Signed-off-by: Zide Chen <zide.chen@intel.com>
2021-09-16 09:26:10 +08:00
Zide Chen e9eb72d319 hv: nested: flush L2 VPID only when it could conflict with L1 VPIDs
By changing the way to assign L1 VPID from bottom-up to top-down,
the possibilities for VPID conflicts between L1 and L2 guests are
small.

Then we can flush VPID just in case of conflicting.

Tracked-On: #6289
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-16 09:26:10 +08:00
Fei Li 730a275ecc misc: acrn_trace: enlarge DEV_PATH_LEN
Now ACRN support platform which CPU numbers are large than 10. So the old value
for DEV_PATH_LEN is not enough (18 is not enough for /dev/acrn_trace_xx).

Tracked-On: #6572
Signed-off-by: Fei Li <fei1.li@intel.com>
2021-09-16 08:50:35 +08:00
Fei Li 0a515ab2ea hv: pci: fix a minor bug about is_pci_cfg_multifunction
Before checking whether a PCI device is a Multi-Function Device or not, we need
make sure this PCI device is a valid PCI device. For a valid PCI device, the
'Header Layout' field in Header Type Register must be 000 0000b (Type 0 PCI device)
or 000 0001b (Type 1 PCI device).

So for a valid PCI device, the Header Type can't be 0xff.

Tracked-On: #4134
Signed-off-by: Fei Li <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-09-15 13:24:18 +08:00
Kunhui-Li e68d66341e config_tools: adjust the execution order of pci_stub command
The execution order of the "modprobe pci_stub" command is erroneous
in the launch script generation logic. The "modprobe pci_stub" command
should be executed before unbinding passthru devices, so we adjust the
command excution order.

Tracked-On: #6565
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-09-15 13:21:46 +08:00
David B. Kinder d1f139a51e doc: add documentation updates to release notes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-14 17:16:46 -07:00
David B. Kinder bdf2ba29d6 doc: update enable PTM instructions
Fix an error in the documentation where the output from dmesg was
incorrect for the Service VM.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-14 15:47:07 -07:00
David B. Kinder a35f4b9e05 doc: starting draft for v2.6 release notes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-09-14 11:39:17 -07:00