Commit Graph

7835 Commits

Author SHA1 Message Date
Chenli Wei 030b2f804c dm: fix the secure coding style violations
There was some secure coding style violations of virtio net and tmp,
this patch add some NULL check to fix these violations.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-08-02 18:01:24 +08:00
Conghui 7d987f9b0f dm: virtio-block: support NO_NOTIFY
disable NOTIFY during getting requests from virtqueue. This will improve
the IO performance.

Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-08-02 11:14:54 +08:00
Conghui 1bf3cb61f5 dm: virtio-blk: enable support for iothread
The usage is:

-s <slot> virtio-blk,[iothread,]<filepath>

e.g  -s 3 virtio-blk,iothread,test.img

Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-08-02 11:14:54 +08:00
Conghui fa69f79e33 dm: add iothread support in virtio framework
Add ioeventfd and iothread to virtio framework. When a virtio device
claim to support iothread, virtio framework will register a ioeventfd
and add it to iothread's epoll. After that, the new notify will come
through the iothread instead of the vcpu thread. The notify handler will
be called to process the request.

Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-08-02 11:14:54 +08:00
Conghui 4fd0a1900a dm: support iothread
Supply a decidate thread, which can moniter a set of fds with epoll,
when the data is ready, call the corresponding callback.

This iothread will be created automatically with the first successful
call to iothread_add,  and will be destroyed in iothread_deinit if it
was created.

Note, currenlty only support one iothread.

Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-08-02 11:14:54 +08:00
Chuang Ke 670ccf21f8 config_tool: Instruction missing for L2-only users
In the cache widget, there are instructions: "Drag the ends of the boxes to cover the cache chunks you want to allocate to specific VMs. If you have a real-time VM,ensure its cache chunks do not overlap with any other VM's cache chunks."

Tracked-On: #7921
Signed-off-by: Chuang-Ke <chuangx.ke@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-08-02 08:43:53 +08:00
Kunhui-Li fa8c149a38 cofig_tools: apply vBDF pattern check to vUART and ivshmem
apply vBDF pattern check to vUART and ivshmem.

Tracked-On: #7925
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-07-29 17:33:07 +08:00
Kunhui-Li 9a5f42e187 config_tools: add tooltips for cpu affinity
add tooltips for cpu affinity and tiny fix for virtio console device.

Tracked-On: #7933
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-07-29 17:33:07 +08:00
Kunhui-Li e83bea0882 config_tools: remove invaild hugepage check
Currently, on the whl-ipc-i5 platform, we found a warning message when
building ACRN with the shared scenario XML file from github.
However, this doesn't affect any feature of ACRN according to the QA's
test result.

So this patch removes this check in order not to confuse users at the first.
If necessary, we will add back the check after getting more detail.

v1-->v2
degrade the log level to debug.

Tracked-On: #7926
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-07-29 17:33:07 +08:00
Chenli Wei da44d6337a misc: refine slot issue of launch script
The current launch script allocate bdf for ivshmem by itself and have
not get bdf from scenario.

This patch refine the above logic and generate slot by user settings.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-07-29 17:03:45 +08:00
Yonghua Huang 95a938e50a hv: validate inputs in vpci_mmio_cfg_access
This function is registered as PCI MMIO configuration
  access handler, which processes PCI configuration access
  request from ACRN guest hence the inputs shall be validated
  to avoid potential hypervisor crash when handling inputs
  from malicious guests.

Tracked-On: #7902
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-07-29 10:30:08 +08:00
Minggui Cao 83164d6030 hv: shell: improve console to modify input easier
1. make memcpy_erms as a public API; add a new one
  memcpy_erms_backwards, which supports to copy data from tail to head.

  2. improve to use right/left/home/end key to move cursor, and support
delete/backspace key to modify current input command.

Tracked-On: #7931
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-07-28 23:31:43 +08:00
Minggui Cao d5b2c82156 hv: shell: improve console to buffer history cmds
1. buffer history commands.
  2. support up/down key to select history buffered commands

