Commit Graph

4564 Commits

Author SHA1 Message Date
Deb Taylor ba5099e69f Doc: Content edits to the acrntrace README file.
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
2019-12-16 16:25:15 -05:00
Yuan Liu 6289124e7c doc: add windows 10 activation
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
2019-12-16 09:54:56 -05:00
Jian Jun Chen 42b8b6eb6e doc: Update WaaG GSG to use ACRNGT GOP to install Windows
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
2019-12-16 09:51:35 -05:00
Geoffroy Van Cutsem e0b323f5ef doc: add a little info on how to configure the boot options
Add a little information (at least pointers) as to how one can change the VM
(Pre-launched, Service or User) boot options.

Tracked-On: #3758
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-12-16 09:46:07 -05:00
Yonghua Huang ee8a3e3826 doc:debug feature is disabled by default
Update guidance to build ACRN from source,
as debug feature is disabled by default in Makefile.

 'RELEASE' shall be 0 if debug feature is required.

Tracked-On: #4222
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-12-16 09:11:24 -05:00
Geoffroy Van Cutsem 72b1a409bb doc: add new dependency to Clear Linux ACRN builder container
Since commit 9e9e1f61, a new build dependency on the NUMA library has been
introduced. We therefore need to add the `devpkg-numactl` bundle to our
Dockerfile used to build the Clear Linux "ACRN builder" container image.

Tracked-On: #4175
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-12-16 15:34:26 +08:00
Shiqing Gao 3cee259583 hv: msr: remove redundant check in write_pat_msr
Reserved bits in a 8-bit PAT field has been checked in pat_mem_type_invalid.
Remove this redundant check "(PAT_FIELD_RSV_BITS & field) != 0UL" in
write_pat_msr.

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-12-16 14:32:42 +08:00
Yonghua Huang d4677a8917 hv:fix crash issue when handling HC_NOTIFY_REQUEST_FINISH
Input 'vcpu_id' and the state of target vCPU should be validated
properly:

  - 'vcpu_id' shall be less than 'vm->hw.created_vcpus' instead
     of 'MAX_VCPUS_PER_VM'.
  - The state of target vCPU should be "VCPU_PAUSED", and reject
    all other states.

Tracked-On: #4245
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-16 09:44:12 +08:00
Victor Sun 5702619620 HV: kconfig: add range check for memory setting
When user use make menuconfig to configure memory related kconfig items,
we need add range check to avoid compile error or other potential issues:

CONFIG_LOW_RAM_SIZE:(0 ~ 0x10000)
		the value should be less than 64KB;

CONFIG_HV_RAM_SIZE: (0x1000000 ~ 0x10000000)
		the hypervisor RAM size should be supposed between
		16MB to 256MB;

CONFIG_PLATFORM_RAM_SIZE: (0x100000000 ~ 0x4000000000)
		the platform RAM size should be larger than 4GB
		and less than 256GB;

CONFIG_SOS_RAM_SIZE: (0x100000000 ~ 0x4000000000)
		the SOS RAM size should be larger than 4GB
		and less than 256GB;

CONFIG_UOS_RAM_SIZE: (0 ~ 0x2000000000)
		the UOS RAM size should be less than 128GB;

Tracked-On: #4229

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-12-16 09:36:44 +08:00
Victor Sun 64bbd37fd7 HV: Kconfig: set default Kata num to 1 in SDC
Set default CONFIG_KATA_VM_NUM to 1 in SDC scenario so that user could
have a try on Kata container without rebuilding hypervisor.

Please be aware that vcpu affinity of VM1 in CPU partition mode
would be impacted by this patch.

Tracked-On: #4232

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-16 09:36:44 +08:00
Wei Liu 98b3dd9426 acrn-config: set HV_RAM_START above 256M for new board
Hv could be failed when hv ram start address when around 16, beacause when
booting from grub mode, hv and sos ram address would be overlaped.
This patch set the HV_RAM_START address above 256M for new board.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 464639e8d3 acrn-config: add 'ramdisk_mod' item tag for tgl-rvp
Add missing 'ramdisk_mod' item tag of industry config xml for tgl-rvp.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 13d6b69d65 acrn-config: set DRHDx_IGNORE while no DEV_SCOPE in DRHD
Set the DRHDx_IGNORE to false even there is no DEV_SCOPE under this
DRHD.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu 12a9bc29df acrn-config: add CONFIG_SERIAL_x for new board
Add CONFIG_SERIAL_x in $(borad).config, this will help to output
console log and help new board debug.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Wei Liu d699347e7b acrn-config: change gvt_args from selectbox to editbox
1. Some VMs don't need pci-gvt args or or need specific configuration
for 'gvt_args' item tag, this patch changes from selectable behavior to
editable for 'gvt_args' item from webUI.

2. Modify the description for gvt_args item tag from launch config xmls.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 13:48:14 +08:00
Yonghua Huang 05682b2bad hv:bugfix in write protect page hypercall
This patch fixes potential hypervisor crash when
 calling hcall_write_protect_page() with a crafted
 GPA in 'struct wp_data' instance, e.g. an invalid
 GPA that is not in the scope of the target VM's
 EPT address space.

 To check the validity for this GPA  before updating
 the 'write protect' page.

Tracked-On: #4240
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2019-12-13 10:42:31 +08:00
Vijay Dhanraj 1636ac0416 acrn-config: Add non-contiguous HPA to currently supported hardware.
For currently supported hardware such as KNL NUC, the scenario xml
file is not generated and the newly added non-contiguous variables
will not be present. This can lead to build issues. This patch adds
the second non-contiguous HPA variable to all supported hardware
for both logical_partition and hybrid modes. It also adds checks
to ensure that HPA2 is valid before using it while creating the
guest VM ve820.

Tracked-On: #4242
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-13 10:13:27 +08:00
Kaige Fu 2777f23075 HV: Add helper function send_single_nmi
This patch adds a helper function send_single_nmi. The fisrt caller
will soon come with the following patch.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-13 10:13:09 +08:00
Kaige Fu 525d4d3cd0 HV: Install a NMI handler in acrn IDT
This patch installs a NMI handler in acrn IDT to handle
NMIs out of dispatch_exception.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-13 10:13:09 +08:00
Kaige Fu fb346a6c11 HV: refine excp/external_interrupt_save_frame and excp_rsvd
There are lines of repeated codes in excp/external_interrupt_save_frame
and excp_rsvd. So, this patch defines two .macro, save_frame and restore_frame,
to reduce the repeated codes.

No functional change.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-13 10:13:09 +08:00
Mingqiang Chi 7f96465407 hv:remove need_cleanup flag in create_vm
remove this redundancy flag.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-12 16:34:13 +08:00
Victor Sun 67ec1b7708 HV: expose port 0x64 read for SOS VM
The port 0x64 is the status register of i8042 keyboard controller. When
i8042 is defined as ACPI PnP device in BIOS, enforce returning 0xff in
read handler would cause infinite loop when booting SOS VM, so expose
the physical port read in this case;

Tracked-On: #4228

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-12 13:51:24 +08:00
Victor Sun a44c1c900c HV: Kconfig: remove MAX_VCPUS_PER_VM in Kconfig
In current architecutre, the maximum vCPUs number per VM could not
exceed the pCPUs number. Given the MAX_PCPU_NUM macro is provided
in board configurations, so remove the MAX_VCPUS_PER_VM from Kconfig
and add a macro of MAX_VCPUS_PER_VM to reference MAX_PCPU_NUM directly.

Tracked-On: #4230

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-12 13:49:28 +08:00
Victor Sun 0ba8434838 acrn-config: rename CONFIG_MAX_PCPU_NUM to MAX_PCPU_NUM
The macro definition is changed in hypervisor code, so modify acrn-config
side accordingly.

Tracked-On: #4230

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-12-12 13:49:28 +08:00
Victor Sun ea3476d22d HV: rename CONFIG_MAX_PCPU_NUM to MAX_PCPU_NUM
rename the macro since MAX_PCPU_NUM could be parsed from board file and
it is not a configurable item anymore.

Tracked-On: #4230

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-12 13:49:28 +08:00
Wei Liu 67b416d523 acrn-config: hide non-legacy serial port as SOS console
SOS vm only support legacy serial port emulation, so we need to
hide non-legacy serial ports from webUI when user want to select
serial port as SOS console.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu deb5ed1f76 acrn-config: unify get_vuart_info_id api in config tool
1. unify get_vuart_info_id/get_vuart_id api in board/scenario/launch
config tool.
2. if vm use 'vuart1(tty)' method to power off, make sure this vm have
select the vuart1 'SOS_COM2_BASE'.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu 212d030b9a acrn-config: add 'poweroff_channel' support for launch config
Add pm_channel support to parse and get 'poweroff_channel' item value
from launch config files, these values are selectable by user.

Tracked-On: #4212
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu 7446d41f20 acrn-config: modify 'poweroff_channel' info in launch xmls
Some vm need power off method, so modify 'poweroff_channel'
item in the launch config files that user could select them from webUI.

Tracked-On: #4212
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu 0f19f87891 acrn-config: add 'virtio-console' info in launch xmls
1. Some vm need mediator of 'virtio-console', so add 'console' item
into 'virtio_devices' leaf that user could edit them from webUI.

2. Add 'vuart0' item to enable/disable serial console emulation by
device model.

Tracked-On: #4186
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Wei Liu bad3c53c1e acrn-config: add 'virtio-console' mediator support for launch config
Add virtio-console mediator support to parse and get 'virtio-console' item value
from launch config files, these values are editable by user.

Tracked-On: #4186
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 10:46:02 +08:00
Mingqiang Chi b6bffd01ff hv:remove 2 unused variables in vm_arch structure
remove 'guest_init_pml4' and 'tmp_pg_array' in vm_arch
since they are not used.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-12-12 10:13:11 +08:00
Yonghua Huang 422a051c30 Makefile: Build Release version by default
Update build option for 'acrn-hypervisor', build release
 version by default.

Tracked-On: #4222
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-12-12 09:12:03 +08:00
Shiqing Gao e95b316dd0 hv: vtd: fix improper use of DMAR_GCMD_REG
The initialization of "dmar_unit->gcmd" shall be done via reading from
Global Status Register rather than Global Command Register.

Rationale:
According to Chapter 10.4.4 Global Command Register in VT-d spec, Global Command
Register is a write-only register to control remapping hardware.
Global Status Register is the corresponding read-only register to report remapping
hardware status.

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-12-12 09:11:04 +08:00
Vijay Dhanraj 68ea2cc62e acrn-config: Fix ve820 table generation when guest memory size is >512MB
This patch fixes an issue with generation of guest ve820 when the size
of the memory is >512MB. The issue is primarily with respect to converting
between hex and int.

Tracked-On: #4219
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-12 09:10:30 +08:00
Junming Liu f2bf3d3ed1 dm:gvt:update bus0 memlimit32 value
Now the GVT already tries to reserve the region.
the problem is that the region should be
reflected in PCI BUS0 memlimit32 and updated to DSDT table.

As the GVT PCI bar0/2 is in reserved region
and not updated to memlimit32 in DSDT table,
the problem is triggered.

Tracked-On: projectacrn#4227

Signed-off-by: Junming Liu <junming.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-12-12 09:04:30 +08:00
Mingqiang Chi acb5affd0b doc:update acrn-shell.rst
update this doc related with dump host & guest memory.

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-12-11 19:10:36 -05:00
Kaige Fu 413f098b11 Doc: Add libnuma dependency for acrntrace
"9e9e1f61 acrntrace: Add opt to specify the cpus where we should capture the data"
uses APIs of libnuma. So this patch adds dependency of libnuma in building-from-source.rst.

libnuma functions have been included in os-core-dev bundle of clearlinux.

Tracked-On: #4175
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-11 17:31:17 -05:00
Victor Sun a90f4a0a53 Makefile: print config summary at the end
The BOARD and SCENARIO parameter of make hypervisor might be overridden
by menuconfig file or BOARD/SCENARIO XML files in make process, also the
$(BOARD)_acpi_info.h would be involved in build if exist, but user might
not be aware of that because the message could be easily ignored from
flooding logs. So give the configuration summary at the end of hypervisor
build process would be helpful for end user.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-12-11 13:31:34 +08:00
Vijay Dhanraj 9729fe07fd acrn-config: support non-contiguous HPA for hybrid scenario
The patch adds acrn-config tool support for adding
non-continguous HPA allocations for pre-launched VMs
in hybrid scenario.

