[siemens/jailhouse] a8be9e: core: ivshmem: Move shared memory parameters into ...

2 views
Skip to first unread message

GitHub

unread,
Jan 7, 2017, 6:54:10 AM1/7/17
to jailho...@googlegroups.com
Branch: refs/heads/wip/ivshmem2
Home: https://github.com/siemens/jailhouse
Commit: a8be9e60b8eb41db3716b0a004408412955f070b
https://github.com/siemens/jailhouse/commit/a8be9e60b8eb41db3716b0a004408412955f070b
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Move shared memory parameters into vendor specific capability

This gives us more flexibility in extending the parameters we expose via
the config space. The capability starts with its ID, the next pointer, a
one-byte length field (these parameters are mandated by the PCI spec),
then a one-byte flags field (currently RsvdZ), and finally the shared
memory region address and size. Proper specification of all this is work
in progress.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 06d3526caaa544e5ee9e88fcee6ca0b1f19f4414
https://github.com/siemens/jailhouse/commit/06d3526caaa544e5ee9e88fcee6ca0b1f19f4414
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/arch/arm-common/ivshmem.c
M hypervisor/arch/x86/ivshmem.c
M hypervisor/include/jailhouse/ivshmem.h
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Move INTx control into PCI config space

This prepares for unprivileged access to the MMIO register space inside
cells. It uses the flags field of the new vendor capability.

To avoid affecting the arch_ivshmem_update_intx handler from further
changes in the enabling logic, pass the new state as parameter.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 49854e440ce63f07f72058aa00fa472f714afd50
https://github.com/siemens/jailhouse/commit/49854e440ce63f07f72058aa00fa472f714afd50
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Derive MMIO register region size from cell config

The BAR mask encodes the size of a PCI device resource. Use this to
allow a target-dependent setting via the cell configuration so that
alignment to the cell's page size become feasible. This will enable the
cell OS to map the MMIO region as a whole into user space.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 6d239182f6d9f899e492d65dbe13b91a9e6f506d
https://github.com/siemens/jailhouse/commit/6d239182f6d9f899e492d65dbe13b91a9e6f506d
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Enable unprivileged MMIO register access

Make sure that unsupported accesses to the MMIO register region do not
raise immediate panic. We should rather ignored them. This allows the
cell OS to hand out the region to unprivileged users.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: eeef7645222a88165917aacf14c59c425bc1300e
https://github.com/siemens/jailhouse/commit/eeef7645222a88165917aacf14c59c425bc1300e
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M configs/amd-seattle-linux-demo.c
M configs/amd-seattle.c
M configs/bananapi-linux-demo.c
M configs/bananapi.c
M configs/hikey-linux-demo.c
M configs/hikey.c
M configs/ivshmem-demo.c
M configs/jetson-tk1-linux-demo.c
M configs/jetson-tk1.c
M configs/linux-x86-demo.c
M configs/qemu-vm.c
M configs/zynqmp-zcu102-linux-demo-2.c
M configs/zynqmp-zcu102-linux-demo.c
M configs/zynqmp-zcu102.c

Log Message:
-----------
config: Adjust ivshmem MMIO region to 4K size

Required so that the cell OS can map the region as a whole to its user
space.

If a cell may use larger minimal page sizes, the mask for BAR 0 has to
be adjusted accordingly. For now we assume they are all on 4K.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: c1a2f8c54133147833f3009e347eb0084bcef1bc
https://github.com/siemens/jailhouse/commit/c1a2f8c54133147833f3009e347eb0084bcef1bc
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Pack MMIO registers

Reorder the layout and fill gaps that were left due to unsupported
registers of the original ivshmem device. We are breaking with that
design anyway.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 5156cf5e2a91537c97b44333529fbd88ca3ae72c
https://github.com/siemens/jailhouse/commit/5156cf5e2a91537c97b44333529fbd88ca3ae72c
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Rename IVPOS register to ID

From user pespective, there is no specific "position" encoded into
"ivpos". It's just a unique identifier on an ivshmem link.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 170665e73913a15cc4a52c36a254ddace16025bb
https://github.com/siemens/jailhouse/commit/170665e73913a15cc4a52c36a254ddace16025bb
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Rename ivshmem_data to ivshmem_link

