Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp641859ybe; Wed, 11 Sep 2019 02:23:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWfdKqUE7Ha/sJrxbiyjRT31hDOOUhE5Sw91zUny70ISPuM2eBqrs7n38h6KFFJwiEZolf X-Received: by 2002:a50:c209:: with SMTP id n9mr35612303edf.215.1568193833647; Wed, 11 Sep 2019 02:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568193833; cv=none; d=google.com; s=arc-20160816; b=pkedw7cQ19L8EgRoueRTqMV0mrxXxy1oNY0zlwFrDm0EODm4jS6QvNHLDHYp5aXvfp PxonEITwJa47VIXDIaPYfRaR9wekA2TOtlxc/m3lXRFxN2ddO7Kva3jfuw+CqZLEiS6P XRZPKKTOg1s/rcCqIu8oeghIrWc9komPAM6z9OAMLlk2EboTCc+u3j2xtRd+awp3zbCh Sj4DBMBVd3ls8qf4vgGxBm/9XfVeV610IYEeqLMgJCPA7axQCLC9JGyhd1/srNg3f7z1 5B6w1BSuqzkphdioc7tXbmTduu9554jOu059xCAPPqA93L6Rh5++e859atp83t0YetP3 6VkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=hMYUHTCi7fn5Sw0yO16prNTLGt7GEhxSSuDcI2T4c8g=; b=nLOGoqCOV6yQxu6mfJIXNDXo8oSL3EAfEAcySr/R5v1F8BJOwuJWpA8dIIvi8k6xvF yZkO3eh5QtQJzXfGMzYQ5qppMGMAe7oRZQ29wu1kpdYmXAmiz2IrmOwrS9WDMyvcRC17 jFZgUo+l+tzmN5rqWJDIH2jcz/uZ9ZVWhLteOehg4aGl9lvmYjwcfqAuz+GglVf/UpHW ZYe///3lM97Pp/6NKd+iskuEdGDno+nFc5fzAdiPHSlxo0rxmZuAhHMHJz2SSH0GOqvF 8B4LDeVCgG0kaLTHCjLDdg+Dn7eT4Zi86FN9Wb58FeBWYCNaT0li0CWEvu2lHjIvQVle uuPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si10903427ejq.92.2019.09.11.02.23.29; Wed, 11 Sep 2019 02:23:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbfIKJVY (ORCPT + 99 others); Wed, 11 Sep 2019 05:21:24 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2212 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726579AbfIKJVY (ORCPT ); Wed, 11 Sep 2019 05:21:24 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E6267DBB613FD0A61D59; Wed, 11 Sep 2019 17:21:21 +0800 (CST) Received: from [127.0.0.1] (10.184.12.158) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Wed, 11 Sep 2019 17:21:13 +0800 Subject: Re: [PATCH 2/2] KVM: arm/arm64: Print the EC hex value with its exact width To: Marc Zyngier CC: , , , , , , References: <1568169216-12632-1-git-send-email-yuzenghui@huawei.com> <1568169216-12632-3-git-send-email-yuzenghui@huawei.com> <86h85js083.wl-maz@kernel.org> From: Zenghui Yu Message-ID: Date: Wed, 11 Sep 2019 17:19:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Thunderbird/64.0 MIME-Version: 1.0 In-Reply-To: <86h85js083.wl-maz@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.184.12.158] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 2019/9/11 16:31, Marc Zyngier wrote: > On Wed, 11 Sep 2019 03:33:36 +0100, > Zenghui Yu wrote: >> >> EC is the bits [31:26] of ESR_ELx on arm64 (HSR on arm). Print the >> hex value with its exact width (8). >> >> Signed-off-by: Zenghui Yu >> --- >> virt/kvm/arm/trace.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/virt/kvm/arm/trace.h b/virt/kvm/arm/trace.h >> index 204d210d01c2..022b0a060034 100644 >> --- a/virt/kvm/arm/trace.h >> +++ b/virt/kvm/arm/trace.h >> @@ -42,7 +42,7 @@ TRACE_EVENT(kvm_exit, >> __entry->vcpu_pc = vcpu_pc; >> ), >> >> - TP_printk("%s: HSR_EC: 0x%04x (%s), PC: 0x%08lx", >> + TP_printk("%s: HSR_EC: 0x%02x (%s), PC: 0x%08lx", >> __print_symbolic(__entry->ret, kvm_arm_exception_type), >> __entry->esr_ec, >> __print_symbolic(__entry->esr_ec, kvm_arm_exception_class), > > Although you're right that 8 bits ought to be enough, this is a change > to the output of the tracepoint, which userspace could (does?) parse. Well-written userspace tools should only parse the low 8 bits (if they do parse). But even if the high bits are parsed, they're always 0. So I don't think this change will have a bad impact on userspace. > I'm thus reluctant to change anything there, knowing that we don't > lose any information, and just print two extra zeroes. Anyway this is not a fix, feel free to ignore it if you're worried about that there might be some issues ;) > Am I missing anything? No. Thanks, zenghui