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

Re: [PATCH v2 3/5] arm/dom0less: put dom0less feature code in a separate module


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 2 Nov 2023 11:15:26 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=ij4llLYRvzJoeeCMyPmnoP//UnQFLv2i3Iz6lGsUXlk=; b=BeAk1I+RAPMc+1GO19W9KSXIUS48J1nK6fFAVorb2FPgNT/ofnCaTmKtqxpBVrcqxQ1lY3Kag42Cn6R7RTOTeWr3Y+gy9hnlwq29kL+fuMfSP66I33kr6929RuuskM0CyP79XyhaUFV/Vhn5US8In/BKZD7UZ668t0WimcsOxfS06fpux/YVn9SivBG6SZMoXD140ZgMTR7pdMreQF0rdIc1YaW9j/Ow2NjUMP4zldqx9AbzEwQidm3JoQTBsfgyCXLaRm4ZGXHGSur5pJd3l/rvocvEpgPKJS/GfsIcJR4tegvlDJMeXZc7k7urhTvmFPI7z1uG0BSj4ZOP4bmaIw==
  • 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=ij4llLYRvzJoeeCMyPmnoP//UnQFLv2i3Iz6lGsUXlk=; b=EXvDUN2nBtUjwEBFVARWibhTY8n0ifvTcYYs1QW5NdYdQGmzMfftZDIThH8RO+akcrwumC5defEUbLaZfSlm1TQL/PYH5cpG8vJmiYidBupsIfVAb/uNLVhFB1C7vZTmEILqazxupwcXtpG9Xhcm0U3XhyeRJwskuAZgbX0ytlacHVAm/05UQnwi1a7HLwIR8W6FVA497TuqxGO6+Vyx+1AbOrsLks1P8rxURfCA/3ZUd80rS+Ated4Nv8MvQaH5ImQjFetyq6UIN3UDNANywREezdILODV5pEDsSgIW6cfNlv6Um7w6NPJhQ/j946613MdjUn4ZS3CQY3BhPmxjSg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=WhiEiM9AMZcHpVRobSGz+fhkfF/8QR2nlIlPdslEXK/OKTIruNaKTtFV6cK0UeY03MQEEpVUVNzSqgd8eY9krwVpbm3GFTZj1igdx12GZRyNBe97IQ0Ga7G3gn8ZKTT2f/NXwue+KYAzK49by0JQO6Q95tt8uSgHKiqDIVi8Ku+VsOM33Moq6+egGJpIPpsGzyez7NEQgGXs7PhjvoqsY9CCKACDMVRszuDWnOD8muPBsOMaSFZXdcy1C7VgpySJP2bVSFzyGBe9J6HH6KzDCjyRsRywuql9Na4YC83duDn5f5gQPTiN/caWwUqsp03o1oe3xGAIIqITZ0nSvtDJPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FwbEhRITkqfMglOI34NsHtancemB0pI31mNasDBfreyll578OlZWz/8oHLsvFxq1WEHWVtStaFSGW9kDk6pLwOyHtkMsXMuUrWA50VzjHkhMBKdeDagxky95xv7/RGJPYt1klkiwjIcH2hTTP6VTiS7AvqeH8kP16zASbSVgBnkwmH5qtq5gSJ6/OZp90mTafXAxMUKtCzIrWsm1flh2PaOhO+MK6TTZXtMnb7LkaIIvh0S117kUruhNsYXhZ1dy7dsY/yEAseWRLpUD5LKzqGT/D7q7WpeJDmUkcITT+PyrBdsoAoPXG2Nut7rOquJdnGWAL1Nk82e8CG3TgmAskg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 02 Nov 2023 11:15:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ8UtNgBNI2koBH0+cEATmTDiuOrBmBjGAgAES7gA=
  • Thread-topic: [PATCH v2 3/5] arm/dom0less: put dom0less feature code in a separate module

Hi Julien,

>> diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
>> new file mode 100644
>> index 000000000000..dc9c90cf00a7
>> --- /dev/null
>> +++ b/xen/arch/arm/dom0less-build.c
>> @@ -0,0 +1,1087 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +/*
>> + * xen/arch/arm/dom0less-build.c
>> + *
>> + * Code related to the dom0less functionality
>> + *
>> + * Copyright (C) 2023 Arm Ltd.
> 
> This feels a bit odd to add your copyright here. It sounds like Arm wrote all 
> the code, but you only moved. That said, I am not a lawyer.

Mmm yes, we should be required to put our copyright in everything we create or 
modify or touch,
said that, I could modify that to be like this:

/*
 * xen/arch/arm/dom0less-build.c 
 *
 * Code related to the dom0less functionality
 *
 * Original code from xen/arch/arm/domain_build.c
 * Modifications: Copyright (C) 2023 Arm Ltd.
 */

What do you think?

> 
>> + */
>> +
>> +#include <xen/device_tree.h>
>> +#include <xen/err.h>
>> +#include <xen/event.h>
>> +#include <xen/grant_table.h>
>> +#include <xen/iocap.h>
>> +#include <xen/libfdt/libfdt.h>
>> +#include <xen/sched.h>
>> +#include <xen/serial.h>
>> +#include <xen/sizes.h>
>> +#include <xen/vmap.h>
>> +
>> +#include <asm/arm64/sve.h>
>> +#include <asm/dom0less-build.h>
>> +#include <asm/domain_build.h>
>> +
>> +bool __init is_dom0less_mode(void)
>> +{
>> +    struct bootmodules *mods = &bootinfo.modules;
>> +    struct bootmodule *mod;
>> +    unsigned int i;
>> +    bool dom0found = false;
>> +    bool domUfound = false;
>> +
>> +    /* Look into the bootmodules */
>> +    for ( i = 0 ; i < mods->nr_mods ; i++ )
>> +    {
>> +        mod = &mods->module[i];
>> +        /* Find if dom0 and domU kernels are present */
>> +        if ( mod->kind == BOOTMOD_KERNEL )
>> +        {
>> +            if ( mod->domU == false )
>> +            {
>> +                dom0found = true;
>> +                break;
>> +            }
>> +            else
>> +                domUfound = true;
>> +        }
>> +    }
>> +
>> +    /*
>> +     * If there is no dom0 kernel but at least one domU, then we are in
>> +     * dom0less mode
>> +     */
>> +    return ( !dom0found && domUfound );
>> +}
>> +
>> +static bool __init allocate_bank_memory(struct domain *d,
>> +                                        struct kernel_info *kinfo,
>> +                                        gfn_t sgfn,
>> +                                        paddr_t tot_size)
> 
> I understand that this is today only used by domUs. However, we could 
> technically use it for allocating dom0 memory if it is not 1:1.
> 
> So I think this function should stay in domain_build.c.

Ok I can leave it there, is it ok for you if I protect it using the KConfig in 
domain_build.c since that code is currently not used apart from dom0less?
(I will do that in the last patch if you agree)

> 
> The rest of the code movement looks alright to me.
> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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