Wednesday, 2022-07-13

*** tpb <[email protected]> has joined #openrisc00:00
shornearnd: I tested setting IO_SPACE_LIMIT to zero, it seems to work, but looking at generated code I see ioport_map() will now always return zero06:48
arndyes, that is expected06:48
shornewhich looks to be because of: port &= IO_SPACE_LIMIT;06:48
arndanything calling this function should check for NULL return and either fail or return an error06:49
arndor have an alternative I mean06:49
shorneI don't use any drivers that do: ioport_map(), but wou;dnt that cause issues?...06:49
arndif IO_SPACE_LIMIT is set to 0, that means no I/O ports are supported, so you can only use hardware built in the last two decades06:50
shorneit seems I will not use any of those devices that do use ioport_map, so maybe its ok06:50
shorneif thats what you were expecting then, I got it :)06:50
arndI had a look at the device emulation in qemu the other day, to see if anything in there actually requires I/O ports06:50
arndthe main user is the PCI-ISA bridge on x86 PCs that is used to attach legacy PC devices like keyboard controller, floppy, soundblaster etc06:51
arndthe only one that you would likely see on a new architecture is the VGA display06:51
shorneI don't think so, I just grepped the kernel source for usages of ioport_map, I don't see any drivers I would be using. There is nothing that I recognized that would be in qemu06:52
shorneI think its safe06:52
arndand I think VGA can use either PIO or MMIO access, so you are still fine, or you just use a more modern graphical output06:52
shornealright cool, just wanted to sync up with you on that06:53
arndNiklas Schnelle was working on a series to add Kconfig dependencies to all device drivers that require PIO, so those can be left out from an allmodconfig build on s39006:53
arndthat is actually the best case I think, because nobody should care about most of those drivers, and the few drivers that people do care about should all have a fallback and work either way06:54
arndwe still try hard to keep PIO working on ARM to avoid regressions, but I always have a bad feeling about it because it just causes more problems that it's worth06:55
shorneyeah, and it causes confusion for new platforms I am sure thinking they need to support it06:57
shorneI see riscv adopted it06:57
arndright, I think the main advantage is that implementing PIO avoids the compile-time warnings that Niklas is  trying to avoid on s39007:26
arndin particular, clang correctly points out that an access to I/O ports turns into a NULL pointer dereference on s390, gcc currently doesn't notice this07:27
arnds390 has no way of supporting PIO in in their PCI host bridge hardware, so it would be silly to add it there07:28
arndan earlier patch from Niklas tried to just turn the accesses into nops, but torvalds didn't like that and said we should just disable those drivers07:28
shorneI see, Ill start looking at those patches, its interesting07:29
shorneI found it, reading, also there are some news articles too07:34
shornereading... it says co-developed by you07:35
shorneI wonder if it makes sense for "younger" architectures like riscv, microblaze to remove their support for ioports07:37
shornearnd: One other question, I don't think I need to define PCI_IOBASE, if I am not using PIO do I?  I am looking through how the kernel uses it and it seems all related to PIO only08:15
shorneI have left it defined as 0, and things seems to work fine08:15
arndright, if you have IO_SPACE_LIMIT set to zero, PCI_IOBASE does not matter08:16
shornethanks for confirming, thats what it looked like, it makes things simiple08:17
shorneNow I just need to think better resource allocation in the virt platform08:17
shornebut thats all controlled via device tree08:18
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc15:49
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Remote host closed the connection)15:50
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has joined #openrisc15:54
*** shorne <[email protected]> has quit IRC (Read error: Connection reset by peer)16:39
*** shorne <[email protected]> has joined #openrisc16:45
*** littlebobeep <littlebobeep!~alMalsamo@gateway/tor-sasl/almalsamo> has quit IRC (Ping timeout: 268 seconds)17:00

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!