From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen: arm: fully implement multicall interface. Date: Tue, 01 Apr 2014 13:05:19 +0100 Message-ID: <533AAB7F.4070009@linaro.org> References: <1396015649-5886-1-git-send-email-ian.campbell@citrix.com> <1396017905.8670.71.camel@kazak.uk.xensource.com> <53358EBE.4060303@linaro.org> <1396019237.8670.78.camel@kazak.uk.xensource.com> <53399A03.9020105@eu.citrix.com> <533A8153.3050708@linaro.org> <1396344497.8667.57.camel@kazak.uk.xensource.com> <533A991F.9060504@linaro.org> <1396349370.8667.94.camel@kazak.uk.xensource.com> <533A9C65.8010806@linaro.org> <1396350957.8667.108.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1396350957.8667.108.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, George Dunlap , tim@xen.org, xen-devel@lists.xen.org, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 04/01/2014 12:15 PM, Ian Campbell wrote: > On Tue, 2014-04-01 at 12:00 +0100, Julien Grall wrote: >> On 04/01/2014 11:49 AM, Ian Campbell wrote: >>> On Tue, 2014-04-01 at 11:46 +0100, Julien Grall wrote: >>>> On 04/01/2014 10:28 AM, Ian Campbell wrote: >>>>> On Tue, 2014-04-01 at 10:05 +0100, Julien Grall wrote: >>>>>> Out-of-context, I've noticed that most of trap failure will kill the >>>>>> domain. From the ARM ARM , if a coprocessor instruction is failing, we >>>>>> should generate an Undefined Instruction exception (see P.7.5). >>>>> >>>>> You mean HSR_EC_CP15_32, HSR_EC_CP15_64 and HSR_EC_SYSREG? >>>>> >>>>> I've not checked but I think we only ask for traps for things which we >>>>> are supposed to be able to handle, so anything which is trapped which we >>>>> can't handle is a bug and would indicate the guest doing something >>>>> funky. >>>> >>>> Right, but if the emulation of the instruction fails (see >>>> vtimer_emulate, do_trap_psci,...), Xen will destroy the domain instead >>>> of sending an UNDEF exception. >>> >>> My point was that the emulation should never fail... >> >> The emulation can fail if the guest decides to write on an RO register. > > Hrm yes, I'd forgotten that case. > > Is that an undef or some other sort of exception? Perhaps it depends on > the cp register whether it faults or is ignored? In either case that > seems to suggest that it is up to the specific handler to inject the > correct kind of exception and return an appropriate error code to the > generic handler. The default exception is "undefined instruction". I didn't find any specific exception following the coprocessor. Actually the only ways to kill the domain in traps.c: - we try to access in read (resp. write) on WO (resp. RO) registers - the hypercall tags is wrong - the PSCI function is not implemented I think we can replace every (?) domain_crash_synchronous by inject_undef*_exception. -- Julien Grall