Commit Graph

82 Commits

Author SHA1 Message Date
David B. Kinder ff9ef2a19d doc: fix broken external links
Found some broken links to external sites in the documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-07 15:52:39 -08:00
Mingqiang Chi 55f52978db hv:move several tsc APIs to timer.c
-- change 'tsc_khz' to static
-- move these APIs from rtl.h to timer.c
   us_to_ticks()
   ticks_to_us()
   ticks_to_ms()
   rdtsc()

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-03-07 20:23:22 +08:00
David B. Kinder 32a7b4f179 doc: add IOC virtualization HLD
Convert and edit IOC virtualization doc to add to ACRN documentation.
Add a note that IOC virtualization is not supported on the NUC or UP2
platforms.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-28 11:55:32 -08:00
Li, Fei1 987ddafa6b hv: vlapic: refine apicv_post_intr to internal function
Rename vlapic_post_intr to apicv_post_intr and move it to internal function
since it's only used in vlaic.c.

Tracked-On: #1842
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-02-25 14:17:27 +08:00
Arindam Roy de8d85753e HV: Modularize vtd.c to remove acrn_vm usage
This patch is a modified one. It removes the usage
of acrn_vm struct from inside vtd.c.
It also puts struct iommu_domain inside vtd.h,
from vtd.c.
It modifies the signature of init_iommu_domain
in order to remove dependency on acrn_vm from
inside vtd.c.
Incorporated comments from Jason and Eddie.
Changed the name of sos_vm_domain to
fallback_iommu_domain
Removed any reference of sos_vm from vtd.[c|h]
files, including comments.

Tracked-On: #2496
Signed-off-by: Arindam Roy <arindam.roy@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-02-06 08:53:46 +08:00
Li, Fei1 ce19dd423e hv: vlapic: make vlapic deliver interrupt related functions more readable
Rename vlapic_deliver_intr to vlapic_receive_intr: ioapic/msi device
deliver an interrupt to lapic.
Rename vlapic_pending_intr to vlapic_find_deliverable_intr: find a
deliverable interrupt which pending in irr and its priority large than ppr.
Rename vlapic_intr_accepted to vlapic_get_deliverable_intr: get the deliverable
interrupt from irr and set it in isr (which also raise ppr update)

Tracked-On: #1842
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-02-02 09:31:49 +08:00
Victor Sun a01c3cb913 doc: change term of vm0 to sos_vm
Using term of VM0 would mislead to a VM with VM id 0 easily, whereas
VM id 0 could be used for any PRE_LAUNCHED_VM. So replace VM0 with
SOS_VM.

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-01-30 17:14:26 -08:00
David B. Kinder 0881bae738 doc: fix correct use of Clear Linux OS
Proper use of the Clear Linux name is with a noun, specifically "OS".
Also fixed some grammar edits along the way.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-30 15:17:33 -08:00
Yan, Like 72faca5068 doc: update documents for "--lapic_pt" feature
- added description of lapic pt feature based on vlapic in HLD virt-interrupt part;
- updated the doc to include description of new acrn-dm option "--lapic_pt".

Tracked-On: #2351
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2019-01-30 10:45:57 -08:00
Jason Chen CJ 15030f6f2c io_emul: reshuffle io emulation path
This is the following patch after removing pending_pre_work, it make sure
all io emulation is done on its own cpu.

For hv emulated request, it follows the steps:
	hv_emulate_pio->emulate_pio_complete
	hv_emulate_mmio->emulate_mmio_complete

For dm emulated request, it follows the steps:
	acrn_insert_request->dm_emulate_io_complete
while in acrn_insert_request, it could trigger scheduling out then resume by
hcall_notify_ioreq_finish, or busy wait for ioreq completion if polling mode
is enabled.

Tracked-On: #2394
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
2019-01-23 16:21:17 +08:00
Victor Sun 49e6deaf26 HV: rename the term of vm0 to sos vm
Under sharing mode, VM0 is identical with SOS VM. But the coupling of
SOS VM and VM 0 is not friendly for partition mode.

