[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Semihost SYS_READC implementation (v4)
From: |
Richard Henderson |
Subject: |
Re: [PATCH] Semihost SYS_READC implementation (v4) |
Date: |
Thu, 14 Nov 2019 21:52:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 11/14/19 8:29 PM, Peter Maydell wrote:
> On Thu, 14 Nov 2019 at 19:18, Richard Henderson
> <address@hidden> wrote:
>> - If the sequence crosses a page, then so be it. Because of
>> step 1, this only happens when we *must* cross a page, and
>> will have recognized any paging exception anyway.
>> The generic parts of qemu will handle proper invalidation of
>> a TB that crosses a page boundary.
>
> I'm not sure this would work. If you have
> insn1 insn2 || other-insn
> (where || is the page boundary and page 2 is non-executable)
> then the required behaviour is "execute insn1 and insn2 with
> normal behaviour, then fault trying to read other-insn, with
> the fault address being that of other-insn".
> Whereas for
> insn1 insn2 || insn3
> you want to treat it as a semihosting sequence. But you can't distinguish
> the two because trying to read the word in page 2 will cause us to
> generate a fault with the fault address being that of insn1. Or
> have I forgotten how the page-crossing handling works ?
Yet another reason why I prefer any semi-hosting call to use an encoding that
is otherwise reserved illegal.
For this, you have to make up your mind: is it important to execute the
instructions as specified by the ISA, or as specified by the semi-hosting spec?
In this case, semi-hosting defines an "entry nop" that begins the sequence, and
I think that we are well within our rights to ignore the validity of "insn1
insn2 || other-insn".
r~
- Re: [PATCH] Semihost SYS_READC implementation (v4), (continued)
Re: [PATCH] Semihost SYS_READC implementation (v4), Peter Maydell, 2019/11/14
Re: [PATCH] Semihost SYS_READC implementation (v4), Keith Packard, 2019/11/14
Re: [PATCH] Semihost SYS_READC implementation (v4), Peter Maydell, 2019/11/15
Re: [PATCH] Semihost SYS_READC implementation (v4), Keith Packard, 2019/11/15