Commit Graph

6835 Commits

Author SHA1 Message Date
Amy Reyes 2fbe9ccb42 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-08 11:02:26 -08:00
Amy Reyes dfe18717ed doc: terminology cleanup in HLD startup
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-08 11:02:26 -08:00
Amy Reyes a11c4592c3 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-08 11:00:30 -08:00
Amy Reyes b662ea1f08 doc: terminology cleanup in HLD virtio
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Replace VHM with HSM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-08 11:00:30 -08:00
Amy Reyes 602a380e03 doc: Update VT-d spec link
Publisher of this document confirmed that VT-d spec link should be updated, and the existing link will be EOL.

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-08 10:56:12 -08:00
Liu Long 342279fdc3 ACRN: DM: Vulnerable coding style in device-model
Fix the Vulnerable coding style in xhci and pci core

Tracked-On: #6769
Signed-off-by: Liu Long <longliu@intel.com>
Reviewed-by: Huang, Yonghua <yonghua.huang@intel.com>
2021-11-08 14:26:13 +08:00
Xiangyang Wu 511fd7b469 misc: config_tools: generate serial configuration file
Generate serial configuration file for service VM according
to scenario file and vUART ports base address allocated by
config tool.
Currently, some non-standard serial ports are emulated in
hypervisor and will be used to do communication between service
VM and user VM, so need to generate serial configuration file
to configure these serial ports for service VM.

v1-->v2:
	Fix some type issues
	Refine script code format

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-08 13:15:38 +08:00
Zhou, Wu 1bc25ed198 HV: refine the ve820 tab for pre-VMs
This patch moves the ssram area in ve820 tab, and reunites the
hpa1_low_part1/2 areas. The ve820 building code is refined.

before:
|<---low_1M--->|
|<---hpa1_low_part1--->|
|<---SSRAM--->|
|<---hpa1_low_part2--->|
|<---GPU_OpRegion--->|
|<---ACPI DATA--->|
|<---ACPI NVS--->|
---2G---

after:
|<---low_1M--->|
|<---hpa_low--->|
|<---SSRAM--->|
|<---GPU_OpRegion--->|
|<---ACPI DATA--->|
|<---ACPI NVS--->|
---2G---

The SSRAM area's address is described in the ACPI's RTCT/PTCT
table. To simplify the SSRAM implementation, SSRAM area was
identical mapped to GPA, and resulted in the divition of hpa_low.
Then the ve820 building logic became too complicated.

Now we managed to edit the guest's RTCT/PTCT table by offline
tools in the former patch, so we can move the guest's SSRAM
area, and reunite the hpa_low areas again.

After doing this, this patch rewrites the ve820 building code
in a much simpler way.

Tracked-On: #6674

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-08 13:13:14 +08:00
Zhou, Wu 48adda150c config-tools: move the pre RTVM's SSRAM base GPA
The pre-rtvm uses the RTCT tab to determine it's SSRAM address.
It was origionally duplicated from the host, and keeped its address
and layout.

To move the SSRAM area in ve820, we have to modify the guest's RTCT
tab first.

This patch uses the board_inspector's RTCT module to parse the host's
RTCT tab, and calculate the offset, then modifies the SSRAM/bin enties,
and saves it to the new RTCT bin file.

Tracked-On: #6674

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-11-08 13:13:14 +08:00
Zhou, Wu f1f6fe11c1 HV: move the ve820 GPU OpRegion address
The ve820 table' hpa1_low area is divided into two parts, which
is making the code too complicated and causing problems. Moving
the entries that divides the hpa1_low could make things easier.

This patch moves the GPU OpRegion to the tail area of 2G,
consecutive to the acpi data/nvs area.

before:
|<---low_1M--->|
|<---hpa1_low_part1--->|
|<---SSRAM--->|
|<---GPU_OpRegion--->|
|<---hpa1_low_part2--->|
|<---ACPI DATA--->|
|<---ACPI NVS--->|
---2G---

after:
|<---low_1M--->|
|<---hpa1_low_part1--->|
|<---SSRAM--->|
|<---hpa1_low_part2--->|
|<---GPU_OpRegion--->|
|<---ACPI DATA--->|
|<---ACPI NVS--->|
---2G---

Tracked-On: #6674

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-08 13:13:14 +08:00
Zhou, Wu e00421d5be HV: Fix the problems in ve820 acpi area
The length of the ACPI data entry in ve820 tab was 960K, while the
ACPI file is 1MB. It causes the ACPI file copy failed due to reserved
ACPI regions in ve820 table is not enough when loading pre-launched
VMs. This patch changes ACPI data area to 1MB to fix the problem.

And the ACPI data length was missed when calculating
ENTRY_HPA1_LOW_PART2 length. Fixed here too.

Also adds some refinement to the hard-coded ACPI base/addr definations

Tracked-On: #6674

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-08 13:13:14 +08:00
Yonghua Huang d12474f34b dm: fixup the alignment of software region address
Address of software SRAM configured by TCC tool shall be
 page-aligned. This patch fixup these addresses if they're
 not page aligned.

Tracked-On: #6778
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2021-11-08 10:26:08 +08:00
Victor Sun f8bb2064a4 config_tools: remove config of MAX_EFI_MMAP_ENTRIES
The config of MAX_EFI_MMAP_ENTRIES has been removed in hypervisor, so remove
this config in config_tools;

Tracked-On: #6442

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-11-08 09:49:24 +08:00
Victor Sun c5107123f6 HV: prepare adaptable guest EFI mmap buffer
Previously we prepared 32KB buffer to store guest VM boot parameters, in which
there is at most 17KB buffer for guest EFI memory map to accomodate ~400 EFI
memory descriptors. But this is uncertain to ensure working on all boards, now
change the algorithm that make the EFI mmap buffer adaptable with configured
MAX_EFI_MMAP_ENTRIES macro.

Tracked-On: #6442

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-11-08 09:49:24 +08:00
Victor Sun 914341c9aa hv: set default MAX_EFI_MMAP_ENTRIES to 350
In previous implementation we leave MAX_EFI_MMAP_ENTRIES in config tool and
let end user to configure it. However it is hard for end user to understand
how to configure it, also it is hard for board_inspector to get this value
automatically because this info is only meaningful during the kernel boot
stage and there is no such info available after boot in Linux toolset.

This patch hardcode the value to 350, and ASSERT if the board need more efi
mmap entries to run ACRN. User could modify the MAX_EFI_MMAP_ENTRIES macro
in case ASSERT occurs in DEBUG stage.

The More size of hv_memdesc[] only consume very little memory, the overhead
is (size * sizeof(struct efi_memory_desc)), i.e. (size * 40) in bytes.

Tracked-On: #6442

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2021-11-08 09:49:24 +08:00
Amy Reyes 546de2bfa9 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-04 14:14:42 -07:00
Amy Reyes ae9c6e3232 doc: Update virtio network in launch script
- Update description of virtio network setting in launch script to match:

https://projectacrn.github.io/latest/user-guides/acrn-dm-parameters.html
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-04 14:14:42 -07:00
Amy Reyes 61fa0ca132 Removed command prompts per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-04 14:11:42 -07:00
Amy Reyes 1f15968f07 Updated per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-04 14:11:42 -07:00
Amy Reyes fc064cfa79 doc: terminology cleanup in acrnlog readme
- Replace SOS with Service VM
- Update file paths to acrnlog directory
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-04 14:11:42 -07:00
Kunhui-Li dde617fa49 config_tools: fix UI issue don't expand the default value in xml file
when we click the "Import XML" button to import the scenario xml file, then
click the "Export XML" to export the xml files, we will find some errors because
UI don't show the default value set in schema.

As a workaround, we call default_populator.py in UI to expand the default value
in the scenario XML file to fix the issue.

Tracked-On: #6292
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-04 20:25:11 +08:00
Junjie Mao 83a938bae6 HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28
The coding guideline rules C-TY-27 and C-TY-28, combined, requires that
assignment and arithmetic operations shall be applied only on operands of the
same kind. This patch either adds explicit type casts or adjust types of
variables to align the types of operands.

The only semantic change introduced by this patch is the promotion of the
second argument of set_vmcs_bit() and clear_vmcs_bit() to
uint64_t (formerly uint32_t). This avoids clear_vmcs_bit() to accidentally
clears the upper 32 bits of the requested VMCS field.

Other than that, this patch has no semantic change. Specifically this patch
is not meant to fix buggy narrowing operations, only to make these
operations explicit.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao 2c86795fa8 HV: arch: fix a violation of coding guideline C-TY-24
The coding guideline rule C-TY-24 requires that 'cast shall not be
performed on a function pointer'. This patch removes a duplicated explicit
cast on timer_expired_handler in tsc_deadline_timer.c.

This patch has no semantic impacts.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao 9781873e77 HV: treewide: fix violations of coding guideline C-TY-12
The coding guideline rule C-TY-12 requires that 'all type conversions shall
be explicit'. Especially implicit cases on the signedness of variables
shall be avoided.

This patch either adds explicit type casts or adjust local variable types
to make sure that Booleans, signed and unsigned integers are not used
mixedly.

This patch has no semantic changes.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao db20e277b6 HV: treewide: fix violations of coding guideline C-TY-02
The coding guideline rule C-TY-02 requires that 'the operands of bit
operations shall be unsigned'. This patch adds explicit casts or literal
suffixes to make explicit the type of values involved in bit operations.
Explicit casts to widen integers before shift operations are also
introduced to make explicit that the variables are expanded BEFORE it is
shifted (which is already so in C99 but implicitly).

This patch has no semantic changes.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao b0dbc1cbfe HV: treewide: fix violations of coding guideline C-ST-02
The coding guideline rule C-ST-02 requires that 'the loop body shall be
enclosed with brackets', or more specifically, braces. This patch adds
braces to the single-line loop bodies.

This patch has no semantic change.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao ff891b4f79 HV: treewide: fix violations of coding guideline C-PP-04
The coding guideline rule C-PP-04 requires that 'parentheses shall be used
when referencing a MACRO parameter'. This patch adds parentheses to macro
parameters or expressions that are not yet wrapped properly.

This patch has no sematic impact.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao d5c137eac5 HV: treewide: fix violations of coding guideline C-FN-09
The coding guideline gule C-FN-09 requires that 'the formal parameter name
of a function shall be consistent'. This patch fixes two places where the
formal parameters are named differently in declarations and
definitions. More specifically, the names in declarations are replaced with
those in definitions.

This patch has no semantic impact.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao fba343bd05 HV: treewide: fix violations of coding guideline C-FN-06
The coding guideline rule C-FN-06 requires that 'a parameter passed by
value to a function shall not be modified directly'. This patch rewrites
two functions which does modify its parameters today.

This patch has no semantic impact.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao d4055d6157 HV: acpi_parser: fix violations of coding guideline C-CU-02
The coding guideline rule C-CU-02 requires that 'only one return statement shall
be in a function'. This patch refactors handle_dmar_devscope() which has
multiple return statements today.

This patch has no semantic changes.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao 3f3f4be642 HV: treewide: fix violations of coding guideline C-EP-05
The coding guideline rule C-EP-05 requires that 'parentheses shall be used
to set the operator precedence explicitly'. This patch adds the missing
parentheses detected by the static analyzer.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Junjie Mao 4cf6c288cd HV: treewide: fix warnings raised by Clang
This patch fixes the following warnings detected by the LLVM/Clang
compiler:

  1. Unused static functions in C sources, which are fixed by explicitly
     tagging them with __unused

  2. Duplicated parentheses around branch conditions

  3. Assigning 64-bit constants to 32-bit variables, which is fixed by
     promoting the variables to uint64_t

  4. Using { '\0' } to zero-fill an array, which is fixed by replacing it
     with { 0 }

  5. Taking a bit out of a variable using && (which should be & instead)

Most changes do not have a semantic impact, except item 5 which is probably
a real code issue.

Tracked-On: #6776
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-04 18:15:47 +08:00
Yifan Liu 496a653b0d dm: Fix potential overflow bug
Fix a potential overflow problem in get_more_acpi_dev_info where ch_read
might have a value greater than 32.

Tracked-On: #6769
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2021-11-04 10:34:13 +08:00
Kunhui-Li 2f5db5f4ee Revert "misc: config_tools: add vuart for communication"
This reverts commit 9e2edd5192.
Because config UI don't support multi legacy vuart in current logic,
we need to revert the commit to unblock UI.

Tracked-On: #6652
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-04 10:20:16 +08:00
Kunhui-Li c782795af8 config_tools: rename UOS to user vm in UI
since PRs #6760 and #6765 have landed,
we also need to rename "UOS" to "user vm" in UI.

Tracked-On: #6744
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-04 10:17:24 +08:00
David B. Kinder 8fb3ca83a6 doc: update last updated information on page footers
The "Last Updated" footer shows the date the page was published, not
when the content was last updated. This has caused readers some
confusion.  Update the footer with the date of the git commit that last
updated the document, and clarify with both the last modified and
published dates in the footer, something like this:

   Last modified: Aug 19, 2021. Published: Nov 03, 2021.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-03 19:10:56 -07:00
Kunhui-Li 9306de95a7 config_tools: fix the duplicate PT_SLOT value issue
when we add two or more virtio block devices and rename them for a VM
in launch xml files, then generate launch scripts through the UI.
After ensuring the devices names are different, we repeat these operations
continuously. Finally we will get the duplicate PT_SLOT value 30 for
different virtio block devices in a launch script. This is wrong.

As a workaround, we reassign PT_SLOT variate to reset it after the launch
script is generated every time.

