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

Re: [PATCH v2 1/3] arm/mpu: Implement setup_mm for MPU systems


  • To: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 12 Nov 2025 16:06:43 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=amd.com 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=arm.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=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=MiZanPlUn/H4shEpLntazS/TlvwQOAjkfJbdp3mM5S0=; b=O0ZtGg2LJQ0VoWhYlkq1f8gNLMSLYBOAIwUwr1SJAQCyhPpkWO4dUjtGnkQmA5jNvl8gMU2DK6OUMMdJv/cEqYCEYli/WBopV7UK+gJKpWsvVuj4DutWGdJwTwiFUw/HXXGz9vYDTWhrLjhJiFtPf33MbJKeUecU7k2GjyRsNpZGDCdYd51xx58gtiQyUf6fot0cmX+L9laxoDbVGGzCW7hhhEXPjELpoT2xJ4pvAp/+MuVoL43AIRoqyDnjk1ARUcsS1+p3Dj9q6AR9tycff4rbDFwm+/PAJ0uqKL2FegoKruxH1YOqZ6cQ0QQ+Hu9U7sYtc9F2m8lbWxgWRxtD2w==
  • 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=MiZanPlUn/H4shEpLntazS/TlvwQOAjkfJbdp3mM5S0=; b=gwHcJMcVjrcDE+qbDCCuab9sBmzxWeKWRhcLrzUXMuuVPQrzABTc7e9zRmzyqJNMaaGqM4EMVajDeKIsFGcxcx8Y17n7R9fmxBohehWn/AdgOgJk/uKrmLctenvGaoi1gjS1e/xI60V5UilPGxdnfJ1VIqQpn7lzFAcdWITCF95fUMhFeDeNyL1j28O7+0rhRgotGexZ+vH25KX+QTHqqxUvH2o35+J+yOOWionpigjzBLO2atfpipzsG+IXy2jA/SO6OedzIpfiJpW+H2Iu1Fcx7p70kAyWwFjs4xMV7MdqcY8wu1kpEciIpPzrDtRIljfT+RB+WzDk8AhTenszxw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=TubpE13QBW8QgGPX3pA+xn+ZJWSdNlSnbLNVMDEyyEERuCtqRJZF5QX9UNikLw+1uK8zttnel0elrR4fLvodBoVDPuroy7T76Ms4jnHazqMB46Azu2UJ7WHN2f/5FWjWJCu+w3CpR8u0PgIrfCNFEbw9fZMDsxCUjhv/S7AijKOa61VJQDfLkt+1vW3B0owTKJ8ORv37XvedmdP00yNOLL/PvXRRL94VtVzeh5vSQ9LkL5PSYrrJ4lWr/kAOnG5uA1+k050za3la3rI+xXfoC/duCIyNE3iebtTal1d+w5mJgPeadM6x0tSOmW87ALzk85tMDPihi2mBX7l/yqSqQg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DuIM5LWuNcSaihjUOgqmpcfS6l1dcb2PTDgSPVbhNZCkp801rlGRHFhFzQNB58BAiF6cvADI2PhOtX9iPyGHhHaeWXqIceJ+AbmQIQ75lgu2YXOZbKVtIvClr7au4Hib/n7Lz0ZJMIxI1bcU+mFcUeGIfuXWjmvh8nork1sliRVxFyUjo6mWziOGr7wYIan1kKU2kbCquIGoL4S6xbedvboX9D5MLCSYNf3TJVEPiBU7SAUxevtBbWNNRiIs9lCnyQbMGkVYjYi0blvhOHjcZGkJoe760PBtLVl5G5o5xGRzJG7G+w+31v8TCpCE/O+x1tSDk7It8masqUzuBFvSvw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Harry Ramsey <Harry.Ramsey@xxxxxxx>
  • Delivery-date: Wed, 12 Nov 2025 16:07:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHcU9GZpx9Ewja+9EW1e1HUZJtzELTvMOuAgAAD+oA=
  • Thread-topic: [PATCH v2 1/3] arm/mpu: Implement setup_mm for MPU systems

Hi Michal,

>>> +void __init setup_mm(void)
>>> +{
>>> +    const struct membanks *banks = bootinfo_get_mem();
>>> +    paddr_t ram_start = INVALID_PADDR;
>>> +    paddr_t ram_end = 0;
>>> +    paddr_t ram_size = 0;
>>> +    unsigned int i;
>>> +
>>> +    init_pdx();
>>> +
>>> +    for ( i = 0; i < banks->nr_banks; i++ )
>>> +    {
>>> +        const struct membank *bank = &banks->bank[i];
>>> +        paddr_t bank_end = bank->start + bank->size;
>>> +
>>> +        ram_size = ram_size + bank->size;
>>> +        ram_start = min(ram_start, bank->start);
>>> +        ram_end = max(ram_end, bank_end);
>>> +    }
>>> +
>>> +    total_pages = ram_size >> PAGE_SHIFT;
>>> +
>>> +    /*
>>> +     * On MMU systems we need some memory to allocate the page-tables used 
>>> for
>>> +     * the directmap mappings.  But some regions may contain memory already
>>> +     * allocated for other uses (e.g. modules, reserved-memory...).
>>> +     *
>>> +     * On MPU systems we need to pre-reserve regions that were allocated 
>>> for
>>> +     * other uses (e.g. modules, reserved-memory...).
>> I'm not sure I understand this part of the comment with regards to
>> populate_boot_allocator(). Could you please explain?

Maybe here we should just write that on MPU system we are populating the boot 
allocator with the
static heap region, since static heap is mandatory for MPU.

What do you think?

e.g.

/*
 * On MMU system…
 * […]
 * 
 * On MPU system we need to populate the boot allocator with the static heap 
region, on such systems
 * the static heap feature is mandatory.
 *

Cheers,
Luca

 


Rackspace

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