mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
kvm: make one_reg helpers available for everyone
s390x introduced helper functions for getting/setting one_regs with
commit 860643bc
. However, nothing about these is s390-specific.
Alexey Kardashevskiy had already posted a general version, so let's
merge the two patches and massage the code a bit.
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
8e03c100a7
commit
ada4135f84
4 changed files with 50 additions and 33 deletions
|
@ -129,35 +129,6 @@ void kvm_arch_reset_vcpu(CPUState *cpu)
|
|||
}
|
||||
}
|
||||
|
||||
static int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source)
|
||||
{
|
||||
struct kvm_one_reg reg;
|
||||
int r;
|
||||
|
||||
reg.id = id;
|
||||
reg.addr = (uint64_t) source;
|
||||
r = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, ®);
|
||||
if (r) {
|
||||
trace_kvm_failed_reg_set(id, strerror(errno));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
static int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target)
|
||||
{
|
||||
struct kvm_one_reg reg;
|
||||
int r;
|
||||
|
||||
reg.id = id;
|
||||
reg.addr = (uint64_t) target;
|
||||
r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, ®);
|
||||
if (r) {
|
||||
trace_kvm_failed_reg_get(id, strerror(errno));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
int kvm_arch_put_registers(CPUState *cs, int level)
|
||||
{
|
||||
S390CPU *cpu = S390_CPU(cs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue