qemu-devel
[Top][All Lists]
Advanced

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

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


From: Michal Marek
Subject: Re: [Qemu-devel] [PATCH] target-s390x: Implement stfl and stfle
Date: Sat, 25 Feb 2017 21:39:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0

Dne 25.2.2017 v 01:05 Richard Henderson napsal(a):
> On 02/25/2017 12:44 AM, Michal Marek wrote:
>> +DEF_HELPER_1(stfl, void, env)
> 
> DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env)
> 
> since this touches no registers, and only writes to lomem which afaik
> cannot fault in kernel mode.

OK.


>> +static int do_stfle(CPUS390XState *env, uint64_t addr, int len)
>> +{
>> +    S390CPU *cpu = s390_env_get_cpu(env);
>> +    uint8_t data[64];
> 
> S390FeatBitmap or S390FeatInit?  Or even a sizeof?
> Hard coding 64 certainly doesn't seem right.

I will change it to something more sensible.


>> +    memset(data, 0, sizeof(data));
>> +    res = s390_fill_feat_block(cpu->model->features,
>> S390_FEAT_TYPE_STFL, data);
>> +    cpu_physical_memory_write(addr, data, MIN(res, len));
> 
> No, not physical memory, you need to write to virtual memory, at least
> for STFLE.  Which, as you'll recall can be used from user-mode.

Oh, I did not realize that STFLE is not a privileged instruction.

Thanks for the review!

Michal



reply via email to

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