[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211104152426.GD743063@leoy-ThinkPad-X240s>
Date: Thu, 4 Nov 2021 23:24:26 +0800
From: Leo Yan <leo.yan@...aro.org>
To: Suzuki K Poulose <suzuki.poulose@....com>
Cc: Mathieu Poirier <mathieu.poirier@...aro.org>,
Mike Leach <mike.leach@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
James Clark <james.clark@....com>, coresight@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/4] coresight: etm4x: Don't use virtual contextID for
non-root PID namespace
On Thu, Nov 04, 2021 at 03:07:45PM +0000, Suzuki Kuruppassery Poulose wrote:
[...]
> > @@ -2111,6 +2111,13 @@ static ssize_t vmid_val_show(struct device *dev,
> > struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
> > struct etmv4_config *config = &drvdata->config;
> > + /*
> > + * Don't use virtual contextID tracing if coming from a PID namespace.
> > + * See comment in ctxid_pid_store().
> > + */
> > + if (task_active_pid_ns(current) != &init_pid_ns)
> > + return -EINVAL;
> > +
> > spin_lock(&drvdata->spinlock);
> > val = (unsigned long)config->vmid_val[config->vmid_idx];
> > spin_unlock(&drvdata->spinlock);
> > @@ -2125,6 +2132,13 @@ static ssize_t vmid_val_store(struct device *dev,
> > struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
> > struct etmv4_config *config = &drvdata->config;
> > + /*
> > + * Don't use virtual contextID tracing if coming from a PID namespace.
> > + * See comment in ctxid_pid_store().
> > + */
> > + if (task_active_pid_ns(current) != &init_pid_ns)
>
> Please could we add a helper function to make this obvious ?
>
> e.g: task_is_in_root_ns(task) ?
Yeah, I will use a separate patch set to add this helper function and
polish relevant codes in the kernel. Thanks for suggestion.
Leo
Powered by blists - more mailing lists