All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Michal Marek <mmarek@suse.com>, Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org, Miroslav Benes <mbenes@suse.cz>,
	Eric Bischoff <ebischoff@suse.com>
Subject: Re: [Qemu-devel] [PATCH] target-s390x: Implement stfl and stfle
Date: Sat, 25 Feb 2017 11:05:55 +1100	[thread overview]
Message-ID: <a634716c-c998-c422-6802-946a283f8837@twiddle.net> (raw)
In-Reply-To: <20170224134411.28882-1-mmarek@suse.com>

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.

> +DEF_HELPER_3(stfle, i64, env, i64, i64)

Unfortunately, we are writing to cc_op, so we do have a TCG register write, so 
I guess this is the best we can do here.

> +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.

> +    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.


r~

  parent reply	other threads:[~2017-02-25  0:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 13:44 [Qemu-devel] [PATCH] target-s390x: Implement stfl and stfle Michal Marek
2017-02-24 14:51 ` no-reply
2017-02-24 15:22   ` Michal Marek
2017-02-24 16:28     ` David Hildenbrand
2017-02-25  0:05 ` Richard Henderson [this message]
2017-02-25 20:39   ` Michal Marek
2017-02-25 23:30     ` Michal Marek
2017-02-25 23:16   ` [Qemu-devel] [PATCH v2] " Michal Marek
2017-02-25 23:38     ` [Qemu-devel] [PATCH v3] " Michal Marek
2017-02-26 11:22       ` Thomas Huth
2017-02-26 18:57         ` Michal Marek
2017-02-27  7:30           ` Thomas Huth
2017-02-27 10:18         ` [Qemu-devel] [PATCH v4] " Michal Marek
2017-02-28 22:11           ` Richard Henderson
2017-03-01  8:00             ` Thomas Huth
2017-03-01 19:30               ` Richard Henderson
2017-03-01 20:20                 ` Thomas Huth
2017-03-02 13:09                 ` David Hildenbrand
2017-03-02 10:53             ` Michal Marek
2017-03-02 13:12               ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a634716c-c998-c422-6802-946a283f8837@twiddle.net \
    --to=rth@twiddle.net \
    --cc=agraf@suse.de \
    --cc=ebischoff@suse.com \
    --cc=mbenes@suse.cz \
    --cc=mmarek@suse.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.