This patch is a pure term change of vm0 to sos VM, it does not change
any code logic or senmantic.

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-21 18:03:31 +08:00
Mingqiang Chi 55e5ed2e1a hv:move ept violation handler to io_emul.c
move this api from ept.c to io_emul.c to avoid
reverse dependency.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-01-21 13:49:54 +08:00
Mingqiang Chi 1d98b7012d hv: move 'setup_io_bitmap' to vm.c
move this api from io_emul.c to vm.c to avoid reverse
dependency

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
2019-01-21 13:49:54 +08:00
David B. Kinder a6cef1095f doc: add GVT-g kernel options doc
Update developer docs with a new GVT-g kernel options document. Update
existing docs with referenced labels.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-13 22:56:58 -08:00
Shiqing Gao e2971ebc98 hv: vlapic: code clean-up
* rename `vlapic_set_intr_ready` to `vlapic_accept_intr`
 * replace calling of `vlapic_intr_edge` with `vlapic_set_intr`
 * remove `vlapic_intr_level` and `vlapic_intr_edge`

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-01-11 09:44:10 +08:00
Shuang Zheng 79f40a569b Update and complete `acrn-dm` parameters description
Update and complete `acrn-dm` parameters description in the user guide and HLD

Tracked-On: #2036
Signed-off-by: Shuang Zheng shuang.zheng@intel.com
2019-01-09 16:19:35 -08:00
Mingqiang Chi 7907fef59e hv:Rename several APIs for vpic and vioapic
vpic:
   vpic_set_irq         --> vpic_set_irqline
   vpic_get_irq_trigger --> vpic_get_irqline_trigger_mode
vioapic:
   vioapic_set_irq_nolock --> vioapic_set_irqline_nolock
   vioapic_set_irq        --> vioapic_set_irqline_lock
   vioapic_send_intr      --> vioapic_generate_intr

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-01-08 14:32:20 +08:00
Shiqing Gao 070a56dbc4 doc: rename register_io_emulation_handler
This is a follow-up patch in doc corresponding to the
changes in source code.

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-01-08 11:28:13 +08:00
Jason Chen CJ 746fbe147d modulization: move functions related with cpu caps into cpu_caps.c
move cpu caps related functions like capability init/detect/check
in cpu.c & mmu.c into a new file cpu_caps.c

Changes to be committed:
	modified:   developer-guides/hld/hv-memmgt.rst
	modified:   ../hypervisor/Makefile
	modified:   ../hypervisor/arch/x86/cpu.c
	new file:   ../hypervisor/arch/x86/cpu_caps.c
	modified:   ../hypervisor/arch/x86/mmu.c
	modified:   ../hypervisor/arch/x86/vmx_asm.S
	modified:   ../hypervisor/include/arch/x86/cpu.h
	new file:   ../hypervisor/include/arch/x86/cpu_caps.h
	modified:   ../hypervisor/include/arch/x86/guest/vm.h
	modified:   ../hypervisor/include/arch/x86/mmu.h
	modified:   ../hypervisor/include/arch/x86/vmcs.h

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-19 09:07:14 +08:00
Jason Chen CJ 59e3f562b8 remove check_tsc
there is no need to clear CR4.TSD as there is no user mode
in ACRN hypervisor.

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-12-17 14:31:52 +08:00
David B. Kinder 117b71e6af doc: add partition mode hld
Partition mode HLD content added to hypervisor hld.
Add target links in referenced docs.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-15 10:35:38 -08:00
Zide Chen c89d6e6526 modularization: clean up namings in vMTRR module
- rename 3 module interface APIs
  init_mtrr() -> init_vmtrr()
  mtrr_rdmsr -> read_vmtrr()
  mtrr_wrmsr() -> write_vmtrr()

- follow naming convention for other modules, rename struct mtrr_state
  to struct acrn_vmtrr. And add acrn_vcpu to it.

- because MTRR is x86 architecture specific, move struct acrn_vmtrr to
  struct acrn_vcpu_arch.

