Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Chan__Matthew
Beginner
217 Views

sepdk build fails on Fedora 31. Asm macros not defined

Hi,

I was trying to build the kernel driver on Fedora 31 (I know it's not officially supported yet but I was going try my luck...) with vtune 2020.0.0.605129 and I received an error about invalid characters in mnemonics in the sepdk/src/sys64.S file. Upon closer inspection, it appears to be macros that have not been substituted. I don't know where to dig after that because they are defined in linux/linkage.h and I don't see why it's not being substituted... They're marked deprecated but they're still there.

 

Error messages:

make[1]: Entering directory '/usr/src/kernels/5.5.10-200.fc31.x86_64'
  AS   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.o

/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S: Assembler messages:
/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S:47: Error: invalid character '(' in mnemonic
/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S:50: Error: invalid character '(' in mnemonic
/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S:82: Error: invalid character '(' in mnemonic
/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S:84: Error: invalid character '(' in mnemonic

Contents of sys64.S:

> sed -n -e 47p -e 50p -e 82p -e 84p sys64.S

ENTRY(SYS_Get_GDT_Base)
ENDPROC(SYS_Get_GDT_Base)
ENTRY(SYS_IO_Delay)
ENDPROC(SYS_IO_Delay)

Offending make command:

make[1]: Entering directory '/usr/src/kernels/5.5.10-200.fc31.x86_64'
...

set -e;  echo '  AS   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.o'; gcc -Wp,-MD,/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/.sys64.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/9/include -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -D__ASSEMBLY__ -fno-PIE -m64 -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -Wa,-gdwarf-2 -DCC_USING_FENTRY  -DMODULE  -c -o /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.o /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S; scripts/basic/fixdep /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/.sys64.o.d /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.o 'gcc -Wp,-MD,/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/.sys64.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/9/include -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -D__ASSEMBLY__ -fno-PIE -m64 -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -Wa,-gdwarf-2 -DCC_USING_FENTRY  -DMODULE  -c -o /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.o /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.S' > /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/.sys64.o.cmd; rm -f /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/.sys64.o.d

Thanks in advance for your help!

0 Kudos
9 Replies
JananiC_Intel
Moderator
217 Views

Hi,

Thanks for reaching out.

Could you please provide us the steps you followed to build the driver so that we can try from our side.

Chan__Matthew
Beginner
217 Views

Hi,

Thanks for your help. I tried 3 methods:

- ./install.sh script to install and build all of VTune

- calling make from inside the sepdk/src directory

- calling the gcc command that make uses from inside the kernel sources directory directly. It's in the last quote on line 4 in the post.

All 3 give the same result.

Thanks,

Matt

Egor_S_Intel1
Employee
217 Views

Hi Matthew,
Some kernel headers have been changed in 5.5 kernel and it leads to compilation error. This issue will be fixed in next public release of VTune.
Now you can try to apply the attached patch to sepdk from VTune 2020:

patch -i <full_path_to>/0001-adapt-sep-for-5.5-kernel.patch -p 1 -d <vtune_install_dir>

 Thanks.

Chan__Matthew
Beginner
217 Views

Hi Egor,

Sorry for the delay. Had to install F31 again to test it. I got the same problem in Fedora 31 as in 30.

$ sudo make
make[1]: Entering directory '/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src'
make -C /lib/modules/5.5.11-200.fc31.x86_64/build M=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src LDDINCDIR=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/../include LDDINCDIR1=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/inc modules PWD=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src -j4
make[2]: Entering directory '/usr/src/kernels/5.5.11-200.fc31.x86_64'
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/socperfdrv.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/control.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/utility.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/pmu_list.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/pci.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/soc_uncore.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/haswellunc_sa.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/npk_uncore.o
  LD   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/socperf3.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/socperf3.mod.o
  LD   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src/socperf3.ko
make[2]: Leaving directory '/usr/src/kernels/5.5.11-200.fc31.x86_64'
cp socperf3.ko socperf3-x32_64-5.5.11-200.fc31.x86_64smp.ko
make[1]: Leaving directory '/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/socperf/src'
make -C /lib/modules/5.5.11-200.fc31.x86_64/build M=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src LDDINCDIR=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/../include LDDINCDIR1=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/inc modules PWD=/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src -j4
make[1]: Entering directory '/usr/src/kernels/5.5.11-200.fc31.x86_64'
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/lwpmudrv.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/control.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/cpumon.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/eventmux.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/linuxos.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/output.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/pmi.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys_info.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/utility.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/valleyview_sochap.o
/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/utility.c: In function ‘UTILITY_Log’:
/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/utility.c:846:79: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  846 |                 if ((category_verbosity & LOG_CHANNEL_PRINTK) * !in_interrupt * !in_notification) {
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_power.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/pmu_list.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/pci.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/chap.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/gmch.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/gfx.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_sa.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/core2.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/perfver4.o
  AS   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sys64.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/silvermont.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/apic.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/pebs.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_gt.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_mmio.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_msr.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_common.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/unc_pci.o
  CC   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sepdrv_p_state.o
  LD   /opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sep5.o
  Building modules, stage 2.
  MODPOST 1 modules
ERROR: "SOCPERF_Switch_Group3" [/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sep5.ko] undefined!
ERROR: "SOCPERF_Read_Data3" [/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/sep5.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make[1]: *** [Makefile:1607: modules] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.5.11-200.fc31.x86_64'
make: *** [Makefile:215: default] Error 2

 

ArunJ_Intel
Moderator
217 Views

Hey Matt,

 

On applying the patch provided by Egor we are able to build the drivers on fedora31. We are using the builddriver utility available with vtune. Could you please try to build driver with the below command and see if it works.

 

/opt/intel/vtune_profiler_2020.0.0.605129/sepdk/src/build-driver -ni --kernel-version="5.5.11-200.fc31.x86_64" --kernel-src-dir=/usr/src/kernels/5.5.11-200.fc31.x86_64

 

ArunJ_Intel
Moderator
217 Views

Hi Matt,

 

Have you tried build-driver , Hope your issue is resolved . Could you please provide an update.

 

Arun Jose

Chan__Matthew
Beginner
217 Views

Hi Arun,

Sorry for the delay.

Yes, that resolves it for both F30 and F31. Thank you!

Was the updated code pushed into the 2020 update 1 version?

Thanks for your help,

Matt

ArunJ_Intel
Moderator
217 Views

Hey Matt,

 

As mentioned by Egor this issue will be fixed in next public release of VTune. 

As your issue is resolved could we  close this thread?.

 

Thanks

Arun Jose

ArunJ_Intel
Moderator
217 Views

Hey Matt.

 

We got the confirmation that patch has already been applied in VTune 2020 update 1, which is just released. You can download and use it.

We are closing this case as your issue is resolved. Please feel free to raise a new thread in case of further issues.

 

Thanks

Arun Jose

 

 

 

 

 

Reply