Il 20/01/2013 00:22, Andreas Färber ha scritto: > Am 19.01.2013 23:06, schrieb Paolo Bonzini: >> Il 19/01/2013 19:11, Andreas Färber ha scritto: >>>>> The patches are mostly mechanical substitutions, and there is no >>>>> user-visible change---neither in total build time, nor in the files that >>>>> are linked into the executables. >>> Without having tested this yet I want to remind that it is necessary for >>> qom/cpu.c to be built twice >> >> Hmm, it's not anymore actually (since libuser was removed). It hasn't >> been built twice for a month and apparently nothing broke. > > I surely didn't ack that.
At the time I did the move, there was no conditional CPUState field (commit 8e98e2e80b92e08e79e27a0c20a172906cfa12d2). The only difference between the user and softmmu qom/cpu.c was that the user version ended up in libuser. ISTR I asked around about libuser, and the conclusion was that it was only needed for --enable-user-pie. > Have you actually tested linux-user to verify > it works? It might lead to unexpected CPUState field accesses. As I said, at the time I did the move there was no difference between the two. Now, I am indeed quite surprised that it works, but yes---it does, at least trivial /bin/ls. > You are judging based on master. I have some more code movements queued > (qom-cpu-8) and I believe it was Anthony who insisted on suppressing > those unneeded user-only fields even if they were unconditional in > CPU_COMMON before. > > qom/cpu.c is not intended to remain so small forever - any cpu_* code > that does not depend on CPUArchState can find a new home there. > cpu_interrupt() is being moved to qom/cpu.h and cpu_reset_interrupt() to > qom/cpu.c for instance. And I'm working on refactoring CPU VMState, that > either requires #ifdef'ery or lots of new stubs beyond what Eduardo added. You can place those in a qom/cpu-softmmu.c. What I care about is having an understandable build system. At some point we had 12 recursive -obj-y variables and a few other non-recursive ones. The interactions and inclusions were completely impossible to understand. Paolo