Tracked-on: #1842
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-12-14 09:43:06 +08:00
Peter Fang f5a66e8e20 doc: update OVMF usage for acrn-dm
Tracked-On: #1832
Signed-off-by: Peter Fang <peter.fang@intel.com>
2018-12-13 09:56:09 +08:00
Geoffroy Van Cutsem 21a5b30865 Update add acrn-dm parameter descriptions
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem c45300fb54 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 6d5b769d67 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 5998f434bc Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem c607aedff4 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem ba79b21860 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 4ab193cf6c Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 1c70f812a0 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 341bf84ced Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem a0708339bc Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem a7be8f731d Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 5aedc8f4aa Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem e7e8ce63f2 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 2454289400 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem edd06fe928 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 1ef6b657fd Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 8b13bf3f7c Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 7446089d80 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem 666c97b0d7 Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
Geoffroy Van Cutsem a21c3ca3eb Update doc/developer-guides/hld/hld-devicemodel.rst
Co-Authored-By: dbkinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
David B. Kinder 7bcd7054e5 doc: additional DM parameter documentation
Update the device model HLD with additional parameter documentation

Tracked-On: #2021

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-12 08:57:16 -08:00
David B. Kinder fe1ace4f56 doc: fix doc misspellings
Fix documentation misspellings missed during the regular review.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-05 17:07:39 -08:00
Li, Fei1 5fd6021dee doc: hv: add comments to timer APIs for documentation
This patch adds more comment to describe functions that are
interfaces to the other modules in the hypervisor. The comments
are in doxygen-style for document generation.

Tracked-On: #1595
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-12-04 15:09:47 +08:00
Li, Fei1 a0582c99cf hv: trusty: refine trusty memory region mapping
Now it's using the memory reserve by hypervisor. So there's not
necessaty to map or ummap this region from SOS.

Tracked-On: #1942
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2018-11-30 16:49:27 +08:00
Mingqiang Chi 5dcfc1336b hv:Rename ptdev to ptirq for some APIs
-- Rename the fowllowing APIs:
  ptdev_intx_pin_remap --> ptirq_intx_pin_remap
  ptdev_msix_remap  --> ptirq_msix_remap
  ptdev_add_intx_remapping --> ptirq_add_intx_remapping
  ptdev_remove_intx_remapping --> ptirq_remove_intx_remapping
  ptdev_add_msix_remapping --> ptirq_add_msix_remapping
  ptdev_remove_msix_remapping --> ptirq_remove_msix_remapping
  ptdev_intx_ack  --> ptirq_intx_ack
  ptdev_lookup_entry_by_sid --> ptirq_lookup_entry_by_sid
  ptdev_lookup_entry_by_vpin --> ptirq_lookup_entry_by_vpin
  ptdev_build_physical_msi --> ptirq_build_physical_msi
  ptdev_build_physical_rte --> ptirq_build_physical_rte
  alloc_entry   --> ptirq_alloc_entry
  release_entry --> ptirq_release_one_entry
  ptdev_activate_entry --> ptirq_activate_entry
  ptdev_deactivate_entry --> ptirq_deactivate_entry
  ptdev_intr_handle_irq --> ptirq_handle_intx
  ptdev_softirq --> ptirq_softirq
  ptdev_enqueue_softirq --> ptirq_enqueue_softirq
  ptdev_dequeue_softirq --> ptirq_dequeue_softirq
  get_vm_ptdev_intr_data --> ptirq_get_intr_data
  alloc_ptdev_entry_id --> ptirq_alloc_entry_id
  ptdev_intr_delay_callback --> ptirq_intr_delay_callback
  ptdev_dequeue_softirq --> ptirq_dequeue_softirq
  ptdev_interrupt_handler --> ptirq_interrupt_handler

-- Merge 'ptdev_release_all_entries' and 'release_all_entries'
   to 'ptirq_release_all_entries'

v2-->v3:
   Rename ptirq_release_one_entry to ptirq_release_entry
v1-->v2:
   still use ptdev_init instead of ptirq_init

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-11-30 13:27:49 +08:00
Binbin Wu fe08a44e83 hv: doc: use doxygen-generated API docs in HLD for passthru
This patch adds vtd.h to the input of doxygen and replaces hard-coded API docs
with doxygen-generated ones.

Tracked-On: #1595
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-11-21 09:27:51 +08:00
Mingqiang Chi 9a009bcef2 hv:Replace dynamic memory with static for mmio
-- Config MAX_EMULATED_MMIO_REGIONS 16 in Kconfig
-- Add emulated mmio array and emulated mmio regions
   in vm structure
-- Remove mmio list in vm structure
-- Remove unregister_mmio_emulation_handler and
   vioapic_cleanup APIs

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-11-13 11:52:48 +08:00