All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Claudio Fontana <cfontana@suse.de>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: Why do we have both CONFIG_SOFTMMU and CONFIG_USER_ONLY?
Date: Tue, 8 Dec 2020 12:10:55 -0600	[thread overview]
Message-ID: <23e8d691-ac1f-8203-dd47-cd19dfb4c40e@linaro.org> (raw)
In-Reply-To: <08bd879e-66db-0fe0-522d-0a378f36f763@suse.de>

On 12/7/20 5:56 AM, Claudio Fontana wrote:
> On 12/7/20 12:50 PM, Peter Maydell wrote:
>> On Mon, 7 Dec 2020 at 11:39, Claudio Fontana <cfontana@suse.de> wrote:
>>>
>>> As in Subject,
>>>
>>> am I understanding correctly that the one or the other is redundant?
>>>
>>> Should we keep only one of them?
>>
>> I think that perhaps the idea at one point was that we
>> might have a version of linux-user which used a softmmu
>> (this would allow better control of the guest's view of
>> its address space, so guest mmap() to fixed addresses
>> would work better, for instance). But nobody's ever actually
>> tried to implement that, so I imagine that if we ever did
>> we'd find that some CONFIG_SOFTMMU and some CONFIG_USER_ONLY
>> defines were the wrong way around...
>>
>> thanks
>> -- PMM
>>
> 
> Hi Peter,
> 
> thanks for the background,
> 
> indeed I am seeing some of these cases, target/XXX/cpu.c is protecting code with #ifndef CONFIG_USER_ONLY,
> 
> but the header files in include/hw/core/cpu.h and others use #ifdef CONFIG_SOFTMMU.

In an ideal future in which linux-user could use softmmu, I would have softmmu
be a runtime option rather than a compile-time option.  The option would merely
affect how TCG generates code.

So while in that ideal future only CONFIG_USER_ONLY would remain, in an ideal
present CONFIG_SOFTMMU would mark those places where a runtime check should be
added.

But the present is not ideal, and system-ness (or non-user-only-ness) and
actual mmu emulation are often confused.  Cleanups welcome.  ;-)


r~


      reply	other threads:[~2020-12-08 18:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 11:19 Why do we have both CONFIG_SOFTMMU and CONFIG_USER_ONLY? Claudio Fontana
2020-12-07 11:26 ` Paolo Bonzini
2020-12-07 11:27   ` Claudio Fontana
2020-12-07 11:53     ` Philippe Mathieu-Daudé
2020-12-07 11:50 ` Peter Maydell
2020-12-07 11:56   ` Claudio Fontana
2020-12-08 18:10     ` Richard Henderson [this message]

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=23e8d691-ac1f-8203-dd47-cd19dfb4c40e@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=cfontana@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.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.