[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [FuSa SIG] Static code analysis. some questions.
On Tue, 28 Jan 2020, Francesco Brancati wrote: > Dear Stefano, > > I have a couple of question for you from the team working on static code > analysis. please see below. Hi Francesco, Sorry for the late reply. > - with the approach presented during last meeting we obtained intermediate > results but for the analysis few decisions were done by us that needs > confirmations and few errors/warning raised by the understand tool: > 1) since the file list provided had some errors (rows with double entries and > file not identified in the path specified) we tried to solve them as reported > in the file list attached: could you confirm that this is a valid list for > headers+source code files for Xen 4.13.0 tinyconfig project ? (see > fileListRes.txt) Sorry about the errors, and yes, your list looks valid, except for a couple of missing headers, see below. > 2) the tool raised the following warnings during the analysis with respect to > .h files that we were unable to solve manually: could you please help us? In regards to the warnings, they affect the following headers: asm/asm-offsets.h asm-arm/vpl011.h xen/compile.h asm/spec_ctrl.h asm/i387.h asm/xstate.h Let's go over them one by one: 1) asm/asm-offsets.h It looks like this is missing from your file list, you should have: include/asm/asm-offsets.h 2) asm-arm/vpl011.h This one is present in your file list as include/asm-arm/vpl011.h, I don't know why the tool is not able to find it. If you look at xen.git, the file is certainly there: http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/include/asm-arm/vpl011.h;h=e6c7ab738194a5759e796aa3b0e30be4133340f8;hb=a2e84d8e42c9e878fff17b738d8e5c5d83888f31 3) xen/compile.h This one is missing from your file list, you should add: include/xen/compile.h 4) asm/spec_ctrl.h This one is interesting because it shouldn't be included at all. This is a x86 header file: xen/include/asm-x86/spec_ctrl.h. The C file that is supposed to include it is xen/common/efi/boot.c: http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/common/efi/boot.c;h=3f1c330afec2c675636b73b00ee89c1734230d47;hb=a2e84d8e42c9e878fff17b738d8e5c5d83888f31 If you look at line 1410, you'll see that the include is actually right after #ifndef CONFIG_ARM: http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/common/efi/boot.c;h=3f1c330afec2c675636b73b00ee89c1734230d47;hb=a2e84d8e42c9e878fff17b738d8e5c5d83888f31#l1410 So this seems to be a genuine error in the tool that doesn't pick up the meaning of #ifndef CONFIG_ARM? 5) asm/i387.h Same as 4), the file is a x86 header file: xen/include/asm-x86/i387.h It is supposed to be included by xen/common/efi/runtime.c, but the #include is done right after a #ifndef CONFIG_ARM, see: http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/common/efi/runtime.c;h=8c2ece468de97c7448b0ef0cad8b440de8cbae51;hb=a2e84d8e42c9e878fff17b738d8e5c5d83888f31#l32 6) asm/xstate.h This is again like 4) and 5), probably an error by the tool. xstate.h is a x86 header: xen/include/asm-x86/xstate.h, it is included by xen/common/efi/runtime.c after a #ifndef CONFIG_ARM, give a look at the same link as before. > 3) in addition to this, we would like to try a new functionality of the > Understand tool that should allow to automatically trace the building process > in order to detect all the files (.c and .h) used for a certain build and > parameters, allowing to analyze all and only the needed file with preprocessor > config. Sounds very useful > in order to do this, we would like to have advices on the build process. > you gave us as reference the following process: > --- > export XEN_TARGET_ARCH=arm64 > export CROSS_COMPILE=/path/to/cross-compiler > cd xen/ > cp arch/arm/configs/tiny64.conf .config > make > (press Enter a few times) > --- > the question is: is it ok with Xen 4.13.0? Yes, it is OK. > Which is the cross-compiler for arm64 that you use? Typically, I just use the one pre-built by Linaro: https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz Unpack the tarball, lets say you end up with: /local/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu Then you need to set CROSS_COMPILE as follows: export CROSS_COMPILE=/local/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- _______________________________________________ Fusa-sig mailing list Fusa-sig@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/fusa-sig
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |