Commit Graph

2184 Commits

Author SHA1 Message Date
Junjie Mao 5f6a10f1e1 kconfig: use defconfig instead of default values in silentoldconfig
Currently silentoldconfig uses the default values in Kconfig when .config does
not exist or is for a different platform from the one specified in command line
options. This makes it impossible to leverage defconfigs when a simple 'make' is
invoked to build the hypervisor, as 'make' calls oldconfig instead of defconfig
for creating a configuration file.

With DEFCONFIG_LIST in Kconfig, now silentoldconfig is also able to know which
defconfig is appropriate given the specified board. This patch changes the
behavior of oldsilentconfig as follows.

    1. When an old .config for the given board exists, the script updates the
       .config per configurations specified from the command line. Instead of
       manually resetting all symbols, the script now relies on Kconfiglib's
       internal logic to automatically update invisible symbols after symbol
       value changes.

    2. When an old .config does not exist or is not for the specified board, the
       defconfig for that board is used as base line and further tweaked per
       configurations from the command line.

v3 -> v4:

* Rephrase comments in silentoldconfig.py.

v2 -> v3:

* Keep backward compatibility of silentoldconfig.py since vmcfg also uses the
  script.

v1 -> v2:

* Include .config when it is edited manually so that new configurations
  overwritten the old (in the outdated config.mk).

* Compare the board in .config with the one in the defconfig instead of what is
  specified in the environment variable BOARD, as defconfig and BOARD may use
  different names (e.g. aliases or different cases)

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao b9d54f4ab3 kconfig: support board-specific defconfig
The current defconfigs are BIOS-specific which makes it difficult to maintain
multiple defconfigs for boards running the same BIOS.

This patch re-organizes the defconfigs to be board-specific. A command line
option BOARD is introduced to specify a board on which the current build targets
at. The original PLATFORM is kept for backward compatibility which redirects to
apl-mrb and nuc6cayh for sbl and uefi, respectively.

The getting started guide is also updated accordingly.

v1 -> v2:

* Rewrite 'up2' to 'UP2'.

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao 8bde372c32 kconfig: enforce remaking config.mk after oldconfig changes .config
Without any command under the .config target, config.mk will not be remade in
the same execution of make after oldconfig changes .config. This can result to
inconsistency between .config and the built image right after .config is
changed.

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao c7907a823c kconfig: a faster way to check the availability of python3 package
It is faster to check the existance of a certain library by trying importing
that library, instead of invoking pip3 for a complete list of installed
libraries. Time of the check can be significantly reduced.

    # time pip3 list
    ...
    real    0m6.038s
    user    0m0.652s
    sys     0m0.036s

    # time python3 -c "import kconfiglib"
    real    0m0.037s
    user    0m0.036s
    sys     0m0.000s

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Junjie Mao 256108f16b kconfig: add more help messages to config symbols
Add help messages to all visible symbols except those heap-related ones which
will be dropped eventually.

v2 -> v3

* Fix typos and misleading descriptions.

v1 -> v2

* Per kconfig language, help messages shall have a larger indent level than the
  attributes.
* Rephrase for clarify.

Tracked-On: #1588
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 10:49:12 +08:00
Yonghua Huang 05bb7aa212 hv: remove deprecated hypercalls
below hypercalls are wrapped to HC_SET_IRQLINE:
- HC_ASSERT_IRQLINE
- HC_DEASSERT_IRQLINE
- HC_PULSE_IRQLINE

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-30 09:59:27 +08:00
David B. Kinder bf7b1cf744 doc: update HLD Device passthrough
transcode, edit, and upload HLD 0.7 section 3.9 (Device passthrough)

Tracked-on: #1645

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-29 16:32:32 -07:00
David B. Kinder 7c192db1ba doc: update HLD VT-d
transcode, edit, and upload HLD 0.7 section 3.8 (VT-d)

