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

Re: [PATCH v4 01/13] x86/boot: add cmdline to struct boot_domain


  • To: <dmkhn@xxxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Wed, 23 Apr 2025 12:40:24 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=proton.me smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w/Nmv1nQx0UDMCQNZUSCLEtvJfNgk7XbZB9PEI3gZns=; b=y8hyrEwj54rVuUfK7N7KP1aTbTCVECfvMxVQDWj+HeXMCgwLAm4cP/8XBOyzY9ThAMALmdVNDJXQMf+a7Kf1obcVpgoXN0uloneneTOUo3uSAqAL96DkOIhJ/ZDfUznTJ++7vVRvxNPGbtzdSD7IDUSy3avCGaH93kOyU9ldp4B/O7GA3hmLxpYzsUKdeLsmpUo9TK92k9S3j5W4acUBSgEY5nGZ5CKA1K0Gf6NevgMTDY5VOeK5/YB+SDtzl402quhVJAGEuiA2c9J2FT0IMsoJboPkpADyempZF6rplA08rQTKJi0hwlxQ/p3s4TJq1rb6AILq7+4/lgLLCJIAsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qqnXd6V3bQGDHrytlwZOcxflcNAZHiSIeJc6R07k3kAmegxzev//xSaWr6z6rzgcRr6zg5CrU1ygyWl3Y6ECPhcs3PnWPtUHzbWrxYHrd4ToeZRxoETu4rEdfgcS5Z03LVeh30/unaDSPLWp3foyd03POMF06tACavLSdzgtEYAuzu+syDON4niLgYHhgKXbQWSZ+l6gj9dde1cQoXlg8zhgsOg6mPxnS0aIlQD2/9c6A9nFNXenmcW7cgtiyKM7WHjBtzbQ+/hrO+32wlZzN/7UudlordqtGQALcUotu+YjkX0LWg+8b5rpHSCBe9Q/92ynWdh2G6JZqduN73yfDQ==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Wed, 23 Apr 2025 11:40:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri Apr 18, 2025 at 10:16 PM BST, dmkhn wrote:
> On Thu, Apr 17, 2025 at 01:48:23PM +0100, Alejandro Vallejo wrote:
>> From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
>> 
>> Add a container for the "cooked" command line for a domain. This
>> provides for the backing memory to be directly associated with the
>> domain being constructed.  This is done in anticipation that the domain
>> construction path may need to be invoked multiple times, thus ensuring
>> each instance had a distinct memory allocation.
>> 
>> Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
>> Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
>> Signed-off-by: Alejandro Vallejo <agarciav@xxxxxxx>
>
>
> Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx>

Thanks

>> diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
>> index 2a094b3145..49832f921c 100644
>> --- a/xen/arch/x86/hvm/dom0_build.c
>> +++ b/xen/arch/x86/hvm/dom0_build.c
>> @@ -778,21 +777,21 @@ static int __init pvh_load_kernel(
>>      /* Free temporary buffers. */
>>      free_boot_modules();
>> 
>> -    if ( cmdline != NULL )
>> +    rc = hvm_copy_to_guest_phys(last_addr, bd->cmdline, cmdline_len, v);
>> +    if ( rc )
>>      {
>> -        rc = hvm_copy_to_guest_phys(last_addr, cmdline, strlen(cmdline) + 
>> 1, v);
>> -        if ( rc )
>> -        {
>> -            printk("Unable to copy guest command line\n");
>> -            return rc;
>> -        }
>> -        start_info.cmdline_paddr = last_addr;
>> -        /*
>> -         * Round up to 32/64 bits (depending on the guest kernel bitness) so
>> -         * the modlist/start_info is aligned.
>> -         */
>> -        last_addr += elf_round_up(&elf, strlen(cmdline) + 1);
>> +        printk("Unable to copy guest command line\n");
>
> Side note: I think it makes sense to add domain ID to all printouts in
> pvh_load_kernel(). E.g. block under elf_xen_parse() logs domain ID.

Sounds sensible and easy enough. Sure.

Cheers,
Alejandro



 


Rackspace

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