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]
Date:   Wed, 16 Nov 2022 15:01:39 +0100
From:   Marijn Suijten <marijn.suijten@...ainline.org>
To:     Nícolas F. R. A. Prado 
        <nfraprado@...labora.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>, kernel@...labora.com,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>
Subject: Re: [PATCH] docs: dt: writing-schema: Document usage of CHECK_DTBS
 make flag

+CC Konrad and Dmitry whom I discussed this with before.

On 2022-11-16 14:55:04, Marijn Suijten wrote:
> Hi Nícolas,
> 
> On 2022-11-02 17:43:00, Nícolas F. R. A. Prado wrote:
> > It is possible to run checks on a Devicetree by passing the CHECK_DTBS
> > flag when building. This is a useful shortcut to the dtbs_check make
> > target since it avoids checking unrelated Devicetrees, which can take
> > some time and is unnecessary if no bindings were modified. Document it.
> > 
> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
> > 
> > ---
> > 
> >  Documentation/devicetree/bindings/writing-schema.rst | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst
> > index 4a381d20f2b4..55ad556472b4 100644
> > --- a/Documentation/devicetree/bindings/writing-schema.rst
> > +++ b/Documentation/devicetree/bindings/writing-schema.rst
> > @@ -167,6 +167,13 @@ setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern.
> >      make dt_binding_check DT_SCHEMA_FILES=/gpio/
> >      make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml
> >  
> > +Note that ``make dtbs_check`` will validate every DT source file that is
> > +enabled. When making changes to a DT but not to the bindings, a possible
> > +shortcut to validate only the DT in question is to explicitly build it with
> > +the ``CHECK_DTBS`` flag enabled. For example::
> > +
> > +    make CHECK_DTBS=y mediatek/mt8192-evb.dtb
> 
> I have a bit of trouble getting this to work on a _clean_ out directory
> (perhaps this should have been reported at the original patch, I had
> always been using Dmitry's version [1] which didn't suffer from this
> problem).
> 
> Consider running with the following:
> 
>     rm out -r
>     make ARCH=arm64 O=out defconfig
>     make ARCH=arm64 O=out CHECK_DTBS=y qcom/sm8450-sony-xperia-nagara-pdx223.dtb
> 
> After compiling preliminaries, it exits with:
> 
>     make[3]: *** No rule to make target 'arch/arm64/boot/dts/qcom/sm8450-sony-xperia-nagara-pdx223.dtb'.  Stop.
>     make[2]: *** [../scripts/Makefile.build:500: arch/arm64/boot/dts/qcom] Error 2
>     make[1]: *** [/kernel/Makefile:1460: qcom/sm8450-sony-xperia-nagara-pdx223.dtb] Error 2
>     make[1]: Leaving directory '/kernel/out'
>     make: *** [Makefile:231: __sub-make] Error 2
> 
> However, if I lint all DTBs first by running `dtbs_check`, it seems the
> schema preliminaries are built:
> 
>       LINT    Documentation/devicetree/bindings
>       CHKDT   Documentation/devicetree/bindings/processed-schema.json
>     ... bunch of warnings
>       SCHEMA  Documentation/devicetree/bindings/processed-schema.json
> 
> And here I ctrl+c the build so that it doesn't run DTC_CHK over every
> dts.  If I now re-run the original command on my .dtb of choice, it
> completes successfully with the warnings that I expect.  Is the logic
> behind `CHECK_DTBS=y` simply missing a step to make sure SCHEMA is built
> and up-to-date?
> 
> Aside from not working in a clean output directly, could this imply
> schema changes (edits in Documentation/devicetree/bindings) _are not_
> propagated when running with `CHECK_DTBS=y?
> 
> At the same time running this command twice results in no output the
> second time around, supposedly because the dtb has "already been built".
> Is that also something we can improve?
> 
> [1]: https://lore.kernel.org/linux-arm-msm/20220623144357.297252-1-dmitry.baryshkov@linaro.org/
> 
> Thanks!
> - Marijn
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