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] [day] [month] [year] [list]
Message-ID: <e8798fa4-a0dc-7c85-e294-bdf6dad6ec74@gmail.com>
Date:   Fri, 26 Apr 2019 22:51:06 +0300
From:   Oleksandr <olekstysh@...il.com>
To:     Julien Grall <julien.grall@....com>,
        linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     horms@...ge.net.au, magnus.damm@...il.com, linux@...linux.org.uk,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>
Subject: Re: [PATCH] ARM: mach-shmobile: Don't configure ARCH timer if PSCI is
 enabled


On 24.04.19 15:31, Julien Grall wrote:
> Hi,

Hi Julien


>
>>
>> As I answered in a previous email:
>>
>>  > But "#if !defined(CONFIG_ARM_PSCI)" wraps secure_cntvoff_init() 
>> call as
>>  > well, which resets CNTVOFF,
>>
>>  > and this is something I tried to avoid the first from being 
>> executed on
>>  > a CPU, which is in SVC mode (when running on top of Xen).
>>
>> What would be a proper way to avoid calling secure_cntvoff_init() at 
>> runtime?
>>
>> Check that we are already in non-secure mode and/or cntvoff is 
>> already 0?
>
> CNTVOFF is controlled by the hypervisor, so you cannot access it from 
> Dom0.
>
> If none of this code should be necessary when PSCI is enabled, then 
> you can check the presence of PSCI (see psci_smp_available()).


If I am not mistaken, U-Boot resets CNTVOFF before leaving monitor mode 
(switching to non-secure state). This happens if "support for booting in 
non-secure mode" is enabled.

This is a mandatory option for PSCI support as well as for support for 
hardware virtualization.

So the presence of PSCI would be an indicator, if CNTVOFF was configured 
in U-Boot and we don't need to.

 From other hand, Gen2 Linux may be booted in non-secure mode, without 
PSCI support...


I was thinking about checking the presence of "enable-method = psci" in 
CPU node, but probably psci_smp_available() is better option.

Also, there is a specific device-tree property 
"arm,cpu-registers-not-fw-configured" [1], but I am not sure whether it 
is appropriate to use here.


>
> Another solution is to check whether we are running on xen (see 
> xen_domain()).
>
> In any case, I would still surround the two checks because the 
> "armgcnt" should really not be touched by Dom0.

Agree.

I will add two checks in V2.


Thank you!


[1]

https://elixir.bootlin.com/linux/v5.1-rc6/source/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml#L68


>
> Cheers,
>
-- 
Regards,

Oleksandr Tyshchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