Commit Graph

1793 Commits

Author SHA1 Message Date
Jack Ren cd4919a93c version: v0.2
Signed-off-by: Jack Ren <jack.ren@intel.com>
2018-09-25 09:44:20 +08:00
David B. Kinder d08256dfa9 doc: code-block text not readable
The .. code-block:: console directive (used for white text on a black
background) didn't handle some CSS cases properly resulting in
unreadable grey text on a black background.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-24 15:31:37 -07:00
David B. Kinder 23cf8079e7 doc: update tagged release doc build instructions
Update the doc build instructions to include how to update the version
navigation selector (bottom of the left nav panel), and make commands
for building and publishing specific tagged releases (e.g., 0.2)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-24 13:43:03 -07:00
David B. Kinder b5bf00b6e0 doc: update doc version menu for v0.2 release
Update conf.py selector list to include version 0.2 documentation (and
fix an URL typo in the release notes).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-24 11:01:15 -07:00
David B. Kinder c7d87795f0 doc: release notes update for v0.2 release
Remove "DRAFT" indicator, and a few tweaks to repo description and
download instructions noticed in PR #1316

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-24 10:44:19 -07:00
Xie, nanlin 8dba99f8c1 doc: Add new known issue in v0.2 release note.
Add new known issue in v0.2 release note.

Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2018-09-24 08:50:34 -07:00
David B. Kinder f20ca31145 doc: add tags and checkout info to release notes
Add instructions for accessing source for the v0.2 tagged
release.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-20 23:19:26 -07:00
Xie, nanlin 6709a08580 doc: Add change log in v0.2 release note.
Add change log in v0.2 release note.

Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2018-09-20 21:30:57 -07:00
David B. Kinder 7dd3207a6a doc: fix typo in network virt hld
punctuation fix

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-20 10:23:48 -07:00
David B. Kinder 01ce3b6aee doc: sort title in developer HLD section
We've got enough docs now that it would be better to put them in sorted
order by title.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-20 10:11:12 -07:00
David B. Kinder dae98a0409 doc: add network virtualization hld
Review, edit, and transcode network virtualization doc

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-20 10:02:43 -07:00
David B. Kinder 55a71e402d doc: add watchdog high-level design
Review, transcode, and publish watchdog high-level design doc.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-20 09:57:55 -07:00
David B. Kinder 31285a9fdd doc: add security hld document
review and publish ACRN security hld document, also added the oplus
replacement symbol

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-20 09:45:36 -07:00
Sainath Grandhi 8c9e0d17db hv: init_iommu rework to enable IOMMU for partition mode ACRN
Current code enables IOMMU from init_iommu_vm0_domain which is called
from vm0/sos boot sequence. For partition mode VMs, this is not called as
VMs are numbered from 1.

This patch adds support to initialize root table pointer for each IOMMU
and enable all IOMMUs from init_iommu. Hence IOMMUs are enabled even
though ACRN does not boot vm0.

This patch also has changes to fix #1270.

Tracked-On: #1246 #1270
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2018-09-20 11:14:07 +08:00
Binbin Wu 53731905d7 dm: passthru: enable NHLT table for audio passthru
CAVS audio driver depends on the NHLT table to get topology info.
Enable NHLT table in DM for audio passthrough.
Also increase the size reserved for NHLT in ACPI table from 2048B to 2560B.

Tracked-On: #1284
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-09-20 11:13:32 +08:00
CHEN Gang 33acca5d86 tools: acrn-crashlog: exclude crashlog tool for release version
This patch is to exclude crashlog tool for release version.

Tracked-On: #1024
Signed-off-by: CHEN Gang <gang.c.chen@intel.com>
Reviewed-by: Zhi Jin <zhi.jin@intel.com>
Acked-by: Zhang Di <di.zhang@intel.com>
2018-09-20 11:12:52 +08:00
Chaohong guo 9817eb3909 Add a comment for switch fallthrough to quiet lint warning
Some code has switch fallthrough cases, it causes some warning during
compiling. Adding a comment can quiet it.

Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Acked-by: Gen Zheng <gen.zheng@intel.com>
2018-09-19 14:32:02 +08:00
Chaohong guo 0306bb47c8 Removed dead funcs in EFI stub module
Due to the last patches, some funcs in malloc.c and stdlib.h files for
EFI stub module are no longer used. This commit just removes them, no
other changes is being introduced. The funcs are:
    emalloc/efree, calloc/malloc/free, strstr/strdup

Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Ackedr-by: Gen Zheng <gen.zheng@intel.com>
2018-09-19 14:32:02 +08:00
Chaohong guo 1d15b98730 Replace the call to emalloc() to uefi pool allocation
emalloc() is called only by construct_mbi() during creating e820 mmap
layout. The switching has two benefits: first, UEFI FW might keep some
memory in pool, unlike call to emalloc(), call to allocate_pool() might
have no impact on e820 mmap; on the other hand, we can remove emalloc()
routine after this switching.

Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Reviewed-by: Anthony Xu <Anthony.Xu@intel.com>
Acked-by: Gen Zheng <gen.zheng@intel.com>
2018-09-19 14:32:02 +08:00
Chaohong guo 951a24cd3d allocate boot related struct right after hypervisor memory
To reduce the call to dynamic memory allocation, the patch tries to
alloate memroy together with hypervisor when hypervisor is being
relocated by efi stub code. The memory allocated will be right at the
end of HV memory. Three structs will be done in this way: 1) boot_ctx,
which saves EFI boot state and is passed to SOS; 2) multiboot_info,
faked multi-boot header for passing boot info to hypervisor;  and 3)
multiboot_mmap, e820 mmap structure.

