#linuxcnc-devel Logs

Jun 26 2019

#linuxcnc-devel Calendar

01:36 PM andypugh: memfrob:
01:39 PM andypugh: Guessing I need to get the 4.14 kernel, where does the autogen look for it?
01:46 PM memfrob: /usr/src/linux by default
01:46 PM memfrob: After you have a configure file, you can change that using either ./configure or make menuconfig
01:47 PM andypugh: And I need to apply the RTAI patch, then compile?
01:47 PM memfrob: I've been trying to get math working again earlier today and I always get undefined symbols and I've been trying -ffast-math -msse -mcmodel=kernel every single combination in the world, nothing is working.
01:48 PM memfrob: yes and make sure IPIPE is enabled in the kernel config.
01:49 PM andypugh: patches from RTAI?
01:49 PM memfrob: IOMMU must be off as well in both BIOS and kernel if not disabled already. There's several options I need to blacklist, but you can't have retpoline, KPTI or any kernel hardening features on, nor strong stack protector.
01:49 PM andypugh: There are patches in NTULINUX/RTAI but only for 3.x kernels
01:49 PM memfrob: for-next branch
01:49 PM memfrob: git checkout for-next ;) 4.14.130 is in there
01:52 PM andypugh: No, sorry, you have lost me
01:52 PM memfrob: git clone my RTAI branch, the one with my 3.x kernels in it, then run git checkout for-next inside the RTAI directory
01:52 PM andypugh: Got you.
01:52 PM memfrob: this tells git to switch branches, the new code isn't in master. master is old stable.
01:53 PM memfrob: I could easily plug in the math support from master into that for-next branch though, but I'd like to get this working the way it should be.
01:54 PM andypugh: Do I need to actually be running the 4.14 kernel?
01:54 PM memfrob: Yes.
01:54 PM andypugh: OK, let me get to that point first.
02:00 PM memfrob: Are you going to be using the same box that hasn't worked with RTAI since the live cd?
02:01 PM andypugh: That was the first plan, yes.
02:02 PM andypugh: If that doesn’t work I can try to find some other PC or other.
02:03 PM andypugh: I wonder if there is any point susting off the roboard BC-Box ?
02:03 PM andypugh: https://www.robotshop.com/en/roboard-ncbox-189-cnc-machine-controller.html
02:04 PM memfrob: At least with this version of RTAI, when you load the modules it does calibration which spews a lot of stuff into dmesg so it should be more diagnostic using this branch than the older stuff.
02:06 PM andypugh: (still installing kernel build dependencoes, like ncurses….
02:07 PM memfrob: Since this is just a latency test, SSE isn't required, but it does need an FPU.
02:08 PM memfrob: The link you posted has a Vortex86MX+ CPU in it, and wikipedia isn't exactly clear which ones have what.
02:13 PM andypugh: I was given it as a freeby by the manufacturer a long time ago.
02:14 PM andypugh: And I mean a _long_ time.
03:02 PM memfrob: andypugh, blacklisting the options now, before you compile the kernel let me post a second kernel patch to go with the RTAI one
03:02 PM memfrob: it's not a complete list but it's something to get started
03:03 PM andypugh: OK.
03:03 PM andypugh: Vanilla kernel is still compiling
03:05 PM memfrob: vanilla?
03:05 PM memfrob: You don't need a 4.14 vanilla kernel to build a 4.14 RTAI kernel
03:35 PM andypugh: memfrob: I thought you said I had to be running the 4.14 kernel ?
03:38 PM memfrob: To build RTAI itself, you need to be booted into your RTAI enabled kernel.
03:38 PM memfrob: The kernel version itself is a bit irrelevant but right now I only support 4.14.130
03:38 PM andypugh: Ah, right.
03:39 PM memfrob: You can build the RTAI kernel with whatever kernel you want, but once you start building RTAI and it's modules, that's when you need to be using your RTAI kernel
03:39 PM andypugh: So, download vanilla, patch with the RTAI patch from your for-next, then compile?
03:39 PM memfrob: Exactly.
03:39 PM andypugh: I misunderstood.
03:40 PM memfrob: I'm just finishing up the Kconfig fixes.
03:42 PM andypugh: Is that for the kernel compile?
03:43 PM andypugh: ie, I should hold off from compiling that until you are done?
03:50 PM memfrob: Yes.
03:51 PM memfrob: I should probably do this before anyone else builds using it so they don't turn on problematic options.
03:52 PM memfrob: or use their distro kernel config without modifying it. With this patch, you can pretty much blow it up and it should work
03:52 PM memfrob: lots of depends on !IPIPE lines lol
03:52 PM memfrob: This is one of those things that should end up in RTAI mainline but never will.
03:53 PM andypugh: RTAI.org seem to think that if you don’t understand the meaning of every possible kernel option you don’t deserve to use their patch.
03:53 PM memfrob: Exactly!
03:54 PM memfrob: If only I had commit rights!
04:00 PM memfrob: Ok run git pull and patch the kernel with 0002 on top of 0001
04:00 PM memfrob: https://github.com/NTULINUX/RTAI/commit/ffeb6896c2d6c110f436b514c21a2ed62db81408
04:02 PM memfrob: There's still some kernel debugging options on that I need to go through but that's going to take awhile and I'll work on that another day. In the mean time, just don't have a lot of those on, like RCU debugging, kernel tracing, or memory/VM debugging
04:04 PM memfrob: Kernel hacking, the only options that should be on are panic on oops, filter access and I/O access to /dev/mem, doublefault exception handler and "allow gcc to uninline functions marked inline"
04:05 PM memfrob: lock debugging, runtime testing, all that off. in compile-time checks and compiler options, have all that off too, "Strip assembler-generated symbols during link" is fine.
04:05 PM memfrob: guess unwinder is the best btw.
04:05 PM andypugh: OK, let me try all that. This will take some time.
04:06 PM memfrob: I know, I'm sorry about that. It'd take me hours to disable the countless debugging features via kconfig
04:06 PM memfrob: there's hundreds
04:08 PM andypugh: That’s wierd
04:09 PM andypugh: I managed to make menuconfg work, (though oddly) and now it’s stopped working again, once more asking me to install ncurses-devel (incidentally, that isn’t a package)
04:10 PM andypugh: Ah, no, I am being dim.
04:10 PM andypugh: “Install ncurses (ncurses-devel) and try again.” is Linux code for “use sudo”
04:11 PM memfrob: if you're building in /usr/src yes you need sudo
04:11 PM memfrob: regular users don't have write access to /usr/src
04:12 PM andypugh: I just wish that the error message was a bit more indicative of the actual problem
04:13 PM andypugh: Are the debugging options in a sensible place, or scattered everywhere?
04:25 PM memfrob: all in the kernel hacking section
04:29 PM andypugh: On a different tack: https://forum.linuxcnc.org/49-basic-configuration/28417-need-help-homing-sequence-in-h-bot-corexy-system?start=10#137928
04:30 PM andypugh: cradek: jepler: seb_kuzminsky: (I would shout to Dewey, were he here) Is my suggestion of putting the homing-magic for CoreXY in the kins off the mark?
04:31 PM andypugh: memfrob: In file included from ./include/linux/kernel.h:10:0,
04:31 PM andypugh: from arch/x86/entry/common.c:10:
04:31 PM andypugh: arch/x86/entry/common.c: In function ‘syscall_return_slowpath’:
04:31 PM andypugh: arch/x86/entry/common.c:297:5: error: implicit declaration of function ‘ipipe_root_nr_syscalls’ [-Werror=implicit-function-declaration]
04:31 PM andypugh: ipipe_root_nr_syscalls(ti)) &&
04:31 PM andypugh: That’s a config thing?
04:36 PM andypugh: At the risk of sounding stupid: is “IPIPE” the same as “Interrupt Pipe Line” ?
04:46 PM andypugh: memfrob: OK, through that. Now: /include/linux/pci.h:453:12: error: ‘struct pci_dev’ has no member named ‘physfn’; did you mean ‘is_physfn’?
04:49 PM andypugh: Maybe a hangover, I will try a make clean then make
04:49 PM andypugh: No, not that
04:53 PM memfrob: Is IPIPE enabled?
04:54 PM memfrob: Processor type and features -> Interrupt pipeline
04:54 PM memfrob: There's a built in compiling error that isn't fixed yet when IPIPE is disabled.
04:55 PM memfrob: You could be running into that.
04:56 PM memfrob: Yeah IPIPE is disabled, I got the same thing on my end.
04:56 PM memfrob: That error is in mainline Xenomai btw.
04:56 PM memfrob: if the kernel is patched with IPIPE but IPIPE is disabled, it's broken.
04:58 PM memfrob: I should make IPIPE default y in another kernel patch so this doesn't happen unless someone turns off IPIPE manually.
05:03 PM andypugh: I turned IPIPE on, and still get the physfn thing. Is that separate?
05:03 PM andypugh: https://www.spinics.net/lists/linux-pci/msg70124.html
05:03 PM andypugh: Sugests something to try
05:06 PM andypugh: Hmm:
05:06 PM andypugh: Symbol: PCI_ATS [=n] x
05:06 PM andypugh: x Type : boolean x
05:06 PM andypugh: x Defined at drivers/pci/Kconfig:83 x
05:06 PM andypugh: x Selected by: PCI_IOV [=y] && PCI [=y] && !IPIPE [=y] || PCI_PRI [=n] && PCI [=y] && !IPIPE [=y] || PCI_PASID [=n] && PCI [=y] && !IPIPE [=y]
05:06 PM andypugh: !IPIPE=y ?
05:08 PM andypugh: <stumped>
05:46 PM memfrob: How is IOV on?
05:47 PM memfrob: config PCI_IOV bool "PCI IOV support" depends on PCI && !IPIPE
05:47 PM memfrob: I can't even turn that on.
05:48 PM memfrob: Symbol: PCI_ATS [=n] Selected by: PCI_IOV [=n] && PCI [=y] && !IPIPE [=y]
05:49 PM memfrob: You somehow have IOV enabled
05:50 PM memfrob: Kconfig should have caught that and PCI_IOV should be disabled.
05:50 PM memfrob: Makes me wonder how many other options are going to slip through..
05:52 PM andypugh: The whole kernel config puzzle seems too large for the human brain.
05:52 PM memfrob: andypugh, you somehow got Kconfig to go full stupid, in make menuconfig can you go into the Bus options (PCI etc.) and disable IOV?
05:52 PM andypugh: I was actually going to attack Kconfig with a text editor :-)
05:52 PM memfrob: Kconfig is already attacked
05:52 PM memfrob: That's what that patch was.
05:53 PM memfrob: You have an option on, which I turned off when IPIPE gets enabled
05:53 PM andypugh: OK, now to find Bus options in the stupid menu tree
05:53 PM memfrob: top level
05:53 PM memfrob: power management and ACPI options, below that is bus options
05:54 PM memfrob: IOV should show up.
05:54 PM memfrob: if it doesn't then somehow your config got all broken.
05:54 PM andypugh: IOV might be there….
05:55 PM memfrob: by design, you shouldn't have the option to turn IOV on or off.
05:55 PM andypugh: x Type : boolean x
05:55 PM andypugh: x Prompt: PCI IOV support x
05:55 PM andypugh: x Location: x
05:55 PM andypugh: x (3) -> Bus options (PCI etc.)
05:55 PM memfrob: HEH, IT SHOWED UP
05:56 PM andypugh: Yes, but no
05:56 PM andypugh: The search really does a poor job of telling you where to find stuff, as most things are given utterly different names
05:57 PM memfrob: The config itself is called PCI_IOV - it shows up in make menuconfig for you?
05:57 PM memfrob: Have you tried running make olddefconfig?
05:57 PM andypugh: No
05:57 PM memfrob: oh it doesn't.
05:57 PM memfrob: in your output from earlier it says Selected by: PCI_IOV [=y]
05:58 PM andypugh: Yes, it says that. But it isn’t actually true.
05:58 PM memfrob: ok.
05:58 PM memfrob: run grep "PCI_IOV" .config inside your kernel tree
05:59 PM memfrob: and grep "PCI_ATS" .config as well
05:59 PM memfrob: If ncurses is lying, I don't trust it
06:05 PM andypugh: https://imagebin.ca/v/4lyr9x2zyTzx
06:06 PM andypugh: And it says: Last login: Fri Jun 21 21:05:27 on console
06:06 PM memfrob: that look right.
06:06 PM andypugh: iMac:~ andypugh$ ssh -Y andypugh@harrison.local
06:06 PM memfrob: *looks
06:06 PM memfrob: oh crap, ASPM. forgot about that.
06:06 PM andypugh: andypugh@harrison.local's password:
06:10 PM andypugh: Oops
06:10 PM andypugh: I don’t know what you saw there. But I crashed my IRC client.
06:11 PM andypugh: It seems that copy-paste from ncurses is unwise
06:11 PM memfrob: heh!
06:12 PM memfrob: I updated that 2nd kernel patch
06:12 PM memfrob: so you're best off reverting and applying the updated 0002 patch after a git pull
06:14 PM andypugh: Yes I am in the middle of deleting all of /usr/src to start from scratch
06:14 PM memfrob: ok :)
06:15 PM memfrob: in the kernel source, before you start modifying anything in menuconfig, run make olddefconfig first
06:16 PM memfrob: cd /usr/src/linux && make mrproper && make olddefconfig && make menuconfig
06:16 PM memfrob: that should solve your problem
06:25 PM andypugh: Maybe it should, but it hasn’t
06:26 PM andypugh: Though, perhaps I did things in the wrong order?
06:29 PM andypugh: Where in that sequence do I patch?
06:31 PM andypugh: I have a feeling that olddefconfig isn’t helping: https://pastebin.ubuntu.com/p/WvF2Cmcdts/
06:35 PM memfrob: it is.
06:36 PM memfrob: there's always a few invalid symbols when running make olddefconfig across different kernel versions, olddefconfig fixes those
06:36 PM memfrob: it compiles here so I have no idea..
06:37 PM memfrob: I'm going to try importing the debian config on my end and see if it works
06:39 PM andypugh: I am googling PCI_IOV and feel like: https://xkcd.com/979/
06:40 PM memfrob: hopefully I can reproduce your problem on my end.
06:42 PM andypugh: I turned off PCI. Who needs PCI anyway?
06:42 PM memfrob: that won't even boot lol
06:43 PM andypugh: It will compile, that’s progress :-)
06:43 PM memfrob: i had more warnings than you did
06:43 PM andypugh: Yes, that’s “fixed” it. So is is something in PCI config.
06:44 PM memfrob: https://pastebin.ubuntu.com/p/8HtD3kwhcH/
06:46 PM andypugh: Well, I do see that… but not where it should be:
06:46 PM andypugh: https://imagebin.ca/v/4lz3KtWmnEb5
06:46 PM memfrob: lmao!
06:46 PM memfrob: I'm going to try turning off those problematic options
06:48 PM andypugh: Leaving ISA-style * off looks like it helped.
07:03 PM memfrob: I just saw a bunch of relocation errors...
07:04 PM memfrob: Fixed those. So there are undocumented problems with IPIPE from mainline that you will not discover unless you use a distro kernel config
07:04 PM memfrob: IA32 and X32 ABI must be off... I'm adding all of these to the kernel patch
07:04 PM memfrob: andypugh, thank you for testing this, you're helping make Xenomai and RTAI much better at what they do :)
07:05 PM memfrob: let's see if i hit any PCI errors..
07:05 PM memfrob: fingers crossed!
07:06 PM andypugh: So far compilation is going well. Turning off ISA-style in bus config rather bizarrely seems to bypass PCI_IOV
07:06 PM memfrob: CONFIG_ISA_DMA_API=y here.
07:17 PM memfrob: just hit the PCI part now
07:23 PM memfrob: it built here with ISA DMA
07:30 PM memfrob: andypugh, I will be pushing a new patch later on tonight but leaving now
07:31 PM memfrob: sorry for all the troubles, thought this was more plug-and-play than I thought.
07:31 PM andypugh: Nothing in code survives contact with the users
08:08 PM Tom_itx is now known as Tom_L
08:43 PM memfrob: ain't that the truth!
09:23 PM CMorley: andypugh: Any opinion on giving push rights to Phillip Carter? I don't know who can set that up IIRC Chris or Jeff did it.
09:54 PM memfrob: he's still awake?
11:11 PM memfrob: I think I got em: https://github.com/NTULINUX/RTAI/commit/ed6329184b3cd64d44a45606853aec627a1956ba
11:30 PM memfrob: if there's any problematic options remaining, let me know, that should be all of them.