Displaying 14 results from an estimated 14 matches for "arch_needs_iommu_platform".
2020 Jun 15
4
[PATCH v2 0/1] s390: virtio: let's 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 16
2
[PATCH v2 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);
>
> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_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..30091089bee8 100644
> --- a/drivers/vir...
2020 Jun 16
2
[PATCH v2 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);
>
> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_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..30091089bee8 100644
> --- a/drivers/vir...
2020 Jun 16
3
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...s a bit strange to me, but
if Heiko and Vasily don't mind, neither do I.
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_iommu_platform(struct virtio_device *dev)
Maybe prefixing the name with virtio_ would help provide the
proper context.
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virt...
2020 Jun 16
3
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...s a bit strange to me, but
if Heiko and Vasily don't mind, neither do I.
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_iommu_platform(struct virtio_device *dev)
Maybe prefixing the name with virtio_ would help provide the
proper context.
> +{
> + return is_prot_virt_guest();
> +}
> +
> /* protected virtualization */
> static void pv_init(void)
> {
> diff --git a/drivers/virtio/virtio.c b/drivers/virt...
2020 Jun 15
0
[PATCH v2 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);
@@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
return is_prot_virt_guest();
}
+int arch_needs_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..30091089bee8 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -167...
2020 Jun 16
0
[PATCH v2 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);
>>
>> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
>> return is_prot_virt_guest();
>> }
>>
>> +int arch_needs_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..3009...
2020 Jun 16
1
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...> #include <asm/uv.h>
> +#include <linux/virtio.h>
>
> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>
> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
> return is_prot_virt_guest();
> }
>
> +int arch_needs_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..30091089bee8 100644
> --- a/drivers/v...
2020 Jun 16
2
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...t; {
> >> int ret = dev->config->finalize_features(dev);
> >> @@ -179,6 +184,10 @@ int virtio_finalize_features(struct virtio_device *dev)
> >> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
> >> return 0;
> >>
> >> + if (arch_needs_iommu_platform(dev) &&
> >> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM))
> >> + return -EIO;
> >> +
> >
> > Why EIO?
>
> Because I/O can not occur correctly?
> I am open to suggestions.
We use -ENODEV if feature when the device rejects the f...
2020 Jun 16
2
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...t; {
> >> int ret = dev->config->finalize_features(dev);
> >> @@ -179,6 +184,10 @@ int virtio_finalize_features(struct virtio_device *dev)
> >> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
> >> return 0;
> >>
> >> + if (arch_needs_iommu_platform(dev) &&
> >> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM))
> >> + return -EIO;
> >> +
> >
> > Why EIO?
>
> Because I/O can not occur correctly?
> I am open to suggestions.
We use -ENODEV if feature when the device rejects the f...
2020 Jun 16
0
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
..., kvm-s390 is another candidate.
>
>>
>> pgd_t swapper_pg_dir[PTRS_PER_PGD] __section(.bss..swapper_pg_dir);
>>
>> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
>> return is_prot_virt_guest();
>> }
>>
>> +int arch_needs_iommu_platform(struct virtio_device *dev)
>
> 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.
>...
2020 Jun 16
1
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...ic wrote:
> > On Mon, 15 Jun 2020 14:39:24 +0200
> > Pierre Morel <pmorel at linux.ibm.com> wrote:
> >> @@ -162,6 +163,11 @@ bool force_dma_unencrypted(struct device *dev)
> >> return is_prot_virt_guest();
> >> }
> >>
> >> +int arch_needs_iommu_platform(struct virtio_device *dev)
> >
> > 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 nobo...
2020 Jun 16
1
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...>config->finalize_features(dev);
>>>>> @@ -179,6 +184,10 @@ int virtio_finalize_features(struct virtio_device *dev)
>>>>> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
>>>>> return 0;
>>>>>
>>>>> + if (arch_needs_iommu_platform(dev) &&
>>>>> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM))
>>>>> + return -EIO;
>>>>> +
>>>>
>>>> Why EIO?
>>>
>>> Because I/O can not occur correctly?
>>> I am open to suggestions.
>...
2020 Jun 16
0
[PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature
...nt ret = dev->config->finalize_features(dev);
> > >> @@ -179,6 +184,10 @@ int virtio_finalize_features(struct virtio_device *dev)
> > >> if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
> > >> return 0;
> > >>
> > >> + if (arch_needs_iommu_platform(dev) &&
> > >> + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM))
> > >> + return -EIO;
> > >> +
> > >
> > > Why EIO?
> >
> > Because I/O can not occur correctly?
> > I am open to suggestions.
>
>...