after this, the EFI stub code (which boot hypervisor) will only have 3
to dynamic memory:
 1. the call for hv binary and the 3 struct;
 2. the call to CPU boot trampoline code;
 3. the call to alloc mmap buf when inquery memory layout from UEFI FW;

Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Reviewed-by: Jason Chen <jason.cj.chen@intel.com>
Reviewed-by: Anthony Xu <Anthony.Xu@intel.com>
Reviewed-by: Eddie Dong <Eddid.Dong@intel.com>
Acked-by: Gen Zheng <gen.zheng@intel.com>
2018-09-19 14:32:02 +08:00
Chaohong guo 6085781983 Replace __emalloc() with a call to uefi allocate_page()
UEFI provides the func allocate_pages() with the option of AllocateAddress
and AllocateMaxAddress to allocate memory at fixed address or below the
specified address respectively. Make use of the interface, simplify the
memory allocation for hyperivosr when CONFIG_RELOC is enabled.

Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Reviewedd-by: Anthony Xu <Anthony.Xu@intel.com>
Acked-by: Gen Zheng <gen.zheng@intel.com>
2018-09-19 14:32:02 +08:00
Chaohong guo fea102ea69 Remove emalloc_for_low_mem() routine in EFI boot code of HV
CPU boot binary need to reside in the memory below 1MB. UEFI firmware
does provide that functionality to limit the highest physical addr of
allocated memory. we just call the right UEFI API and no longer do it
in EFI stub code.

Tracked-On:#1260
Signed-off-by: Chaohong Guo <chaohong.guo@intel.com>
Reviewed-by: Jason Chen <jason.cj.chen@intel.com>
Acked-by: Gen Zheng <gen.zheng@intel.com>
Reviewed-by: Anthony Xu <Anthony.Xu@intel.com>
2018-09-19 14:32:02 +08:00
Yan, Like ccf562402e hv:irq: avoid out-of-range access to irq_alloc_bitmap[]
Logically, out-of-range access won't happen at these places. However, it
depends on the behaviour of other codes.
This commit makes changes to explicitly eliminate the possibility in these
functions.

Tracked-On: #1235
Signed-off-by: Yan, Like <like.yan@intel.com>
2018-09-19 12:58:59 +08:00
Yin Fengwei 4a038d18b1 dm: workaroud for DM crash when doing fastboot reboot
This is temperory workaround for DM crash when doing fastboot
reboot. In fastboot, it will disable USB host functionality by
disable device respsone to one PCI bar. While DM code just release
the bar in this case. Which break the reboot functionality.

The workaround is to remove the assert to avoid DM abort. This is
safe because reboot will remove all memory range registered.

We will have offiical fixing later.

Tracked-On: #1277
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-09-19 10:47:59 +08:00
Xiaoguang Wu 688cddac6a DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG.
Change launch_uos.sh to enable USB xHCI full emulation support.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1242
2018-09-19 10:47:10 +08:00
Zhang, wenling d4afddc0a7 Revert "hv: init_iommu rework to enable IOMMU for partition mode ACRN"
This reverts commit d8508e4229.
2018-09-19 09:24:02 +08:00
David B. Kinder 40dfd3fc24 doc: edit 0.2 release notes
Followup #1281 update with some spelling and formatting fixes

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-18 09:19:48 -07:00
Xie, nanlin 737c29fad8 doc: Add known issues in v0.2 release note.
Add known issues and description in v0.2 release note.

Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2018-09-18 09:06:09 -07:00
Yonghua Huang 994a375103 HV:fix potential buffer overflow issues
- use sizeof(struct lapic_regs),instead of arbitrary size
   to lear 'apic_page' memory region in vlapic.c
 - fix potential buffer overflow issues in vpic.c & ioapic.c

