[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/14] kvm: Allow arch to set sigmask length
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/14] kvm: Allow arch to set sigmask length |
Date: |
Fri, 20 Jun 2014 14:11:16 +0200 |
From: James Hogan <address@hidden>
MIPS/Linux is unusual in having 128 signals rather than just 64 like
most other architectures. This means its sigmask is 16 bytes instead of
8, so allow arches to override the sigmask->len value passed to the
KVM_SET_SIGNAL_MASK ioctl in kvm_set_signal_mask() by calling
kvm_set_sigmask_len() from kvm_arch_init(). Otherwise default to 8
bytes.
Signed-off-by: James Hogan <address@hidden>
Cc: Aurelien Jarno <address@hidden>
Cc: Sanjay Lal <address@hidden>
Cc: Gleb Natapov <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Peter Maydell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
include/sysemu/kvm.h | 2 ++
kvm-all.c | 11 ++++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index e79e92c..de4bdaa 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -325,6 +325,8 @@ int kvm_check_extension(KVMState *s, unsigned int
extension);
uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
uint32_t index, int reg);
+void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len);
+
#if !defined(CONFIG_USER_ONLY)
int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr,
hwaddr *phys_addr);
diff --git a/kvm-all.c b/kvm-all.c
index 56a251b..3142335 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -99,6 +99,7 @@ struct KVMState
* they're not. Linux, glibc and *BSD all treat ioctl numbers as
* unsigned, and treating them as signed here can break things */
unsigned irq_set_ioctl;
+ unsigned int sigmask_len;
#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing *irq_routes;
int nr_allocated_irq_routes;
@@ -1397,6 +1398,8 @@ int kvm_init(MachineClass *mc)
assert(TARGET_PAGE_SIZE <= getpagesize());
page_size_init();
+ s->sigmask_len = 8;
+
#ifdef KVM_CAP_SET_GUEST_DEBUG
QTAILQ_INIT(&s->kvm_sw_breakpoints);
#endif
@@ -1575,6 +1578,11 @@ err:
return ret;
}
+void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len)
+{
+ s->sigmask_len = sigmask_len;
+}
+
static void kvm_handle_io(uint16_t port, void *data, int direction, int size,
uint32_t count)
{
@@ -2095,6 +2103,7 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset)
{
+ KVMState *s = kvm_state;
struct kvm_signal_mask *sigmask;
int r;
@@ -2104,7 +2113,7 @@ int kvm_set_signal_mask(CPUState *cpu, const sigset_t
*sigset)
sigmask = g_malloc(sizeof(*sigmask) + sizeof(*sigset));
- sigmask->len = 8;
+ sigmask->len = s->sigmask_len;
memcpy(sigmask->sigset, sigset, sizeof(*sigset));
r = kvm_vcpu_ioctl(cpu, KVM_SET_SIGNAL_MASK, sigmask);
g_free(sigmask);
--
1.7.1
- [Qemu-devel] [PULL 00/14] Pending KVM patches for 2.1, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 01/14] KVM: Fix GSI number space limit, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 03/14] hw/mips/cputimer: Don't start periodic timer in KVM mode, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 02/14] target-mips: Reset CPU timer consistently, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 04/14] hw/mips: Add API to convert KVM guest KSEG0 <-> GPA, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 05/14] target-mips: get_physical_address: Add defines for segment bases, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 06/14] target-mips: get_physical_address: Add KVM awareness, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 07/14] kvm: Allow arch to set sigmask length,
Paolo Bonzini <=
- [Qemu-devel] [PULL 08/14] target-mips: kvm: Add main KVM support for MIPS, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 09/14] target-mips: Call kvm_mips_reset_vcpu() from mips_cpu_reset(), Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 10/14] hw/mips: In KVM mode, inject IRQ2 (I/O) interrupts via ioctls, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 11/14] hw/mips: malta: Add KVM support, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 12/14] target-mips: Enable KVM support in build system, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 13/14] MAINTAINERS: Add entry for MIPS KVM, Paolo Bonzini, 2014/06/20
- [Qemu-devel] [PULL 14/14] hw/mips: malta: Don't boot from flash with KVM T&E, Paolo Bonzini, 2014/06/20
- Re: [Qemu-devel] [PULL 00/14] Pending KVM patches for 2.1, Peter Maydell, 2014/06/20