mbox series

[Xen-devel,v3,0/4] xen/arm: Inject an exception to the guest rather than crashing it

Message ID 20180202101444.3510-1-julien.grall@arm.com
Headers show
Series xen/arm: Inject an exception to the guest rather than crashing it | expand

Message

Julien Grall Feb. 2, 2018, 10:14 a.m. UTC
Hi all,

This small series replaces all call to domain_crash_synchronous by injecting
an exception to the guest.

This will result to a nicer trace from the guest (no need to manually walk
the stack) and give a chance to the guest to give a bit more information on
what it was doing.

Cheers,

Julien Grall (4):
  xen/arm: traps: Merge try_handle_mmio() and handle_mmio()
  xen/arm: io: Distinguish unhandled IO from aborted one
  xen/arm: Don't crash domain on bad MMIO emulation
  xen/arm: Don't crash the domain on invalid HVC immediate

 xen/arch/arm/io.c          | 65 ++++++++++++++++++++++++++++++++---------
 xen/arch/arm/traps.c       | 72 +++++++++++++++-------------------------------
 xen/arch/arm/vgic-v2.c     |  2 --
 xen/arch/arm/vgic-v3-its.c |  3 --
 xen/arch/arm/vgic-v3.c     |  8 ------
 xen/arch/arm/vpl011.c      |  2 --
 xen/include/asm-arm/mmio.h | 11 ++++++-
 7 files changed, 84 insertions(+), 79 deletions(-)

Comments

Stefano Stabellini Feb. 2, 2018, 10:48 p.m. UTC | #1
Committed, thanks

On Fri, 2 Feb 2018, Julien Grall wrote:
> Hi all,
> 
> This small series replaces all call to domain_crash_synchronous by injecting
> an exception to the guest.
> 
> This will result to a nicer trace from the guest (no need to manually walk
> the stack) and give a chance to the guest to give a bit more information on
> what it was doing.
> 
> Cheers,
> 
> Julien Grall (4):
>   xen/arm: traps: Merge try_handle_mmio() and handle_mmio()
>   xen/arm: io: Distinguish unhandled IO from aborted one
>   xen/arm: Don't crash domain on bad MMIO emulation
>   xen/arm: Don't crash the domain on invalid HVC immediate
> 
>  xen/arch/arm/io.c          | 65 ++++++++++++++++++++++++++++++++---------
>  xen/arch/arm/traps.c       | 72 +++++++++++++++-------------------------------
>  xen/arch/arm/vgic-v2.c     |  2 --
>  xen/arch/arm/vgic-v3-its.c |  3 --
>  xen/arch/arm/vgic-v3.c     |  8 ------
>  xen/arch/arm/vpl011.c      |  2 --
>  xen/include/asm-arm/mmio.h | 11 ++++++-
>  7 files changed, 84 insertions(+), 79 deletions(-)
> 
> -- 
> 2.11.0
>
Julien Grall Feb. 2, 2018, 11:10 p.m. UTC | #2
On 02/02/2018 22:48, Stefano Stabellini wrote:
> Committed, thanks

I know you acked/reviewed all the patches, but it would have been nice 
to wait/give more feedback regarding Andre's valid point on patch #4.

Cheers,

> On Fri, 2 Feb 2018, Julien Grall wrote:
>> Hi all,
>>
>> This small series replaces all call to domain_crash_synchronous by injecting
>> an exception to the guest.
>>
>> This will result to a nicer trace from the guest (no need to manually walk
>> the stack) and give a chance to the guest to give a bit more information on
>> what it was doing.
>>
>> Cheers,
>>
>> Julien Grall (4):
>>    xen/arm: traps: Merge try_handle_mmio() and handle_mmio()
>>    xen/arm: io: Distinguish unhandled IO from aborted one
>>    xen/arm: Don't crash domain on bad MMIO emulation
>>    xen/arm: Don't crash the domain on invalid HVC immediate
>>
>>   xen/arch/arm/io.c          | 65 ++++++++++++++++++++++++++++++++---------
>>   xen/arch/arm/traps.c       | 72 +++++++++++++++-------------------------------
>>   xen/arch/arm/vgic-v2.c     |  2 --
>>   xen/arch/arm/vgic-v3-its.c |  3 --
>>   xen/arch/arm/vgic-v3.c     |  8 ------
>>   xen/arch/arm/vpl011.c      |  2 --
>>   xen/include/asm-arm/mmio.h | 11 ++++++-
>>   7 files changed, 84 insertions(+), 79 deletions(-)
>>
>> -- 
>> 2.11.0
>>
Andre Przywara Feb. 5, 2018, 9:54 a.m. UTC | #3
Hi,

On 02/02/18 23:10, Julien Grall wrote:
> 
> 
> On 02/02/2018 22:48, Stefano Stabellini wrote:
>> Committed, thanks
> 
> I know you acked/reviewed all the patches, but it would have been nice
> to wait/give more feedback regarding Andre's valid point on patch #4.

I think that's fine. I didn't have time to answer on Julien's reply, but
I think given the options he presented injecting an UNDEF is the best
way to handle those thing. At least I couldn't find any architectural
reasoning that would deny that and I don't have a better idea.

Cheers,
Andre.

>> On Fri, 2 Feb 2018, Julien Grall wrote:
>>> Hi all,
>>>
>>> This small series replaces all call to domain_crash_synchronous by
>>> injecting
>>> an exception to the guest.
>>>
>>> This will result to a nicer trace from the guest (no need to manually
>>> walk
>>> the stack) and give a chance to the guest to give a bit more
>>> information on
>>> what it was doing.
>>>
>>> Cheers,
>>>
>>> Julien Grall (4):
>>>    xen/arm: traps: Merge try_handle_mmio() and handle_mmio()
>>>    xen/arm: io: Distinguish unhandled IO from aborted one
>>>    xen/arm: Don't crash domain on bad MMIO emulation
>>>    xen/arm: Don't crash the domain on invalid HVC immediate
>>>
>>>   xen/arch/arm/io.c          | 65
>>> ++++++++++++++++++++++++++++++++---------
>>>   xen/arch/arm/traps.c       | 72
>>> +++++++++++++++-------------------------------
>>>   xen/arch/arm/vgic-v2.c     |  2 --
>>>   xen/arch/arm/vgic-v3-its.c |  3 --
>>>   xen/arch/arm/vgic-v3.c     |  8 ------
>>>   xen/arch/arm/vpl011.c      |  2 --
>>>   xen/include/asm-arm/mmio.h | 11 ++++++-
>>>   7 files changed, 84 insertions(+), 79 deletions(-)
>>>
>>> -- 
>>> 2.11.0
>>>
>