Tracked-On: #1252
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 16:14:27 +08:00
Victor Sun b501ce4388 HV: remove dead APIC info MACROs in bsp
These MACROs are never used by current code so remove it. The needed APIC
info is defined in other files with other MACROs.

We will unify kinds of APIC info definition in one place soon.

Tracked-On: #1274

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 15:56:18 +08:00
Victor Sun 2197f4306a HV: Add acpi_fixup api to override acpi on needs
Add acpi_fixup() api in bsp that can override platform ACPI info when
do init_bsp(), this is useful when platform bootloader is not lock
down before production.

In current code only the wake vector addresses would be parsed after
boot and then override to host_acpi_info, we can add more in furture
based on our needs.

Tracked-On: #1264

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 13:34:47 +08:00
Victor Sun 0d5ad8a522 HV: add simple parser for ACPI data table
Per ACPI spec, there are two fundamental types of ACPI tables:

Tables that contain AML code produced from the ACPI Source Language (ASL).
These include the DSDT, any SSDTs, and sometimes OEM-specific tables (OEMx).

Tables that contain simple data and no AML byte code. These types of tables
are known as ACPI Data Tables. They include tables such as the FADT, MADT,
ECDT, SRAT, etc. -essentially any table other than a DSDT or SSDT.

The second type of table, the ACPI Data Table, could be parsed here.

If Kconfig of CONSTANT_ACPI is set to yes, this parser is not needed.

Tracked-On: #1264

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 13:34:47 +08:00
Victor Sun a1e9fdc7f9 HV: add Kconfig of CONSTANT_ACPI
If CONFIG_CONSTANT_ACPI is true, then the value in host_acpi_info structure
is constant. Otherwise the host_acpi_info value could be overrided.

This is useful when platform ACPI table value is not fixed in Bootloader
before production.

In production release, this config should be set to yes.

Tracked-On: #1264

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 13:34:47 +08:00
Junjun Shan eb8c4fb0d5 hv:Fix Implict conversion:actual to formal param
MISRAC has requirement about implict conversion: actual to formal
param. This patch is used to fix part of these violations.

1.Add a new structure seg_desc_vmcs to hold the VMCS field address of
segment selector to clean up seg_desc structure.

2.Add the definition of maximum MSI entry and the relevant judgement.

3.The violations in shell.c, logmsg.c will be fixed in other series of
patches with modification of function snprintf(), vsnprintf() and other
related usages.

v1->v2:
  *Move the definition of struct seg_desc_vmcs from instr_emul.h to
   instr_emul.c.
  *Modify the formal parameter type in function definition from uint8_t
   to char instead of using cast.
  *Drop the const declaration for char data in formal parameter.

v2->v3:
  *update the data missing conversion.
  *change type of internal parameter len to avoid casting in npklog.c.
  *change the conversion from signed char to unsigned int in
   uart16550_getc() to solve sign-extension.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 13:09:39 +08:00
Qi Yadong 8f0cb5630d HV: trusty: refine version checking when initializing trusty
Replace if--else logic with switch--case when checking interface
version.

Tracked-On: #1265
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2018-09-18 13:09:01 +08:00
Shiqing Gao 9d602208e5 hv: remove unused MACROs
MISRA-C states that redundant macros reduce the maintainability of code.

In some cases, we would like to keep the current unused macros for code
completeness, such as cpu registers. These macros might be used later.

This patch removes some unused macros that is not critical for code
completeness.

v1 -> v2:
 * Keep TRUSTY_VERSION in trusty.c.
   Yadong will cook another patch which will utilize TRUSTY_VERSION.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 09:43:43 +08:00
Xiangyang Wu bb0a2bc2ab HV:Hypercall:Remove redundant error checking
In the current hypervisor hypercall, first all vcpu is
allocated to SOS, vcpu's vm field is initialized to vm0.
When the vcpu is offlined, vcpu will be paused and vcpu's
vm field is set as NULL by DM. When UOS is created, vcpu's
vm field is set as UOS's vm. So when vmcall_vmexit_handler
is invoked, vcpu's vm filed is always non-NULL.
error checking for vm pointer is done in the function
"vmcall_vmexit_handler", vmcall_vmexit_handler will
guarantee that vm is vm0.

So all hypercall functions (these functions is just for handler
hypercall, except vmcall_vmexit_handler) don't need to check
whether invoking vm is NULL and don't need to check whether
invoking vm is vm0 or not.

Remove related invoking vm error checking for hypercall handling.

V1 --> V2:
	Add pre-condition for hypercall in the head file.
V2 --> V3:
	Add pre-condition for copy_from_gpa and copy_to_gpa.
