qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Get current env within io_handler ?


From: Peter Maydell
Subject: Re: [Qemu-devel] Get current env within io_handler ?
Date: Sat, 19 May 2012 10:39:02 +0100

On 19 May 2012 08:13, Blue Swirl <address@hidden> wrote:
> nicolas.sauzede wrote:
>> Well, for example, we have the issue where we need to know if
>> the cpu that performs a hardware io is in priviledged/secure mode,
>> because some HW devices implemented in TLM requires such special
>> flags on certain register accesses.

> How does real HW do it? I don't think there is a bus that indicates
> the CPU number to the device.

The AMBA AXI bus includes attributes for:
 * secure/nonsecure world (used for TrustZone)
 * privileged/nonprivileged
 * instruction/data access
 * a transaction ID

The transaction ID typically encodes "which core in the
CPU made this memory transaction?". It's not always
meaningful, eg when caching intervenes, but for device
access you can use it. I'd tend to expect to see that in
testbench setups rather than the real world, though. Looking
straightforwardly at the protection attributes as Nicolas
suggests is much more standard.

>> Also, I think about some specific IPs such as local timers and
>> such, all seen at the same address by all the smp cpu, then how
>> can we know what cpu number originated the io transaction ?
>
> For each CPU, a different physical memory view should be constructed,
> with a different CPU specific device at this common address. I'm not
> sure if memory API can handle this yet, but it would be useful for x86
> APIC as well which in theory could have similar arrangement.

This is conceptually the nicest way to handle these, yes, but
I don't think we have the infrastructure for it just at the
moment...

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]