All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Vijay Kilari <vijay.kilari@gmail.com>
Subject: Re: unknown gpa read address error for GICv3 re-distributor register access.
Date: Mon, 28 Sep 2015 10:42:42 +0100	[thread overview]
Message-ID: <56090B92.3020806@citrix.com> (raw)
In-Reply-To: <5FC3163CFD30C246ABAA99954A238FA81728A026@lhreml504-mbs>



On 28/09/2015 09:36, Shameerali Kolothum Thodi wrote:
> Hi All,

Hi,


> I am working on enabling Xen on our HIPO5 board(http://lists.xenproject.org/archives/html/xen-users/2015-07/msg00090.html)
>
> Since the board has got GIC/ITS, tried this ITS  patch series (https://github.com/vijaykilari/its_v6/commits/stating_its_v6).

The ITS series is not upstream and unless your PCI device can't work 
without MSI I would advise you to first boot Xen and DOM0 without ITS. 
Once you have a working base, you can add the ITS series.

Although, use the latest version i.e v7: 
https://github.com/vijaykilari/its_v6/tree/staging_its_v7.

>
> The board has got 16 cores. The dts file for the GIC is as below.
>
>
>          gic: interrupt-controller@8d000000 {
>                  compatible = "hisilicon,gic-v3";

This compatible string is not supported by Xen and below your log shows 
that your tree is dirty. What's the difference between staging and your 
tree?

>                  #interrupt-cells = <3>;
>                  #address-cells = <2>;
>                  #size-cells = <2>;
>                  ranges;
>                  interrupt-controller;
>                  #redistributor-regions = <1>;
>                  redistributor-stride = <0x0 0x30000>;

The GICv3 driver reads an 32 byte value for this field. It seems to be a 
mistake in our implementation (will send a patch for it).

Although I don't think it's affecting your problem because Xen seems to 
retrieve the correct stride:

  (XEN) GICv3 initialization:
  (XEN)       gic_dist_addr=0x0000008d000000
  (XEN)       gic_maintenance_irq=25
  (XEN)       gic_rdist_stride=30000

>                  reg = <0x0 0x8d000000 0 0x10000>,       /* GICD */
>                        <0x0 0x8d100000 0 0x300000>,      /* GICR c */
>                        <0x0 0xfe000000 0 0x10000>,       /* GICC */
>                        <0x0 0xfe010000 0 0x10000>,       /* GICH */
>                        <0x0 0xfe020000 0 0x10000>;       /* GICV */
>                  interrupts = <1 9 0xff04>;

[...]

>          };
>
>
> It has got the re-distributor base as 0x8d1000000 and stride size as 0x30000.I have seen couple of issues that blocks my Dom0 boot attempt. The first issue is related to the Dom0 secondary cpu boot failure.
>
> This is what I believe is happening(Please correct me if my understanding is wrong).
> -Dom0 make the CPU1 on.
> -gic_secondary_init() -->gic_populate_rdist()  (irq-gic-v3.c)
>
> Here it tries to find the re-distributor address by reading the GICR_TYPER register.  Since we have the rdbase as 0x8d100000 and stride size as 0x30000, a read is issued at 0x8d130008.
>
> Please find the Xen log below(Full log is attached at the end).
>
> (XEN) d0v0: vGICR: unknown gpa read address 000000008d130008
> (XEN) traps.c:2447:d0v1 HSR=0x93c08006 pc=0xffffffc00032362c gva=0xffffff80000b0008 gpa=0x0000008d130008
> (XEN) DOM0: ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> (XEN) DOM0: CPU1: failed to come online
>
> vgic_v3_rdistr_mmio_read()
> {
> 	----
> 	v = get_vcpu_from_rdist(info->gpa, v, &offset);
> 	----
> }
> I think the function returns the offset as 0x20008 and vcpu as 0, instead what I am expecting is offset 0x8 and vcpu 1.

It seems that you are right. To get the offset in the region, we use 
stride - 1 which will give 0x2ffff for your platform.

The code to get the vCPU is only valid when there is only a bit set in 
the stride.

I'm not sure if we can turn the mask into modulo and division. I will 
try to see how I can fix it.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-09-28  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28  8:36 unknown gpa read address error for GICv3 re-distributor register access Shameerali Kolothum Thodi
2015-09-28  9:42 ` Julien Grall [this message]
2015-09-28 10:24   ` Shameerali Kolothum Thodi
2015-09-28 11:10     ` Julien Grall
2015-09-28 11:26       ` Shameerali Kolothum Thodi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56090B92.3020806@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=vijay.kilari@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.