qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: Peter Maydell <peter.maydell@linaro.org>
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 21:09:52 +0100	[thread overview]
Message-ID: <55720210.7010200@imgtec.com> (raw)
In-Reply-To: <CAFEAcA-RCY_Z7exFLk4f9k=ODbFXBYov+36m1vqmw3MD_2khvg@mail.gmail.com>

On 05/06/15 16:23, Peter Maydell wrote:
> On 26 May 2015 at 17:03, Leon Alrae <leon.alrae@imgtec.com> wrote:
>> --- 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.

semihosting_get_cmdline() returns NULL if neither semihosting args nor
-kernel have been specified. As far as I can tell existing
implementation may also blow up if kernel_filename is NULL, so we retain
the same behaviour. Besides, it's not clear to me how the
TARGET_SYS_GET_CMDLINE should behave if cmdline is not available,
whether should return -1 or pass an empty string to the guest. For me
this looks like a separate issue, not much related to this patch series.

Thanks,
Leon

  reply	other threads:[~2015-06-05 20:10 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
2015-06-05 20:09     ` Leon Alrae [this message]
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=55720210.7010200@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=christopher.covington@linaro.org \
    --cc=ilg@livius.net \
    --cc=matthew.fortune@imgtec.com \
    --cc=peter.maydell@linaro.org \
    --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).