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

Re: [PATCH RFC] x86/boot: Update construct_dom0() to take a const char *cmdline


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 19 Jul 2023 16:13:40 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P1sYICqKnpdu0fmsyevRhCyDcZaOPyWwxqQvjY5Jm84=; b=j41qLFYOFR7Sr+WwOWVIIYfN8Nj5S51EryF3J8PE5EAG/ue+rh6W28gY+BZerBjWN+/AGJ82NET4B6WaJmw4al1lZQE89/CEzUwtj7QNCxrD3W5Fj5S8RlqcD+EtPXavoJqSNWPHgjBAzZRtmFuoqdJh5pCh17W67GRCct6OUoBZ2OV4+tnWQArxPVHAQlX5NCzxQjs/p1ftn259ivDW1Ao4m6doItfE1i6Us9tHEJz9Ob+tdLOtLjMtZza/yeEqFBRlw2uae4bJScUsD8eharr58hXGQOi4W9xxT/hyvlb+X6lyuQA/CcCRR51z+uzmrNK8Za9FjnAP54tMNpzvvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KjXdc2ltqmJqB+CpLPC1NnoLtiGCOYHOTnf4e1l31+NuoRT6LPtw3YB0+sUiX0JewJeEo7aU1TyTMKpi6IPclqGwvJCFjdXQHg41bc4HqseRex/2UOBIG5MZDMAsI4i+prGtZ0DBmBftjo6HA4TvciE7sKGx0YKbaiDNCYaIuGWijIjtJLVAuhPt6hqAFtrLVrt51HXVW1Gq3lZ7itVFkFIUqoFjYymS7qYFBhlEgxYtH3RwWMURWEslYvIebiHkCalACAPLTb4JCcv14dDkTZgLE0f/Cx8ixisnMvM2hqV0cy8mscoe8QMZh+xafENgFDDmW6vhgTTe2EfYzT8kzg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Christopher Clark <christopher@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 19 Jul 2023 14:13:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.07.2023 15:18, Andrew Cooper wrote:
> With hvm_copy_to_guest_*() able to use const sources, update construct_dom0()
> and friends to pass a const cmdline pointer.  Nothing in these paths have a
> reason to be modifying the command line passed in.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
> CC: Christopher Clark <christopher@xxxxxxxxxx>
> 
> Slightly RFC.
> 
> I'm confused as to why image is const, but the initrd isn't.

dom0_construct_pv() has

            initrd->mod_start = initrd_mfn = mfn_x(page_to_mfn(page));

Looks like dom0_construct_pvh() and pvh_load_kernel() could have
it const-ified.

> This is necessary to make the -Wwrite-strings bodge compile, but I'm hoping
> that a less-bad solution to the cmdline literals problem would avoid the need
> to propagate const through this callpath.

But propagating const through this, like any other, path is a good
thing, isn't it?

If you want to keep it (you appear to be uncertain)
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

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