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

Re: [XEN v2] xen/arm64: io: Decode 32-bit ldr/str post-indexing instructions


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 1 Dec 2021 08:14:15 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kIRH1aImBK6j98HLmRlw4xmYhA7G69JSk+OJxmaJkbU=; b=RWBhiGvi2f0fmiYXuRs6UNDcnwuA9zbDvAfUTUikiEYWPPXpGtQ3/IxQ9IIvtES0sIlBeC4jdvZfmFPgfGLImIa51akqmYIBED2xn0fSts+1pE7rgLI8K56aXyLFAtCDPsug2QClQ71icLmnm0ADmBUd6ROuEtLwpdAgyDF+8dKB5sMa9uYE5hC3HDxu475Fea3nZkCzxQrxxQqvxUvhOWhr18l4nA2d7fD49HGx3y0I0B+Xz+EHPmRttmdnYbCIs2A4nI0t8M0GAB7i4r5w5nFkuGEPlAeLlmnAWWsVb8V5tbwbeh6bZyqIIiIYbpt+fcDyM3vXIswncprT6cERKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDpg0oItFKPGi7PT0+AW+8UeEYuUCToPjpnUe4S0si1oAoiqjtAlNHvU9oFUgc5IhGOuRrTcyKG/aYOpGLsv/kjBMiFWXAocZ1UbbM4+xu+cnkppIKWtkedafX4lRlNAYieX2pMowSr3WrqTeCYkFmIwE/1HHqA4Fb86uAMO9vNoXz+mYdmvtw4jG9zVbz9TnwyfaTAFYlJ1RiYXEGLUHnTU7K0eBlZUtQYMuHaiaJiXM9qwVj7tXgt9utg0DhtzHqhcGzPWWTMmDRfESvBLe/KZ+TBVBGP/o+JkXWwR0jy6afP/ECqYDlgMVAtmMOuBG5z1KIjaAvADZRK7eLqa+g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, stefanos@xxxxxxxxxx, julien@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, andre.przywara@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 01 Dec 2021 07:14:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.11.2021 19:35, Ayan Kumar Halder wrote:
> On 30/11/2021 07:57, Jan Beulich wrote:
>> On 29.11.2021 20:16, Ayan Kumar Halder wrote:
>>> +{
>>> +    struct cpu_user_regs *regs = guest_cpu_user_regs();
>>> +    unsigned int val;
>>> +
>>> +    val = get_user_reg(regs, instr->code.rn);
>>> +    val += instr->code.imm9;
>>> +    set_user_reg(regs, instr->code.rn, val);
>>
>> I don't think this handles the SP case correctly, and I also don't see
>> that case getting rejected elsewhere.
> 
> Sorry, I did not understand you. Can you explain a bit more ?
> 
> Following 
> https://www.keil.com/support/man/docs/armasm/armasm_dom1361289873425.htm 
> , Are you saying that we need to handle this restriction
> "You can use SP for Rt in non-word instructions in ARM code but this is 
> deprecated in ARMv6T2 and above"

Are you looking at the correct (part of the) doc? It feels like this is
Arm32 wording (plus it's Rn I'm talking about, not Rt) ... DDI0487G-b
has nothing like this on the "LDR (immediate)" insn page. And even if
it had, "deprecated" doesn't mean "impossible", so you'd still need to
deal with the situation in a way that's not silently doing the wrong
thing (IOW you may be fine not actually emulating the case, but then
you need to clearly fail emulation rather than using XZR).

I have to admit I don't recall what the behavior is when Rt == 31. But
what you may further want to deal with independent of that is Rt == Rn.

Jan




 


Rackspace

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