From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Is KVM_GET_SREGS safe from other threads? Date: Sun, 8 May 2011 11:24:24 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 To: KVM General , Avi Kivity , Ingo Molnar , Cyrill Gorcunov Return-path: Received: from mail-vx0-f174.google.com ([209.85.220.174]:51652 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126Ab1EHIYZ (ORCPT ); Sun, 8 May 2011 04:24:25 -0400 Received: by vxi39 with SMTP id 39so4774075vxi.19 for ; Sun, 08 May 2011 01:24:24 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: Hi! We've noticed that sometimes KVM_GET_SREGS from a signal handler hangs. We use it like this: static void handle_sigquit(int sig) { int i; for (i = 0; i < nrcpus; i++) { struct kvm_cpu *cpu = kvm_cpus[i]; kvm_cpu__show_registers(cpu); <-- here kvm_cpu__show_code(cpu); kvm_cpu__show_page_tables(cpu); } and void kvm_cpu__show_registers(struct kvm_cpu *self) { [...] if (ioctl(self->vcpu_fd, KVM_GET_SREGS, &sregs) < 0) die("KVM_GET_REGS failed"); is it not OK to call KVM_GET_SREGS from other threads than the one that's doing KVM_RUN? Pekka