Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp788614ybi; Fri, 26 Jul 2019 20:02:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjwMEM9jUp+UcnG6AGhtzitj/ostfCGPXNq0Au4l0W3ORb+f4JwEYuLc9OZOfWIoo40zoH X-Received: by 2002:a63:4a51:: with SMTP id j17mr94080718pgl.284.1564196520502; Fri, 26 Jul 2019 20:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564196520; cv=none; d=google.com; s=arc-20160816; b=lyYroFDUZFoblKNLb8vNmtJVe/51IQdizwniYsP+Hylk/hdHJAljRzKO8tgbcmdYzg nFPbeNgYW+SDJ0403e2sjKM2YPD8BbEtj70W5NBEujVcNME3Vo4iuaRxgEIVJD7PIKPF gdlUwB/KDtqSx4XcNdSf5rqB6xKI+Qsm3nrnC0SYuAsOQ9Bsh6SgUfKEbM7BA5tfieVT CD95JiXHLahqa0DpkZ93rdGAWyw9Pt/wuFCPzRu3p8tpDeZXcqMr0KF7m0f0s2EMDV+k /K0EAFhcKgdMfSc8R7FY6nxLB+jdU4Ex09yJznvVu0PvxjldIcm6zJgqsjqyZgt0n9my +plw== 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=c7hgB7d26rKFGTMaH74rL3ZEQ6Yr5vowCKgYf4cXi9Y=; b=wdwEdHS89FAUQz0hfk58dNm2cxRKbR1TnWsR5Cn+PPhSZIcKdNBwQNxuxKLuWXZ6aG Qf0kfMOjpkXCnPh6eFfNI85RPFfZahV6x8R+1ddk+avJdt4XmEPjTzgtTQ9+Hal4Z0Fh eGQwf3qzEQxA/qmHW0485KXw8pbwi8ILQFRRRJdZ9YReaurDVKZPpedMBzQCm04/SMK5 aOTaan+6nxoi0ZQSp5oo3RFwHDRrW1I766vcEZCe4xykbVRAo2OvEL91r3x5eztk2Sv4 f1SNBAf8rpeLb5mvlw7HGK9r46TNaDGwYu/ZveWsnYE27BMdYa2xdZ8LuKdwAn0JWRLi 2v6g== 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 y84si27584591pfc.33.2019.07.26.20.01.45; Fri, 26 Jul 2019 20:02:00 -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 S1727758AbfG0C4N (ORCPT + 99 others); Fri, 26 Jul 2019 22:56:13 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2782 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726415AbfG0C4N (ORCPT ); Fri, 26 Jul 2019 22:56:13 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 64AC312BCB15B6E8DB67; Sat, 27 Jul 2019 10:56:10 +0800 (CST) Received: from [127.0.0.1] (10.184.12.158) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Sat, 27 Jul 2019 10:55:59 +0800 Subject: Re: [PATCH] KVM: arm64: Update kvm_arm_exception_class and esr_class_str for new EC To: James Morse , CC: , , , , , , , , , , References: <1562992854-972-1-git-send-email-yuzenghui@huawei.com> From: Zenghui Yu Message-ID: <3e3029b5-74b2-693f-b4ab-5876baee3414@huawei.com> Date: Sat, 27 Jul 2019 10:54:59 +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: 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, I noticed Marc had applied this patch in his kvmarm tree, with the updated commit message. Thanks Marc :) On 2019/7/25 20:48, James Morse wrote: > Hi, > > On 13/07/2019 05:40, Zenghui Yu wrote: >> We've added two ESR exception classes for new ARM hardware extensions: >> ESR_ELx_EC_PAC and ESR_ELx_EC_SVE. >> >> This patch updates "kvm_arm_exception_class" for these two EC, which the > >> new EC will be parsed in kvm_exit trace events (for guest's usage of > > new EC will be visible to user-space via kvm_exit() trace events... ? > > >> Pointer Authentication and Scalable Vector Extension). The same updates >> to "esr_class_str" for ESR_ELx_EC_PAC, by which we can get more accurate >> debug info. > > Its accurate either way round. This stops the trace-point print from printing the EC in > hex, instead giving it a name, like we do for all the others. So this should be "readable". >> Trivial changes, update them in one go. > > (I don't think this bit needs to go in the git-log!) > > >> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h >> index a8b205e..ddf9d76 100644 >> --- a/arch/arm64/include/asm/kvm_arm.h >> +++ b/arch/arm64/include/asm/kvm_arm.h >> @@ -316,9 +316,10 @@ >> >> #define kvm_arm_exception_class \ >> ECN(UNKNOWN), ECN(WFx), ECN(CP15_32), ECN(CP15_64), ECN(CP14_MR), \ >> - ECN(CP14_LS), ECN(FP_ASIMD), ECN(CP10_ID), ECN(CP14_64), ECN(SVC64), \ >> - ECN(HVC64), ECN(SMC64), ECN(SYS64), ECN(IMP_DEF), ECN(IABT_LOW), \ >> - ECN(IABT_CUR), ECN(PC_ALIGN), ECN(DABT_LOW), ECN(DABT_CUR), \ >> + ECN(CP14_LS), ECN(FP_ASIMD), ECN(CP10_ID), ECN(PAC), ECN(CP14_64), \ >> + ECN(SVC64), ECN(HVC64), ECN(SMC64), ECN(SYS64), ECN(SVE), \ >> + ECN(IMP_DEF), ECN(IABT_LOW), ECN(IABT_CUR), \ >> + ECN(PC_ALIGN), ECN(DABT_LOW), ECN(DABT_CUR), \ >> ECN(SP_ALIGN), ECN(FP_EXC32), ECN(FP_EXC64), ECN(SERROR), \ >> ECN(BREAKPT_LOW), ECN(BREAKPT_CUR), ECN(SOFTSTP_LOW), \ >> ECN(SOFTSTP_CUR), ECN(WATCHPT_LOW), ECN(WATCHPT_CUR), \ > > Do we need to add: > ESR_ELx_EC_ILL > ESR_ELx_EC_HVC32 > ESR_ELx_EC_SMC32 I think they're needed. But these three EC are not included into kvm_arm_exception_class at the time it was introduced, I don't know the reason. > (I don't see how any of the _CUR entries could ever happen as these EC originally come > from ESR_EL2, but they're harmless) (I agree with you.) >> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c >> index 8c03456..969e156 100644 >> --- a/arch/arm64/kernel/traps.c >> +++ b/arch/arm64/kernel/traps.c >> @@ -734,6 +734,7 @@ asmlinkage void __exception do_sysinstr(unsigned int esr, struct pt_regs *regs) >> [ESR_ELx_EC_CP14_LS] = "CP14 LDC/STC", >> [ESR_ELx_EC_FP_ASIMD] = "ASIMD", >> [ESR_ELx_EC_CP10_ID] = "CP10 MRC/VMRS", >> + [ESR_ELx_EC_PAC] = "PAC", >> [ESR_ELx_EC_CP14_64] = "CP14 MCRR/MRRC", >> [ESR_ELx_EC_ILL] = "PSTATE.IL", >> [ESR_ELx_EC_SVC32] = "SVC (AArch32)", > > > Reviewed-by: James Morse Thanks for your reviewing! Zenghui