Tracked-On: #6767
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-04 09:43:00 +08:00
Kunhui-Li 2b7c46377c config_tools: rename uos to user_vm in config UI
since PRs #6760 and #6747 have renamed uos to user_vm,
we also need to rename it in config UI.

Tracked-On: #6744
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-03 12:05:16 +08:00
Liu Long 7f846b7ecf Rename the xml file and generate launch script from uos to user_vm.
Tracked-On: #6744
Signed-off-by: Liu Long long.liu@linux.intel.com

Signed-off-by: Liu Long <long.liu@linux.intel.com>
2021-11-03 12:02:30 +08:00
Kunhui-Li 3124097a78 config_tools: remove hvlog parameter and update HV_RAM_START default address
1. remove hvlog parameter in bootargs for all platforms.
2. update HV_RAM_START default address from 2MB to 4MB.
3. add the check that the HV_RAM_START value should be larger
than or equal to 2MB and 2MB aligned.

Tracked-On: #6663
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-03 10:28:40 +08:00
Yang,Yu-chu 1bc7f0f6a5 config-tools: refine MMIO32/64_START and MMIO32/64_END
Get the start and end address based on all pci bus memory resource.

Tracked-On: #6752
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-03 09:28:23 +08:00
Xiangyang Wu 9e2edd5192 misc: config_tools: add vuart for communication
In this patch, add vuart configuration in scenario XML of
each board to support communication between service VM and
user VM since system shutdown feature need to send commands
through this vuart communication channel.

The follow changes are made in this patch:
- Add multi legacy vuart for service VM for communication
- Add one legacy vuart for user VM for communication
- Add 8250.nr_uarts parameter in command line of service OS

Tracked-On: #6652
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-03 09:13:41 +08:00
David B. Kinder 603780e6ef doc: draft release notes for v2.7
Start documenting the major changes to v2.7, in particular the UOS/SOS
term changes that impact the APIs and documentation, and the scenario name changes.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-02 18:04:26 -07:00
David B. Kinder fb226e2938 doc: clean up UOS/SOS and scenario names in glossary
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-02 18:04:06 -07:00
David B. Kinder 0bcb66e94e doc: tweak CSS for Sphinx/Breathe API documents
Words in the function prototypes looked run together making it hard to
read, so tweak the CSS to add a bit of padding.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-02 17:28:02 -07:00
Weiyi Feng 648b880f89 config_tools: Update launch xml for Sriov/GPU passthrough support
1. Update launch xml for Sriov/GPU passthrough support

Tracked-On: #6290
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-02 18:30:54 +08:00
Weiyi Feng 20f1dfd9c3 config_tools: Update GPU passthrough support
1. Remove gvt_args field.
2. Add passthrough GPU devices support.
3. Add sriov device support.

Tracked-On: #6290
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-02 18:30:54 +08:00
Hu Fenglin f65a87585b deb-pkg: add acrn-hypervisor and acrn-board-inspector into debian package
1. "make clean && make BOARD=nuc11tnbi5  SCENARIO=shared" will generate the acrn debian package.
 2. "make clean && make board_inspector" will generate the acrn board_inspector debian package

Tracked-On: #6688
Signed-off-by: Hu Fenglin <fenglin.hu@intel.com>
2021-11-02 15:31:18 +08:00
Peter Fang 856815bb5c OVMF release v2.7
- OvmfPkg/PlatformGopPolicy: Add OpRegion 2.1 support
- OvmfPkg: refine Platform GOP Policy

Tracked-On: #6749
Signed-off-by: Peter Fang <peter.fang@intel.com>
2021-11-02 15:11:42 +08:00
Yifan Liu 10963b04d1 hv: Fix vcpu signaling racing problem in lock instruction emulation
In lock instruction emulation, we use vcpu_make_request and
signal_event pairs to shoot down/release other vcpus.
However, vcpu_make_request is async and does not guarantee an execution
of wait_event on target vcpu, and we want wait_event to be consistent
with signal_event.

Consider following scenarios:

1, When target vcpu's state has not yet turned to VCPU_RUNNING,
vcpu_make_request on ACRN_REQUEST_SPLIT_LOCK does not make sense, and will
not result in wait_event.

2, When target vcpu is already requested on ACRN_REQUEST_SPLIT_LOCK (i.e., the
corresponding bit in pending_req is set) but not yet handled,
the vcpu_make_request call does not result in wait_event as 1 bit is not
enough to cache multiple requests.

This patch tries to add checks in vcpu_kick_lock_instr_emulation and
vcpu_complete_lock_instr_emulation to resolve these issues.

Tracked-On: #6502
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2021-11-02 15:01:20 +08:00