On 11/14/19 8:29 PM, Peter Maydell wrote: > On Thu, 14 Nov 2019 at 19:18, Richard Henderson > <richard.hender...@linaro.org> 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~