[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] unhandled word causes Xen crash with recent Linux kernels, was: Re: [PATCH v2 05/11] xen/arm: vgic: Properly emulate the full register



On Wed, 2015-11-25 at 12:15 +0000, Stefano Stabellini wrote:
> Hi Shannon,
> 
> On Wed, 25 Nov 2015, Shannon Zhao wrote:
> > Upstream Linux kernel applies below patch which will write
> > GICD_ICACTIVER. But since Xen doesn't support it, so it will cause Dom0
> > initializes GIC failed.
> > 
> > 0eece2b22849c90b730815c893425a36b9d10fd5 (irqchip/gic: Make sure all
> > interrupts are deactivated at boot)
> > 
> > (XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER4
> > (XEN) traps.c:2447:d0v0 HSR=0x93860046 pc=0xffffffc0008d63f0
> > gva=0xffffff8000004384 gpa=0x0000002f000384
> > (XEN) DOM0: Unhandled fault: ttbr address size fault (0x96000000) at
> > 0xffffff8000004384
> > (XEN) DOM0: Internal error: : 96000000 [#1] PREEMPT SMP
> > (XEN) DOM0: Modules linked in:
> > (XEN) DOM0: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc2+ #364
> > (XEN) DOM0: Hardware name: (null) (DT)
> > (XEN) DOM0: task: ffffffc000969970 ti: ffffffc00095c000 task.ti:
> > ffffffc00095c000
> > (XEN) DOM0: PC is at gic_dist_config+0x78/0xa0
> > (XEN) DOM0: LR is at __gic_init_bases+0x240/0x2bc
> > 
> > Do we have a plan to fix this?
> 
> Thanks for the reporting the issue, I can reproduce the problem.ÂÂGiven
> that this is a very serious regression and that we cannot really "fix"
> the Linux side because Linux is not doing anything wrong, I think we
> have to go with a very simple change, something we can easily backport
> to all past Xen releases.
> 
> I suggest we turn the "unhandled word write" into a write_ignore, see
> below:

As discussed IRL this might be tolerable as a patch intended for
backporting purposes, but I would want to see it in a series along with one
or more not-for-backport patches which actually makes the register work as
it should.

> 
> ---
> 
> xen/arm: ignore GICD_ICACTIVER writes
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> 
> diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
> index f7d784b..8585c44 100644
> --- a/xen/arch/arm/vgic-v2.c
> +++ b/xen/arch/arm/vgic-v2.c
> @@ -332,11 +332,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v,
> mmio_info_t *info,
> ÂÂÂÂÂÂÂÂÂreturn 0;
> Â
> ÂÂÂÂÂcase GICD_ICACTIVER ... GICD_ICACTIVERN:
> -ÂÂÂÂÂÂÂÂif ( dabt.size != DABT_WORD ) goto bad_width;
> -ÂÂÂÂÂÂÂÂprintk(XENLOG_G_ERR
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ"%pv: vGICD: unhandled word write %#"PRIregister" to
> ICACTIVER%d\n",
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂv, r, gicd_reg - GICD_ICACTIVER);
> -ÂÂÂÂÂÂÂÂreturn 0;
> +ÂÂÂÂÂÂÂÂ/* we should really be implementing this */
> +ÂÂÂÂÂÂÂÂgoto write_ignore_32;
> Â
> ÂÂÂÂÂcase GICD_ITARGETSR ... GICD_ITARGETSR + 7:
> ÂÂÂÂÂÂÂÂÂ/* SGI/PPI target is read only */
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index b5249ff..6d77373 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -421,11 +421,8 @@ static int __vgic_v3_distr_common_mmio_write(const
> char *name, struct vcpu *v,
> ÂÂÂÂÂÂÂÂÂreturn 0;
> Â
> ÂÂÂÂÂcase GICD_ICACTIVER ... GICD_ICACTIVERN:
> -ÂÂÂÂÂÂÂÂif ( dabt.size != DABT_WORD ) goto bad_width;
> -ÂÂÂÂÂÂÂÂprintk(XENLOG_G_ERR
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ"%pv: %s: unhandled word write %#"PRIregister" to
> ICACTIVER%d\n",
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂv, name, r, reg - GICD_ICACTIVER);
> -ÂÂÂÂÂÂÂÂreturn 0;
> +ÂÂÂÂÂÂÂÂ/* we should really be implementing this */
> +ÂÂÂÂÂÂÂÂgoto write_ignore_32;
> Â
> ÂÂÂÂÂcase GICD_IPRIORITYR ... GICD_IPRIORITYRN:
> ÂÂÂÂÂÂÂÂÂif ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto
> bad_width;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.