xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org, Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH v3 7/9] xen/arm: vgic: Optimize the way to store the target vCPU in the rank
Date: Mon, 12 Oct 2015 12:28:52 +0100	[thread overview]
Message-ID: <561B9974.7060504@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1510121205530.1179@kaball.uk.xensource.com>

On 12/10/15 12:07, Stefano Stabellini wrote:
> On Mon, 12 Oct 2015, Julien Grall wrote:
>> On 12/10/15 11:41, Stefano Stabellini wrote:
>>> On Thu, 8 Oct 2015, Ian Campbell wrote:
>>>>> If the concern is the behavior is changed, I'm happy to rework this code
>>>>> to keep exactly the same behavior. I.e any 32-bit write containing
>>>>> a 0 byte will be ignored. This is not optimal but at least I'm not
>>>>> opening the pandora box of fixing every single error in the code touch
>>>>> by this series.
>>>>
>>>> I'm okay with the new behaviour, I think Stefano was willing to tolerate it
>>>> (based on <alpine.DEB.2.02.1510081220190.1179@kaball.uk.xensource.com>).
>>>>
>>>> So if we aren't going to fix it to DTRT WRT writing zero to a target then I
>>>> think we can go with the current variant and not change to ignoring any
>>>> word with a zero byte in it.
>>>  
>>> OK.
>>>
>>> BTW it would be interesting to see how real hardware behaves in this
>>> regard. I seem to recall that X-Gene was ignoring 0 writes too.
>>
>> What do you mean by 0 writes? Is it the write ignored if one byte is 0?
> 
> Yes, for either 32bit or 8bit writes.

I just gave a try on X-gene and any write is store even if it contains
a 0 byte:

(XEN) ITARGET56 = 0x1010101
(XEN)    w 0x2020200 r 0x2020200
(XEN)    w 0x4040004 r 0x4040004
(XEN)    w 0x8000808 r 0x8000808
(XEN)    w 0x101010 r 0x101010


diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 5841e59..743c9eb 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -279,6 +279,32 @@ static void __init gicv2_dist_init(void)
     for ( i = 32; i < nr_lines; i += 4 )
         writel_gicd(cpumask, GICD_ITARGETSR + (i / 4) * 4);
 
+    for ( i = 32; i < nr_lines; i += 4 )
+    {
+        int n = i / 4;
+        int j = 0;
+        unsigned int reg = GICD_ITARGETSR + (i / 4) * 4;
+
+        printk("ITARGET%u = 0x%x\n", n, readl_gicd(reg));
+
+        for ( j = 0; j < 4; j++ )
+        {
+            uint32_t tmp = 1 << (j + 1);
+
+            tmp |= tmp << 8;
+            tmp |= tmp << 16;
+
+            /* Mask the field j */
+            tmp &= ~((0xff) << (j * 8));
+
+            writel_gicd(tmp, reg);
+
+            printk("\t w 0x%x r 0x%x\n", tmp, readl_gicd(reg));
+        }
+    }
+
+    while (1);
+
     /* Default priority for global interrupts */
     for ( i = 32; i < nr_lines; i += 4 )
         writel_gicd(GIC_PRI_IRQ << 24 | GIC_PRI_IRQ << 16 |

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-10-12 11:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 14:41 [PATCH v3 0/9] xen/arm: vgic: Support 32-bit access for 64-bit register Julien Grall
2015-10-07 14:41 ` [PATCH v3 1/9] xen/arm: io: remove mmio_check_t typedef Julien Grall
2015-10-07 14:41 ` [PATCH v3 2/9] xen/arm: io: Extend write/read handler to pass the register in parameter Julien Grall
2015-10-07 14:41 ` [PATCH v3 3/9] xen/arm: io: Support sign-extension for every read access Julien Grall
2015-10-07 14:41 ` [PATCH v3 4/9] xen/arm: vgic: ctlr stores a 32-bit hardware register so use uint32_t Julien Grall
2015-10-07 14:41 ` [PATCH v3 5/9] xen/arm: vgic: Optimize the way to store GICD_IPRIORITYR in the rank Julien Grall
2015-10-07 14:41 ` [PATCH v3 6/9] xen/arm: vgic: Introduce a new field to store the rank index and use it Julien Grall
2015-10-07 14:41 ` [PATCH v3 7/9] xen/arm: vgic: Optimize the way to store the target vCPU in the rank Julien Grall
2015-10-07 15:38   ` Ian Campbell
2015-10-07 15:48     ` Julien Grall
2015-10-07 16:00       ` Ian Campbell
2015-10-07 16:29         ` Julien Grall
2015-10-07 19:13           ` Julien Grall
2015-10-08  9:39             ` Ian Campbell
2015-10-08 10:43               ` Julien Grall
2015-10-07 17:26   ` Stefano Stabellini
2015-10-07 18:16     ` Julien Grall
2015-10-08 10:56       ` Ian Campbell
2015-10-08 11:36         ` Stefano Stabellini
2015-10-08 12:23           ` Ian Campbell
2015-10-08 12:34             ` Stefano Stabellini
2015-10-08 13:46             ` Julien Grall
2015-10-08 14:25               ` Ian Campbell
2015-10-08 18:36                 ` Julien Grall
2015-10-09 11:24                   ` Julien Grall
2015-10-09 11:38                     ` Ian Campbell
2015-10-12 10:41                 ` Stefano Stabellini
2015-10-12 11:00                   ` Julien Grall
2015-10-12 11:07                     ` Stefano Stabellini
2015-10-12 11:28                       ` Julien Grall [this message]
2015-10-07 14:41 ` [PATCH v3 8/9] xen/arm: vgic: Introduce helpers to extract/update/clear/set vGIC register Julien Grall
2015-10-07 14:41 ` [PATCH v3 9/9] xen/arm: vgic-v3: Support 32-bit access for 64-bit registers Julien Grall
2015-10-08 10:44 ` [PATCH v3 0/9] xen/arm: vgic: Support 32-bit access for 64-bit register Julien Grall
2015-10-08 11:46   ` Ian Campbell

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=561B9974.7060504@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).