[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/19] exec.c: Use cpu_get_phys_page_attrs_de
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 09/19] exec.c: Use cpu_get_phys_page_attrs_debug |
Date: |
Mon, 11 Jan 2016 14:18:23 +0000 |
On 11 January 2016 at 13:47, Paolo Bonzini <address@hidden> wrote:
>
>
> On 16/11/2015 15:05, Peter Maydell wrote:
>> - hwaddr phys = cpu_get_phys_page_debug(cpu, pc);
>> + MemTxAttrs attrs = {};
>> + hwaddr phys = cpu_get_phys_page_attrs_debug(cpu, pc, &attrs);
>> + int asidx = cpu_asidx_from_attrs(cpu, attrs);
>> if (phys != -1) {
>> - tb_invalidate_phys_addr(cpu->as,
>> + tb_invalidate_phys_addr(cpu->cpu_ases[asidx].as,
>> phys | (pc & ~TARGET_PAGE_MASK));
>> }
>
> The only question I have is whether it is right to have empty MemTxAttrs
> here. Is there any way to use the MemTxAttrs for the "current state" of
> the CPU, whatever that is (on x86 I have added cpu_get_mem_attrs to
> target-i386/cpu.h)?
That's what the call to cpu_get_phys_page_attrs_debug() does:
it fills in the MemTxAttrs :secure and :user fields, and then
cpu_asidx_from_attrs() uses the returned attributes to pick
the right address space. (cpu_get_phys_page_attrs_debug()
only fills in attribute fields it knows about, which is why
we pass it an empty attrs struct to start with.)
thanks
-- PMM