Tracked-on: #1643

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-29 13:34:01 -07:00
Xinyun Liu e141150e4c doc: Fix AcrnGT broken API doc due to kernel upgrade
* interface name changed
* missing kernel doc comment in kernel source code

Tracked-On: #1511

Signed-off-by: Xinyun Liu <xinyun.liu@intel.com>
2018-10-29 09:20:43 -07:00
Zide Chen 83dbfe4fd3 hv: implement sharing_mode.c for PCI emulation in sharing mode
Compared with partition_mode.c, the major difference between them is
the list of PCI devices is statically defined or dynamically
enumerated and allocated.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen 7c506ebc69 hv: implement msix.c for MSI-X remapping
Similar to MSI emulation, this patch emulates the Message Control word
within MSI-X Capability Structure.

Also it emulates MSI-X table. MSI-X remapping is triggered when the guest
is changing the Mask bit in Vector Control, or the Message Data/Addr when
MSI-X Enable bit is set.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen dcebdb8e98 hv: implement msi.c to handle MSI remapping for vm0
Emulate MSI Capability structure for vm0 in sharing mode:

- it intercepts the IO requests for MSI Capability structure, emulates
  the Message Control word, and bypasses all other I/O requests to the
  physical device.

- criteria to trigger MSI remapping: MSI Enable bit is being changed,
  Message Data/Addr is being changed when MSI Enable is set.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen 6af47f249c hv: vpci: add callback functions to struct vpci
Add 'struct vpci_ops *ops' to 'struct vpci' so we have clearer structure:

- struct vpci: include struct vpci_ops pointing to different callback
  functions for partition or sharing mode repsectively.
- struct pci_vdev: includes struct pci_vdev_ops to handle different vpci
  functionalities:
      hostbridge emulation
      passthrough device BAR emulation
      msi/msi-x remapping

This patch moves the code around but doesn't change the underlying logic
in terms of PCI spec handling. More detailed implementation:

- create new file partition_mode.c to house the implementation of partition mode
  regarding the vpci layer.
- vpci.c: only keeps the abstract code which calls vpci->ops to functions
  in partition_mode.c, and potentially to sharing_mode.c.
- the following functions are moved to partition_mode.c and renamed with
  partition_mode prefix.
    - vpci_init() -> partition_mode_vpci_init()
    - vpci_cleanup() -> partition_mode_vpci_deinit()
    - pci_cfg_io_write() -> partition_mode_cfgread()
    - pci_cfg_io_read() -> partition_mode_cfgwrite()

Track-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen 3e54c70d0f hv: rework the MMIO handler callback hv_mem_io_handler_t arguments
commit 026ae83bd5 ("hv: include: fix 'Unused procedure parameter'")
removed the then unused parameter handler_private_data from
hv_mem_io_handler_t because MISRA-C requires that there should be no
unused parameters in functions.

This patch removes vcpu from the parameter list as well since this may
not be used by all users. Also it brings back handler_private_data which
is more flexible. For example, vioapic_mmio_access_handler() can use it
to pass vcpu pointer.

Tracked-On: #861
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen ec5b90f11e hv: implement PCI bus scan function
- It starts from scaning bus 0 and scan other buses only if it is referred
  as a Secondary Bus by a PCI-to-PCI bridge.
- Skip to next device if function 0 is not implemented.
- Don't enumerate function 1-7 if a device is not a multi-function device.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen 9cc1f57f63 hv: change function parameters: pci_pdev_read_cfg and pci_pdev_write_cfg
In order to allow these functions to be called without an associated
struct pci_pdev (for example, at the time of PCI bus enumeration), these
two functions can not take the struct vdev as input parameter.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen 19e1b9675f hv: MSI Message Address should be 64 bits
Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen 7b4b78c323 hv: minor cleanup for dm/vpci code
- It makes more sense to return bool from pci_bar_access()
- other minor changes for cleanup

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Zide Chen bc4f82d1d1 hv: more cleanup for pci.h
Don't have any logical changes.
- add more common PCI macros
- remove redundant definitions in dmar_parse.c
- move all the common mascos from vpci.h to pci.h

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 14:29:37 +08:00
Huihuang Shi e24899d9c9 fix "Recursion in procedure calls found"
Functions shall not call themselves, either directly or indirectly.
V1->V2:
    add pre-assumption.
