linux_openpvrsgx icon indicating copy to clipboard operation
linux_openpvrsgx copied to clipboard

Build fails with CONFIG_SGX_DEBUG

Open MightyM17 opened this issue 4 years ago • 12 comments

When trying to build the kernel with SGX_DEBUG=y there will be an error which prevents the kernel to be built successfully

  CC [M]  drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysconfig.o
  CC [M]  drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o
../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c: In function 'ReleaseGPTimer':
../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:539:50: error: 'SYS_SPECIFIC_DATA' {aka 'struct _SYS_SPECIFIC_DATA_TAG_'} has no member named 'sTimerRegPhysBase'
  539 |  pui32TimerDisable = OSMapPhysToLin(psSysSpecData->sTimerRegPhysBase,
      |                                                  ^~
make[6]: *** [../scripts/Makefile.build:271: drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o] Error 1

MightyM17 avatar Mar 19 '21 15:03 MightyM17

Thanks for the report. I'll try to reproduce as soon as I find time.

Am 19.03.2021 um 16:43 schrieb Mighty @.***>:

When trying to build the kernel with SGX_DEBUG=y there will be an error which prevents the kernel to be built successfully

CC [M] drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysconfig.o CC [M] drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o ../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c: In function 'ReleaseGPTimer': ../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:539:50: error: 'SYS_SPECIFIC_DATA' {aka 'struct SYS_SPECIFIC_DATA_TAG'} has no member named 'sTimerRegPhysBase' 539 | pui32TimerDisable = OSMapPhysToLin(psSysSpecData->sTimerRegPhysBase, | ^~ make[6]: *** [../scripts/Makefile.build:271: drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o] Error 1 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOUPPN4PXBARKQENU4PKLTENWKFANCNFSM4ZPBB54Q.

goldelico avatar Mar 20 '21 09:03 goldelico

Any updates?

MightyM17 avatar Mar 27 '21 14:03 MightyM17

Am 27.03.2021 um 15:47 schrieb Mighty @.***>:

Any updates?

No solution. I can repeat some error but it bails out earlier (likely a compiler warning level difference):

CC [M] drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o - due to target missing drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c: In function 'ReleaseGPTimer': drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:352:3: error: implicit declaration of function 'omap_dm_timer_stop' [-Werror=implicit-function-declaration] (void) omap_dm_timer_stop(psSysSpecData->psGPTimer); ^ drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:354:3: error: implicit declaration of function 'omap_dm_timer_disable' [-Werror=implicit-function-declaration] omap_dm_timer_disable(psSysSpecData->psGPTimer); ^ drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:356:3: error: implicit declaration of function 'omap_dm_timer_free' [-Werror=implicit-function-declaration] omap_dm_timer_free(psSysSpecData->psGPTimer); ^ cc1: some warnings being treated as errors

Recipie: checkout letux-5.12-rc4 change letux_defconfig to CONFIG_SGX_DEBUG=y make letux_lpae_defconfig

What I found about these functions omap_dm_timer_stop() etc. is that they were public until v4.16 (arch/arm/plat-omap/include/plat/dmtimer.h). Then they became static in v4.17 and are available only through omap_dm_timer_ops function pointers. Registration was to be done through omap_dm_timer_request_specific() which is deprecated and also static since timers are now to be requested through omap_dm_timer_request_by_cap().

The first idea would be fixing sysutils_linux.c, but we have to do it for all older DDK releases the same way. omap_dm_timer_stop() is used from DDK 1.9 up to DDK 1.17.

So we may have to mimick this old API in pvr-drv.c to wrap the approach of modern kernels.

Unfortunately there is no common header file included by all DDK versions.

Or simply keep CONFIG_SGX_DEBUG disabled...

BR, Nikolaus

goldelico avatar Mar 27 '21 17:03 goldelico

Thanks for the detailed message :D Yes that is exactly the error I was facing, well it seems like a huge task to fix it again, is it better just remove it from the kconfig?

MightyM17 avatar Mar 28 '21 03:03 MightyM17

Am 28.03.2021 um 05:48 schrieb Mighty @.***>:

Thanks for the detailed message :D Yes that is exactly the error I was facing, well it seems like a huge task to fix it again, is it better just remove it from the kconfig?

Well, a compile fix is not difficult. Making it work is. Especially since we do not really understand what the code is intended to be doing.

Attached is a patch (which should be adapted to the other DDK versions as well). Please give it a try.

BR, Nikolaus

goldelico avatar Mar 28 '21 11:03 goldelico

Sure thing will give it a try! Also I cannot find any patches is it in the commits?

MightyM17 avatar Mar 28 '21 11:03 MightyM17

Am 28.03.2021 um 13:54 schrieb Mighty @.***>:

Sure thing will give it a try! Also I cannot find any patches is it in the commits?

No, it is attached to the mail I sent to the list.

goldelico avatar Mar 28 '21 12:03 goldelico

Oh alrighty my apologies, I still cannot find it

MightyM17 avatar Mar 28 '21 13:03 MightyM17

Am 28.03.2021 um 15:06 schrieb Mighty @.***>:

Oh alrighty my apologies

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Ah, I get the issue.

You are sending from github, not the official mailing list. This is not connected to the mailing list even if it looks as if it were... Github is trying to do something good but isn't really because they split the community into two separate mail systems and pretend to be the official project mailing list.

The patch is attached again here.

You may find it also under https://lists.goldelico.com/pipermail/openpvrsgx-devgroup/2021-March/thread.html in some minutes.

BR, Nikolaus

goldelico avatar Mar 28 '21 14:03 goldelico

Sorry for the inconvenience :( I even checked my emails but this is because of github and mailing lost as you said Thanks for the patch will try it as soon as possible

MightyM17 avatar Mar 28 '21 16:03 MightyM17

Patch did not work for me still same error, anyways SGX_DEBUG shouldnt be too much of an important thing.

MightyM17 avatar Mar 30 '21 06:03 MightyM17

Am 30.03.2021 um 08:15 schrieb Mighty @.***>:

Patch did not work for me still same error

I see - it was not exactly the same. So it may be a second issue. I'll take a look later.

goldelico avatar Mar 30 '21 08:03 goldelico