From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v1 3/8] xen/arm: Support sign-extension for every read access Date: Tue, 29 Sep 2015 14:16:28 +0100 Message-ID: <560A8F2C.2030606@citrix.com> References: <1443192698-16163-1-git-send-email-julien.grall@citrix.com> <1443192698-16163-4-git-send-email-julien.grall@citrix.com> <1443199485.25250.212.camel@citrix.com> <56098549.2080503@citrix.com> <1443524629.16718.49.camel@citrix.com> <560A7265.3040307@citrix.com> <1443532421.16718.65.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zguo9-0008RQ-AS for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 13:19:01 +0000 In-Reply-To: <1443532421.16718.65.camel@citrix.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 , xen-devel@lists.xenproject.org Cc: Vijaya.Kumar@caviumnetworks.com, stefano.stabellini@citrix.com, manish.jaggi@caviumnetworks.com, vijay.kilari@gmail.com List-Id: xen-devel@lists.xenproject.org On 29/09/15 14:13, Ian Campbell wrote: > On Tue, 2015-09-29 at 12:13 +0100, Julien Grall wrote: >>> Or is it, couldn't we be updating a byte in the middle of the word? >> >> *r is a register, the byte/half-word/word... are always living in the >> lowest bit of the register. > > So just to check: > > ldrs* do support e.g odd offsets, but given a 32 bit MMIO region which > reads 0xAABBCCDD then when reading from offset 1 at this point *r contains > 0x000000CC already (and not 0x0000C00) and sign extending the lowest byte > is therefore correct. > > Right? Correct. For more details see the pseudo-code to implement the different ldrs* instruction (for instance A8.8.86 in ARM DDI 0406C.b). Regards, -- Julien Grall