On Wed, 15 Jan 2020 at 01:17, Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Tue, 2020-01-14 at 09:59 +0000, Peter Maydell wrote: > > Note that semihosting is not a "here's a handy QEMU feature" > > thing. It's an architecture-specific API and ABI, which should > > be defined somewhere in a standard external to QEMU. > > There is no such standard for powerpc today that I know of.
So you need to write one down somewhere. You're proposing an ABI which will be implemented by multiple implementors and used by multiple consumers. That needs a spec, not just code. I don't want to see more semihosting implementations added to QEMU that don't have a specification written down somewhere. The riscv single paragraph in their arch spec that vaguely says "works like arm semihosting" is not sufficient detail, incidentally. > Keith and I are somewhat of a different mind here. From the perspective > of the user of that API (picolibc is one), it's easier to deal with a > single one and have everybody inherit the same bugs. > > Now I understand the point of wanting to fix the mistakes made but I > would suggest we do so by proposing extensions to the existing one to > do so. The point about the mistakes is that you can't easily fix them by adding extensions, because the core of the biggest mistake is "we didn't provide a good way to allow extensions to be added and probed for by the user". So we had to implement an ugly and hard to implement mechanism instead. New architectures could mandate providing the good way from the start and avoid the painful-to-implement approach entirely. (I think RISCV has already missed this window of opportunity, which is a shame.) thanks -- PMM