Commit Graph

2347 Commits

Author SHA1 Message Date
fuzhongl d3ac30c639 hv: modify SOS i915 plane setting for hybrid scenario
Change i915.domain_plane_owners and i915.avail_planes_per_pipe for
hybrid scenario;because some User vm(like:Ubuntu/Debian and WaaG)
doesn't support plane restriction; it will use PipeA by default.

Tracked-On: #3840

Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
2019-10-16 22:02:45 +08:00
Jian Jun Chen e1a2ed1727 hv: fix a bug that tpr threshold is not updated
Consider the following case when TPR shadow is used with vlapic
basic mode:
1) 2 interrupts are pending in vlapic. INTa's priority > TPR and
   INTb's priority <= TPR.
2) TPR threshold is set to zero and INTa is injected to guest.
3) Guest set TPR to the priority of INTa.
4) EOI of INTa. PPR is updated to TPR which equals INTa's priority.
   INTb cannot be injected because its priority <= PPR.
5) Guest set TPR to zero. Because TPR threshold is still zero, there is
   no TPR threshold vmexit. But since both TPR and ISRV are zero at
   this time, the PPR is zero as well. INTb still cannot be injected.
   This is a bug.

By adding vcpu_make_request(vlapic->vcpu, ACRN_REQUEST_EVENT) in EOI,
TPR threshold will be updated before vm_resume.

Tracked-On: #3795
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-10-16 16:40:29 +08:00
Shuo A Liu de157ab96c hv: sched: remove runqueue from current schedule logic
Currently we are using a 1:1 mapping logic for pcpu:vcpu. So don't need
a runqueue for it. Removing it as preparation work to abstract scheduler
framework.

Tracked-On: #3813
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-10-16 10:25:53 +08:00
Shuo A Liu 837e4d8788 hv: sched: rename schedule related structs and vars
prepare_switch_out -> switch_out
prepare_switch_in -> switch_in
prepare_switch -> do_switch
run_thread_t -> thread_entry_t
sched_object -> thread_object
sched_object.thread -> thread_object.thread_entry
sched_obj -> thread_obj
sched_context -> sched_control
sched_ctx -> sched_ctl

Tracked-On: #3813
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-10-16 10:25:53 +08:00
Binbin Wu d19592a33e hv: vmsr: disable prmrr related msrs in vm
PRMRR related MSRs need to be configured by platform BIOS / bootloader.
These settings are not allowed to be changed by guest.
VMs currently have no requirement to access these MSRs even when vSGX is enabled.
So, this patch disables PRMRR related MSRs in VM.

Tracked-On: #3739
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2019-10-15 15:13:11 +08:00
Mingqiang Chi de0a5a48d6 hv:remove some unnecessary includes
--remove unnecessary includes
--remove unnecssary forward-declaration for 'struct vhm_request'

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-10-15 14:40:39 +08:00
Li, Fei1 0dac373d93 hv: vpci: remove pci_msi_cap in pci_pdev
The MSI Message Address and Message Data have no valid data after Power-ON. So
there's no need to initialize them by reading the data from physical PCI configuration
space.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-10-14 15:09:03 +08:00
Yonghua Huang b1e43b4454 hv: fix error debug message in hcall_set_callback_vector
this patch is to fix error debug message
 for invalid 'param' case, there is no string
 variable for '%s' output, which will potenially
 trigger hypervisor crash as it may access random
 memroy address and trigger SMAP violation.

Tracked-On: #3801
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2019-10-14 09:07:30 +08:00
Li, Fei1 8c9c88765e hv: vpci: remove PC-Card type support
We only support Type 0 and Type 1 PCI device. Remove PC-Card type support which
was originally described in the [PC-Card] and is used in previous versions of
the programming model.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-10-12 09:46:26 +08:00
Peter Fang 28b50463c9 hv: vm: properly reset pCPUs with LAPIC PT enabled during VM shutdown/reset
When a VM is configured with LAPIC PT mode and its vCPU is in x2APIC
mode, the corresponding pCPU needs to be reset during VM shutdown/reset
as its physical LAPIC was used by its guest.

