lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230821120440.GB19617@willie-the-truck>
Date:   Mon, 21 Aug 2023 13:04:40 +0100
From:   Will Deacon <will@...nel.org>
To:     Jijie Shao <shaojijie@...wei.com>
Cc:     jonathan.cameron@...wei.com, mark.rutland@....com,
        chenhao418@...wei.com, shenjian15@...wei.com,
        wangjie125@...wei.com, liuyonglong@...wei.com,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        huangguangbin2@...wei.com, zhangshaokun@...ilicon.com
Subject: Re: [PATCH drivers/perf: hisi: 2/2] drivers/perf: hisi: fix set
 wrong filter mode for running events issue

[+Guangbin Huang and Shaokun Zhang]

On Wed, Aug 16, 2023 at 05:46:19PM +0800, Jijie Shao wrote:
> From: Hao Chen <chenhao418@...wei.com>
> 
> hns3_pmu_select_filter_mode() includes a series of mode judgments such
> as global mode ,function mode, function-queue mode, port mode, port-tc
> mode.
> 
> For a special scenario, command use parameter "bdf=0x3700,config=0x3,
> queue=0x0", it is expected to enter function-queue mode, but event of
> config 0x3 doesn't support func-queue mode, then it enter port-tc mode.
> it's not up to expectations.
> 
> It shouldn't enter any modes but return -ENOENT.
> 
> So, add judgement of bdf parameter to fix it.
> 
> Fixes: 66637ab137b4 ("drivers/perf: hisi: add driver for HNS3 PMU")
> Signed-off-by: Hao Chen <chenhao418@...wei.com>
> Signed-off-by: Jijie Shao <shaojijie@...wei.com>
> ---
>  drivers/perf/hisilicon/hns3_pmu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/hisilicon/hns3_pmu.c b/drivers/perf/hisilicon/hns3_pmu.c
> index 6a4d04cbae91..7f38a9e489d4 100644
> --- a/drivers/perf/hisilicon/hns3_pmu.c
> +++ b/drivers/perf/hisilicon/hns3_pmu.c
> @@ -1000,12 +1000,13 @@ static bool
>  hns3_pmu_is_enabled_port_tc_mode(struct perf_event *event,
>  				 struct hns3_pmu_event_attr *pmu_event)
>  {
> +	u16 bdf = hns3_pmu_get_bdf(event);
>  	u8 tc_id = hns3_pmu_get_tc(event);
>  
>  	if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_PORT_TC))
>  		return false;
>  
> -	return tc_id != HNS3_PMU_FILTER_ALL_TC;
> +	return (tc_id != HNS3_PMU_FILTER_ALL_TC) && (!bdf);
>  }

Sorry, but I'm struggling to see how this correlates with your example
in the commit message, which implies that it's the config of 0x3 causing
the problem rather than the bdf.

Please can you explain the problem in more detail?

Thanks,

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