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: <alpine.DEB.2.10.1603211116410.25124@vshiva-Udesk>
Date:	Mon, 21 Mar 2016 11:27:55 -0700 (PDT)
From:	Vikas Shivappa <vikas.shivappa@...ux.intel.com>
To:	Matt Fleming <matt@...eblueprint.co.uk>
cc:	vikas.shivappa@...ux.intel.com, dsahern@...il.com,
	namhyung@...nel.org, mingo@...nel.org, peterz@...radead.org,
	brgerst@...il.com, bp@...en8.de, dvlasenk@...hat.com,
	vincent.weaver@...ne.edu, torvalds@...ux-foundation.org,
	eranian@...gle.com, tony.luck@...el.com, tglx@...utronix.de,
	alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
	luto@...capital.net, hpa@...or.com, jolsa@...hat.com,
	acme@...hat.com, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/urgent] perf/x86/mbm: Implement RMID recycling



On Mon, 21 Mar 2016, Matt Fleming wrote:

> On Mon, 21 Mar, at 02:53:04AM, tip-bot for Vikas Shivappa wrote:
>> @@ -489,6 +496,22 @@ static u32 intel_cqm_xchg_rmid(struct perf_event *group, u32 rmid)
>>
>>  	raw_spin_unlock_irq(&cache_lock);
>>
>> +	/*
>> +	 * If the allocation is for mbm, init the mbm stats.
>> +	 * Need to check if each event in the group is mbm event
>> +	 * because there could be multiple type of events in the same group.
>> +	 */
>> +	if (__rmid_valid(rmid)) {
>> +		event = group;
>> +		if (is_mbm_event(event->attr.config))
>> +			init_mbm_sample(rmid, event->attr.config);
>> +
>> +		list_for_each_entry(event, head, hw.cqm_group_entry) {
>> +			if (is_mbm_event(event->attr.config))
>> +				init_mbm_sample(rmid, event->attr.config);
>> +		}
>> +	}
>> +
>>  	return old_rmid;
>>  }
>>
>
> You're calling init_mbm_sample() without holding cache_lock. Won't
> this potentially trash the existing value in MSR_IA32_QM_EVTSEL, if
> say, we're reading the counter at the same time as the recycling
> worker is running?

The init_mbm_sample calls the update_sample to read the MSR in IPI .. Since the 
count is also in IPI , they should not trash each other ?

Basically all the MSR read/writes are in high irql , except for the mbm overflow 
timer and read calls which holds an irqsave spinlock.

Thanks,
Vikas


>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