qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Claudio Fontana <cfontana@suse.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 4/6] accel/tcg: Declare missing cpu_loop_exit*() stubs
Date: Mon, 15 Feb 2021 12:01:02 +0000	[thread overview]
Message-ID: <874kidv8sa.fsf@linaro.org> (raw)
In-Reply-To: <35adfe42-6f89-1f48-7ed2-da1d2f4d7eb7@suse.de>


Claudio Fontana <cfontana@suse.de> writes:

> On 1/18/21 10:39 AM, Philippe Mathieu-Daudé wrote:
>> On 1/18/21 10:29 AM, Claudio Fontana wrote:
>>> On 1/17/21 5:48 PM, Philippe Mathieu-Daudé wrote:
>>>> cpu_loop_exit*() functions are declared in accel/tcg/cpu-exec-common.c,
>>>> and are not available when TCG accelerator is not built. Add stubs so
>>>> linking without TCG succeed.
>>>
>>> The reason why stubs are needed here at all seems to be that that the code
>>> calling cpu_loop_exit is not refactored properly yet;
>> 
>> I agree ...
>> 
>>> if we look at the example of i386, after the refactoring moving tcg related code into target/i386/tcg/,
>>> (and really even before that I think),
>>> the code calling cpu_loop_exit is not built for non-TCG at all, and so we don't need stubs.
>>>
>>> I am ok with this anyway, just wanted to convey that I think we should look at stubs as a necessary evil until all code stops mixing tcg, kvm and other accels...
>>>
>>> Thanks,
>>>
>>> Claudio
>>>
>>>>
>>>> Problematic files:
>>>>
>>>> - hw/semihosting/console.c in qemu_semihosting_console_inc()
>>>> - hw/ppc/spapr_hcall.c in h_confer()
>>>> - hw/s390x/ipl.c in s390_ipl_reset_request()
>>>> - hw/misc/mips_itu.c
>> 
>> ... but I have no clue how to refactore these, as they
>> are used in both KVM and TCG.
>> 
>> How would you do? I'm stuck with the semihosting code
>> dependency on ARM since 2 years...
>> 
>> Phil.
>> 
>
> Just naively looking at this, qemu_semihosting_console_inc seems called only by
> do_arm_semihosting in target/arm/arm-semi.c,
>
> which in turn is called by linux-user (TCG),
>
> target/arm/m_helper.c in arm_v7m_cpu_do_interrupt(),
> which I would assume is TCG only too, just waiting for the TCG/KVM refactoring in ARM, which I would assume would make cpu_tcg.c TCG-only,
>
> target/arm/helper.c in handle_semihosting, which is already wrapped in #ifdef CONFIG_TCG and is commented with:
>
> "
> * We only see semihosting exceptions in TCG only as they are not                                                                           
> * trapped to the hypervisor in KVM.                                                                                                        
> */
> "
>
> So am I wrong in my assumption that as soon as we are able to separate
> TCG vs KVM in target/arm/ , the issue of hw/semihosting/console.c
> would be solved?

I think it is - certainly for ARM. I don't know if real RiscV HW can
trap semihosting calls to the kernel/hypervisor.

-- 
Alex Bennée


  reply	other threads:[~2021-02-15 12:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 16:48 [PATCH 0/6] accel: Restrict TCG-specific code Philippe Mathieu-Daudé
2021-01-17 16:48 ` [PATCH 1/6] accel/tcg: Make cpu_gen_init() static Philippe Mathieu-Daudé
2021-01-18  9:14   ` Claudio Fontana
2021-01-21  5:54   ` Richard Henderson
2021-01-17 16:48 ` [PATCH 2/6] accel/tcg: Restrict tb_flush_jmp_cache() from other accelerators Philippe Mathieu-Daudé
2021-01-18  9:14   ` Claudio Fontana
2021-01-21  5:55   ` Richard Henderson
2021-01-17 16:48 ` [PATCH 3/6] accel/tcg: Restrict tb_gen_code() " Philippe Mathieu-Daudé
2021-01-18  9:12   ` Claudio Fontana
2021-01-21  6:06     ` Richard Henderson
2021-03-15 13:52       ` Claudio Fontana
2021-03-15 14:48         ` Philippe Mathieu-Daudé
2021-01-17 16:48 ` [PATCH 4/6] accel/tcg: Declare missing cpu_loop_exit*() stubs Philippe Mathieu-Daudé
2021-01-18  9:02   ` Claudio Fontana
2021-01-18  9:29   ` Claudio Fontana
2021-01-18  9:39     ` Philippe Mathieu-Daudé
2021-01-18 10:03       ` Claudio Fontana
2021-02-15 12:01         ` Alex Bennée [this message]
2021-01-21  6:21   ` Richard Henderson
2021-01-17 16:48 ` [RFC PATCH 5/6] accel/tcg: Restrict cpu_io_recompile() from other accelerators Philippe Mathieu-Daudé
2021-01-18  9:04   ` Claudio Fontana
2021-01-21  6:53   ` Richard Henderson
2021-01-17 16:48 ` [RFC PATCH 6/6] softmmu: Restrict watchpoint handlers to TCG accelerator Philippe Mathieu-Daudé
2021-01-18  9:10   ` Claudio Fontana
2021-01-18  9:36     ` Philippe Mathieu-Daudé
2021-02-15 10:42       ` Claudio Fontana
2021-02-15 12:05         ` Alex Bennée
2021-01-21  6:56   ` Richard Henderson
2021-01-18  9:20 ` [PATCH 0/6] accel: Restrict TCG-specific code Claudio Fontana

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=874kidv8sa.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=cfontana@suse.de \
    --cc=chenhuacai@kernel.org \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    /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).