qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulat


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulation
Date: Wed, 4 May 2011 06:57:01 +0200

On 20.04.2011, at 12:38, Aurelien Jarno wrote:

> On Fri, Apr 15, 2011 at 05:32:52PM +0200, Alexander Graf wrote:
>> When running system emulation, we need to transverse through the MMU and
>> deliver interrupts according to the specification.
>> 
>> This patch implements those two pieces and in addition adjusts the CPU
>> initialization code to account for the new fields in CPUState.
>> 
>> Signed-off-by: Alexander Graf <address@hidden>
>> 

[...]

>> 
>> +int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong _vaddr, int rw,
>>                                 int mmu_idx, int is_softmmu)
>> {
>> -    target_ulong phys;
>> +    uint64_t asc = env->psw.mask & PSW_MASK_ASC;
>> +    target_ulong vaddr, raddr;
>>     int prot;
>> 
>> -    /* XXX: implement mmu */
>> +    dprintf("%s: address 0x%" PRIx64 " rw %d mmu_idx %d is_softmmu %d\n",
>> +            __FUNCTION__, _vaddr, rw, mmu_idx, is_softmmu);
>> +
>> +    _vaddr &= TARGET_PAGE_MASK;
>> +    vaddr = _vaddr;
> 
> You don't need to use a second vaddr variable here, you can directly
> apply the mast on _vaddr (and probably rename it to vaddr).

Unfortunately, it's not that easy. Take a look at the next few lines - there 
we're masking vaddr in 31-bit (and 24-bit) mode. We still need to add the real 
vaddr that we got into the TLB though, so we somehow need to keep the 
non-masked version around.


Alex




reply via email to

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