Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1679471

Re: [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow
Date 2017-07-02 16:00 +0200
Message-ID <tYNzP-2La-1@gated-at.bofh.it> (permalink)
References <tWHoR-5Yd-3@gated-at.bofh.it> <tWHoS-5Yd-47@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 26 Jun 2017, Vikas Shivappa wrote:
> +static void mbm_update(struct rdt_domain *d, int rmid)
> +{
> +	struct rmid_read rr;
> +
> +	rr.first = false;
> +	rr.d = d;
> +
> +	if (is_mbm_total_enabled()) {
> +		rr.evtid = QOS_L3_MBM_TOTAL_EVENT_ID;
> +		__mon_event_count(rmid, &rr);

This is broken as it is not protected against a concurrent read from user
space which comes in via a smp function call.

This means both the internal state and __rmid_read() are unprotected.

I'm not sure whether it's enough to disable interrupts around
__mon_event_count(), but that's the minimal protection required. It's
definitely good enough for __rmid_read(), but it might not be sufficient
for protecting domain->mbm_[local|total]. I leave the exercise of figuring
that out to you.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V1 00/21] x86/cqm3: Resctrl based cqm Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
  [PATCH 16/21] x86/intel_rdt/cqm: Add mount,umount support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 16/21] x86/intel_rdt/cqm: Add mount,umount support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 15:30 +0200
  [PATCH 20/21] x86/intel_rdt/mbm: Add mbm counter initialization Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
  [PATCH 13/21] x86/intel_rdt/cqm: Add cpus file support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 13/21] x86/intel_rdt/cqm: Add cpus file support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 13:20 +0200
    Re: [PATCH 13/21] x86/intel_rdt/cqm: Add cpus file support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 14:40 +0200
  [PATCH 15/21] x86/intel_rdt/cqm: Add rmdir support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 15/21] x86/intel_rdt/cqm: Add rmdir support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 15:20 +0200
  [PATCH 03/21] x86/intel_rdt/cqm: Documentation for resctrl based RDT Monitoring Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
  [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 21/21] x86/intel_rdt/mbm: Handle counter overflow Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 16:00 +0200
  [PATCH 14/21] x86/intel_rdt/cqm: Add mon_data Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 14/21] x86/intel_rdt/cqm: Add mon_data Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 14:50 +0200
  [PATCH 17/21] x86/intel_rdt/cqm: Add sched_in support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 17/21] x86/intel_rdt/cqm: Add sched_in support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 15:40 +0200
  [PATCH 12/21] x86/intel_rdt/cqm: Add tasks file support Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 12/21] x86/intel_rdt/cqm: Add tasks file support Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 13:10 +0200
  [PATCH 08/21] x86/intel_rdt/cqm: Add RMID(Resource monitoring ID) management Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2017-06-26 21:00 +0200
    Re: [PATCH 08/21] x86/intel_rdt/cqm: Add RMID(Resource monitoring  ID) management Thomas Gleixner <tglx@linutronix.de> - 2017-07-02 12:10 +0200
      Re: [PATCH 08/21] x86/intel_rdt/cqm: Add RMID(Resource monitoring  ID) management Thomas Gleixner <tglx@linutronix.de> - 2017-07-03 12:00 +0200

csiph-web