V2->V3:
    when vector < 16,call vlapic_set_error

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-29 14:18:28 +08:00
Junjie Mao e8a59f30f1 checkpatch: fix the line limit back to 120
The checkpatch configuration set by commit 7b06be9 ("HV: checkpatch: add
configurations to customize checkpatch.pl") is unintendedly set to 20 (instead
of 120). This patch fix the setting to the expected value.

Tracked-On: #1557
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2018-10-29 14:10:22 +08:00
Qi Yadong f4f139bf8b DM: generate random virtual RPMB key
The virtual rpmb key transfer path is ready now, so replace
previous temporary fixed key solution with random key
solution.

Tracked-On: #1636
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2018-10-29 11:07:45 +08:00
Mingqiang Chi dff441a0d5 hv:Replace dynamic memory with static for pcpu
--remove 'calloc' for pcpu, change it to static array
--rename 'init_percpu_data_area' to 'init_percpu_lapic_id'
Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-29 10:14:25 +08:00
Mingqiang Chi 4afb6666b9 hv:cleanup vcpu_id compare with phys_cpu_num
Currently we compare vcpu_id with phys_cpu_num,
vcpu_id is not related with phys_cpu_num,
this patch cleanup them.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-29 10:14:25 +08:00
Mingqiang Chi 3eb45b9bf6 hv:Check pcpu number to avoid overflow
-- check pcpu number in several functions
   to avoid overflow
-- rename pcpu_id to pcpu_num in local_parse_madt

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-29 10:14:25 +08:00
Mingqiang Chi 672583a091 hv: Check pcpu number in Hw platform detect
if the physical number > CONFIG_MAX_PCPU_NUM,
will return error and panic.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-29 10:14:25 +08:00
Mingqiang Chi 298044d95b hv: Add MAX_PCPU_NUM in Kconfig
--Removed MAX_PCPU_NUM in cpu.h
--Changed the default value from 128 to 8 for
  MAX_PCPU_NUM

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-10-29 10:14:25 +08:00
Yonghua Huang b686b562f4 DM: wrap ASSERT/DEASSERT IRQ line with Set/Clear IRQ line
- remove ASSERT & DEASSET IRQ line IOCTLs
 - remove PULSE IRQ line IOCTLs, use set/clear
   IRQ line instead.
 - Use IC_SET_IRQLINE to set or clear IRQ line

Tracked-On: #861
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-29 09:26:23 +08:00
Jian Jun Chen e12f88b8c7 dm: virtio-console: remove unused virtio_console_cfgwrite
Virtio-console device specific configuration is readonly, callback
for the cfgwrite is not required. This patch removed the unused
virtio_console_cfgwrite.

Tracked-On: #1364
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-10-27 22:28:04 +08:00
Kaige Fu 7961a5bad2 HV: Fix some inconsistent comments in vm_description.c
This patch is for fixing inconsistent comments in vm_description.c

Tracked-On: #1160
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2018-10-27 22:27:27 +08:00
Yonghua Huang 8860af3b4c dm: fix possible buffer overflow in 'acrn_load_elf()'
Will attempt to access element 2048..2049 of
  array "ptr32" if below conditions are both true:
  1) ptr32[i] == MULTIBOOT_HEAD_MAGIC
  2) (i == (ELF_BUF_LEN/4) - 1)

Tracked-On: #1252
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Fengwei Yin <fengwei.yin@intel.com>
2018-10-27 22:26:49 +08:00
David B. Kinder dc7df1cd0f doc: update HLD Virtual Interrupt
transcode, edit, and upload HLD 0.7 section 3.7 (Virtual Interrupt)
Add target references in other docs as needed.

