mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
virtio: replace arch_has_restricted_virtio_memory_access()
Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> # Arm64 only Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Borislav Petkov <bp@suse.de>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform-feature.h>
|
||||
#include <uapi/linux/virtio_ids.h>
|
||||
|
||||
/* Unique numbering for virtio devices. */
|
||||
@@ -170,12 +171,10 @@ EXPORT_SYMBOL_GPL(virtio_add_status);
|
||||
static int virtio_features_ok(struct virtio_device *dev)
|
||||
{
|
||||
unsigned int status;
|
||||
int ret;
|
||||
|
||||
might_sleep();
|
||||
|
||||
ret = arch_has_restricted_virtio_memory_access();
|
||||
if (ret) {
|
||||
if (platform_has(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS)) {
|
||||
if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) {
|
||||
dev_warn(&dev->dev,
|
||||
"device must provide VIRTIO_F_VERSION_1\n");
|
||||
|
||||
Reference in New Issue
Block a user