Re: [Qemu-devel] How to trigger faults for missing peripherals?

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 15:30, Liviu Ionescu i...@livius.net wrote:

 On 18 Jun 2015, at 13:21, Peter Maydell peter.mayd...@linaro.org wrote:

 ... do_unassigned_access is the QOM CPUClass hook for this,

 this hook seems associated with the Trying to execute code outside
 RAM or ROM at 0x error, which is a bit different, I want to catch
 read/write accesses, not execute accesses.

read/write accesses call the hook via the code path:
 unassigned_mem_{read,write}() - cpu_unassigned_access()

(though this is part of the design issue I mentioned --
it means the hook gets called for *anything* that touches
an unassigned address, even if it was the DMA controller
and not the CPU at all. The hook calls need to be hoisted
out of those functions and up to a higher level in the
call tree.)

-- PMM



Re: [Qemu-devel] How to trigger faults for missing peripherals?

2015-06-18 Thread Liviu Ionescu

 On 18 Jun 2015, at 13:21, Peter Maydell peter.mayd...@linaro.org wrote:
 
 ... do_unassigned_access is the QOM CPUClass hook for this, 

this hook seems associated with the Trying to execute code outside RAM or ROM 
at 0x error, which is a bit different, I want to catch read/write accesses, 
not execute accesses.

is the error message misleading, and the hook is used for all accesses? 
(get_page_addr_code() in cputlb.c)


regards,

Liviu






Re: [Qemu-devel] How to trigger faults for missing peripherals?

2015-06-18 Thread Peter Maydell
On 18 June 2015 at 10:45, Liviu Ionescu i...@livius.net wrote:
 In order to make the Cortex-M emulation accurate, I would need to configure 
 the missing address ranges to trigger memory faults.

 I noticed that the emulator defines a memory range to
 cover the entire 64-bits memory space. Is it possible
 to make it trigger exceptions?

In theory, but the machinery to do this is a bit broken
and there's a bunch of cleanup and design fixes necessary
before we can turn it on for ARM. do_unassigned_access
is the QOM CPUClass hook for this, and searching the
mailing list archives will probably turn up discussion
about the fixes needed.

-- PMM