qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Cc: agraf@suse.de, Aurelien Jarno <aurelien@aurel32.net>,
	thuth@redhat.com, Miroslav Benes <mbenes@suse.cz>
Subject: Re: [Qemu-devel] [PATCH v1 2/3] target/s390x: implement mvcos instruction
Date: Wed, 14 Jun 2017 19:02:48 +0200	[thread overview]
Message-ID: <0959e60a-7894-d7d7-0bfe-dbb19b162875@redhat.com> (raw)
In-Reply-To: <e379cef7-90e9-46d5-6872-3d069f39fd6a@twiddle.net>


>> Would it makes sense to
>>
>> a) move cpu_restore_state() into program_interrupt()
>> b) make all callers forward ra from GETPC() (problem with kvm code that
>> share handlers?)
>> c) fixup callers that already do the cpu_restore_state()
>> d) drop potential_page_fault() completely
> 
> Yes, that makes sense.  For B, kvm can pass 0 for RA and nothing will happen. 
> For C, that project is on-going but not complete; D is indeed the ultimate goal.
> 
>> Two questions:
>> a) Could we avoid having to forward the ra by doing GETPC directly in
>> program_interrupt()? In mem_helper, I can see that we do GETPC on
>> several places and pass it around, so I assume GETPC() has to be called
>> in the first handler?
> 
> You must use GETPC in the first handler.  We're looking for the address of the 
> TCG generated code from where we were called.  So, no, you can't use GETPC from 
> program_interrupt.
> 
>> b) With cpu_restore_state(), there is no need for update_psw_addr() +
>> update_cc_op(), correct?
> 
> Correct.

Thanks for the clarification!

> 
>>>> +    potential_page_fault(s);
>>>> +    gen_helper_mvcos(cc_op, cpu_env, o->addr1, o->in2, regs[r3]);
>>>
>>> ... the potential_page_fault.
>>
>> I would suggest to leave it in this patch as it and then clean it up all
>> together in one shot (adding 5 cpu_restore_state() vs. one
>> potential_page_fault() temporarily looks better to me).
> 
> I would say the opposite, since the code generated by potential_page_fault is 
> always executed, whereas the cpu_restore_state is on an error path which for a 
> well-behaved guest will never be executed.

By temporary I meant:
I will be looking into cleaning this all up and getting rid of
potential_page_fault() soon :)

However, in v2 I avoided potential_page_fault().

> 
> 
> r~
> 

Thanks!

-- 

Thanks,

David

  reply	other threads:[~2017-06-14 17:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 21:47 [Qemu-devel] [PATCH v1 0/3] target/s390x: implement MVCOS and allow to enable it David Hildenbrand
2017-06-13 21:47 ` [Qemu-devel] [PATCH v1 1/3] target/s390x: change PSW_SHIFT_KEY David Hildenbrand
2017-06-14  7:05   ` Thomas Huth
2017-06-13 21:47 ` [Qemu-devel] [PATCH v1 2/3] target/s390x: implement mvcos instruction David Hildenbrand
2017-06-14  4:41   ` Richard Henderson
2017-06-14  7:22     ` David Hildenbrand
2017-06-14 14:30       ` Richard Henderson
2017-06-14 17:02         ` David Hildenbrand [this message]
2017-06-14  7:37   ` Thomas Huth
2017-06-14  7:56     ` David Hildenbrand
2017-06-14 20:00       ` Thomas Huth
2017-06-14 23:44         ` Richard Henderson
2017-06-13 21:47 ` [Qemu-devel] [PATCH v1 3/3] s390x/cpumodel: allow to enable MVCOS for qemu cpu model David Hildenbrand
2017-06-14  4:44   ` Richard Henderson
2017-06-14  7:03     ` David Hildenbrand
2017-06-14  7:40       ` Thomas Huth
2017-06-13 21:57 ` [Qemu-devel] [PATCH v1 0/3] target/s390x: implement MVCOS and allow to enable it no-reply

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=0959e60a-7894-d7d7-0bfe-dbb19b162875@redhat.com \
    --to=david@redhat.com \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=mbenes@suse.cz \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).