lkml.org 
[lkml]   [2021]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-11-04 16:25    [W:0.707 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site