From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EA63C433E0 for ; Wed, 29 Jul 2020 07:30:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 21A1E2070B for ; Wed, 29 Jul 2020 07:30:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fNptDvu2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="glV6G4yF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21A1E2070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2ivBNmJQ2rpKdGUxQTd3IDg9ptDJK39IhBUzA79yUFQ=; b=fNptDvu2hu7uFfXW1j4TCv34g S911KE4glL6VgSC2jEFXIay4mEJm1oxpi5rLldIOENBvRshvKd69q0IIrxNWScJqAOX2Hpq69pebV xH/WBplCiCfBQZbHm87/ILGzg1rkYHnTuFKeOwPyC4yPXYZUexx6WRrPUOyKZJWhBgKqBJe9JFo9L NqsvFoEYNhIs5OL6inVyoiT9r16gD3+GZKvg2QVWgnPq7WWOhQksrr3eEaz+TSxEUsDKMxgnMoyPD oipdFcAkG7A7srfGC5nBbiSyIE4gCRtFaShiaFWJ8ZfwImKGxxzIvGFssQNK9sIJ8BSdzW2bguRHq 9yyAouTSg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0gWJ-0000NR-8e; Wed, 29 Jul 2020 07:28:59 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0gWG-0000MQ-0I for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2020 07:28:57 +0000 Received: by mail-pl1-x643.google.com with SMTP id o1so11433589plk.1 for ; Wed, 29 Jul 2020 00:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EJr/zTDFzZfQRmZS6ci7CqEyuf2WF4U9auGGGduBo5I=; b=glV6G4yF/ctOKkutWvrjdnMnG74hlw+iQArwph1Do5y5F/pCCoo0Ifg5//DTx+3kys P+WAQYeFVytmcxP/5t8WiCVBl8hklDLIsEDbl/YQOwZsMGg6+GIxxEA52i9nWws5YvGm m5CWQTVRNUJLwtj0q+CBV5dLM6X8kjQR7Q1NHjXuT0uSJ35hT37xXWnEskgZ054j/ZFk +FjE6H8JC0htoFVSRJ5bmG/qg6//aqQB+kSncDfpPKVfK1TALRK1lMuogqpWpi6kiadn 0sjEmpZ2P35alY/uXNHexlgKVJdU4tXfNXPZZpyvOMNNJZM/x0CrFRGLkCZzOBH9Uehv hFow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EJr/zTDFzZfQRmZS6ci7CqEyuf2WF4U9auGGGduBo5I=; b=WNZ1h8ave+t0qT2UKff11Funh0Se9rpbShNBGFnPvW6srBE0cuwNPxmoN0wwgSvHho JTPUPexJ/iQtFrTKUn+pf6gpAzlNGPDXKp67gzyy6WEI8d411X0q/xs5JVS4KcJlbdf0 pvZNTs9lHK0bc+MNYdoYVHUt7fJo4jUT7uNmKeRg2fJWwzqNIkpYDqpgQcvMAySba043 B5hZZX3QtTPqXYJZlFBPMiNp9gM7xscO84lhbTDa1GmNLPreCXGf4sAUJNNMkTT4ptjF /knpJdF8sMFN3uzdhjikeyZkB13ETniryGMpBPFsuGkgOaeJtyV5lbRG8Yz+GEXa3AjF L8DQ== X-Gm-Message-State: AOAM533J9nm7QZmpoRpr7VqR8AKZyloo2+5BKJOQR0nRKPUrqBbBL4NV oL+36ls7yaVP2jmHjntCB9BCQw== X-Google-Smtp-Source: ABdhPJzQi3/n+N6dk4WNX9b8fO92IseRXtdS3tuBiUnMzRWekyfUXvYe3hhlDfh5IEzIinAQo+q/Cg== X-Received: by 2002:a17:90a:e986:: with SMTP id v6mr4700183pjy.88.1596007733700; Wed, 29 Jul 2020 00:28:53 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([2600:3c01::f03c:91ff:fe8a:bb03]) by smtp.gmail.com with ESMTPSA id 17sm1191144pjl.30.2020.07.29.00.28.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 00:28:53 -0700 (PDT) Date: Wed, 29 Jul 2020 15:28:44 +0800 From: Leo Yan To: "liwei (GF)" Subject: Re: [PATCH 2/4] perf: arm-spe: Add support for ARMv8.3-SPE Message-ID: <20200729072844.GH4343@leoy-ThinkPad-X240s> References: <20200724091607.41903-1-liwei391@huawei.com> <20200724091607.41903-3-liwei391@huawei.com> <20200729062951.GE4343@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200729_032856_350062_6517FC83 X-CRM114-Status: GOOD ( 25.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Will Deacon , Suzuki K Poulose , Alexander Shishkin , Catalin Marinas , Adrian Hunter , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, zhangshaokun@hisilicon.com, Peter Zijlstra , Ingo Molnar , James Clark , guohanjun@huawei.com, Namhyung Kim , Jiri Olsa , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 29, 2020 at 03:21:20PM +0800, liwei (GF) wrote: [...] > >> @@ -354,8 +372,38 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, > >> } > >> case ARM_SPE_OP_TYPE: > >> switch (idx) { > >> - case 0: return snprintf(buf, buf_len, "%s", payload & 0x1 ? > >> - "COND-SELECT" : "INSN-OTHER"); > >> + case 0: { > >> + if (payload & 0x8) { > > > > Some nitpicks for packet format checking ... > > > > For SVE operation, the payload partten is: 0b0xxx1xx0. > > > > So it's good to check the partten like: > > > > /* SVE operation subclass is: 0b0xxx1xx0 */ > > if ((payload & 0x8081) == 0x80) { > > .... > > } > > > > If later the packet format is extended, this will not introduce any > > confliction. > > Get it, but i think what you are really meaning is: > if ((payload & 0x89) == 0x80) { > ... > } Yes. > > > >> + size_t blen = buf_len; > >> + > >> + ret = snprintf(buf, buf_len, "SVE-OTHER"); > >> + buf += ret; > >> + blen -= ret; > >> + if (payload & 0x2) { > > > > Here should express as binary results: " FP" or " INT". > > I think this is a style choice, i add these just like the current code where > processing "AT", "EXCL", "AR", "COND" and so on. So should we modify all the corresponding code together? Okay, understood. Let's just follow the existed style and later can enhance the output log with more readable format. [...] > > > >> + ret = snprintf(buf, buf_len, " FP"); > >> + buf += ret; > >> + blen -= ret; > >> + } > >> + if (payload & 0x4) { > >> + ret = snprintf(buf, buf_len, " PRED"); > > > > Here should express as binary results: " PRED" or " NOT-PRED". > > Ditto. > > > > >> + buf += ret; > >> + blen -= ret; > >> + } > >> + if (payload & 0x70) { > > > > This is incorrect. If bits[6:4] is zero, it presents vector length is 32 bits. > > > > I am a little confused here. > Refer to the ARM DDI 0487F.b (ID040120), page D10-2830, if bits[6:4] is zero, > it presents vector length is 32 bits indeed. Yes, if bits[6:4] is zero, your current code will not output any info. Thanks, Leo > >> + ret = snprintf(buf, buf_len, " EVL %d", > >> + 32 << ((payload & 0x70) >> 4)); > >> + buf += ret; > >> + blen -= ret; > >> + } > >> + if (ret < 0) > >> + return ret; > >> + blen -= ret; > >> + return buf_len - blen; > >> + } else { > > > > Here we can check with more accurate format as defined in ARMv8 ARM: > > > > /* Other operation subclass is: 0b0000000x */ > > if ((payload & 0xfe) == 0x0) { > > .... > > } > > > >> + return snprintf(buf, buf_len, "%s", payload & 0x1 ? > >> + "COND-SELECT" : "INSN-OTHER"); > >> + } > >> + } > >> case 1: { > >> size_t blen = buf_len; > >> > >> @@ -385,6 +433,23 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, > >> ret = snprintf(buf, buf_len, " SIMD-FP"); > >> buf += ret; > >> blen -= ret; > >> + } else if (payload & 0x8) { > >> + if (payload & 0x4) { > >> + ret = snprintf(buf, buf_len, " PRED"); > > > > Here should express as binary results: " PRED" or " NOT-PRED". > > Ditto. > > >> + buf += ret; > >> + blen -= ret; > >> + } > >> + if (payload & 0x70) { > > > > This is incorrect. If bits[6:4] is zero, it presents vector length is 32 bits. > > Refer to the ARM DDI 0487F.b (ID040120), page D10-2832, if bits[6:4] is zero, > it presents vector length is 32 bits indeed. > > >> + ret = snprintf(buf, buf_len, " EVL %d", > >> + 32 << ((payload & 0x70) >> 4)); > >> + buf += ret; > >> + blen -= ret; > >> + } > >> + if (payload & 0x80) { > >> + ret = snprintf(buf, buf_len, " SG"); > > > > Here should express as binary results: " SG" or " NOT-SG". > > > Thanks, > Wei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel