From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: "Jim Mussared" <jim@groklearning.com>,
"Julia Suvorova" <jusual@mail.ru>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Steffen Gortz" <qemu.ml@steffen-goertz.de>,
qemu-arm <qemu-arm@nongnu.org>, "Joel Stanley" <joel@jms.id.au>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Revert "armv7m: Guard against no -kernel argument"
Date: Mon, 29 Apr 2019 17:07:51 +0200 [thread overview]
Message-ID: <738394de-bd75-4ef3-10ef-de8cd07891de@redhat.com> (raw)
In-Reply-To: <20190429122819.GB7587@stefanha-x1.localdomain>
On 4/29/19 2:28 PM, Stefan Hajnoczi wrote:
> On Fri, Apr 26, 2019 at 12:45:37PM +0100, Peter Maydell wrote:
>> On Fri, 26 Apr 2019 at 10:17, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>>> On Thu, Apr 25, 2019 at 08:07:06PM +0200, Philippe Mathieu-Daudé wrote:
>>> Old boards probably want to continue using -kernel. New boards like
>>> microbit may use just -device loader. Perhaps there is even a group
>>> that wants both options.
>>>
>>> A solution is to introduce explicit checks so that we can tell the user
>>> the appropriate option for the machine type. I can work on this if you
>>> like, but probably won't be able to send a patch until Tuesday.
>>
>> But it's difficult to tell how to identify whether there's really
>> any guest code there. For instance the user might want to start
>> QEMU, connect via the gdbstub and load guest code from gdb.
>> Or they might be using the generic-loader device. Or they might
>> really be using -kernel but with a broken guest image which doesn't
>> have a vector table in it, which will result in the same message.
>> I guess you could have a heuristic for "if an M-profile CPU is in reset
>> and the value it loads for the starting PC is zero and the gdb
>> stub is not connected, then print a warning that the guest image
>> is missing or there's no vector table" but I'm not a big fan of
>> heuristics...
>
> I was going to add a function to check kernel_filename and the presence
> of -device loader. Then each machine type init function would call the
> function with flags indicating which modes are allowed:
>
> /* Allow both -kernel and -device loader */
> check_kernel_loaded(KERNEL_CMDLINE | KERNEL_LOADER);
>
> /* Allow only -kernel */
> check_kernel_loaded(KERNEL_CMDLINE);
>
> /* Allow only -device loader */
> check_kernel_loaded(KERNEL_LOADER);
>
> This doesn't support the gdbstub use case you've described though. No
> heuristics but a bit inflexible.
> What do you think?
We can check for QEMU_OPTION_gdb/QEMU_OPTION_s, if present display
warning, else display error? Or no warning at all...
WARNING: multiple messages have this Message-ID (diff)
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: "Jim Mussared" <jim@groklearning.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Steffen Gortz" <qemu.ml@steffen-goertz.de>,
qemu-arm <qemu-arm@nongnu.org>, "Joel Stanley" <joel@jms.id.au>,
"Thomas Huth" <thuth@redhat.com>,
"Julia Suvorova" <jusual@mail.ru>
Subject: Re: [Qemu-devel] [PATCH] Revert "armv7m: Guard against no -kernel argument"
Date: Mon, 29 Apr 2019 17:07:51 +0200 [thread overview]
Message-ID: <738394de-bd75-4ef3-10ef-de8cd07891de@redhat.com> (raw)
Message-ID: <20190429150751.xw33xDiE9useM1eb-v4COYaAy6haYF_x60gIE52B1Os@z> (raw)
In-Reply-To: <20190429122819.GB7587@stefanha-x1.localdomain>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2088 bytes --]
On 4/29/19 2:28 PM, Stefan Hajnoczi wrote:
> On Fri, Apr 26, 2019 at 12:45:37PM +0100, Peter Maydell wrote:
>> On Fri, 26 Apr 2019 at 10:17, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>>> On Thu, Apr 25, 2019 at 08:07:06PM +0200, Philippe Mathieu-Daudé wrote:
>>> Old boards probably want to continue using -kernel. New boards like
>>> microbit may use just -device loader. Perhaps there is even a group
>>> that wants both options.
>>>
>>> A solution is to introduce explicit checks so that we can tell the user
>>> the appropriate option for the machine type. I can work on this if you
>>> like, but probably won't be able to send a patch until Tuesday.
>>
>> But it's difficult to tell how to identify whether there's really
>> any guest code there. For instance the user might want to start
>> QEMU, connect via the gdbstub and load guest code from gdb.
>> Or they might be using the generic-loader device. Or they might
>> really be using -kernel but with a broken guest image which doesn't
>> have a vector table in it, which will result in the same message.
>> I guess you could have a heuristic for "if an M-profile CPU is in reset
>> and the value it loads for the starting PC is zero and the gdb
>> stub is not connected, then print a warning that the guest image
>> is missing or there's no vector table" but I'm not a big fan of
>> heuristics...
>
> I was going to add a function to check kernel_filename and the presence
> of -device loader. Then each machine type init function would call the
> function with flags indicating which modes are allowed:
>
> /* Allow both -kernel and -device loader */
> check_kernel_loaded(KERNEL_CMDLINE | KERNEL_LOADER);
>
> /* Allow only -kernel */
> check_kernel_loaded(KERNEL_CMDLINE);
>
> /* Allow only -device loader */
> check_kernel_loaded(KERNEL_LOADER);
>
> This doesn't support the gdbstub use case you've described though. No
> heuristics but a bit inflexible.
> What do you think?
We can check for QEMU_OPTION_gdb/QEMU_OPTION_s, if present display
warning, else display error? Or no warning at all...
next prev parent reply other threads:[~2019-04-29 15:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 14:41 [Qemu-devel] [PATCH] Revert "armv7m: Guard against no -kernel argument" Stefan Hajnoczi
2019-01-04 15:16 ` Peter Maydell
2019-04-25 18:07 ` Philippe Mathieu-Daudé
2019-04-25 18:07 ` Philippe Mathieu-Daudé
2019-04-25 21:48 ` Philippe Mathieu-Daudé
2019-04-25 21:48 ` Philippe Mathieu-Daudé
2019-04-26 9:17 ` Stefan Hajnoczi
2019-04-26 9:17 ` Stefan Hajnoczi
2019-04-26 11:45 ` Peter Maydell
2019-04-26 11:45 ` Peter Maydell
2019-04-29 12:28 ` Stefan Hajnoczi
2019-04-29 12:28 ` Stefan Hajnoczi
2019-04-29 12:58 ` Peter Maydell
2019-04-29 12:58 ` Peter Maydell
2019-05-01 16:25 ` Stefan Hajnoczi
2019-05-01 16:25 ` Stefan Hajnoczi
2019-04-29 15:07 ` Philippe Mathieu-Daudé [this message]
2019-04-29 15:07 ` Philippe Mathieu-Daudé
2019-04-29 12:53 ` Joel Stanley
2019-04-29 12:53 ` Joel Stanley
2019-05-01 16:23 ` Stefan Hajnoczi
2019-05-01 16:23 ` Stefan Hajnoczi
2019-05-03 2:04 ` Joel Stanley
2019-05-03 2:04 ` Joel Stanley
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=738394de-bd75-4ef3-10ef-de8cd07891de@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=jim@groklearning.com \
--cc=joel@jms.id.au \
--cc=jusual@mail.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu.ml@steffen-goertz.de \
--cc=stefanha@redhat.com \
--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).