Displaying 20 results from an estimated 32 matches for "arch_needs_virtio_iommu_platform".
2020 Jun 17
6
[PATCH v3 0/1] s390: virtio: let arch choose to accept devices without IOMMU feature
An architecture protecting the guest memory against unauthorized host
access may want to enforce VIRTIO I/O device protection through the
use of VIRTIO_F_IOMMU_PLATFORM.
Let's give a chance to the architecture to accept or not devices
without VIRTIO_F_IOMMU_PLATFORM.
Pierre Morel (1):
s390: virtio: let arch accept devices without IOMMU feature
arch/s390/mm/init.c | 6 ++++++
2020 Jun 17
1
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...g.h>
> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index a977e32a88f2..aa8e01104f86 100644
> --- a/drivers/virt...
2020 Jun 17
1
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...g.h>
> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index a977e32a88f2..aa8e01104f86 100644
> --- a/drivers/virt...
2020 Jun 29
3
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...g.h>
> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index a977e32a88f2..aa8e01104f86 100644
> --- a/drivers/virt...
2020 Jun 29
3
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...g.h>
> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index a977e32a88f2..aa8e01104f86 100644
> --- a/drivers/virt...
2020 Jul 07
3
[PATCH v4 1/2] virtio: let arch validate VIRTIO features
...o/virtio.c
> index a977e32a88f2..3179a8aa76f5 100644
> --- a/drivers/virtio/virtio.c
> +++ b/drivers/virtio/virtio.c
> @@ -167,6 +167,21 @@ void virtio_add_status(struct virtio_device *dev, unsigned int status)
> }
> EXPORT_SYMBOL_GPL(virtio_add_status);
>
> +/*
> + * arch_needs_virtio_iommu_platform - provide arch specific hook when finalizing
s/arch_needs_virtio_iommu_platform/arch_validate_virtio_features/
:)
> + * features for VIRTIO device dev
> + * @dev: the VIRTIO device being added
> + *
> + * Permits the platform to provide architecture specific functionality wh...
2020 Jul 07
3
[PATCH v4 1/2] virtio: let arch validate VIRTIO features
...o/virtio.c
> index a977e32a88f2..3179a8aa76f5 100644
> --- a/drivers/virtio/virtio.c
> +++ b/drivers/virtio/virtio.c
> @@ -167,6 +167,21 @@ void virtio_add_status(struct virtio_device *dev, unsigned int status)
> }
> EXPORT_SYMBOL_GPL(virtio_add_status);
>
> +/*
> + * arch_needs_virtio_iommu_platform - provide arch specific hook when finalizing
s/arch_needs_virtio_iommu_platform/arch_validate_virtio_features/
:)
> + * features for VIRTIO device dev
> + * @dev: the VIRTIO device being added
> + *
> + * Permits the platform to provide architecture specific functionality wh...
2020 Jun 17
0
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...e <asm/kasan.h>
#include <asm/dma-mapping.h>
#include <asm/uv.h>
+#include <linux/virtio.h>
pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
@@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
return is_prot_virt_guest();
}
+int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
+{
+ return is_prot_virt_guest();
+}
+
/* protected virtualization */
static void pv_init(void)
{
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index a977e32a88f2..aa8e01104f86 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -167,...
2020 Jun 17
0
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...t;> +#include <linux/virtio.h>
>>
>> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>>
>> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
>> return is_prot_virt_guest();
>> }
>>
>> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
>> +{
>> + return is_prot_virt_guest();
>> +}
>> +
>> /* protected virtualization */
>> static void pv_init(void)
>> {
>> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
>> index a977e32a88f2..aa8e...
2020 Jun 17
4
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...generic.
One option is to introduce virtio_arch_finalize_features(), a hook that
could reject any feature that is inappropriate.
Another option would be to find a common name for is_prot_virt_guest()
(arch/s390) sev_active() (arch/x86) and is_secure_guest() (arch/powerpc)
and use that instead of arch_needs_virtio_iommu_platform() and where-ever
appropriate. Currently we seem to want this info in driver code only for
virtio, but if the virtio driver has a legitimate need to know, other
drivers may as well have a legitimate need to know. For example if we
wanted to protect ourselves in ccw device drivers from somebody
setti...
2020 Jun 17
4
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...generic.
One option is to introduce virtio_arch_finalize_features(), a hook that
could reject any feature that is inappropriate.
Another option would be to find a common name for is_prot_virt_guest()
(arch/s390) sev_active() (arch/x86) and is_secure_guest() (arch/powerpc)
and use that instead of arch_needs_virtio_iommu_platform() and where-ever
appropriate. Currently we seem to want this info in driver code only for
virtio, but if the virtio driver has a legitimate need to know, other
drivers may as well have a legitimate need to know. For example if we
wanted to protect ourselves in ccw device drivers from somebody
setti...
2020 Jun 29
2
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...g.h>
> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index a977e32a88f2..aa8e01104f86 100644
> --- a/drivers/virt...
2020 Jun 29
2
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...g.h>
> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -161,6 +162,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_virtio_iommu_platform(struct virtio_device *dev)
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index a977e32a88f2..aa8e01104f86 100644
> --- a/drivers/virt...
2020 Jul 02
2
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...de/linux/virtio.h | 2 ++
>>> 3 files changed, 30 insertions(+)
>
>>> @@ -179,6 +194,13 @@ int virtio_finalize_features(struct virtio_device *dev)
>>> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
>>> return 0;
>>>
>>> + if (arch_needs_virtio_iommu_platform(dev) &&
>>> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) {
>>> + dev_warn(&dev->dev,
>>> + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n");
>>> + return -ENODEV;
>>> + }
>>> +
>>> virti...
2020 Jul 02
2
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...de/linux/virtio.h | 2 ++
>>> 3 files changed, 30 insertions(+)
>
>>> @@ -179,6 +194,13 @@ int virtio_finalize_features(struct virtio_device *dev)
>>> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
>>> return 0;
>>>
>>> + if (arch_needs_virtio_iommu_platform(dev) &&
>>> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) {
>>> + dev_warn(&dev->dev,
>>> + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n");
>>> + return -ENODEV;
>>> + }
>>> +
>>> virti...
2020 Jun 29
2
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...>> {
>>> int ret = dev->config->finalize_features(dev);
>>> @@ -179,6 +194,13 @@ int virtio_finalize_features(struct virtio_device *dev)
>>> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
>>> return 0;
>>>
>>> + if (arch_needs_virtio_iommu_platform(dev) &&
>>> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) {
>>> + dev_warn(&dev->dev,
>>> + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n");
>>
>> I'm not sure, divulging the current Linux name of this feature...
2020 Jun 29
2
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...>> {
>>> int ret = dev->config->finalize_features(dev);
>>> @@ -179,6 +194,13 @@ int virtio_finalize_features(struct virtio_device *dev)
>>> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
>>> return 0;
>>>
>>> + if (arch_needs_virtio_iommu_platform(dev) &&
>>> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) {
>>> + dev_warn(&dev->dev,
>>> + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n");
>>
>> I'm not sure, divulging the current Linux name of this feature...
2020 Jun 16
1
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...> > Maybe prefixing the name with virtio_ would help provide the
> > proper context.
>
> The virtio_dev makes it obvious and from the virtio side it should be
> obvious that the arch is responsible for this.
>
> However if nobody has something against I change it.
arch_needs_virtio_iommu_platform()?
>
> >
> >> +{
> >> + return is_prot_virt_guest();
> >> +}
> >> +
> >> /* protected virtualization */
> >> static void pv_init(void)
> >> {
2020 Jun 19
1
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
On Fri, 19 Jun 2020 11:20:51 +0200
Cornelia Huck <cohuck at redhat.com> wrote:
> > > + if (arch_needs_virtio_iommu_platform(dev) &&
> > > + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) {
> > > + dev_warn(&dev->dev,
> > > + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n");
> >
> > I'm not sure, divulging the current Linux name of...
2020 Jul 07
0
[PATCH v4 1/2] virtio: let arch validate VIRTIO features
...f2..3179a8aa76f5 100644
>> --- a/drivers/virtio/virtio.c
>> +++ b/drivers/virtio/virtio.c
>> @@ -167,6 +167,21 @@ void virtio_add_status(struct virtio_device *dev, unsigned int status)
>> }
>> EXPORT_SYMBOL_GPL(virtio_add_status);
>>
>> +/*
>> + * arch_needs_virtio_iommu_platform - provide arch specific hook when finalizing
>
> s/arch_needs_virtio_iommu_platform/arch_validate_virtio_features/
With the things from Conny fixed,
Acked-by: Christian Borntraeger <borntraeger at de.ibm.com>