mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
Merge tag 'kvmarm-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 updates for Linux 5.13 New features: - Stage-2 isolation for the host kernel when running in protected mode - Guest SVE support when running in nVHE mode - Force W^X hypervisor mappings in nVHE mode - ITS save/restore for guests using direct injection with GICv4.1 - nVHE panics now produce readable backtraces - Guest support for PTP using the ptp_kvm driver - Performance improvements in the S2 fault handler - Alexandru is now a reviewer (not really a new feature...) Fixes: - Proper emulation of the GICR_TYPER register - Handle the complete set of relocation in the nVHE EL2 object - Get rid of the oprofile dependency in the PMU code (and of the oprofile body parts at the same time) - Debug and SPE fixes - Fix vcpu reset
This commit is contained in:
@@ -1730,6 +1730,81 @@ int _kvm_ioctl(struct kvm_vm *vm, unsigned long cmd, void *arg)
|
||||
return ioctl(vm->kvm_fd, cmd, arg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Device Ioctl
|
||||
*/
|
||||
|
||||
int _kvm_device_check_attr(int dev_fd, uint32_t group, uint64_t attr)
|
||||
{
|
||||
struct kvm_device_attr attribute = {
|
||||
.group = group,
|
||||
.attr = attr,
|
||||
.flags = 0,
|
||||
};
|
||||
|
||||
return ioctl(dev_fd, KVM_HAS_DEVICE_ATTR, &attribute);
|
||||
}
|
||||
|
||||
int kvm_device_check_attr(int dev_fd, uint32_t group, uint64_t attr)
|
||||
{
|
||||
int ret = _kvm_device_check_attr(dev_fd, group, attr);
|
||||
|
||||
TEST_ASSERT(ret >= 0, "KVM_HAS_DEVICE_ATTR failed, rc: %i errno: %i", ret, errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int _kvm_create_device(struct kvm_vm *vm, uint64_t type, bool test, int *fd)
|
||||
{
|
||||
struct kvm_create_device create_dev;
|
||||
int ret;
|
||||
|
||||
create_dev.type = type;
|
||||
create_dev.fd = -1;
|
||||
create_dev.flags = test ? KVM_CREATE_DEVICE_TEST : 0;
|
||||
ret = ioctl(vm_get_fd(vm), KVM_CREATE_DEVICE, &create_dev);
|
||||
*fd = create_dev.fd;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int kvm_create_device(struct kvm_vm *vm, uint64_t type, bool test)
|
||||
{
|
||||
int fd, ret;
|
||||
|
||||
ret = _kvm_create_device(vm, type, test, &fd);
|
||||
|
||||
if (!test) {
|
||||
TEST_ASSERT(ret >= 0,
|
||||
"KVM_CREATE_DEVICE IOCTL failed, rc: %i errno: %i", ret, errno);
|
||||
return fd;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int _kvm_device_access(int dev_fd, uint32_t group, uint64_t attr,
|
||||
void *val, bool write)
|
||||
{
|
||||
struct kvm_device_attr kvmattr = {
|
||||
.group = group,
|
||||
.attr = attr,
|
||||
.flags = 0,
|
||||
.addr = (uintptr_t)val,
|
||||
};
|
||||
int ret;
|
||||
|
||||
ret = ioctl(dev_fd, write ? KVM_SET_DEVICE_ATTR : KVM_GET_DEVICE_ATTR,
|
||||
&kvmattr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int kvm_device_access(int dev_fd, uint32_t group, uint64_t attr,
|
||||
void *val, bool write)
|
||||
{
|
||||
int ret = _kvm_device_access(dev_fd, group, attr, val, write);
|
||||
|
||||
TEST_ASSERT(ret >= 0, "KVM_SET|GET_DEVICE_ATTR IOCTL failed, rc: %i errno: %i", ret, errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* VM Dump
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user