From patchwork Tue Jun 17 07:54:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 360425 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 52FDF140085 for ; Tue, 17 Jun 2014 19:47:48 +1000 (EST) Received: from localhost ([::1]:48527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwpzW-0002hc-6r for incoming@patchwork.ozlabs.org; Tue, 17 Jun 2014 05:47:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwoEL-0002Lg-Jg for qemu-devel@nongnu.org; Tue, 17 Jun 2014 03:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwoEG-0002AH-Gi for qemu-devel@nongnu.org; Tue, 17 Jun 2014 03:54:57 -0400 Received: from ozlabs.org ([103.22.144.67]:41032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwoEG-000292-5C for qemu-devel@nongnu.org; Tue, 17 Jun 2014 03:54:52 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 6FB4B140099; Tue, 17 Jun 2014 17:54:48 +1000 (EST) From: Michael Ellerman To: qemu-devel@nongnu.org Date: Tue, 17 Jun 2014 17:54:31 +1000 Message-Id: <1402991675-24905-2-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1402991675-24905-1-git-send-email-mpe@ellerman.id.au> References: <1402991675-24905-1-git-send-email-mpe@ellerman.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 X-Mailman-Approved-At: Tue, 17 Jun 2014 05:47:18 -0400 Cc: kvm@vger.kernel.org, aik@ozlabs.ru, jan.kiszka@siemens.com, agraf@suse.de, jfrei@linux.vnet.ibm.com, alfs@linux.vnet.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 2/6] kvm_stat: Fix the non-x86 exit reasons X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In kvm_stat we have a dictionary of exit reasons for s390. Firstly these are not s390 specific, they are the generic exit reasons. So rename the dictionary to reflect that. Secondly, the values are defined using hex, but in the kernel header they are decimal. That means values above 9 in kvm_stat are incorrect. As far as I can tell this does not matter in practice because s390 does not define a kvm_exit trace point. While we're there, fix the whitespace to match the rest of the file. Signed-off-by: Michael Ellerman --- scripts/kvm/kvm_stat | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat index 2a788bc..fe2eae3 100755 --- a/scripts/kvm/kvm_stat +++ b/scripts/kvm/kvm_stat @@ -141,33 +141,38 @@ svm_exit_reasons = { 0x400: 'NPF', } -s390_exit_reasons = { - 0x000: 'UNKNOWN', - 0x001: 'EXCEPTION', - 0x002: 'IO', - 0x003: 'HYPERCALL', - 0x004: 'DEBUG', - 0x005: 'HLT', - 0x006: 'MMIO', - 0x007: 'IRQ_WINDOW_OPEN', - 0x008: 'SHUTDOWN', - 0x009: 'FAIL_ENTRY', - 0x010: 'INTR', - 0x011: 'SET_TPR', - 0x012: 'TPR_ACCESS', - 0x013: 'S390_SIEIC', - 0x014: 'S390_RESET', - 0x015: 'DCR', - 0x016: 'NMI', - 0x017: 'INTERNAL_ERROR', - 0x018: 'OSI', - 0x019: 'PAPR_HCALL', +# From include/uapi/linux/kvm.h, KVM_EXIT_xxx +generic_exit_reasons = { + 0: 'UNKNOWN', + 1: 'EXCEPTION', + 2: 'IO', + 3: 'HYPERCALL', + 4: 'DEBUG', + 5: 'HLT', + 6: 'MMIO', + 7: 'IRQ_WINDOW_OPEN', + 8: 'SHUTDOWN', + 9: 'FAIL_ENTRY', + 10: 'INTR', + 11: 'SET_TPR', + 12: 'TPR_ACCESS', + 13: 'S390_SIEIC', + 14: 'S390_RESET', + 15: 'DCR', + 16: 'NMI', + 17: 'INTERNAL_ERROR', + 18: 'OSI', + 19: 'PAPR_HCALL', + 20: 'S390_UCONTROL', + 21: 'WATCHDOG', + 22: 'S390_TSCH', + 23: 'EPR', } vendor_exit_reasons = { 'vmx': vmx_exit_reasons, 'svm': svm_exit_reasons, - 'IBM/S390': s390_exit_reasons, + 'IBM/S390': generic_exit_reasons, } syscall_numbers = {