[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/16] x86/boot: add cmdline to struct boot_domain
- To: Alejandro Vallejo <agarciav@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
- From: Alejandro Vallejo <agarciav@xxxxxxx>
- Date: Wed, 9 Apr 2025 12:28:06 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com 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=6DowtmgwRIK88JgB6IjV7FGb2nBUtbyDSiEL9cfroBg=; b=g10SUICceXatt1ZAnVLXPA5uxPAKtO356IFDYadTCJ73BBAeLg12Jb3qiwh/I2Y1LjDLrohLhzJwQ09ZsOeolCjumPurSSNKrRODtKKU/siCs7pn6fEHF2ZEVo2I5QuV/1SR2HQ2Qb8pqS990MZSCcmdlAq2xxnfhNCd+0/uBZ/xx4VC6MXo+HAiepJxJjtxXDIlBBe9BA9PvmUBeEMPnjp+IiXA6L3lyAjysDCY0CB3DdNYA7Y8ZKr1n08o2jYl5Tpo30gp2RBMSsbl9U29iUPcjhgZOUYAIhW2n5KKcBI1HxbhnuWgwZ2MRojZpOddnn1CCyMuO7JQtPATcY1Bkg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fVMvieJsfZkVZ+8lv2X+eGD+ayrbtEJVvZ6e1ufb47PxaYHgnkMtBEeKbKJNhvcJbJyMJVtVgxIpNvynrWnxnq8GuxTNpftXTL0ci8W4sdpWoqDDIJi/sgHNTEUQQLflzi//+AC9EeTc1qONonxwxTa7fzJmPCihLtOfMjg2MM/GXmZKBq8ys6DVbxF7hXE0UWdKA7RXxNVxmTVhjEnHFJQFxSPKbl+vJOKPcFNNdY/tfqevMUn0RcDVZrJzq82xe2lJkW0l0qsSE4DvnsouiaT59KaviTRnP3NmgznyB3vYZ7vtdXuKKo5OeJfIWWhJLVMFrSME1RDtbakPgmmvWw==
- Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 09 Apr 2025 11:28:27 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed Apr 9, 2025 at 12:11 PM BST, Alejandro Vallejo wrote:
> On Wed Apr 9, 2025 at 7:48 AM BST, Jan Beulich wrote:
>> On 08.04.2025 18:07, Alejandro Vallejo wrote:
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -978,10 +978,30 @@ static unsigned int __init copy_bios_e820(struct
>>> e820entry *map, unsigned int li
>>> return n;
>>> }
>>>
>>> -static struct domain *__init create_dom0(struct boot_info *bi)
>>> +static size_t __init domain_cmdline_size(
>>> + struct boot_info *bi, struct boot_domain *bd)
>>
>> const for both? And perhaps s/domain/dom0/ in the function name?
(missed this one)
Sure to the const pointers. But as the hyperlaunch effort progresses the
point is to turn all this into a more generic domain builders rather
than having dom0-specific stuff. Changing the name like that here to
adjust it in a few patches down the line doesn't seem worth the effort.
>> While this tidies the local variable, what about bd->cmdline? As it stands
>> this
>> gives the impression that you're freeing a pointer here which may still be
>> used
>> through passing bd elsewhere.
>
> That ought to have been bd->cmdline indeed.
>
Actually, it can't be. It's a "const char *", so XFREE() chokes on it.
I'll turn it into
XFREE(cmdline);
bd->cmdline = NULL;
instead.
Cheers,
Alejandro
|