This commit fixes an issue where this reset never happens.
is_lapic_pt_enabled() needs to be called before reset_vcpu() to be able
to correctly reflect a vCPU's APIC mode.

A vCPU with LAPIC PT mode but in xAPIC mode does not require such reset,
since its physical LAPIC was not touched by its guest directly.

v2 -> v3:
- refine edge case detection logic

v1 -> v2:
- use a separate function to return the bitmap of LAPIC PT enabled pCPUs

Tracked-On: #3708
Signed-off-by: Peter Fang <peter.fang@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Jack Ren <jack.ren@intel.com>
2019-09-29 15:12:25 +08:00
Mingqiang Chi 187fa97e52 hv:fixed compilation error in Ubuntu
it uses builtin function(__builtin_popcountl)in bitmap_weight(),
it will use the 'popcnt' instruction,
this patch enable 'popcnt' instruction support in Makefile

Tracked-On: #3663
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-26 14:03:51 +08:00
Shiqing Gao c8bcab9006 hv: pci: update function "bdf_is_equal"
- update the function argument type to union
  Declaring argument as pointer is not necessary since it
  only does the comparison.

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-09-25 13:45:39 +08:00
Shiqing Gao 658fff27b4 hv: pci: update "union pci_bdf"
- add one more filed in "union pci_bdf"
- remove following interfaces:
  * pci_bus
  * pci_slot
  * pci_func
  * pci_devfn

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
2019-09-25 13:45:39 +08:00
Shuo A Liu 2096c43e5c hv: create all VCPUs for guest when create VM
To enable static configuration of different scenarios, we configure VMs
in HV code and prepare all nesserary resources for this VM in create VM
hypercall. It means when we create one VM through hypercall, HV will
read all its configuration and run it automatically.

Tracked-On: #3663
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-09-24 11:58:45 +08:00
Shuo A Liu 9a23ec6b5a hv: remove unused pcpu assignment functions
As we introduced vcpu_affinity[] to assign vcpus to different pcpus, the
old policy and functions are not needed. Remove them.

Tracked-On: #3663
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-24 11:58:45 +08:00
Shuo A Liu 1c526e6d16 hv: use vcpu_affinity[] in vm_config to support vcpu assignment
Add this vcpu_affinity[] for each VM to indicate the assignment policy.
With it, pcpu_bitmap is not needed, so remove it from vm_config.
Instead, vcpu_affinity is a must for each VM.

This patch also add some sanitize check of vcpu_affinity[]. Here are
some rules:
  1) only one bit can be set for each vcpu_affinity of vcpu.
  2) two vcpus in same VM cannot be set with same vcpu_affinity.
  3) vcpu_affinity cannot be set to the pcpu which used by pre-launched VM.

v4: config SDC with CONFIG_MAX_KATA_VM_NUM
v5: config SDC with CONFIG_MAX_PCPU_NUM

Tracked-On: #3663
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-09-24 11:58:45 +08:00
Shuo A Liu ca2540fe8c hv: return pre-defined vcpu_num from HV to upper layer
There is plan that define each VM configuration statically in HV and let
DM just do VM creating and destroying. So DM need get vcpu_num
information when VM creating.

This patch return the vcpu_num via the API param. And also initial the
VMs' cpu_num for existing scenarios.

Tracked-On: #3663
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>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-24 11:58:45 +08:00
Shuo A Liu 59e39c5fbb hv: move MAX_PCPU_NUM from Kconfig to header file
MAX_PCPU_NUM is different on various BOARDs. So we move the generic
definition from Kconfig to each board's config header file.

Tracked-On: #3663
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-09-24 11:58:45 +08:00
Shuo A Liu d588703976 hv: Add a helper to account bitmap weight
Sometimes we need know the number of 1 in one bitmap. This patch provide
a inline function bitmap_weight for it.