Tracked-on: #1623

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-26 16:46:49 -07:00
David B. Kinder 1c54734f8b doc: update HLD Timer section
transcode, edit, and upload HLD 0.7 section 3.6 (Timer)
Also, fix the hv sections file names to be consistent.

Tracked-on: #1623

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-10-26 15:12:45 -07:00
Geoffroy Van Cutsem d6523964ee Documentation: tweak 'partition mode' tutorial
Tweak the 'Using partition mode on UP2' tutorial by removing
a couple of Grub menu entries that are not present by default
(nor introduced as part of the tutorial).

Also make it more obvious that there is still a default entry
called 'Ubuntu' which is the one by default.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-10-26 15:06:20 -07:00
Manisha Chinthapally b3cb7a53d4 Fix to kernel hang in smp_call_function
smp_call_function:
 smp_call_mask can be modified by more than one process which can cause kernel hang and timeout

Adding a lock to smp_call_mask to prevent race condition

Tracked-On: #1606
Acked-by:   Xu, Anthony <anthony.xu.intel.com>
Signed-off-by: Manisha Chinthapally <manisha.chinthapally@intel.com>
2018-10-26 13:44:18 +08:00
Chinthapally, Manisha cab93c053a HV:Added SBuf support to copy samples generated to guest.
sbuf.h:
    Added new shared buffer types for SEP and SOCWATCH

profiling.c
   sbuf_next_ptr - returns  address of next available buffer

profiling_sbuf_put_variable:
   This function allows to write data of variable size into shared buffer.

profiling_generate_data:
     Read profiling data and transfer to SOS
     Drops transfer of profiling data if sbuf is full/insufficient and log it

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Chinthapally, Manisha 5985c1216e HV:Added implementation for PMI handler function
irq.c/.h:
	Added new variables(ctx_rflags, ctx_rip, ctx_cs) in irq_desc
	On each interrupt this information is populated
	Added api's to access the irq_desc members

profiling.c:
	profiling_pmi_handler:On each PMI generates gets the context and other information that	caused it

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Chinthapally, Manisha a7cbee1802 HV:Added support to get VM enter and exit information
profiling_vmenter_handler:Saves vm information

profiling_vmexit_handler: Saves vm information and vm exit reason

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Chinthapally, Manisha fc8f9d792c HV:Added support to perform MSR operation on all cpus
MSR operations are directly done based on physical cpu's

profiling_handle_msrops:
	Per cpu function, performs the MSR operations (Read, Read clear,Write)
	For SOCWATCH/ power tool, generates MSR samples.

profiling_msr_ops_all_cpus :
	Receives required information for MSR operations from guest,
	SMP calls profiling_handle_msrops,
	Copies the information collected to guest

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Manisha Chinthapally 1786f6222a HV:Added support to setup tool & start/stop profing
profiling_set_control:
    Receives tool control information from guest and sets control switches accordingly,
    tool control information includes:
         type - sep/socwatch
         action - Start/stop
         feature - What to collect(core/lbr/vm switch)
    This function provides interface to start and stop profiling data collection

profiling_start_pmu:
    Initialize sep state and enable PMU counters
    SMP calls profiling_enable_pmu

profiling_stop_pmu:
    Reset sep state and Disable all the PMU counters
    SMP calls profiling_disable_pmu

profiling_enable_pmu:
    Enable all the Performance Monitoring Control registers.
    Unmask LAPIC entry for PMC register to enable performance monitoring
    Walk through the entries and write to PMU control regiesters

profiling_disable_pmu:
    Disable all Performance Monitoring Control registers

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Chinthapally, Manisha 898b9c8d4a HV:Added support to configure PMI and VM switch info
This patch provides interface to configure(setup before actual
collection) PMI and VM switch tracing information.

profiling_config_pmi:
    Receives required information for configuring PMI from guest,
    populates the information info per_cpu region and SMP calls profiling_initilaize_pmi

