[siemens/jailhouse] 3be1d0: core: Introduce struct jailhouse_iommu

3 views
Skip to first unread message

GitHub

unread,
Feb 3, 2016, 2:46:16 PM2/3/16
to jailho...@googlegroups.com
Branch: refs/heads/wip/amd-vi
Home: https://github.com/siemens/jailhouse
Commit: 3be1d02568b2060cf37447e17b74b62a4d4e0ed0
https://github.com/siemens/jailhouse/commit/3be1d02568b2060cf37447e17b74b62a4d4e0ed0
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M configs/f2a88xm-hd3.c
M configs/h87i.c
M configs/qemu-vm.c
M hypervisor/arch/x86/iommu.c
M hypervisor/arch/x86/vtd.c
M hypervisor/include/jailhouse/cell-config.h
M tools/jailhouse-config-create
M tools/root-cell-config.c.tmpl

Log Message:
-----------
core: Introduce struct jailhouse_iommu

For AMD, we need to store not only base address but also MMIO size
(and maybe other attributes in future). Introduce struct jailhoue_iommu
to encapsulate all data required. For now, all fields make sense both for
VT-d and AMD IOMMU.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 3fddea89eef421a557dcc4829b2de886100829b6
https://github.com/siemens/jailhouse/commit/3fddea89eef421a557dcc4829b2de886100829b6
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/include/jailhouse/pci.h
M hypervisor/pci.c

Log Message:
-----------
pci: Add pci_find_capability_by_id()

Implement a way to get capability block by the identifier.
This is essential for PCI devices configuration from the hypervisor,
e.g. in amd_iommu code.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: f6da279a41a3d798f76367749f2a430528622f42
https://github.com/siemens/jailhouse/commit/f6da279a41a3d798f76367749f2a430528622f42
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/include/asm/cell.h
M hypervisor/include/jailhouse/paging.h

Log Message:
-----------
x86: Prepare to introduce amd_iommu code

Add few modifications to Jailhouse codebase required for amd_iommu code
to work properly. First, we allocate IOMMU page tables statically in
struct cell. Second, account for page sizes larger than 2GB in struct paging.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: ec9f80d1209feaf20cc0f9d9d74f73a32bfb7ea8
https://github.com/siemens/jailhouse/commit/ec9f80d1209feaf20cc0f9d9d74f73a32bfb7ea8
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M configs/f2a88xm-hd3.c
M hypervisor/include/jailhouse/cell-config.h
M tools/jailhouse-config-create
M tools/root-cell-config.c.tmpl

Log Message:
-----------
x86: Store amd_iommu feature bits in config files

Adjust jailhouse config tool and related data structures to store
AMD IOMMU feature bits (coming from ACPI and useful to determine
its properties like HATS) in cell configuration file.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 541f4017e12e3b8dbe9b19c5dcbb5ac1244a0f55
https://github.com/siemens/jailhouse/commit/541f4017e12e3b8dbe9b19c5dcbb5ac1244a0f55
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/include/asm/amd_iommu.h

Log Message:
-----------
x86: Add amd_iommu structs and definitions

Introduce amd_iommu.h with all structures and definitions needed
for subsequent changes in this patches to work properly.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 55df51482755d0f76209022e57f247f4b348d20a
https://github.com/siemens/jailhouse/commit/55df51482755d0f76209022e57f247f4b348d20a
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/Makefile
A hypervisor/arch/x86/amd_iommu_paging.c
A hypervisor/arch/x86/include/asm/amd_iommu_paging.h

Log Message:
-----------
x86: Add amd_iommu page tables handling code

amd_iommu page tables are extensions to x86_64 page tables. However,
they are 6-level, so one can't easily derive them from x66_64_paging
structures, as e.g. SVM code does.

This commit adds self-containing amd_iommu_paging structures.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: d602e8e58ce1d132528193250b4d114b40eb4309
https://github.com/siemens/jailhouse/commit/d602e8e58ce1d132528193250b4d114b40eb4309
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Add amd_iommu initialization code

Implement iommu_init() and iommu_shutdown() for AMD-based systems.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 7e71b97fbdfe360badb12e7e8782a54b720432e7
https://github.com/siemens/jailhouse/commit/7e71b97fbdfe360badb12e7e8782a54b720432e7
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Implement amd_iommu cell management functions

Add iommu_cell_init() and iommu_cell_destroy() for amd_iommu.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: a270f4d9ea5ca22b57112b1d5ab25a5cd87d2332
https://github.com/siemens/jailhouse/commit/a270f4d9ea5ca22b57112b1d5ab25a5cd87d2332
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Add amd_iommu's memory mapping functions

Implement iommu_map_memory_region() and iommu_unmap_memory_region()
for amd_iommu.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 913f8794054250542424bcef2d5298706ebdfe9c
https://github.com/siemens/jailhouse/commit/913f8794054250542424bcef2d5298706ebdfe9c
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Implement amd_iommu command posting

Add basic infrastructure (heavily influenced by Linux amd_iommu driver)
to submit commands to AMD IOMMU command buffer. For now, having only
INVALIDATE_IOMMU_PAGES and COMPLETION_WAIT seems to be sufficient.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 4bb538b713707c0c8f3f36f38189c3d9b225dcee
https://github.com/siemens/jailhouse/commit/4bb538b713707c0c8f3f36f38189c3d9b225dcee
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Add device management functions for amd_iommu

Implement iommu_add_pci_device() for amd_iommu.

Basically, this is all about filling DTE entry. However, there is no way
to allocate device tables sparsely with ADM IOMMU. To save some memory,
Device Table Segmentation (Revision 2.6 and up) is used whenever possible,
and this adds some infrastructure.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: d76e70b18a0e7e832d2255cdb5bf02968bf482f7
https://github.com/siemens/jailhouse/commit/d76e70b18a0e7e832d2255cdb5bf02968bf482f7
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Add iommu_commit_config() for amd_iommu

Implement functions to apply configuration for an IOMMU.
In case something goes wrong, we need to trigger an NMI, which
amd_iommu_init_fault_nmi() configures.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: 0278cff37699def93d6ff7ccf8cce52812bdc9e3
https://github.com/siemens/jailhouse/commit/0278cff37699def93d6ff7ccf8cce52812bdc9e3
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Implement amd_iommu event log

Add functions to read event logs AMD IOMMU provides and print their
contents. The latter is rather basic, but decoding all possible log
entries is hairy, so we'd better wait and collect stats which
problems occur most often.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Commit: ee98647785a554f1afa482be98359ba9da2459a1
https://github.com/siemens/jailhouse/commit/ee98647785a554f1afa482be98359ba9da2459a1
Author: Valentine Sinitsyn <valentine...@gmail.com>
Date: 2016-02-03 (Wed, 03 Feb 2016)

Changed paths:
M hypervisor/arch/x86/amd_iommu.c

Log Message:
-----------
x86: Add amd_iommu pending faults check

Add iommu_pending_faults() for amd_iommu. This looks into
Hardware Event Register first, and then loops over the event log
printing what's in it. This way, we don't miss errors that happen
when event logging is unavailable.

Signed-off-by: Valentine Sinitsyn <valentine...@gmail.com>


Compare: https://github.com/siemens/jailhouse/compare/3be1d02568b2^...ee98647785a5
Reply all
Reply to author
Forward
0 new messages