From: Peter Maydell <peter.maydell@linaro.org>
To: Leon Alrae <leon.alrae@imgtec.com>
Cc: Liviu Ionescu <ilg@livius.net>,
Christopher Covington <christopher.covington@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Matthew Fortune <matthew.fortune@imgtec.com>
Subject: Re: [Qemu-devel] [PATCH v4 2/2] semihosting: add --semihosting-config arg sub-argument
Date: Fri, 5 Jun 2015 16:23:08 +0100 [thread overview]
Message-ID: <CAFEAcA-RCY_Z7exFLk4f9k=ODbFXBYov+36m1vqmw3MD_2khvg@mail.gmail.com> (raw)
In-Reply-To: <1432656234-9791-3-git-send-email-leon.alrae@imgtec.com>
On 26 May 2015 at 17:03, Leon Alrae <leon.alrae@imgtec.com> wrote:
> Add new "arg" sub-argument to the --semihosting-config allowing the user
> to pass multiple input arguments separately. It is required for example
> by UHI semihosting to construct argc and argv.
>
> Also, update ARM semihosting to support new option (at the moment it is
> the only target which cares about arguments).
>
> If the semihosting is enabled and no semihosting args have been specified,
> then fall back to -kernel/-append. The -append string is split on whitespace
> before initializing semihosting.argv[1..n]; this is different from what
> QEMU MIPS machines' pseudo-bootloaders do (i.e. argv[1] contains the whole
> -append), but is more intuitive from UHI user's point of view and Linux
> kernel just does not care as it concatenates argv[1..n] into single cmdline
> string anyway.
>
> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
> --- a/target-arm/arm-semi.c
> +++ b/target-arm/arm-semi.c
> @@ -27,6 +27,7 @@
> #include <time.h>
>
> #include "cpu.h"
> +#include "exec/semihost.h"
> #ifdef CONFIG_USER_ONLY
> #include "qemu.h"
>
> @@ -440,10 +441,7 @@ uint32_t do_arm_semihosting(CPUARMState *env)
> input_size = arg1;
> /* Compute the size of the output string. */
> #if !defined(CONFIG_USER_ONLY)
> - output_size = strlen(ts->boot_info->kernel_filename)
> - + 1 /* Separating space. */
> - + strlen(ts->boot_info->kernel_cmdline)
> - + 1; /* Terminating null byte. */
> + output_size = strlen(semihosting_get_cmdline()) + 1;
It looks like semihosting_get_cmdline() can return NULL,
in which case this will blow up, I think.
Patch looks OK otherwise (haven't tested it yet).
-- PMM
next prev parent reply other threads:[~2015-06-05 15:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 16:03 [Qemu-devel] [PATCH v4 0/2] semihosting: clean up and add --semihosting-config arg Leon Alrae
2015-05-26 16:03 ` [Qemu-devel] [PATCH v4 1/2] semihosting: create SemihostingConfig structure and semihost.h Leon Alrae
2015-05-26 16:03 ` [Qemu-devel] [PATCH v4 2/2] semihosting: add --semihosting-config arg sub-argument Leon Alrae
2015-06-05 15:23 ` Peter Maydell [this message]
2015-06-05 20:09 ` Leon Alrae
2015-06-05 21:11 ` Liviu Ionescu
2015-06-05 22:54 ` Peter Maydell
2015-06-06 8:50 ` Liviu Ionescu
2015-06-16 12:32 ` Liviu Ionescu
2015-06-16 14:03 ` Peter Maydell
2015-06-16 14:20 ` Leon Alrae
2015-06-18 12:29 ` Peter Maydell
2015-06-03 12:30 ` [Qemu-devel] [PATCH v4 0/2] semihosting: clean up and add --semihosting-config arg Leon Alrae
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='CAFEAcA-RCY_Z7exFLk4f9k=ODbFXBYov+36m1vqmw3MD_2khvg@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=christopher.covington@linaro.org \
--cc=ilg@livius.net \
--cc=leon.alrae@imgtec.com \
--cc=matthew.fortune@imgtec.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 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).