[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 6/7] accel/kvm: Let KVM_EXIT_MMIO return error
From: |
Peter Maydell |
Subject: |
Re: [RFC PATCH v2 6/7] accel/kvm: Let KVM_EXIT_MMIO return error |
Date: |
Thu, 21 May 2020 16:45:43 +0100 |
On Thu, 21 May 2020 at 16:39, Paolo Bonzini <address@hidden> wrote:
>
> On 18/05/20 18:01, Peter Maydell wrote:
> > The "right" answer is that the kernel should enhance the KVM_EXIT_MMIO
> > API to allow userspace to say "sorry, you got a bus error on that
> > memory access the guest just tried" (which the kernel then has to
> > turn into an appropriate guest exception, or ignore, depending on
> > what the architecture requires.) You don't want to set ret to
> > non-zero here, because that will cause us to VM_STOP, and I
> > suspect that x86 at least is relying on the implict RAZ/WI
> > behaviour it currently gets.
>
> Yes, it is. It may even be already possible to inject the right
> exception (on ARM) through KVM_SET_VCPU_EVENTS or something like that, too.
Yeah, in theory we could deliver an exception from userspace
by updating all the register state, but I think the kernel really
ought to do it both (a) because it's just a neater API to do it
that way round and (b) because the kernel is the one that has
the info about the faulting insn that it might need for things
like setting up a syndrome register value.
thanks
-- PMM
- [PATCH v2 2/7] exec: Propagate cpu_memory_rw_debug() error, (continued)
- [PATCH v2 2/7] exec: Propagate cpu_memory_rw_debug() error, Philippe Mathieu-Daudé, 2020/05/18
- [PATCH v2 3/7] disas: Let disas::read_memory() handler return EIO on error, Philippe Mathieu-Daudé, 2020/05/18
- [PATCH v2 4/7] hw/elf_ops: Do not ignore write failures when loading ELF, Philippe Mathieu-Daudé, 2020/05/18
- [PATCH v2 5/7] hw/arm/boot: Abort if set_kernel_args() fails, Philippe Mathieu-Daudé, 2020/05/18
- [RFC PATCH v2 6/7] accel/kvm: Let KVM_EXIT_MMIO return error, Philippe Mathieu-Daudé, 2020/05/18
- [RFC PATCH v2 7/7] hw/core/loader: Assert loading ROM regions succeeds at reset, Philippe Mathieu-Daudé, 2020/05/18
- [PATCH v2 1/7] exec: Let address_space_read/write_cached() propagate MemTxResult, Philippe Mathieu-Daudé, 2020/05/18
- Re: [PATCH v2 0/7] exec/memory: Enforce checking MemTxResult values, Paolo Bonzini, 2020/05/21