Messages in this thread |  | | Subject | Re: [PATCH 1/1] KVM: inject data abort if instruction cannot be decoded | From | Alexander Graf <> | Date | Fri, 6 Sep 2019 16:12:51 +0200 |
| |
On 06.09.19 15:50, Peter Maydell wrote: > On Fri, 6 Sep 2019 at 14:41, Alexander Graf <graf@amazon.com> wrote: >> On 06.09.19 15:31, Peter Maydell wrote: >>> (b) we try to reuse the code we already have that does TCG exception >>> injection, which might or might not be a design mistake, and >> >> That's probably a design mistake, correct :) > > Well, conceptually it's not necessarily a bad idea, because > in both cases what we're doing is "change the system register > state (PC, ESR_EL1, ELR_EL1 etc) so that the CPU looks like > it's just taken an exception"; but some of what the > TCG code needs to do isn't necessary for KVM and all of it > was not written with the idea of KVM in mind at all...
Yes, and it probably makes sense to model the QEMU internal API similarly, so that exception generating code does not have to distinguish.
However, it's much easier for KVM to ensure exception prioritization as well as internal state synchronization. Conceptually, as you've seen, it really doesn't make a lot of sense to pull register state from KVM, wiggle it and then push it down when KVM has awareness of the same transformation anyway.
So I guess the path is clear: Create a generic interface for exception injection and a separate patch similar to what Christoffer already posted with the new CAP to route illegal MMIO traps into user space.
Connecting the two dots in user space really should be trivial then.
(famous last words)
Alex
Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879
|  |