Tracked-On: #4217
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-12-11 10:12:46 +08:00
Vijay Dhanraj c8a4ca6c78 HV: Extend non-contiguous HPA for hybrid scenario
This patch extends non-contiguous HPA allocations for
pre-launched VMs in hybrid scenario.

Tracked-On: #4217
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-11 10:12:46 +08:00
Shuo A Liu b32ae229fb hv: sched: use hypervisor configuration to choose scheduler
For now, we set NOOP scheduler as default. User can choose IORR scheduler as needed.

Tracked-On: #4178
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-11 09:31:39 +08:00
Shuo A Liu 6a144e6e3e hv: sched: add yield support
Add yield support for schedule, which can give up pcpu proactively.

Tracked-On: #4178
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-11 09:31:39 +08:00
Shuo A Liu 6554437cc0 hv: sched_iorr: add some interfaces implementation of sched_iorr
Implement .sleep/.wake/.pick_next of sched_iorr.
In .pick_next, we count current object's timeslice and pick the next
avaiable one. The policy is
  1) get the first item in runqueue firstly
  2) if object picked has no time_cycles, replenish it pick this one
  3) At least take one idle sched object if we have no runnable object
     after step 1) and 2)
In .wake, we start the tick if we have more than one active
thread_object in runqueue. In .sleep, stop the tick timer if necessary.

Tracked-On: #4178
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-12-11 09:31:39 +08:00
Shuo A Liu b39630a8e0 hv: sched_iorr: add tick handler and runqueue operations
sched_control is per-pcpu, each sched_control has a tick timer running
periodically. Every period called a tick. In tick handler, we do
  1) compute left timeslice of current thread_object if it's not the idle
  2) make a schedule request if current thread_object run out of timeslice

For runqueue maintaining, we will keep objects which has timeslice in
the front of runqueue and the ones get new replenished in tail.

Tracked-On: #4178
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-12-11 09:31:39 +08:00
Shuo A Liu f44aa4e4c9 hv: sched_iorr: add init functions of sched_iorr
We set timeslice to 10ms as default, and set tick interval to 1ms.
When init sched_iorr scheduler, we init a periodic timer as the tick and
init the runqueue to maintain objects in the sched_control. Destroy
the timer in deinit.

Tracked-On: #4178
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-11 09:31:39 +08:00
Shuo A Liu ed4008630d hv: sched_iorr: Add IO sensitive Round-robin scheduler
IO sensitive Round-robin scheduler aim to schedule threads with
round-robin policy. Meanwhile, we also enhance it with some fairness
configuration, such as thread will be scheduled out without properly
timeslice. IO request on thread will be handled in high priority.

This patch only add a skeleton for the sched_iorr scheduler.

Tracked-On: #4178
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-12-11 09:31:39 +08:00
Gary 3c8d465a11 acrnboot: correct the calculation of the end boundry of _DYNAMIC region
The calculation of the end boundry address is corrected by
    adding the size extracted from _DYNAMIC to start address
    in type of uint8_t while improving the code by calulating
    the end boundry address after scanning, also reducing type
    casts accordingly.

Tracked-On: projectacrn#4191
Signed-off-by: Gary <gordon.king@intel.com>
2019-12-11 09:31:24 +08:00
Kaige Fu 0bf03b411e acrntrace: Set FLAG_CLEAR_BUF by default
Normally, we care more about the current trace data than
buffered old data. So, this patch set FLAG_CLEAR_BUF by
default and adds one new option '-r' to unset the FLAG_CLEAR_BUF
if we want to capture the buffered old data.

---
  v1 -> v2:
  Add 'deprecated' mark to '-c' option

Tracked-On: #4175
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00
Kaige Fu 9e9e1f61ad acrntrace: Add opt to specify the cpus where we should capture the data
This patch adds one new option '-a' to specify the cpus where we should
capture the trace data. If the this option is not set or set with wrong
optarg, we will capture the trace data of all possible cpus.

The set of the cpus can be specified as A,B,C, or A-C, or A,D-F, and so on.

Tracked-On: #4175
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-10 15:11:12 +08:00