Tracked-On: #7931
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-07-28 23:31:43 +08:00
David B. Kinder 22662b579c doc: add v3.0.1 release notes
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-07-27 20:42:31 -07:00
Yonghua Huang 8c4ad317de doc: update security advisory for 3.0.1 release
Update security advisory for release_3.0.1

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-07-27 08:25:25 -07:00
Chuang Ke c46c78591d [config_tool] Order of plus and minus icons is inconsistent
let minus icons in front of plus icons in those views below: Virtio input device, Virtio network device, Virtio console device, CPU affinity.

Tracked-On: projectacrn#7917
Signed-off-by: Chuang-Ke <chuangx.ke@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-07-27 20:57:25 +08:00
chuangxke e5a9c36095 show warning message when users attempt to create a new scenario
fix warning message when users attempt to create a new scenario, or import an existing scenario, for an existing configuration

Tracked-On: #7898
Signed-off-by: Chuang-Ke chuangx.ke@intel.com
Reviewed-by: Junjie Mao junjie.mao@intel.com
2022-07-27 20:22:35 +08:00
Weiyi Feng 715a597e37 config_tools: fix CAT data can not be load back issue
fix CAT data can not be load back issue

Tracked-On: #6691
Signed-off-by: Weiyi Feng <fwy1998@gmail.com>
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-07-27 09:54:36 +08:00
Liu Long 49d6a909cd ACRN:DM: Correct vhost_ext_features network bit
Use the VHOST_NET_F_VIRTIO_NET_HDR in linux system header file,
and set the correct feature bit for Virtio net header.

Tracked-On: #7790
Signed-off-by: Liu Long <long.liu@linux.intel.com>
2022-07-27 07:57:29 +08:00
Liu Long 73c529a903 ACRN:DM: Free virtio_vsock struct resource in deinit function
Free the virtio_vsock struct resource in virtio vsock deinit function
in case memory leak.

Tracked-On: #7759
Signed-off-by: Liu Long <long.liu@linux.intel.com>
2022-07-27 07:57:29 +08:00
Liu Long 6e18d2bd8f ACRN: DM: Fix the vsock error info.
Replace the exclamation mark with period mark in debug info and fix
the Guest CID max value macro.

Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
2022-07-27 07:57:29 +08:00
David B. Kinder ad0297ff02 doc: explain configurator error check and display model
We aluready updated the GSG to discuss how to find and address errors
when using the configurator (specifically doing a save scenario to check
for errors or to verify all errors were resolved). Add a description of
this error interaction model to the configurator tool documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-07-26 09:33:51 -07:00
Jian Jun Chen 22a302599a hv: tlfs: fix the incorrect vLAPIC freq MSR
When LAPIC timer is working in oneshot or periodic mode, OS uses
initial counter register/current counter register to program
a timer. Both initial counter and current counter depend on the
LAPIC frequency. ACRN emulated vLAPIC timer based on the TSC.
vLAPIC freq is the same as TSC freq.

Tracked-On: #7876
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
2022-07-26 05:53:19 +08:00
chuangxke a3449c4893 config_tools: add two spaces for error messgae.
add two spacings in alert sentence.

Tracked-On: #7915
Signed-off-by: Chuang-Ke <chuangx.ke@intel.com>
Reviewed-by:Junjie Mao <junjie.mao@intel.com>
2022-07-25 10:32:26 +08:00
zihengL1 6ced747e10 config-tools: fix board inspector crashed error
Fixed the problem of exception handling of the
incoming type error in reading GSI number method
in 40-acpi-tables.py line 37 when dmesg command
line is too long.

Tracked-On: #7906
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-22 10:15:21 +08:00
Yifan Liu 4f4da08490 hv: cve hotfix: Disable RRSBA on platform using retpoline
For platform that supports RRSBA (Restricted Return Stack Buffer
Alternate), using retpoline may not be sufficient to guard against branch
history injection or intra-mode branch target injection. RRSBA must
be disabled to prevent CPUs from using alternate predictors for RETs.

Quoting Intel CVE-2022-0001/CVE-2022-0002:

Where software is using retpoline as a mitigation for BHI or intra-mode BTI,
and the processor both enumerates RRSBA and enumerates RRSBA_DIS controls,
it should disable this behavior.
...
Software using retpoline as a mitigation for BHI or intra-mode BTI should use
these new indirect predictor controls to disable alternate predictors for RETs.

See: https://www.intel.com/content/www/us/en/developer/articles/technical/
 software-security-guidance/technical-documentation/branch-history-injection.html

Tracked-On: #7907
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-07-22 09:38:41 +08:00
Kunhui-Li de8877e71a config_tools: add tooltips for virtio devices
add tooltips for virtio network, input and console.

Tracked-On: #7897
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-07-21 16:49:36 +08:00
Kunhui-Li 3aee139da9 config_tools: left-align the plus icon in the virtio devices
left-align the plus icon in the virtio devices so that they
match the alignment in the IVSHMEM widget.

Tracked-On: #7897
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-07-21 16:49:36 +08:00
Yifan Liu 2edd704a3b misc: configurator: bugfix: incorrect path split
Board files with multiple dots in their name may be splitted
incorrectly, and os.path.basename assumes os.name == posix in pyodide
environment. This workaround partially fixes this problem whenever the
the board filename does not contain '\' character.

Tracked-On: #7582
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-07-20 12:19:42 +08:00
Yifan Liu 63ff99a8da misc: configurator: fix minor typo
Tracked-On: #7707
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-07-20 12:19:42 +08:00
Kunhui-Li 7acf4fee9c config_tools: remove VMX and VT-d invalid BIOS check in acrn-board-inspector
this patch removes VMX and VT-d invalid BIOS setting check in
acrn-board-inspector because the board inspector tool also adds
these checks (please refer to PR #7216) and may it's possible for user
to get the wrong information by these two check in acrn-board-inspector.

so we remove the repeated check in acrn-board-inspector.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-07-20 11:48:27 +08:00
Weiyi Feng fd8c9800ae config_tools: add icon for configurator
add icon for configurator

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2022-07-20 11:48:27 +08:00
Jeremy Ouillette 1370965443 Some Debian dependencies are currently missing in the /debian/control file. This change adds these missing dependencies:
Source: acrn-hypervisor
- python3-requests
- python3-tqdm

Package: python3-acrn-board-inspector
- usbutils

Tracked-On: #6688
Signed-off-by: Jeremy Ouillette <jeremy.ouillette@intel.com>
2022-07-20 11:01:01 +08:00
David B. Kinder fed4f81e30 doc: include sample app doc but unhook from toctree
Documentation for the sample app isn't ready for the public, so let's
not add it to the toctree yet (use the :orphan: role to stop Sphinx from
complaining about an unreferenced .rst file)

Tracked-On: #7820

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-07-20 09:36:03 +08:00
Geoffroy Van Cutsem 7b25da00ae doc: add ACRN Sample App doc to toctree
Add the ACRN Sample App document (README.rst) to the toctree
Convert the README.rst from Dos to Unix text file format

Tracked-On: #7820
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-07-20 09:36:03 +08:00
Matthew Leon 0e0bf3321f Fix string bug in webapp
Tracked-On: #7820
Signed-off-by: Matthew Leon <matthew.leon@intel.com>
2022-07-20 09:36:03 +08:00
Matthew Leon dcb01e1de2 Fix bugs and clean up code
Tracked-On: #7820
Signed-off-by: Matthew Leon <matthew.leon@intel.com>
2022-07-20 09:36:03 +08:00
Matthew Leon 905b31549e sample app: conform README to repo RST standard
This commit changes the README from Markdown to RST.

Tracked-On #7820
Signed-off-by: Matthew Leon <matthew.leon@intel.com>
2022-07-20 09:36:03 +08:00
Matthew Leon d8f55c7bca sample app: initial import of the sample app
This sample application allows the user to get the hypervisor and a simple Virtual Machine Scenario to run
This sample application assumes the user is following the sample app guide in the acrn hypervisor documentation

Tracked-On: #7820
Signed-off-by: Matthew Leon <matthew.leon@intel.com>
2022-07-20 09:36:03 +08:00
David B. Kinder c6fcda2a0d doc: add configurator error handling to GSG
Explain that consistency and validation checks of the schema are done
when a schema is imported/created or when it's saved, and after you
resolve any errors, you need to save the scenario to force another
schema validation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-07-19 13:37:33 -07:00
Chenli Wei ccf80a5ec2 doc: update vUART tutorials
The current code assign COM2 to S5 feature as a commutation vUART, so
the COM2's IO port which value is 0x2F8 could not assign to another
vUART connection.

This patch add a note and modify the legacy vUART sample, change the
default IO port to 0x3E8 which was known as COM3.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-07-19 10:25:34 -07:00
Kunhui-Li 69e1ec970c config_tools: update gpu passthru doc
add "i915.modeset=0" in kernel cmd line parameter for
allowing users to access a Ubuntu desktop.

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-07-18 10:12:08 -07:00
Kunhui-Li 39626609d0 config_tools: apply pattern check to virtio input id
this patch applies pattern check to virtio input id. Report error if
regex doesn't match.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-07-18 18:01:24 +08:00
Kunhui-Li df0c683c6c config_tools: apply pattern check to interface name
This patch applies pattern check to network interface name.
Report error if regex doesn't match.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-07-18 18:01:24 +08:00
Jian Jun Chen c88860250e hv: tlfs: add tlfs TSC freq MSR support for WaaG
TLFS defined 2 vMSRs which can be used by Windows guest to get the
TSC/APIC frequencies from hypervisor. This patch adds the support
of HV_X64_MSR_TSC_FREQUENCY/HV_X64_MSR_APIC_FREQUENCY vMSRS whose
availability is exposed by CPUID.0x40000003:EAX[bit11] and EDX[bit8].

v1->v2:
- revise commit message to highlight that the changes are for WaaG

Tracked-On: #7876
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2022-07-18 16:15:29 +08:00
Jian Jun Chen 97a2919138 hv: tsc: calibrate TSC by HPET
On some platforms CPUID.0x15:ECX is zero and CPUID.0x16 can
only return the TSC frequency in MHZ which is not accurate.
For example the TSC frequency obtained by CPUID.0x16 is 2300
MHZ and the TSC frequency calibrated by HPET is 2303.998 MHZ
which is much closer to the actual TSC frequency 2304.000 MHZ.
This patch adds the support of using HPET to calibrate TSC
when HPET is available and CPUID.0x15:ECX is zero.

v3->v4:
  - move calc_tsc_by_hpet into hpet_calibrate_tsc

v2->v3:
  - remove the NULL check in hpet_init
  - remove ""& 0xFFFFFFFFU" in tsc_read_hpet
  - add comment for the counter wrap in the low 32 bits in
    calc_tsc_by_hpet
  - use a dedicated function for hpet_calibrate_tsc

v1->v2:
  - change native_calibrate_tsc_cpuid_0x15/0x16 to
    native_calculate_tsc_cpuid_0x15/0x16
  - move hpet_init to BSP init
  - encapsulate both HPET and PIT calibration to one function
  - revise the commit message with an example"

Tracked-On: #7876
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2022-07-17 16:48:47 +08:00
zihengL1 047a11dff3 config-tools: hide the 'update-pciids: download failed' message
Use stderror to redirect error message to subprocess.DEVNULL
to hide it when the "update pciids" command is called.

Tracked-On: #7886
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-17 16:30:53 +08:00
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00
Ziheng Li d5f3643e4f config_tool: Move "BIOS Revision" line in Configurator UI
Placed the "BIOS Revision:" at the top line of BIOS
information, and change the order of the information to have
the board information to the left, and BIOS information to the right.

Tracked-On: #7884
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:27:50 +08:00
Junjie Mao df41ce807f config_tools: resolve incompatibility with elementpath 2.5.3
This patch adds to the customized function `number-of-clos-id-needed` more
robust checks, which ensures that a given node is a concrete element,
before that function passes the node to `get_policy_list`. This resolves
the incompatibility issue with elementpath 2.5.3 which is reported in v3.0.

Tracked-On: #7893
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-07-15 10:56:50 +08:00