Represents more clearly what the structure is about: meta data
describing the link between two ivshmem endpoints.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 23c26bee4269386918570f471a22c6a81a250d40
https://github.com/siemens/jailhouse/commit/23c26bee4269386918570f471a22c6a81a250d40
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Introduce link pointer to ivshmem_endpoint

Will be used when moving the remote lock to link level.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 968a7f0b79c98a78d4e2856e9616edcee87a5ddc
https://github.com/siemens/jailhouse/commit/968a7f0b79c98a78d4e2856e9616edcee87a5ddc
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Promote remote lock to a link level lock

This is required when synchronizing activities (see upcoming remote
state write-back) that require references to both sides: Taking both
remote locks would required lock nesting and creates deadlock risks. It
is simpler to validate that a single lock at link level is acquired and
released correctly.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 947f07ddccdca7e02c0780ab476b06ce06b282eb
https://github.com/siemens/jailhouse/commit/947f07ddccdca7e02c0780ab476b06ce06b282eb
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/arch/arm-common/ivshmem.c
M hypervisor/arch/x86/ivshmem.c
M hypervisor/arch/x86/vtd.c
M hypervisor/include/jailhouse/ivshmem.h
M hypervisor/ivshmem.c
M hypervisor/pci.c

Log Message:
-----------
core: ivshmem: Reintroduce ivshmem_update_msix

This function consolidates the check for num_msix_vectors > 0 and
ivshmem_is_msix_masked, leaving arch_ivshmem_update_msix with less work.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: ae46b5d34fea1a27dcb71f878c0f6085339c65f1
https://github.com/siemens/jailhouse/commit/ae46b5d34fea1a27dcb71f878c0f6085339c65f1
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/arch/arm-common/ivshmem.c
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Add PCI-conforming INTx mask

Simple enough to add, and newer PCI specs demand this feature anyway:
allow to mask the INTx line via the command register.

For this purpose, factor out ivshmem_update_intx that determines the
state of the line prior to calling arch_ivshmem_update_intx. It also
skips over this call in case num_msix_vectors is non-null, offloading
this check from the arch function.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 9df3144b5e30009e5c8e769197d96c611e6fbd7e
https://github.com/siemens/jailhouse/commit/9df3144b5e30009e5c8e769197d96c611e6fbd7e
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Move arch_ivshmem_update_msix/intx under link lock

This both ensure atomicity /wrt arch_ivshmem_trigger_interrupt and
provides a barrier so that no further interrupts are in flight (provided
the hardware does not delay IPI delivery) after returning from an
interrupt masking operation.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 7cec3bb265b1a4e84e43024dfd8f877e1d904372
https://github.com/siemens/jailhouse/commit/7cec3bb265b1a4e84e43024dfd8f877e1d904372
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Implement remote state write-back to shared memory

