From patchwork Sun Feb 15 20:22:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 44689 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B5C6D21533 for ; Sun, 15 Feb 2015 20:25:28 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf17640620eek.3 for ; Sun, 15 Feb 2015 12:25:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=G4DJ1Ae00DJlDNUGUfisSzACJpqxpugBje8S/k6ZFW0=; b=YZlmoxoshIsvNgKU5sfmu7cGo8epCaFEoYVOoP9t++YrUnswP++IuzddIGW9aEe4ln cxvcmnhtnjhfSpHH5RMO3HGbIk039BHUjm0hRk4yeJP8joHUwNaMNc6bpD8Cz65XhJqe WiT2HE4I4yI89/znyznvDBvRqJbL8vpMyVH2iGAzh3kF6U2hFFPg9n9Assqfl8unGLa9 S8S2WawG06tDEWZkQRsu9ec8Ufo2A7wW3xOEoAzLP8X6RkKdPfsyQEYtoZwI7enGaz9S 6CJtJbG6Gai0dAknisty6emT+VDsFgQLmiEVAKFsdzaue/YBLRZf+NPbDaJzXNF9ywsN EozQ== X-Gm-Message-State: ALoCoQmqPHRAMAzS56z2scgZR3Syzkvy4mYRZcO15I2hDmBStFuEYcFvjJSxZX84f1IxB4FOJVzw X-Received: by 10.112.77.101 with SMTP id r5mr1859023lbw.4.1424031927384; Sun, 15 Feb 2015 12:25:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.130 with SMTP id v2ls410182lae.98.gmail; Sun, 15 Feb 2015 12:25:27 -0800 (PST) X-Received: by 10.112.255.104 with SMTP id ap8mr18518938lbd.105.1424031927173; Sun, 15 Feb 2015 12:25:27 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id b6si414899lbc.116.2015.02.15.12.25.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Feb 2015 12:25:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labge10 with SMTP id ge10so24868263lab.12 for ; Sun, 15 Feb 2015 12:25:26 -0800 (PST) X-Received: by 10.152.45.100 with SMTP id l4mr18468455lam.112.1424031926690; Sun, 15 Feb 2015 12:25:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1205739lbj; Sun, 15 Feb 2015 12:25:25 -0800 (PST) X-Received: by 10.68.87.196 with SMTP id ba4mr33389852pbb.15.1424031924251; Sun, 15 Feb 2015 12:25:24 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id oj5si541681pab.241.2015.02.15.12.25.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Feb 2015 12:25:24 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YN5ij-0002wZ-Qw; Sun, 15 Feb 2015 20:23:13 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YN5iW-0002oB-23 for linux-arm-kernel@lists.infradead.org; Sun, 15 Feb 2015 20:23:01 +0000 Received: by mail-lb0-f181.google.com with SMTP id b6so23847541lbj.12 for ; Sun, 15 Feb 2015 12:22:37 -0800 (PST) X-Received: by 10.112.132.67 with SMTP id os3mr18637492lbb.90.1424031757666; Sun, 15 Feb 2015 12:22:37 -0800 (PST) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id f9sm2563600laa.20.2015.02.15.12.22.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Feb 2015 12:22:36 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [GIT PULL 2/2] arm/arm64: KVM: Add exit reaons to kvm_exit event tracing Date: Sun, 15 Feb 2015 21:22:43 +0100 Message-Id: <1424031763-9534-3-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1424031763-9534-1-git-send-email-christoffer.dall@linaro.org> References: <1424031763-9534-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150215_122300_330377_2409B4B6 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.181 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.217.181 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Marc Zyngier , Wei Huang , Christoffer Dall , kvm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Wei Huang This patch extends trace_kvm_exit() to include KVM exit reasons (i.e. EC of HSR). The tracing function then dumps both exit reason and PC of vCPU, shown as the following. Tracing tools can use this new exit_reason field to better understand the behavior of guest VMs. 886.301252: kvm_exit: HSR_EC: 0x0024, PC: 0xfffffe0000506b28 Signed-off-by: Wei Huang Signed-off-by: Christoffer Dall --- arch/arm/kvm/arm.c | 2 +- arch/arm/kvm/trace.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 0b0d58a..4a00131 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -533,7 +533,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) vcpu->mode = OUTSIDE_GUEST_MODE; kvm_guest_exit(); - trace_kvm_exit(*vcpu_pc(vcpu)); + trace_kvm_exit(kvm_vcpu_trap_get_class(vcpu), *vcpu_pc(vcpu)); /* * We may have taken a host interrupt in HYP mode (ie * while executing the guest). This interrupt is still diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h index b6a6e71..89fd80a6 100644 --- a/arch/arm/kvm/trace.h +++ b/arch/arm/kvm/trace.h @@ -25,18 +25,22 @@ TRACE_EVENT(kvm_entry, ); TRACE_EVENT(kvm_exit, - TP_PROTO(unsigned long vcpu_pc), - TP_ARGS(vcpu_pc), + TP_PROTO(unsigned int exit_reason, unsigned long vcpu_pc), + TP_ARGS(exit_reason, vcpu_pc), TP_STRUCT__entry( + __field( unsigned int, exit_reason ) __field( unsigned long, vcpu_pc ) ), TP_fast_assign( + __entry->exit_reason = exit_reason; __entry->vcpu_pc = vcpu_pc; ), - TP_printk("PC: 0x%08lx", __entry->vcpu_pc) + TP_printk("HSR_EC: 0x%04x, PC: 0x%08lx", + __entry->exit_reason, + __entry->vcpu_pc) ); TRACE_EVENT(kvm_guest_fault,