[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v3 1/1] plat/kvm/arm: Add image name as the first argument


  • To: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: "Justin He (Arm Technology China)" <Justin.He@xxxxxxx>
  • Date: Fri, 16 Aug 2019 06:33:00 +0000
  • Accept-language: en-US, zh-CN
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uv60CI/UvRfxSZKndUZ/Z/wkwBnMJrldmLaQ+26r2Zc=; b=JMBp8OHVyIjHPUI0vL59ANvxNPiOTboF9XfmfVSrRRDCGfJbaT/iw1G1xFDtx4Rwa48NsZ8VDSjrgUlYLiDyc7adQem+t4J4hyj0PqqYj25e/RWSy3iMUjeGeRAsWxMQLz6IwPUAdk435Vu6v/9B5nHRakGNmTea5WRjCVDLdHBlFqkAg8GCfHLjlh9g8yFpYvedBfw/N9g3DLaSK9rbwVOsnZcI0XHY1X9OJO9de3YYVNAjgaAVO2Ohfcv4h5GCiakw/4cJuTO5lF1w8QMWTyFJV/9B+23g82iFNBt1KGW4nwvoDzgjCSIKxSJ879bDlBv01aMP+Ws63Bx0B1oHog==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQPWjXbOdLlvC/425rvRsF2tj92JC0w6TVXw4knG+5etya9K15Kt6xTS3lrE0el9nwuiz4waBy/FVgerGg+R5Rr4i0E+7OHFFiF1bnthLmVIe3roWpt+7DklqurMmLf29iwwqW+V47PAKPxYQAVlvSpgoyxdUjWKUjXET6zSZaJjhWf9KckHeuNo8aLzKcEfLJiZzm4YeS+miLErznoOmsSKkUp6d4kjoC5W3C32bM47dmow+WDvo6pcSf/ESDYKDhYCi8fRhJC2hnqMHfd3lI4f7WKPjcqrnHP1VChPPFUCFzUawLKoCN4m1JvPKXEnvWLF4+AfHVMbhZ2VfeWLJg==
  • Authentication-results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xen.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xen.org; dmarc=temperror action=none header.from=arm.com;
  • Authentication-results-original: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Delivery-date: Fri, 16 Aug 2019 06:33:17 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Thread-index: AQHVU1q3cp1xWTdeh0SFM/dmBWEIoqb9UZ0Q
  • Thread-topic: [UNIKRAFT PATCH v3 1/1] plat/kvm/arm: Add image name as the first argument

Hi Sharan, this patch looks good to me
Reviewed-by: Justin He <Justin.He@xxxxxxx>;

> -----Original Message-----
> From: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
> Sent: 2019年8月15日 19:15
> To: minios-devel@xxxxxxxxxxxxx
> Cc: Justin He (Arm Technology China) <Justin.He@xxxxxxx>; Sharan
> Santhanam <sharan.santhanam@xxxxxxxxx>
> Subject: [UNIKRAFT PATCH v3 1/1] plat/kvm/arm: Add image name as the
> first argument
>
> While setting up the command line arguments to an application, the user
> argument start at index 0 instead of having the application name
> followed by the user arguments.
>
> Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
> ---
>  plat/kvm/arm/setup.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/plat/kvm/arm/setup.c b/plat/kvm/arm/setup.c
> index b8148f9c..3046646d 100644
> --- a/plat/kvm/arm/setup.c
> +++ b/plat/kvm/arm/setup.c
> @@ -18,6 +18,7 @@
>   * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
>   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>   */
> +#include <uk/config.h>
>  #include <libfdt.h>
>  #include <sections.h>
>  #include <kvm/console.h>
> @@ -32,6 +33,7 @@ struct kvmplat_config _libkvmplat_cfg = { 0 };
>
>  #define MAX_CMDLINE_SIZE 1024
>  static char cmdline[MAX_CMDLINE_SIZE];
> +static const char *appname = CONFIG_UK_NAME;
>
>  smcc_psci_callfn_t smcc_psci_call;
>
> @@ -181,22 +183,26 @@ static void _dtb_get_cmdline(char *cmdline,
> size_t maxlen)
>       if (!fdtcmdline || (len <= 0))
>               goto enocmdl;
>
> -     strncpy(cmdline, fdtcmdline, MIN(maxlen, (unsigned int) len));
> +     if (likely(maxlen >= (unsigned int)len))
> +             maxlen = len;
> +     else
> +             uk_pr_err("Command line too long, truncated\n");
> +
> +     strncpy(cmdline, fdtcmdline, maxlen);
>       /* ensure null termination */
> -     cmdline[((unsigned int) len - 1) <= (maxlen - 1) ?
> -             ((unsigned int) len - 1) : (maxlen - 1)] = '\0';
> +     cmdline[maxlen - 1] = '\0';
>
>       uk_pr_info("Command line: %s\n", cmdline);
>       return;
>
>  enocmdl:
>       uk_pr_info("No command line found\n");
> -     strcpy(cmdline, CONFIG_UK_NAME);
>  }
>
>  static void _libkvmplat_entry2(void *arg __attribute__((unused)))
>  {
> -     ukplat_entry_argp(NULL, (char *)cmdline, strlen(cmdline));
> +     ukplat_entry_argp(DECONST(char *, appname),
> +                       (char *)cmdline, strlen(cmdline));
>  }
>
>  void _libkvmplat_start(void *dtb_pointer)
> --
> 2.20.1

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.