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: <CANLsYkwO64CRfcZ+z+=+ucbtOVeOcOoCy+d0GO5sEuTf+Qe0WQ@mail.gmail.com>
Date:	Thu, 1 Oct 2015 16:42:35 -0600
From:	Mathieu Poirier <mathieu.poirier@...aro.org>
To:	Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc:	Greg KH <gregkh@...uxfoundation.org>, a.p.zijlstra@...llo.nl,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...hat.com>, Jon Corbet <corbet@....net>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Chunyan Zhang <zhang.chunyan@...aro.org>,
	Mike Leach <mike.leach@....com>, Tor Jeremiassen <tor@...com>,
	Al Grant <al.grant@....com>,
	Paweł Moll <pawel.moll@....com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>, linux-doc@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default
 arch init

On 30 September 2015 at 05:33, Alexander Shishkin
<alexander.shishkin@...ux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@...aro.org> writes:
>
>> Calling function 'smp_call_function_single()' to unlock the
>> tracer and calling it right after to perform the default
>> initialisation doesn't make sense.
>>
>> Moving 'etm_os_unlock()' just before making the default
>> initialisation results in the same outcome while saving
>> one call to 'smp_call_function_single()'.
>>
>> Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
>> ---
>>  drivers/hwtracing/coresight/coresight-etm3x.c | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>> index c6880c1ade55..a4c158df0fef 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>> @@ -1867,6 +1867,11 @@ static void etm_init_arch_data(void *info)
>>        * certain registers might be ignored.
>>        */
>>       etm_clr_pwrdwn(drvdata);
>> +
>> +     /* Make sure all registers are accessible */
>> +     etm_os_unlock(drvdata);
>
> In case of co-processor register access, this will end up unlocking the
> local ETM instead of the one on target cpu, by the looks of it.

"etm_init_arch_data()" is also called from "smp_function_calls()" and
as such, will end up executing the correct CPU.

> That's
> why smp_function_call() was needed there. Or you might want a
> etm_read_on_cpu() variant if it's really worth it.
>
>> +     drvdata->os_unlock = true;
>> +
>>       /*
>>        * Set prog bit. It will be set from reset but this is included to
>>        * ensure it is set
>> @@ -1961,9 +1966,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
>>       get_online_cpus();
>>       etmdrvdata[drvdata->cpu] = drvdata;
>>
>> -     if (!smp_call_function_single(drvdata->cpu, etm_os_unlock, drvdata, 1))
>> -             drvdata->os_unlock = true;
>> -
>>       if (smp_call_function_single(drvdata->cpu,
>>                                    etm_init_arch_data,  drvdata, 1))
>>               dev_err(dev, "ETM arch init failed\n");
>> --
>> 1.9.1
>
> Regards,
> --
> Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