V3 --> V4:
	Add pre-condition both in the head file and source file.

Tracked-On:#1258

Signed-off-by: Xiangyang Wu <xiangyang.wu@linux.intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 09:43:24 +08:00
Sainath Grandhi d8508e4229 hv: init_iommu rework to enable IOMMU for partition mode ACRN
Current code enables IOMMU from init_iommu_vm0_domain which is called
from vm0/sos boot sequence. For partition mode VMs, this is not called as
VMs are numbered from 1.

This patch adds support to initialize root table pointer for each IOMMU
and enable all IOMMUs from init_iommu. Hence IOMMUs are enabled even
though ACRN does not boot vm0.

Tracked-On: #1246
Signed-off-by: Sainath Grandhi sainath.grandhi@intel.com
2018-09-18 09:21:31 +08:00
Yonghua Huang 2af08d9619 HV: refine 'struct lapic_regs' definition.
- remove 'PAD3' & 'PAD4'
 - define local APIC registers by 'struct lapic_reg' type.

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 09:09:44 +08:00
Binbin Wu 5329ced1ea hv: vtd: fix potential buffer overflow in suspend/resume
In current code of suspend_iommu/resume_iommu, there is potential buffer overflow
according to the code.
This patch put the buffer to struct dmar_drhd_rt, so that no need to access the buffer
via index.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Tracked-On: #1252
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-18 09:09:18 +08:00
Zhang, wenling f355cdf6f4 Revert "DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG."
This reverts commit c03ea2d365.
2018-09-17 15:13:05 +08:00
Junjun Shan 83d1ddc6d8 hv:Delete the dead code
Delete the dead code get_irq_info(), local_get_irq_info() in io_request.c
and definition in guest.h.

v1->v2
 *the dead code used pointers which not checked before use, therefore it
  causes "pointer not checked for null before use". To make it clearly,
  modify the subject to "delete the dead code" directly.

 *remove dead code local_get_irq_info() in io_request.c and definition
  in guest.h together.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-17 09:52:02 +08:00
Yin Fengwei c307e1b6eb hv: long and long long is same for printf within x86_64
In ACRN hypervisor, u/int64_t is defined as unsigned/ long.
It's nature to use %l to print it. But current printf use
%l to print int and only use %ll for long.

This patch fix it by treat long and long long same for printf.

Tracked-On: #1230
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-09-17 09:50:06 +08:00
David B. Kinder a47f5d4129 doc: fix Makefile to address multiple publishers
Need to make sure the local projectacrn.github.io is in sync with the
master before starting up the publishing process.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-16 14:30:05 -07:00
David B. Kinder 41a171444b doc: fix spaces in release notes
Removed white space at the end of the line, and fixed a sentence that
did not have a space after the period.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-16 14:29:48 -07:00
Xie, nanlin 3c8157bf22 doc: Add new feature in v0.2 release note
Add new feature list and description in v0.2 release note.

Signed-off-by: Xie, nanlin <nanlin.xie@intel.com>
2018-09-16 13:58:37 -07:00
Xiaoguang Wu c03ea2d365 DM USB: xHCI: enable USB xHCI emulation in LaaG and AaaG.
Change launch_uos.sh to enable USB xHCI full emulation support.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1242
2018-09-14 13:32:34 +08:00
Xiaoguang Wu b4755cdc52 DM USB: xHCI: enable 'cold plug' mode
USB device is connected before UOS is booted up, this scenario is
called 'cold plug' for easy to refer.

Under 'cold plug' situation, the libusb will not report 'connect'
event to device model, hence UOS will not discover 'cold plugged'
device.

This patch add support to fix this issue.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1242
2018-09-14 13:32:34 +08:00
Liang Yang 612037e138 DM USB: xHCI: enable Flat Mode Hub emulation support.
Flat Mode for hub emulation means DM emulates USB devices under hub but
hide hub itself. Under this design the Guest OS cannot see any emulated
hub. So in the perspective of Guest OS, all the emulated devices are
under root hub.

This patch is used to enable feature as mentioned above. And please NOTE,
it is the initial version of hub flat Mode hub emulation, there are one
limitation: only one physical hub is supported. If second physical hub is
connected, the connect and disconnect behavior in second hub may affect
the function of first emulated hub.

The USB HUB device model should be the final long term solution, but it is
very complex. Use flat mode HUB emulation as the short term solution first
to support some USB touch devices which integrated internal HUB.

Signed-off-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1243
2018-09-14 13:32:34 +08:00
Shiqing Gao d886375ee4 hv: clean up spinlock
- move spinlock_init and spinlock_obtain to spinlock.h as inline APIs
- remove spinlock.c

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-09-14 09:44:44 +08:00