Tracked-On: #3663
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>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-24 11:58:45 +08:00
Shuo A Liu f4ce9cc4a2 hv: make hypercall HC_CREATE_VCPU empty
Now, we create vcpus while VM being created in hypervisor. The
create vcpu hypercall will not be used any more. For compatbility,
keep the hypercall HC_CREATE_VCPU do nothing.

v4: Don't remove HC_CREATE_VCPU hypercall, let it do nothing.

Tracked-On: #3663
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-09-24 11:58:45 +08:00
Mingqiang Chi 489937f7b8 hv:check pcpu numbers during init_pcpu_pre
it will panic if phys_cpu_num > CONFIG_MAX_PCPU_NUM
during init_pcpu_pre,after that no need to check it again.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-24 09:02:05 +08:00
Mingqiang Chi 5a03a5df05 hv:fix MISRA-C violation for variable-length array
C99 supports variable-length array,
but misra-c required "variable-length array types shall not be used"

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-24 09:02:05 +08:00
Mingqiang Chi c36908dce2 hv:remove redundant memset in some cases
No need to memset since it will overwrite the memory
by copy_from_gpa in some cases.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-24 09:02:05 +08:00
Li, Fei1 535a83e24b hv: vpci: refine vPCI BAR initialization
Initialize vBAR configure space when doing vPCI BAR initialization. At this time,
we access the physical device as we needs, no need to cache physical PCI device
BAR information beforehand.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-23 11:16:48 +08:00
Victor Sun 153a5992f5 Makefile: add build tag for acrn-config tool in version.h
Add " with acrn-config" tag in build info when user build hypervisor with
acrn-config xmls would be helpful to identify the hypervisor configuration
in current build is from acrn-config xml or from source code.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-20 19:39:22 +08:00
Victor Sun 3f3ec3865e Makefile: generate config patch in hypervisor/Makefile
Previously we generate config patch based on config xml in toplevel Makefile,
it brings two issues:

1. we could not generate xml configuration patch with hypervisor source only;

2. The github commit info of current code base which is defined in version.h
will be overwritten by the new generated config patch, then the lost commit
info would impact build identify and bug reproducing.

This patch fixed these two issues. Besides, the patch also modify the logic of
platform_acpi_info file existence judgement, which need to be depends on the
acrn-config patch.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-20 19:39:22 +08:00
Qi Yadong 3ebeecf060 hv: save/restore TSC in host's suspend/resume path
TSC would be reset to 0 when enter suspend state on some platform.
This will fail the secure timer checking in secure world because
secure world leverage the TSC as source of secure timer which should
be increased monotonously.

This patch save/restore TSC in host suspend/resume path to guarantee
the mono increasing TSC.

Note: There should no timer setup before TSC resumed.

Tracked-On: #3697
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-19 13:50:50 +08:00
Andy 04d5638745 Fix the second problem: The Extended Model ID needs to be examined only when the Family ID is 06H or 0FH
Tracked-On:#3675
Signed-off-by: Andy <andyx.liu@intel.com>
2019-09-19 08:44:45 +08:00
Andy 857cdb0c4f Fix the first problem: CPUID(EAX = 10H, ECX = ResID=1 or 2).EAX Bits 04 - 00: Length of the capacity bit mask for the corresponding ResID using minus-one notation
Tracked-On:#3675
Signed-off-by: Andy <andyx.liu@intel.com>
2019-09-19 08:44:45 +08:00
Victor Sun 0b65b8f05c Makefile: override .config with specified scenario
1. if SCENARIO=$(SCENARIO) is specified in make param, then override
the default CONFIG_$(SCENARIO) value in existed .config. This means
we don't need to modify the default SCENARIO config in Kconfig file
to build the hypervisor;

2. Some board name shortcuts like apl-nuc/kbl-nuc-i7 need to be converted
to official board name to make sure overrides working;

