qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4] target-s390x: Implement stfl and stfle


From: Michal Marek
Subject: Re: [Qemu-devel] [PATCH v4] target-s390x: Implement stfl and stfle
Date: Thu, 2 Mar 2017 11:53:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0

Dne 28.2.2017 v 23:11 Richard Henderson napsal(a):
> On 02/27/2017 09:18 PM, Michal Marek wrote:
>> +static int do_stfle(CPUS390XState *env, uint64_t addr, uint32_t ar,
>> int len)
>> +{
>> +    S390CPU *cpu = s390_env_get_cpu(env);
>> +    /* 256 doublewords as per STFLE documentation */
>> +    uint8_t data[256 * 8] = { 0 };
>> +    int res;
>> +
>> +    res = s390_fill_feat_block(cpu->model->features,
>> S390_FEAT_TYPE_STFL, data);
>> +    res = ROUND_UP(res, 8);
>> +    s390_cpu_virt_mem_write(cpu, addr, ar, data, MIN(res, len));
> 
> This does not do what you think it does.  Or indeed, I suspect what the
> original author thinks it does.  I suspect it works for KVM only, and no
> one has actually tried the non-KVM code path.
> 
> Primarily, it does not raise an exception for error.  Secondarily, I
> have no idea what the "AR" argument is supposed to be, or how that's
> supposed to interact with the rest of the virtual memory system.
> 
> Your writes need to look a lot more like fast_memmove in mem_helper.c,
> except that of course only the destination needs translation.
> 
> Of course, in practice we could reduce this to just one cpu_stl_data for
> STFL and one or two cpu_stq_data for STFLE.  So a full fast_memmove loop
> is overkill.
> 
> As it happens, this reminds me that I wrote a version of this several
> years ago but never submitted it upstream.  I'll dig it out.

So, does it make sense for me to post a v5 again not using
s390_cpu_virt_mem_write(), or are you going to refresh your stfle
implementation?

Thanks,
Michal



reply via email to

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