|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN v4] xen/arm64: io: Decode ldr/str post-indexing instructions
On 26/01/2022 12:21, Ayan Kumar Halder wrote: Hi Julien/Stefano, Hi, On 25/01/2022 23:02, Julien Grall wrote:Sorry, the check below does that but is used only for rn == 31. I should move ((regs->cpsr & PSR_MODE_MASK) != PSR_MODE_EL1h) ) into a separate check of its own.+ } + + /* + * Handle when rn = SP+ * Refer ArmV8 ARM DDI 0487G.b, Page - D1-2463 "Stack pointer register selection" + * As we are interested in handling exceptions only from EL1 in AArch64 state, + * thus M[3:0] == EL1h (Page - C5-480 "When exception taken from AArch64 state:")I read the last sentence as "We only support decoding from instruction run at EL1". But I can't find a check guarantee that. The question is why do we want to limit instruction decoding to EL1? + */+ if ( (instr->code.rn == 31) && ((regs->cpsr & PSR_MODE_MASK) != PSR_MODE_EL1h) ) What ambiguity? The caller should be completely agnostic to what instruction we decode. Later, if this gets extended, then it can be named more appropriately depending on the usage. Renaming afterwards is exactly what I want to avoid. Also, the bit-pattern in "union ldr_str_instr_class" is very much specific to ldr/str. I agree that the bit-pattern is specific to load/store. But that's just one way to interpret the 32-bit value. It would be easy to add another way to interpret it. I.e:
union
{
value;
struct {
} str_ldr;
struct {
} brk;
}
I think moving if ( !dabt.valid ) earlier should be part of a pre-patch. This would allows us to backport it as we don't want to forward the I/O to an IOREQ server if ISV=0.I would say that in the pre-patch, we should move "if ( !dabt.valid )" before "find_mmio_handler()". The reason being if the intruction was not decoded successfully (ie ISV=0), then there is no need to find the mmio handler corresponding to the gpa. Please let me know your thoughts and I can send the pre-patch. Sounds good to me. /* * Erratum 766422: Thumb store translation fault to Hypervisor may * not have correct HSR Rt value.@@ -134,7 +145,7 @@ enum io_state try_handle_mmio(struct cpu_user_regs *regs, Yes. But... if ( (!info.dabt.valid ) || (( check_workaround_766422() && (regs->cpsr & PSR_THUMB) && ... without this comment. Also see my reply to Stefano's email. [...] Yes. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |