qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 2/4] s390x/tcg: Introduce probe_read_access()


From: David Hildenbrand
Subject: Re: [Qemu-devel] [PATCH v1 2/4] s390x/tcg: Introduce probe_read_access()
Date: Thu, 22 Aug 2019 08:42:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 22.08.19 00:43, Richard Henderson wrote:
> On 8/21/19 3:31 PM, Richard Henderson wrote:
>>> Yes, that's what I mean, TARGET_PAGE_SIZE, but eventually crossing a
>>> page boundary. The longer I stare at the MVCL code, the more broken it
>>> is. There are more nice things buried in the PoP. MVCL does not detect
>>> access exceptions beyond the next 2k. So we have to limit it there
>>> differently.
>> That language is indeed odd.
>>
>> The only reading of that paragraph that makes sense to me is that the 
>> hardware
>> *must* interrupt MVCL after every 2k bytes processed.  The idea that the user
>> can magically write to a read-only page simply by providing length = 2MB and
>> page that is initially writable is dumb.  I cannot imagine that is a correct
>> reading.
>>
>> Getting clarification from an IBM engineer on that would be good; otherwise I
>> would just ignore that and proceed as if all access checks are performed.
>>
> 
> FWIW, splitting the operation at every aligned 2k boundary is exactly what the
> Hercules emulator does:
> 
>     len3 = NOCROSS2KL(addr1,len1) ? len1 : (int)(0x800 - (addr1 & 0x7FF));
>     len4 = NOCROSS2KL(addr2,len2) ? len2 : (int)(0x800 - (addr2 & 0x7FF));
>     len = len3 < len4 ? len3 : len4;
>     /* Use concpy to ensure Concurrent block update consistency */
>     concpy (regs, dest, source, len);
> 
> After this it writes back the lengths and addresses to the
> register file, and then if necessary loops back to the address
> translation step.

That's almost exactly how I planned to fix MVCL :)

-- 

Thanks,

David / dhildenb



reply via email to

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