3. Previously make sbl-hypervisor did not load the defconfig so the
defconfig for boards are lost, this patch fix this issue;

4. remove SCENARIO param when make hypervisor, because SCENARIO could
be got from SCENARIO_NAME which parsed from .config;

Tracked-On: #3593

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-18 11:48:31 +08:00
Conghui Chen 65347d38dc hv: vuart: support reliable communication
The orignal communication port will lose data when tx is too fast, and
the data in FIFO will be overwritten.
Now, when the FIFO is full, stop sending more data. When the FIFO is not
full, notify the vuart to send more data.

Tracked-On: #3681
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-17 09:45:28 +08:00
Conghui Chen 8e4e1c96d1 hv: vuart bugfix for additional byte in tx fifo
For communication vuart, when it send data to target vuart's fifo, it
should meet the conditions:

1. MCR_LOOPBACK is not set
2. LCR_DLAB is not set
3. access reg is UART16550_THR
4. target_vu is not null

But the LCR_DLAB is missed now, and when vuart set it's UART16550_DLL,
it will be send to target by mistake as UART16550_DLL = UART16550_THR.
Add the missed condition.

DLAB in uart16550 spec:

Divisor Latch Access Bit.
1 = Allows access to the Divisor Latch Registers and reading of the FIFO
Control Register.
0 = Allows access to RBR, THR, IER and IIR registers.

Tracked-On: #3681
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2019-09-17 09:45:28 +08:00
Victor Sun 398137990e HV: add memmap param for hvlog in sos cmdline
Reserve memory for hv sbuf to avoid its possible overwriting on kernel memory.

For apl-up2, move hv_log address to 0x5de00000 to avoid possible conflict with
HV_RAM which start from 0x5e000000;

For nuc6cayh, move HV_RAM_START to 0x20000000 to avoid possible conflict with
hv_log which start from 0x1fe00000;

Tracked-On: #3533

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2019-09-17 09:12:03 +08:00
Mingqiang Chi 12fc8e9c8d hv:enable the O2 option for HV
commit 5d19962d removed O2 option improperly,
this patch re-enable it.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2019-09-16 16:29:46 +08:00
Manisha 76f104cf3d SEP/SOCWATCH: fix misra violation
Tracked-On: #3598
Signed-off-by: Manisha <manisha.chinthapally@intel.com>
2019-09-16 15:54:34 +08:00
Manisha 489a0e645d SEP/SOCWATCH change variable names
To follow ACRN coding guideline: identifier cannot be reused.
in profiling_info_wrapper struct, modified member names:
pmu_sample -> p_sample
sep_state -> s_state
sw_msr_op_info -> sw_msr_info
vm_switch_trace -> vm_trace

Tracked-On: #3598
Acked-by: min.yeol.lim@intel.com
Signed-off-by: Manisha <manisha.chinthapally@intel.com>
2019-09-16 15:54:34 +08:00
Li, Fei1 de589c25fc hv: vpci: a minor fix about vpci_init_pt_dev
In "commit 6ebc22" the vPCI device initialize sequence is wrong changed. This patch
tries to revert it.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-16 15:32:26 +08:00
Li, Fei1 a6954486e9 hv: vpci: a minor fix about handling vmsix table mmio access for post-launched VM
In "commit 90480d" we use a pointer new_owner to point to the actual vPCI device
for post-launched VM when this device is assigned to this post-launched VM from
SOS. However, now DM will use SOS's vmsix_table_mmio_access_handler to trap vMSI-X
table mmio access for post-launched VM. So we should use the post-launched VM's
vPCI device in this case.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-16 15:32:26 +08:00
Mingqiang Chi 60adef33d3 hv:move down structures run_context and ext_context
Now the structures(run_context & ext_context) are defined
in vcpu.h,and they are used in the lower-layer modules(wakeup.S),
this patch move down the structures from vcpu.h to cpu.h
to avoid reversed dependency.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-16 14:51:36 +08:00
Mingqiang Chi 4f98cb03a7 hv:move down the structure intr_source
Now the structures(union source & struct intr_source) are defined
in ptdev.h,they are used in vtd.c and assign.c,
vtd is the hardware layer and ptdev is the upper-layer module
from the modularization perspective, this patch move down
these structures to avoid reversed dependency.

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-16 14:51:36 +08:00
Shuo A Liu 4742d1c747 hv: ptdev: move softirq_dev_entry_list from vm structure to per_cpu region
Using per_cpu list to record ptdev interrupts is more reasonable than
recording them per-vm. It makes dispatching such interrupts more easier
as we now do it in softirq which happens following interrupt context of
each pcpu.

Tracked-On: #3663
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-16 09:36:52 +08:00
Shuo A Liu 2cc45534d6 hv: move pcpu offline request and vm shutdown request from schedule
From modulization perspective, it's not suitable to put pcpu and vm
related request operations in schedule. So move them to pcpu and vm
module respectively. Also change need_offline return value to bool.

Tracked-On: #3663
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-09-16 09:36:52 +08:00
Yin Fengwei 6b6aa80600 hv: pm: fix coding style issue
This patch fix the coding style issue introduced by previous two
patches.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 17:30:24 +08:00
Yin Fengwei f039d75998 hv: pm: enhencement platform S5 entering operation
Now, we have assumption that SOS control whether the platform
should enter S5 or not. So when SOS tries enter S5, we just
forward the S5 request to native port which make sure platform
S5 is totally aligned with SOS S5.

With higher serverity guest introduced,this assumption is not
true any more. We need to extend the platform S5 process to
handle higher severity guest:
  - For DM launched RTVM, we need to make sure these guests
    is off before put the whole platfrom to S5.

  - For pre-launched VM, there are two cases:
    * if os running in it support S5, we wait for guests off.
    * if os running in it doesn't support S5, we expect it
      will invoke one hypercall to notify HV to shutdown it.
      NOTE: this case is not supported yet. Will add it in the
      future.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
2019-09-11 17:30:24 +08:00
Yin Fengwei ce9375874c hv: pm: correct the function name
do_acpi_s3 actually not limit to do s3 operation. It depends on
the paramters pm1a_cnt_val and pm1b_cnt_val. It could be s3/s5.
Update the function name from xx_s3 to xx_sx.

Tracked-On: #3564
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-09-11 17:30:24 +08:00
Victor Sun d188afbc59 HV: add acpi info header for nuc7i7dnb
Currently nuc7i7dnb board is using default platform acpi info file so causes
S3/S5 not working properly.

This patch updates the correct ACPI info for nuc7i7dnb board.

Tracked-On: #3609

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-11 14:00:53 +08:00
Li, Fei1 ca51cc9d8a hv: vPCI: vPCI device should use its virtual configure space to access its BAR
vPCI device should use its virtual configure space to access its BAR after vPCI
device initialized.
This patch also remove corner case "vPCI device will use its 64 bits BAR high idx
to access its BAR base address".

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-11 13:17:42 +08:00
Li, Fei1 6ebc22210b hv: vPCI: cache PCI BAR physical base address
PCI BAR physical base address will never changed. Cache it to avoid calculating
it every time when we access it.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2019-09-11 13:17:42 +08:00
Li, Fei1 8b9aa11030 hv: mmu: remove strict check for deleting page table mapping
When we support PCI MSI-X table BAR remapping, we may re-delete the MSI-X table BAR
region. This patch removes strict check for deleting page table mapping.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-10 15:28:07 +08:00
Li, Fei1 127c73c3be hv: mmu: add strict check for adding page table mapping
The current implement only do "only add a page table mapping for a region when
it's not mapped" check when this page table entry is a PTE entry. However, it
need to do this check for PDPTE entry and PDE entry too.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
2019-09-10 15:28:07 +08:00