Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732221 > unrolled thread

Re: [PATCH v6 5/7] arm64: kvm: route synchronous external abort exceptions to el2

Started bygengdongjiu <gengdongjiu@huawei.com>
First post2017-09-14 13:20 +0200
Last post2017-09-14 14:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v6 5/7] arm64: kvm: route synchronous external abort  exceptions to el2 gengdongjiu <gengdongjiu@huawei.com> - 2017-09-14 13:20 +0200
    Re: [PATCH v6 5/7] arm64: kvm: route synchronous external abort exceptions  to el2 James Morse <james.morse@arm.com> - 2017-09-14 14:40 +0200

#1732221 — Re: [PATCH v6 5/7] arm64: kvm: route synchronous external abort exceptions to el2

Fromgengdongjiu <gengdongjiu@huawei.com>
Date2017-09-14 13:20 +0200
SubjectRe: [PATCH v6 5/7] arm64: kvm: route synchronous external abort exceptions to el2
Message-ID<upAlA-4iQ-13@gated-at.bofh.it>
James,

On 2017/9/8 0:31, James Morse wrote:
> KVM already handles external aborts from lower exception levels, no more work
> needs doing for TEA.
If it is firmware first solution, that is SCR_EL3.EA=1, all SError interrupt and synchronous External
Abort exceptions are taken to EL3, so EL3 firmware will handle it, KVM no needs to handle it.

HCR_EL3.TEA is only for EL3 to check its value to decide to jump to hypervisor or kernel.

> 
> What happens when a guest access the RAS-Error-Record registers?
> 
> Before we can set HCR_EL2.TERR I think we need to add some minimal emulation for
> the registers it traps. Most of them should be RAZ/WI, so it should be
> straightforward. (I think KVMs default is to emulate an undef for unknown traps).
Today I added the support to do some minimal emulation for RAS-Error-Record registers, thanks
for the good suggestion.

> 
> Eventually we will want to back this with a page of memory that lets
> Qemu/kvmtool configure what the guest can see. (i.e. the emulated machine's
> errors for kernel-first handling.)

[toc] | [next] | [standalone]


#1732251 — Re: [PATCH v6 5/7] arm64: kvm: route synchronous external abort exceptions to el2

FromJames Morse <james.morse@arm.com>
Date2017-09-14 14:40 +0200
SubjectRe: [PATCH v6 5/7] arm64: kvm: route synchronous external abort exceptions to el2
Message-ID<upBB0-52v-11@gated-at.bofh.it>
In reply to#1732221
Hi gengdongjiu,

On 14/09/17 12:12, gengdongjiu wrote:
> On 2017/9/8 0:31, James Morse wrote:
>> KVM already handles external aborts from lower exception levels, no more work
>> needs doing for TEA.

> If it is firmware first solution, that is SCR_EL3.EA=1, all SError interrupt and synchronous External
> Abort exceptions are taken to EL3, so EL3 firmware will handle it, KVM no needs to handle it.

... and presumably your firmware generates a fake-Synchronous-external-abort to
hand to EL2 as an APEI SEA notification? My point: this is fine, KVM already
handles synchronous-external aborts, no more work needed for this trap, (in
contrast to the TERR, which you've fixed)


> HCR_EL3.TEA is only for EL3 to check its value to decide to jump to hypervisor or kernel.

HCR_EL3!?!


>> What happens when a guest access the RAS-Error-Record registers?
>>
>> Before we can set HCR_EL2.TERR I think we need to add some minimal emulation for
>> the registers it traps. Most of them should be RAZ/WI, so it should be
>> straightforward. (I think KVMs default is to emulate an undef for unknown traps).

> Today I added the support to do some minimal emulation for RAS-Error-Record registers, thanks
> for the good suggestion.

Thanks. Software has the bad habit of living much longer than we think, if KVM
traps part of the architecture then we have to emulate it... Some bright spark
might boot a future Linux-v4.42 guest on a Linux-v4.16 host.

I had a run through the RAS spec: if we make ERRIDR_EL1 RAZ/WI then we can do
the same with ERRSELR_EL1. Then following the rules for 'If ERRSELR_EL1.SEL is
[>=]  ERRIDR_EL1.NUM' that makes the ERX* registers RAZ/WI too.


>> Eventually we will want to back this with a page of memory that lets
>> Qemu/kvmtool configure what the guest can see. (i.e. the emulated machine's
>> errors for kernel-first handling.)


Thanks,

James

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web