profiling_initialize_pmi:
    Configure the PMU's for sep/socwatch profiling.
    Initial write of PMU registers.
    Walk through the entries and write the value of the register accordingly.

profiling_config_vmsw:
    Receives required information for configuring
    VMswitch from guest, Configure for VM-switch data on all cpus

profiling_initialize_vmsw: initializes VMSwitch	tracing

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Chinthapally, Manisha df549096f2 HV:Added support to get phy CPU, VM, tool information
This patch includes support to following
1. Collection of physical cpuid information
2. Collection of List of VM's available and information
3. Tool version information
4. Sending tool control information to guest

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Chinthapally, Manisha 8ba333d275 HV: Added Initial support for SEP/SOCWATCH profiling
This patch adds support to sep/socwatch profiling
     Adds 2 new files include/arch/x86/profiling.h and arch/x86/profiling.c
     which contains most of the implementation for profiling,most of the functions
     in profiling.c have dummy implementation and will be implemented in next patches

     a. cpu.c, Initial profiling setup is done as part of bsp_boot_post
  and cpu_secondary_post flow
     b. vmcall.c, New ioctl is added for performing profiling related
  operations in vmcall_vmexit_handler
	ioctl - HC_PROFILING_OPS
        function - hcall_profiling_ops()
     c. common/hypercall.c, hcall_profiling_ops() implementation.
     d. hv_main.c, In vcpu_thread calling profiling related functions
  to save vm context
     e. acrn_hv_defs.h, list all the profiling command types

Tracked-On: projectacrn#1409
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Chinthapally, Manisha <manisha.chinthapally@intel.com>
2018-10-26 13:39:07 +08:00
Conghui Chen 3010718d4a dm: cmdline: remove unused parameters
Remove unused parameters for acrn-dm

Tracked-On: #1616
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-10-26 13:37:47 +08:00
Xiaoguang Wu 4261ca223e DM USB: xHCI: refine logic of Disable Slot Command
Remove the changing operation for 'xdev->native_ports[].state' in
pci_xhci_cmd_disable_slot. The operation should not be done in this
funciton.

Tracked-On: #1589
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>
2018-10-26 13:36:50 +08:00
Xiaoguang Wu e1e0d3047e DM USB: xHCI: refine the USB disconnect logic in DM
On certain SOC, during the system suspend and resume process, connecting
and disconnecting events may happen. In previous implementation, DM didn't
clear PED bit in the xHCI PORTSC register, this will induce many invalid
polling operations in UOS and fail to enumerate one or more USB devices.

Tracked-On: #1589
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>
2018-10-26 13:36:50 +08:00
Xiaoguang Wu f799e8fa1c DM USB: xHCI: fix process logic of LINK type TRB
When the LINK type TRB are received, it should not be counted as
valid date block to give libusb. This patch is used to fix it.

Tracked-On: #1567
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>
2018-10-26 13:36:50 +08:00
Xiaoguang Wu 08a7227fe6 DM USB: xHCI: fix bug in port unassigning function
The function for port unassigning: pci_xhci_clr_native_port_assigned
should reset the 'info' member to all zero when it is called.

Tracked-On: #1434
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>
2018-10-26 13:36:50 +08:00
Xiaoguang Wu d7008408d0 DM USB: xHCI: fix issue: crash when plug device during UOS booting
This issue is result from reporting interrupt when the interrupt ability
of virtual xHCI is disabled.

As Event Ring State Machine showed in Figure 20 of xHCI spec, following
rules should be followed:
1 when RS bit of USBCMD register is zero, Event Ring should not be accessed;
2 when INTE bit of USBCMD register is zero, Interrupt should not be sent.

Tracked-On: #1566
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>
2018-10-26 13:36:50 +08:00
Yin Fengwei 3d94f86812 hv: flush cache after update the trampoline code
Trampoline code is updated as data when preparing the trampoline
code and doing relocation. In this case, we need to flush cache
to make sure the updated code is in RAM.

Tracked-On: #1604
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2018-10-26 13:35:19 +08:00