Checking the remote state currently requires a MMIO register access
which implies a vmexit. As we only have one interrupt vector so far (and
there won't be more with INTx), this affects even the hot-path of
exchanging I/O-related events with the peer. Also when doing polling,
the check is unnecessary expensive.

Reduce the costs by writing state changes to the shared memory at a
location the peer can decide. This, of course, requires coordination
between both sides to avoid using the location also for different
purposes, but that is out of scope for the shared memory device.

Enabling or updating the write-back address triggers immediate setting
of the target memory so that the user will have the latest state
available when checking the field afterwards.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: dbf0d2a52cea7e57f9793cbf1442d9b090cff5fe
https://github.com/siemens/jailhouse/commit/dbf0d2a52cea7e57f9793cbf1442d9b090cff5fe
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M configs/amd-seattle-linux-demo.c
M configs/amd-seattle.c
M configs/bananapi-linux-demo.c
M configs/bananapi.c
M configs/hikey-linux-demo.c
M configs/hikey.c
M configs/ivshmem-demo.c
M configs/jetson-tk1-linux-demo.c
M configs/jetson-tk1.c
M configs/linux-x86-demo.c
M configs/qemu-vm.c
M configs/zynqmp-zcu102-linux-demo-2.c
M configs/zynqmp-zcu102-linux-demo.c
M configs/zynqmp-zcu102.c
M hypervisor/include/jailhouse/cell-config.h
M hypervisor/include/jailhouse/ivshmem.h
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Add support for unidirectional memory regions

Extend the ivshmem device to map up to 3 memory regions. Conceptually,
all regions are optional, thus can be empty but have to be listed as
such in the cell configuration. If present, the first region shall be
read/write for both sides. The second shall be read/write for the local
side and read-only for the remote. The third one shall be read-only
locally and read/writable for the remote. Thus, second and third region
need to be specified reversely in the configuration of both peers.

All three regions are reported via the vendor-specific capability of the
ivshmem device. The capability is extended accordingly.

For the shared-memory network devices, we only use the second and third
region, thus the unidirectional ones. Update the cell configurations
accordingly by splitting the existing one into two halves.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 501a13d1d18990f837df711a68cab860a852d0c0
https://github.com/siemens/jailhouse/commit/501a13d1d18990f837df711a68cab860a852d0c0
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/ivshmem.c

Log Message:
-----------
core: ivshmem: Reindent defines

Pure styling, no functional changes.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 59181893f2eb209a526d6420bb633c1dfb23aa05
https://github.com/siemens/jailhouse/commit/59181893f2eb209a526d6420bb633c1dfb23aa05
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M hypervisor/arch/arm-common/include/asm/ivshmem.h
M hypervisor/arch/x86/include/asm/ivshmem.h
M scripts/header_check

Log Message:
-----------
core: Restrict asm/ivshmem.h to inclusion by jailhouse/ivshmem.h

The asm header will gain a dependency on the generic one and, thus,
should no longer be considered for direct inclusion. Adjust the header
check accordingly.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: 5821e5d99c458e04848bdf8f7ab9a9994856fc5a
https://github.com/siemens/jailhouse/commit/5821e5d99c458e04848bdf8f7ab9a9994856fc5a
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

Changed paths:
M configs/amd-seattle-linux-demo.c
M configs/amd-seattle.c
M configs/ivshmem-demo.c
M configs/linux-x86-demo.c
M configs/qemu-vm.c
M hypervisor/arch/arm-common/include/asm/ivshmem.h
M hypervisor/arch/arm-common/ivshmem.c
M hypervisor/arch/x86/include/asm/ivshmem.h
M hypervisor/arch/x86/ivshmem.c
M hypervisor/arch/x86/vtd.c
M hypervisor/include/jailhouse/ivshmem.h
M hypervisor/ivshmem.c

Log Message:
-----------
core, configs: ivshmem: Add support for up to 16 MSI-X vectors

This allows ivshmem devices with MSI-X support to expose up to 16
(PCI_EMBEDDED_MSIX_VECTS) vectors to its users. The doorbell register is
now interpreting the written value as vector number. It is possible to
restrict the number of available vectors via the cell configuration. Out
of range writes to the doorbell register will simply be ignored.

In case the cell uses less than the exposed vectors, it is now important
to correctly mask them initially in the MSI-X table as the PCI spec
demands, or the hypervisor may find invalid vectors and complain.

With the number of vectors increasing, we also need to adjust the size
of the related resource region in the cell configs accordingly.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Commit: fca8e0ed560a874bbb3cbd2f455c6ced99c5dd78
https://github.com/siemens/jailhouse/commit/fca8e0ed560a874bbb3cbd2f455c6ced99c5dd78
Author: Jan Kiszka <jan.k...@siemens.com>
Date: 2017-01-07 (Sat, 07 Jan 2017)

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

Log Message:
-----------
core: ivshmem: Fold ivshmem_write_msix_control into caller

Using pci_msix_registers to model the update of the MSI-X control
register does not really simplify the code. Rather use a plain mask that
contains all modifiable bits, PCI_MSIX_CTRL_RW_MASK, and perform the
update in ivshmem_pci_cfg_write directly, analogously to the vendor
capability.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>


Compare: https://github.com/siemens/jailhouse/compare/e1bef3c09719...fca8e0ed560a
Reply all
Reply to author
Forward
0 new messages