linux-stable/include/linux/platform-feature.h
Juergen Gross e5f57aaccb virtio: replace restricted mem access flag with callback
[ Upstream commit a603002eea ]

Instead of having a global flag to require restricted memory access
for all virtio devices, introduce a callback which can select that
requirement on a per-device basis.

For convenience add a common function returning always true, which can
be used for use cases like SEV.

Per default use a callback always returning false.

As the callback needs to be set in early init code already, add a
virtio anchor which is builtin in case virtio is enabled.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> # Arm64 guest using Xen
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/20220622063838.8854-2-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 15:15:41 +02:00

15 lines
449 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PLATFORM_FEATURE_H
#define _PLATFORM_FEATURE_H
#include <linux/bitops.h>
#include <asm/platform-feature.h>
/* The platform features are starting with the architecture specific ones. */
#define PLATFORM_FEAT_N (0 + PLATFORM_ARCH_FEAT_N)
void platform_set(unsigned int feature);
void platform_clear(unsigned int feature);
bool platform_has(unsigned int feature);
#endif /* _PLATFORM_FEATURE_H */