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: <56939CC0.1@arm.com>
Date:	Mon, 11 Jan 2016 12:14:56 +0000
From:	"Suzuki K. Poulose" <Suzuki.Poulose@....com>
To:	Mark Rutland <mark.rutland@....com>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	arm@...nel.org, punit.agrawal@....com, peterz@...radead.org
Subject: Re: [PATCH v5 08/11] arm-cci: Provide hook for writing to PMU
 counters

On 11/01/16 10:54, Mark Rutland wrote:
> On Mon, Jan 04, 2016 at 11:54:47AM +0000, Suzuki K. Poulose wrote:

>>   static struct cci_pmu_model cci_pmu_models[];
>> @@ -846,7 +847,15 @@ static void pmu_write_counter(struct perf_event *event, u32 value)
>>   		dev_err(&cci_pmu->plat_device->dev, "Invalid CCI PMU counter %d\n", idx);
>>   		return;
>>   	}
>> -	__pmu_write_counter(cci_pmu, value, idx);
>> +
>> +	if (cci_pmu->model->write_counters) {
>> +		unsigned long mask[BITS_TO_LONGS(cci_pmu->num_cntrs)];
>> +
>> +		memset(mask, 0, BITS_TO_LONGS(cci_pmu->num_cntrs) * sizeof(unsigned long));
>> +		set_bit(idx, mask);
>> +		cci_pmu->model->write_counters(cci_pmu, mask, value);
>> +	} else
>> +		__pmu_write_counter(cci_pmu, value, idx);
>>   }
>
> It would be much simpler to always log writes here, and only do the real
> wirtes in batches when we re-enable the PMU (with appropriate
> disable/enable calls in the IRQ handler).
>
> We'd still need special hooks for CCIs which require a special dance to
> program them, but all the logic to handle the writes would be in one
> place.

This one is only there for the writes from the irq handler. Now that
we have decided to disable pmu there, we could batch this one too.

Cheers
Suzuki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