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]
Date: Mon, 29 Jan 2024 11:50:40 +0530
From: "Maulik Shah (mkshah)" <quic_mkshah@...cinc.com>
To: Bjorn Andersson <andersson@...nel.org>
CC: Konrad Dybcio <konrad.dybcio@...aro.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <quic_eberman@...cinc.com>,
        <quic_collinsd@...cinc.com>, <quic_lsrao@...cinc.com>
Subject: Re: [PATCH v2] soc: qcom: rpmh-rsc: Enhance check for VREG in-flight
 request

Hi,

On 1/28/2024 9:13 AM, Bjorn Andersson wrote:
> On Fri, Jan 19, 2024 at 01:56:54PM +0530, Maulik Shah wrote:

>>
>> Signed-off-by: Maulik Shah <quic_mkshah@...cinc.com>
>> Signed-off-by: Elliot Berman <quic_eberman@...cinc.com>
> 
> The s-o-b chain doesn't look right.

I will fix in v3.

> 
>> ---
>>   
>> +#define ACCL_TYPE(addr)			FIELD_GET(GENMASK(19, 16), addr)
> 
> Command DB is there so we don't have to make assumptions about the
> addresses of resources. As such, I dislike this define.

sure i will consider querying command db for resource type.

> 
>> +#define VREG_ADDR(addr)			FIELD_GET(GENMASK(19, 4), addr)
>> +
>> +enum {
>> +	HW_ACCL_CLK = 0x3,
>> +	HW_ACCL_VREG,
>> +	HW_ACCL_BUS,
> 
> We already define these in the kernel, but with different names:
> CMD_DB_HW_ARC, CMD_DB_HW_VRM, CMD_DB_HW_BCM. I see no reason to use
> different names for the same thing.
> 
>> +};

Right, I missed it, With querying cmd-db would not need this enum.

>> +
>>   /*
>>    * Here's a high level overview of how all the registers in RPMH work
>>    * together:
>> @@ -557,7 +568,15 @@ static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs,
>>   		for_each_set_bit(j, &curr_enabled, MAX_CMDS_PER_TCS) {
>>   			addr = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], i, j);
>>   			for (k = 0; k < msg->num_cmds; k++) {
>> -				if (addr == msg->cmds[k].addr)
>> +				/*
>> +				 * Each RPMh VREG accelerator resource has 3 or 4 contiguous 4-byte
>> +				 * aligned addresses associated with it. Ignore the offset to check
>> +				 * for in-flight VREG requests.
>> +				 */
>> +				if (ACCL_TYPE(msg->cmds[k].addr) == HW_ACCL_VREG &&
>> +				    VREG_ADDR(msg->cmds[k].addr) == VREG_ADDR(addr))
> 
> I'm sure this work, at least for some targets, but I don't fancy
> encoding this information here. It feels like a hack.
> 
> Furthermore, I really would like TP_printk() of trace_rpmh_send_msg() to
> be able to resolve the symbolic names for VRMs as well, and it would
> need the same information...

I can update in separate patch for trace_() to resolve symbolic names.

> 
> Please consider how we can query command db for the type and/or grouping
> information.

Sure, i will update in v3 to query command db for the type.

Thanks,
Maulik

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