Skip to content

Commit 6ca9971

Browse files
JasonChenCJlijinxia
authored andcommitted
Revert "hv: More changes to enable GPU passthru"
This reverts commit 8d50d40.
1 parent cfb2828 commit 6ca9971

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

hypervisor/arch/x86/ept.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ int ept_mmap(struct vm *vm, uint64_t hpa,
489489
* to force snooping of PCIe devices if the page
490490
* is cachable
491491
*/
492-
if ((prot & IA32E_EPT_MT_MASK) != IA32E_EPT_UNCACHED && iommu_snoop)
492+
if ((prot & IA32E_EPT_MT_MASK) != IA32E_EPT_UNCACHED)
493493
prot |= IA32E_EPT_SNOOP_CTRL;
494494
map_mem(&map_params, (void *)hpa,
495495
(void *)gpa, size, prot);

hypervisor/arch/x86/vtd.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ struct iommu_domain {
152152
uint64_t trans_table_ptr;
153153
};
154154

155-
bool iommu_snoop = true; /* enable iommu snoop control */
156-
157155
static struct list_head dmar_drhd_units;
158156
static uint32_t dmar_hdrh_unit_count;
159157

@@ -421,13 +419,9 @@ static void dmar_register_hrhd(struct dmar_drhd_rt *dmar_uint)
421419
* How to guarantee it when EPT is used as second-level
422420
* translation paging structures?
423421
*/
424-
425-
/* enable snoop control only if it is supported by all the VT-d engines */
426-
if (!iommu_ecap_sc(dmar_uint->ecap)) {
422+
if (iommu_ecap_sc(dmar_uint->ecap) == 0U)
427423
dev_dbg(ACRN_DBG_IOMMU,
428424
"dmar uint doesn't support snoop control!");
429-
iommu_snoop = false;
430-
}
431425

432426
dmar_uint->max_domain_id = iommu_cap_ndoms(dmar_uint->cap) - 1;
433427

@@ -1015,6 +1009,7 @@ static int add_iommu_device(struct iommu_domain *domain, uint16_t segment,
10151009
ASSERT(false,
10161010
"dmaru doesn't support trans passthrough");
10171011
} else {
1012+
/* TODO: add Device TLB support */
10181013
upper =
10191014
DMAR_SET_BITSLICE(upper, CTX_ENTRY_UPPER_AW,
10201015
width_to_agaw(

hypervisor/boot/dmar_parse.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ handle_one_drhd(struct acpi_dmar_hardware_unit *acpi_drhd,
270270

271271
consumed = handle_dmar_devscope(dev_scope, cp, remaining);
272272

273+
if (((drhd->segment << 16) |
274+
(dev_scope->bus << 8) |
275+
dev_scope->devfun) == CONFIG_GPU_SBDF) {
276+
ASSERT(dev_count == 1, "no dedicated iommu for gpu");
277+
drhd->ignore = true;
278+
}
279+
273280
if (consumed <= 0)
274281
break;
275282

hypervisor/bsp/sbl/sbl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static struct dmar_drhd drhd_info_array[] = {
3333
/* Ignore the iommu for intel graphic device since GVT-g needs
3434
* vtd disabled for gpu
3535
*/
36-
.ignore = false,
36+
.ignore = true,
3737
.devices = default_drhd_unit_dev_scope0,
3838
},
3939
{

hypervisor/bsp/uefi/include/bsp/bsp_cfg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define CONFIG_RAM_START 0x20000000
2222
#define CONFIG_RAM_SIZE 0x02000000 /* 32M */
2323
#define CONFIG_DMAR_PARSE_ENABLED 1
24+
#define CONFIG_GPU_SBDF 0x00000010 /* 0000:00:02.0 */
2425
#define CONFIG_EFI_STUB 1
2526
#define CONFIG_UEFI_OS_LOADER_NAME "\\EFI\\org.clearlinux\\bootloaderx64.efi"
2627
#define CONFIG_MTRR_ENABLED 1

hypervisor/include/arch/x86/vtd.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ struct dmar_info {
206206

207207
extern struct dmar_info *get_dmar_info(void);
208208

209-
extern bool iommu_snoop;
210-
211209
struct iommu_domain;
212210

213211
/* Assign a device specified by bus & devfun to a iommu domain */

0 commit comments

Comments
 (0)