Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error #47

Open
cleverior opened this issue May 21, 2016 · 57 comments
Open

Compile error #47

cleverior opened this issue May 21, 2016 · 57 comments

Comments

@cleverior
Copy link

I try to compile kernel using UBERTC 4.9 for my redmi3 but i stuck on this error

  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CC      scripts/mod/devicetable-offsets.s
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTLD  scripts/mod/modpost
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  CC      drivers/soc/qcom/subsystem_restart.o
drivers/soc/qcom/subsystem_restart.c: In function 'subsys_register':
drivers/soc/qcom/subsystem_restart.c:1480:19: error: 'WT_SUBSYSTEM_REASTART_LEVEL' undeclared (first use in this function)
  if (0 == strncmp(WT_SUBSYSTEM_REASTART_LEVEL, "SYSTEM", 6)) {
                   ^
drivers/soc/qcom/subsystem_restart.c:1480:19: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [drivers/soc/qcom/subsystem_restart.o] Error 1
make[2]: *** [drivers/soc/qcom] Error 2
make[1]: *** [drivers/soc] Error 2
make: *** [drivers] Error 2
@cleverior
Copy link
Author

Still stuck on the same error

@eebssk1
Copy link

eebssk1 commented May 22, 2016

don' build it now
the source code has errors

@eebssk1
Copy link

eebssk1 commented May 22, 2016

forget my last comment.it can be built with a correct config

@eebssk1
Copy link

eebssk1 commented May 22, 2016

sorry…i misunderstood you…
it seems the source code really having errors
i think this problem happens because it is missing header files.
@hehao
@MiCode

@cleverior
Copy link
Author

Waiting for update

@eebssk1
Copy link

eebssk1 commented May 23, 2016

@cleverior
clever!?…
I found a way out!
in your .config
found CONFIG_MSM_SUBSYSTEM_RESTART=y
change to =n or just # drop it.
enjoy building
or you can still wait for update…😂

@hehao
Copy link

hehao commented May 23, 2016

Hi Guys,

You mentioned wrong person.

@eebssk1
Copy link

eebssk1 commented May 23, 2016

same nickname"😱"

@cleverior
Copy link
Author

@eebssk1 : thanks for your info. I'll try it later.

@cleverior
Copy link
Author

stuck on new error

make[1]: Nothing to be done for `dtbs'.
  CHK     include/generated/compile.h
  GZIP    kernel/config_data.gz
  CHK     kernel/config_data.h
  CC      drivers/video/msm/msm_fb.o
  CC      drivers/video/msm/mdp.o
  CC      drivers/video/msm/mdp_ppp.o
drivers/video/msm/msm_fb.c:30:24: fatal error: mach/board.h: No such file or directory
 #include <mach/board.h>
                        ^
compilation terminated.
make[3]: *** [drivers/video/msm/msm_fb.o] Error 1
make[3]: *** Waiting for unfinished jobs....
drivers/video/msm/mdp.c:28:27: fatal error: mach/hardware.h: No such file or directory
 #include <mach/hardware.h>
                           ^
compilation terminated.
make[3]: *** [drivers/video/msm/mdp.o] Error 1
drivers/video/msm/mdp_ppp.c:29:27: fatal error: mach/hardware.h: No such file or directory
 #include <mach/hardware.h>
                           ^
compilation terminated.
make[3]: *** [drivers/video/msm/mdp_ppp.o] Error 1
make[2]: *** [drivers/video/msm] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2

@eebssk1
Copy link

eebssk1 commented May 23, 2016

maybe it's gcc's problem
i use android ndk r10e
system environment's problem is possibe too…

@webhaikal
Copy link

@cleverior, you need to resync the code. Mine builds fine but doesnt boot...

@cleverior
Copy link
Author

Which gcc u use ?

@webhaikal
Copy link

4.9 UberTC

@eebssk1
Copy link

eebssk1 commented Jun 1, 2016

compile finished! but touchscreen didn't work…

how about you?…

@cleverior

@webhaikal
Copy link

How you got it to boot @eebssk1?

@eebssk1
Copy link

eebssk1 commented Jun 2, 2016

@webhaikal
yes

@cleverior
Copy link
Author

Still stuck bro
On Jun 2, 2016 7:37 AM, "eebssk1" notifications@github.com wrote:

@webhaikal https://github.com/webhaikal
yes


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEGXB7NGeWfwwyWNu6m9TpVptiZWxh31ks5qHiW-gaJpZM4Ijvji
.

@webhaikal
Copy link

@eebssk1 How you compile it? What defconfig used and what changes?
@cleverior Same here...

@eebssk1
Copy link

eebssk1 commented Jun 2, 2016

android r10e
wtbalabala-perf-defconfig
config_msm_subsystem_restart=n
silly batter states
touchscreen does't work
data doesn't work

so the code is trash…

don't care about my english and i'm lazy………

@eebssk1
Copy link

eebssk1 commented Jun 2, 2016

i use debian 8

@eebssk1
Copy link

eebssk1 commented Jun 2, 2016

android ndk r10e………

@cleverior
Copy link
Author

Please share the link of gcc which you use.
On Jun 2, 2016 4:43 PM, "eebssk1" notifications@github.com wrote:

android ndk r10e………


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEGXB9leS3I92gtYKE2RUKWXyJXtJBBZks5qHqWsgaJpZM4Ijvji
.

@eebssk1
Copy link

eebssk1 commented Jun 3, 2016

@cleverior
32bit or 64bit system do you use?

@cleverior
Copy link
Author

64bit
On Jun 3, 2016 5:12 PM, "eebssk1" notifications@github.com wrote:

@cleverior https://github.com/cleverior
32bit or 64bit system do you use?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEGXByyDBuO8cK9sYijK6logr7jtAwEjks5qH_36gaJpZM4Ijvji
.

@webhaikal
Copy link

@cleverior @eebssk1 lets try to collaborate on this? Try to fix what we can and improve on it?

@cleverior
Copy link
Author

I still get error compile. Even i already try to use android ndk.
On Jun 3, 2016 7:19 PM, "Haikal Izzuddin" notifications@github.com wrote:

@cleverior https://github.com/cleverior @eebssk1
https://github.com/eebssk1 lets try to collaborate on this? Try to fix
what we can and improve on it?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEGXB6CtnwNR9BHBfFlRO38dMAN9rDo0ks5qIBvIgaJpZM4Ijvji
.

@webhaikal
Copy link

Mine compiles but doesnt boot, using all known GCC (Sabermod, UberTC, AOSP)

@cleverior
Copy link
Author

Can we create a Hangout group ?
On Jun 4, 2016 8:29 AM, "Haikal Izzuddin" notifications@github.com wrote:

Mine compiles but doesnt boot, using all known GCC (Sabermod, UberTC, AOSP)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEGXB1i6m3BEqB1PIwPyXieA_UNfJ7a0ks5qINTsgaJpZM4Ijvji
.

@webhaikal
Copy link

@cleverior why not?

@eebssk1
Copy link

eebssk1 commented Jun 10, 2016

Don't have this problem…

@vikoadi
Copy link

vikoadi commented Jun 12, 2016

@eebssk1 I can build it using subsystem_restart off, but can't boot it. Adb show that it can't find any sound card
What I do is pulling boot.img from my phone, replace Image file using mkbootimg_tools, then reflash.

Are you rebuilding dt.img to get it to work?
I'm trying to but failed with 0 unique DTS found.

@asiansaga
Copy link

asiansaga commented Jun 14, 2016

premaca already doing great job on this, take a look at his code here https://github.com/premaca/Xiaomi_Kernel_OpenSource/tree/lp5.x

i can compile using his defconfig, and get fix on sound and touchscreen, there are still wifi error left, and some sensors i think.

count me in if you guys want to create some groups

@eebssk1
Copy link

eebssk1 commented Jun 14, 2016

404
@asiansaga

@asiansaga
Copy link

i've edited the link

@eebssk1

@cleverior
Copy link
Author

oh maaaan... so many errors i found with this source kernel So confusing. -_-

And i already try to use source from premaca but i get this error

CC scripts/mod/empty.o
HOSTCC scripts/selinux/genheaders/genheaders
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/selinux/mdp/mdp
make: *** [scripts] Error 2
make: INTERNAL: Exiting with 5 jobserver tokens available; should be 4!

any ide @asiansaga ?

@asiansaga
Copy link

@cleverior
I don't meet those error, are you sure using the right defconfig, also try to run make distclean before running another make

@webhaikal
Copy link

@asiansaga You can get it to boot? I can't seem to get it to boot even using that repo...

@asiansaga
Copy link

@webhaikal yup, boot but without WiFi, and some sensor not working. Build from this repo, with some adjustments from @premaca repo

@webhaikal
Copy link

@asiansaga I can't seem to get it to boot... I took the changes from @premaca and combined it with this but still doesnt work. What steps you did, what toolchain used and such?

@asiansaga
Copy link

@webhaikal
Let me tell you from the start 😁

  1. Build from this repo, with wt88047-perf_defconfig, found error with MSM_SUBSYSTEM_RESTART
  2. Googling here, got suggestions from @eebssk1 to remark it in .config file, got it build and also boot with no touchscreen
  3. Ask to Miui forum and directed to @premaca repo to fix touchscreen, build with no simcard support
  4. Look deeper to premaca repo, found difference in file drivers/soc/qcom/subsytem_restart.c, put it in my working source, build and got no sound
  5. There's a fix for sound in premaca repo, build and no wifi
  6. Haven't got spare time to look how to fix it, I just wait for master @premaca to fix it 😄

I use UBERTC 4.9 to build and android kitchen from osm0sis @ xda to unpack - repack boot.img

Flash to device using fastboot

@webhaikal
Copy link

@asiansaga is it the wt88047-perf or the wt88509-64-perf?

@eebssk1
Copy link

eebssk1 commented Jun 16, 2016

@asiansaga
you can manually download the wifi driver source code from codeaurora,
BUT I got error when i was buiding it。。。

@asiansaga
Copy link

@webhaikal wt88047-perf and make sure the arch=arm not arm64 cause MIUI still build using ARM architecture

@eebssk1 any link there?

@asiansaga
Copy link

@webhaikal i forgot that my device is redmi 2 prime, sorry if you think it's a redmi3

@WinKarbik
Copy link

I ll try fix kernel source for redmi 3

@rushabh71
Copy link

Anyone able to make dt.img for xiaomi mi4i kernel?
giving me an error..

`DTB combiner:
Input directory: '/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dts/'

Output file: '/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dt.img'

Searching subdir: /home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dts/include/ ...

=> Found 0 unique DTB(s)`

as i have read various threads but can not able to fix this. i have used dtbToolCm and dtbtool (version -3 and -2) also same result.

@chhapil
Copy link

chhapil commented Jul 27, 2016

your device tree files seems to be located in
https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/ferrari-l-oss/arch/arm/boot/dts/qcom
try changing it and see if it can generate the dtbs

On Tue, Jul 26, 2016 at 4:23 PM, Rushabh Patel notifications@github.com
wrote:

Anyone able to make dt.img for xiaomi mi4i kernel?
giving me an error..

`DTB combiner:
Input directory:
'/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dts/'

Output file:
'/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dt.img'

Searching subdir:
/home/rushabh/KernelDevelopment/Xiaomi_Kernel_OpenSource-ferrari-l-oss/arch/arm64/boot/dts/include/
...

=> Found 0 unique DTB(s)`

as i have read various threads but can not able to fix this. i have used
dtbToolCm and dtbtool (version -3 and -2) also same result.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIpoHQX5hCr9fQutylpvsXgXgcVbDp0sks5qZecMgaJpZM4Ijvji
.

Thanks & Regards
Ruturaj

@rushabh71
Copy link

@chhapil tried it, but still not able to find dtb

./dtbToolCM -2 -s 2048 -o /home/rushabh/Desktop/dt.img -p /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/scripts/dtc/ /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/ DTB combiner: Input directory: '/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/' Output file: '/home/rushabh/Desktop/dt.img' => Found 0 unique DTB(s)

If i change input directory like below than it works but it is using 'arm' dtb, i think so....

./dtbToolCM -2 -s 2048 -o /home/rushabh/Desktop/dt.img -p /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/scripts/dtc/ /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/
DTB combiner:
Input directory: '/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/'
Output file: '/home/rushabh/Desktop/dt.img'
Found file: msm8936-qrd-skuk.dtb ...
Version:2
chipset: 233, rev: 0, platform: 65547, subtype: 5, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 65547, subtype: 5, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 65547, subtype: 5, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Searching subdir: /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/bootp/ ...
Found file: msm8939-mtp-jdi.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8916-mtp-smb1360.dtb ...
Version:2
chipset: 206, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 248, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 249, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 250, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-cdp.dtb ...
Version:2
chipset: 233, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msmtellurium-sim.dtb ...
Version:2
chipset: 264, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Searching subdir: /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/compressed/ ...
Found file: msm8939-mtp-smb1360.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8939-cdp-jdi.dtb ...
Version:2
chipset: 239, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8916-mtp.dtb ...
Version:2
chipset: 206, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 248, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 249, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 250, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8939-sim.dtb ...
Version:2
chipset: 239, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-mtp.dtb ...
Version:2
chipset: 233, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msmtellurium-rumi.dtb ...
Version:2
chipset: 264, rev: 0, platform: 15, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8939-cdp.dtb ...
Version:2
chipset: 239, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Searching subdir: /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/ ...
Searching subdir: /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/include/ ...
Searching subdir: /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/ ...
Searching subdir: /home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/testcases/ ...
Found file: msm8939-mtp.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-cdp-smb1360.dtb ...
Version:2
chipset: 233, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-mtp-smb1360.dtb ...
Version:2
chipset: 233, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2: 0, pmic3: 0
=> Found 43 unique DTB(s)

Generating master DTB... completed

is it ok to use dtb of /arm/boot/ ?

@chhapil
Copy link

chhapil commented Jul 27, 2016

you are compiling for Mi4i right? thats MSM8939
Using arm directory should be fine to generate the dtb, nothing to do with
32 bit or 64 with it

On Wed, Jul 27, 2016 at 4:13 PM, Rushabh Patel notifications@github.com
wrote:

@chhapil https://github.com/chhapil tried it, but still not able to
find dtb

./dtbToolCM -2 -s 2048 -o /home/rushabh/Desktop/dt.img -p
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/scripts/dtc/
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/
DTB combiner:
Input directory:
'/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/'
Output file: '/home/rushabh/Desktop/dt.img'
=> Found 0 unique DTB(s)

If i change input directory like below than it works but it is using 'arm'
dtb, i think so....

./dtbToolCM -2 -s 2048 -o /home/rushabh/Desktop/dt.img -p
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/scripts/dtc/
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/
DTB combiner:
Input directory:
'/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/'
Output file: '/home/rushabh/Desktop/dt.img'
Found file: msm8936-qrd-skuk.dtb ...
Version:2
chipset: 233, rev: 0, platform: 65547, subtype: 5, pmic0: 0, pmic1: 0,
pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 65547, subtype: 5, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 65547, subtype: 5, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/bootp/
...
Found file: msm8939-mtp-jdi.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8916-mtp-smb1360.dtb ...
Version:2
chipset: 206, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 248, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 249, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 250, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8936-cdp.dtb ...
Version:2
chipset: 233, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msmtellurium-sim.dtb ...
Version:2
chipset: 264, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/compressed/
...
Found file: msm8939-mtp-smb1360.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8939-cdp-jdi.dtb ...
Version:2
chipset: 239, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8916-mtp.dtb ...
Version:2
chipset: 206, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 248, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 249, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 250, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8939-sim.dtb ...
Version:2
chipset: 239, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 16, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 16, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-mtp.dtb ...
Version:2
chipset: 233, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msmtellurium-rumi.dtb ...
Version:2
chipset: 264, rev: 0, platform: 15, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
Found file: msm8939-cdp.dtb ...
Version:2
chipset: 239, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/
...
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/include/
...
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/
...
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/testcases/
...
Found file: msm8939-mtp.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8936-cdp-smb1360.dtb ...
Version:2
chipset: 233, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
Found file: msm8936-mtp-smb1360.dtb ...
Version:2
chipset: 233, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1:
0, pmic2: 0, pmic3: 0
=> Found 43 unique DTB(s)

Generating master DTB... completed

is it ok to use dtb of /arm/boot/ ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIpoHZRSOSLxPdgRP_YzawwgSsjIvxdBks5qZzZKgaJpZM4Ijvji
.

Thanks & Regards
Ruturaj

@chhapil
Copy link

chhapil commented Jul 27, 2016

another hint, just decompile your boot.img and validate the dtb file size
from it, whether its using a combined dtb or only specific one.
I had this experience while compiling kernel for Lenevo A6000, it was using
combined dtb.

Cheers

On Wed, Jul 27, 2016 at 4:41 PM, Ruturaj Shetye ru2raj@gmail.com wrote:

you are compiling for Mi4i right? thats MSM8939
Using arm directory should be fine to generate the dtb, nothing to do with
32 bit or 64 with it

On Wed, Jul 27, 2016 at 4:13 PM, Rushabh Patel notifications@github.com
wrote:

@chhapil https://github.com/chhapil tried it, but still not able to
find dtb

./dtbToolCM -2 -s 2048 -o /home/rushabh/Desktop/dt.img -p
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/scripts/dtc/
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/
DTB combiner:
Input directory:
'/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/'
Output file: '/home/rushabh/Desktop/dt.img'
=> Found 0 unique DTB(s)

If i change input directory like below than it works but it is using
'arm' dtb, i think so....

./dtbToolCM -2 -s 2048 -o /home/rushabh/Desktop/dt.img -p
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/scripts/dtc/
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/
DTB combiner:
Input directory:
'/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/'
Output file: '/home/rushabh/Desktop/dt.img'
Found file: msm8936-qrd-skuk.dtb ...
Version:2
chipset: 233, rev: 0, platform: 65547, subtype: 5, pmic0: 0, pmic1: 0,
pmic2: 0, pmic3: 0
additional chipset: 240, rev: 0, platform: 65547, subtype: 5, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 65547, subtype: 5, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/bootp/
...
Found file: msm8939-mtp-jdi.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 3, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 3, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 3, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8916-mtp-smb1360.dtb ...
Version:2
chipset: 206, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 248, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 249, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 250, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-cdp.dtb ...
Version:2
chipset: 233, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 1, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 1, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msmtellurium-sim.dtb ...
Version:2
chipset: 264, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0,
pmic2: 0, pmic3: 0
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/compressed/
...
Found file: msm8939-mtp-smb1360.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8939-cdp-jdi.dtb ...
Version:2
chipset: 239, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 1, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 1, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8916-mtp.dtb ...
Version:2
chipset: 206, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 248, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 249, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 250, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8939-sim.dtb ...
Version:2
chipset: 239, rev: 0, platform: 16, subtype: 0, pmic0: 0, pmic1: 0,
pmic2: 0, pmic3: 0
additional chipset: 241, rev: 0, platform: 16, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 16, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-mtp.dtb ...
Version:2
chipset: 233, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msmtellurium-rumi.dtb ...
Version:2
chipset: 264, rev: 0, platform: 15, subtype: 0, pmic0: 0, pmic1: 0,
pmic2: 0, pmic3: 0
Found file: msm8939-cdp.dtb ...
Version:2
chipset: 239, rev: 0, platform: 1, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 1, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 1, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/
...
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/include/
...
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/qcom/
...
Searching subdir:
/home/rushabh/KernelDevelopment/android_kernel_xiaomi_ferrari/arch/arm/boot/dts/testcases/
...
Found file: msm8939-mtp.dtb ...
Version:2
chipset: 239, rev: 0, platform: 8, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 241, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 263, rev: 0, platform: 8, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-cdp-smb1360.dtb ...
Version:2
chipset: 233, rev: 0, platform: 1, subtype: 1, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 1, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 1, subtype: 1, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
Found file: msm8936-mtp-smb1360.dtb ...
Version:2
chipset: 233, rev: 0, platform: 8, subtype: 0, pmic0: 0, pmic1: 0, pmic2:
0, pmic3: 0
additional chipset: 240, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
additional chipset: 242, rev: 0, platform: 8, subtype: 0, pmic0: 0,
pmic1: 0, pmic2: 0, pmic3: 0
=> Found 43 unique DTB(s)

Generating master DTB... completed

is it ok to use dtb of /arm/boot/ ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIpoHZRSOSLxPdgRP_YzawwgSsjIvxdBks5qZzZKgaJpZM4Ijvji
.

Thanks & Regards
Ruturaj

Thanks & Regards
Ruturaj

@rushabh71
Copy link

@chhapil thanks man. will try to boot with this generated dt.img.

@bystepii
Copy link

I think it should be #define WT_SUBSYSTEM_REASTART_LEVEL "related" in drivers/soc/qcom/subsystem_restart.c on line 15, as in this fork

mihirshah006 pushed a commit to mihirshah006/Xiaomi_Kernel_OpenSource that referenced this issue Jul 25, 2017
commit 7301d6a upstream.

Reported by syzkaller:

    [ INFO: suspicious RCU usage. ]
    4.9.0-rc4+ MiCode#47 Not tainted
    -------------------------------
    ./include/linux/kvm_host.h:536 suspicious rcu_dereference_check() usage!

    stack backtrace:
    CPU: 1 PID: 6679 Comm: syz-executor Not tainted 4.9.0-rc4+ MiCode#47
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
     ffff880039e2f6d0 ffffffff81c2e46b ffff88003e3a5b40 0000000000000000
     0000000000000001 ffffffff83215600 ffff880039e2f700 ffffffff81334ea9
     ffffc9000730b000 0000000000000004 ffff88003c4f8420 ffff88003d3f8000
    Call Trace:
     [<     inline     >] __dump_stack lib/dump_stack.c:15
     [<ffffffff81c2e46b>] dump_stack+0xb3/0x118 lib/dump_stack.c:51
     [<ffffffff81334ea9>] lockdep_rcu_suspicious+0x139/0x180 kernel/locking/lockdep.c:4445
     [<     inline     >] __kvm_memslots include/linux/kvm_host.h:534
     [<     inline     >] kvm_memslots include/linux/kvm_host.h:541
     [<ffffffff8105d6ae>] kvm_gfn_to_hva_cache_init+0xa1e/0xce0 virt/kvm/kvm_main.c:1941
     [<ffffffff8112685d>] kvm_lapic_set_vapic_addr+0xed/0x140 arch/x86/kvm/lapic.c:2217

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: fda4e2e
Cc: Andrew Honig <ahonig@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Kr�má� <rkrcmar@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
AxelBlaz3 pushed a commit to AxelBlaz3/Xiaomi_Kernel_OpenSource that referenced this issue May 8, 2018
commit 7301d6a upstream.

Reported by syzkaller:

    [ INFO: suspicious RCU usage. ]
    4.9.0-rc4+ MiCode#47 Not tainted
    -------------------------------
    ./include/linux/kvm_host.h:536 suspicious rcu_dereference_check() usage!

    stack backtrace:
    CPU: 1 PID: 6679 Comm: syz-executor Not tainted 4.9.0-rc4+ MiCode#47
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
     ffff880039e2f6d0 ffffffff81c2e46b ffff88003e3a5b40 0000000000000000
     0000000000000001 ffffffff83215600 ffff880039e2f700 ffffffff81334ea9
     ffffc9000730b000 0000000000000004 ffff88003c4f8420 ffff88003d3f8000
    Call Trace:
     [<     inline     >] __dump_stack lib/dump_stack.c:15
     [<ffffffff81c2e46b>] dump_stack+0xb3/0x118 lib/dump_stack.c:51
     [<ffffffff81334ea9>] lockdep_rcu_suspicious+0x139/0x180 kernel/locking/lockdep.c:4445
     [<     inline     >] __kvm_memslots include/linux/kvm_host.h:534
     [<     inline     >] kvm_memslots include/linux/kvm_host.h:541
     [<ffffffff8105d6ae>] kvm_gfn_to_hva_cache_init+0xa1e/0xce0 virt/kvm/kvm_main.c:1941
     [<ffffffff8112685d>] kvm_lapic_set_vapic_addr+0xed/0x140 arch/x86/kvm/lapic.c:2217

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: fda4e2e
Cc: Andrew Honig <ahonig@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ahmed-Hady pushed a commit to Ahmed-Hady/android_xiaomi_daisy that referenced this issue Jun 11, 2019
[ Upstream commit 36096f2 ]

kernel BUG at lib/list_debug.c:47!
invalid opcode: 0000 [#1
CPU: 0 PID: 12914 Comm: rmmod Tainted: G        W         5.1.0+ MiCode#47
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
RIP: 0010:__list_del_entry_valid+0x53/0x90
Code: 48 8b 32 48 39 fe 75 35 48 8b 50 08 48 39 f2 75 40 b8 01 00 00 00 5d c3 48
89 fe 48 89 c2 48 c7 c7 18 75 fe 82 e8 cb 34 78 ff <0f> 0b 48 89 fe 48 c7 c7 50 75 fe 82 e8 ba 34 78 ff 0f 0b 48 89 f2
RSP: 0018:ffffc90001c2fe40 EFLAGS: 00010286
RAX: 000000000000004e RBX: ffffffffa0184000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff888237a17788 RDI: 00000000ffffffff
RBP: ffffc90001c2fe40 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc90001c2fe10 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc90001c2fe50 R14: ffffffffa0184000 R15: 0000000000000000
FS:  00007f3d83634540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555c350ea818 CR3: 0000000231677000 CR4: 00000000000006f0
Call Trace:
 unregister_pernet_operations+0x34/0x120
 unregister_pernet_subsys+0x1c/0x30
 packet_exit+0x1c/0x369 [af_packet
 __x64_sys_delete_module+0x156/0x260
 ? lockdep_hardirqs_on+0x133/0x1b0
 ? do_syscall_64+0x12/0x1f0
 do_syscall_64+0x6e/0x1f0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

When modprobe af_packet, register_pernet_subsys
fails and does a cleanup, ops->list is set to LIST_POISON1,
but the module init is considered to success, then while rmmod it,
BUG() is triggered in __list_del_entry_valid which is called from
unregister_pernet_subsys. This patch fix error handing path in
packet_init to avoid possilbe issue if some error occur.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pix106 pushed a commit to pix106/android_kernel_xiaomi that referenced this issue Jun 15, 2019
[ Upstream commit 36096f2 ]

kernel BUG at lib/list_debug.c:47!
invalid opcode: 0000 [MiCode#1
CPU: 0 PID: 12914 Comm: rmmod Tainted: G        W         5.1.0+ MiCode#47
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
RIP: 0010:__list_del_entry_valid+0x53/0x90
Code: 48 8b 32 48 39 fe 75 35 48 8b 50 08 48 39 f2 75 40 b8 01 00 00 00 5d c3 48
89 fe 48 89 c2 48 c7 c7 18 75 fe 82 e8 cb 34 78 ff <0f> 0b 48 89 fe 48 c7 c7 50 75 fe 82 e8 ba 34 78 ff 0f 0b 48 89 f2
RSP: 0018:ffffc90001c2fe40 EFLAGS: 00010286
RAX: 000000000000004e RBX: ffffffffa0184000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff888237a17788 RDI: 00000000ffffffff
RBP: ffffc90001c2fe40 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc90001c2fe10 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc90001c2fe50 R14: ffffffffa0184000 R15: 0000000000000000
FS:  00007f3d83634540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555c350ea818 CR3: 0000000231677000 CR4: 00000000000006f0
Call Trace:
 unregister_pernet_operations+0x34/0x120
 unregister_pernet_subsys+0x1c/0x30
 packet_exit+0x1c/0x369 [af_packet
 __x64_sys_delete_module+0x156/0x260
 ? lockdep_hardirqs_on+0x133/0x1b0
 ? do_syscall_64+0x12/0x1f0
 do_syscall_64+0x6e/0x1f0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

When modprobe af_packet, register_pernet_subsys
fails and does a cleanup, ops->list is set to LIST_POISON1,
but the module init is considered to success, then while rmmod it,
BUG() is triggered in __list_del_entry_valid which is called from
unregister_pernet_subsys. This patch fix error handing path in
packet_init to avoid possilbe issue if some error occur.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
acervenky pushed a commit to acervenky/quax_raphael-q that referenced this issue Dec 7, 2019
[ Upstream commit 36096f2 ]

kernel BUG at lib/list_debug.c:47!
invalid opcode: 0000 [MiCode#1
CPU: 0 PID: 12914 Comm: rmmod Tainted: G        W         5.1.0+ MiCode#47
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
RIP: 0010:__list_del_entry_valid+0x53/0x90
Code: 48 8b 32 48 39 fe 75 35 48 8b 50 08 48 39 f2 75 40 b8 01 00 00 00 5d c3 48
89 fe 48 89 c2 48 c7 c7 18 75 fe 82 e8 cb 34 78 ff <0f> 0b 48 89 fe 48 c7 c7 50 75 fe 82 e8 ba 34 78 ff 0f 0b 48 89 f2
RSP: 0018:ffffc90001c2fe40 EFLAGS: 00010286
RAX: 000000000000004e RBX: ffffffffa0184000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff888237a17788 RDI: 00000000ffffffff
RBP: ffffc90001c2fe40 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc90001c2fe10 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc90001c2fe50 R14: ffffffffa0184000 R15: 0000000000000000
FS:  00007f3d83634540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555c350ea818 CR3: 0000000231677000 CR4: 00000000000006f0
Call Trace:
 unregister_pernet_operations+0x34/0x120
 unregister_pernet_subsys+0x1c/0x30
 packet_exit+0x1c/0x369 [af_packet
 __x64_sys_delete_module+0x156/0x260
 ? lockdep_hardirqs_on+0x133/0x1b0
 ? do_syscall_64+0x12/0x1f0
 do_syscall_64+0x6e/0x1f0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

When modprobe af_packet, register_pernet_subsys
fails and does a cleanup, ops->list is set to LIST_POISON1,
but the module init is considered to success, then while rmmod it,
BUG() is triggered in __list_del_entry_valid which is called from
unregister_pernet_subsys. This patch fix error handing path in
packet_init to avoid possilbe issue if some error occur.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
regiesoriano pushed a commit to regiesoriano/android_kernel_xiaomi_jasmine_sprout that referenced this issue May 29, 2021
[ Upstream commit d5027ca ]

Ritesh reported a bug [1] against UML, noting that it crashed on
startup. The backtrace shows the following (heavily redacted):

(gdb) bt
...
 MiCode#26 0x0000000060015b5d in sem_init () at ipc/sem.c:268
 MiCode#27 0x00007f89906d92f7 in ?? () from /lib/x86_64-linux-gnu/libcom_err.so.2
 MiCode#28 0x00007f8990ab8fb2 in call_init (...) at dl-init.c:72
...
 MiCode#40 0x00007f89909bf3a6 in nss_load_library (...) at nsswitch.c:359
...
 MiCode#44 0x00007f8990895e35 in _nss_compat_getgrnam_r (...) at nss_compat/compat-grp.c:486
 MiCode#45 0x00007f8990968b85 in __getgrnam_r [...]
 MiCode#46 0x00007f89909d6b77 in grantpt [...]
 MiCode#47 0x00007f8990a9394e in __GI_openpty [...]
 MiCode#48 0x00000000604a1f65 in openpty_cb (...) at arch/um/os-Linux/sigio.c:407
 MiCode#49 0x00000000604a58d0 in start_idle_thread (...) at arch/um/os-Linux/skas/process.c:598
 MiCode#50 0x0000000060004a3d in start_uml () at arch/um/kernel/skas/process.c:45
 MiCode#51 0x00000000600047b2 in linux_main (...) at arch/um/kernel/um_arch.c:334
 MiCode#52 0x000000006000574f in main (...) at arch/um/os-Linux/main.c:144

indicating that the UML function openpty_cb() calls openpty(),
which internally calls __getgrnam_r(), which causes the nsswitch
machinery to get started.

This loads, through lots of indirection that I snipped, the
libcom_err.so.2 library, which (in an unknown function, "??")
calls sem_init().

Now, of course it wants to get libpthread's sem_init(), since
it's linked against libpthread. However, the dynamic linker
looks up that symbol against the binary first, and gets the
kernel's sem_init().

Hajime Tazaki noted that "objcopy -L" can localize a symbol,
so the dynamic linker wouldn't do the lookup this way. I tried,
but for some reason that didn't seem to work.

Doing the same thing in the linker script instead does seem to
work, though I cannot entirely explain - it *also* works if I
just add "VERSION { { global: *; }; }" instead, indicating that
something else is happening that I don't really understand. It
may be that explicitly doing that marks them with some kind of
empty version, and that's different from the default.

Explicitly marking them with a version breaks kallsyms, so that
doesn't seem to be possible.

Marking all the symbols as local seems correct, and does seem
to address the issue, so do that. Also do it for static link,
nsswitch libraries could still be loaded there.

[1] https://bugs.debian.org/983379

Reported-by: Ritesh Raj Sarraf <rrs@debian.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Tested-By: Ritesh Raj Sarraf <rrs@debian.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
roniwae pushed a commit to roniwae/xiaomi_kernel that referenced this issue Dec 28, 2023
[ Upstream commit 36096f2 ]

kernel BUG at lib/list_debug.c:47!
invalid opcode: 0000 [MiCode#1
CPU: 0 PID: 12914 Comm: rmmod Tainted: G        W         5.1.0+ MiCode#47
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
RIP: 0010:__list_del_entry_valid+0x53/0x90
Code: 48 8b 32 48 39 fe 75 35 48 8b 50 08 48 39 f2 75 40 b8 01 00 00 00 5d c3 48
89 fe 48 89 c2 48 c7 c7 18 75 fe 82 e8 cb 34 78 ff <0f> 0b 48 89 fe 48 c7 c7 50 75 fe 82 e8 ba 34 78 ff 0f 0b 48 89 f2
RSP: 0018:ffffc90001c2fe40 EFLAGS: 00010286
RAX: 000000000000004e RBX: ffffffffa0184000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff888237a17788 RDI: 00000000ffffffff
RBP: ffffc90001c2fe40 R08: 0000000000000000 R09: 0000000000000000
R10: ffffc90001c2fe10 R11: 0000000000000000 R12: 0000000000000000
R13: ffffc90001c2fe50 R14: ffffffffa0184000 R15: 0000000000000000
FS:  00007f3d83634540(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555c350ea818 CR3: 0000000231677000 CR4: 00000000000006f0
Call Trace:
 unregister_pernet_operations+0x34/0x120
 unregister_pernet_subsys+0x1c/0x30
 packet_exit+0x1c/0x369 [af_packet
 __x64_sys_delete_module+0x156/0x260
 ? lockdep_hardirqs_on+0x133/0x1b0
 ? do_syscall_64+0x12/0x1f0
 do_syscall_64+0x6e/0x1f0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

When modprobe af_packet, register_pernet_subsys
fails and does a cleanup, ops->list is set to LIST_POISON1,
but the module init is considered to success, then while rmmod it,
BUG() is triggered in __list_del_entry_valid which is called from
unregister_pernet_subsys. This patch fix error handing path in
packet_init to avoid possilbe issue if some error occur.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants