|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v9 6/6] x86/boot: add cmdline to struct boot_domain
On 11/15/24 08:12, Daniel P. Smith wrote: 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> --- Changes since v8: - switch to a dynamically allocated buffer - dropped local cmdline var in pv dom0_construct() Changes since v7: - updated commit message to expand on intent and purpose --- xen/arch/x86/include/asm/bootdomain.h | 2 ++ xen/arch/x86/include/asm/dom0_build.h | 1 + xen/arch/x86/pv/dom0_build.c | 6 ++-- xen/arch/x86/setup.c | 49 ++++++++++++++++++++++----- 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/asm/bootdomain.h index 3873f916f854..75e7c706d86e 100644 --- a/xen/arch/x86/include/asm/bootdomain.h +++ b/xen/arch/x86/include/asm/bootdomain.h @@ -12,6 +12,8 @@ struct boot_module; struct domain;struct boot_domain { The logic from which this originally derives mistakenly gives the sense, at least for me, that `string` field from module_t would only be a valid address if there was a string. I have now discovered this is not the case but is in fact the address of a zero length string. It just so happens all the previous logic worked out even for a zero length string. It also means this block was always being executed, since the check for a cmdline_pa will always be true. I am open to other suggestions, but my thinking right now is that the check of cmdline_pa should be a twofold check, that it is not zero and that it has a string length, e.g.:
if ( (bd->kernel->cmdline_pa &&
strlen(__va(bd->kernel->cmdline_pa))) || bi->kextra )
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |