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

RE: [PATCH v2 11/40] xen/mpu: build up start-of-day Xen MPU memory region map


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "ayan.kumar.halder@xxxxxxxxxx" <ayan.kumar.halder@xxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 1 Feb 2023 05:39:45 +0000
  • Accept-language: en-US
  • 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=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=hxpFKNHzViWLAA9DiG4Oxyfyq64BtVV1CnamlGeQP+Y=; b=V+IaacA+j10K+dvrO6isV4CcC3+51OTBOwm/aR9qAvMWX1Ve/lHE0mmFFMHbVzCzKXitG0tOMlSeT+dZ+yz2qH28uYzyf2bknA0uOTFqeqDhU47h6fkGgxyKBKOxRjYnnRaW/tW/I4YN4owbGfdc+nnP17+gD35On8IwyrV7O+cgCFwxjMowx3BrsvTxPXuZ7qcIb9ZlZOTfcTxczhRRS7MVUBrR4VrT1gWUj+DTbPC1/dSQw+D+6r81jaMMQ/osSqfGOKEY4YBB0NQCPiCkT6s39QS3fcf7Ltx7e2p2URS5CPCeTNoV63Xk32VG6yXgh6acKH3LgZYyb59wxrZRwQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nl7io+6UkzJg9Vuok5eG3vzbeCVV8HE1O5L+N0ZyxBkuKNDSq4u5gkq6xD44djO3tUSc1HwN2ZtPEPuehB6JjF7AtxPUBYHz2UmyK9w+GfYNHfKuoHIGtG/8ynAZcw6mXS/ATyzdlZq324SPj+v92EIZyWg8BQa361qF3/5p1QcRRfKhE+h8zozi36ZUQIHLZqZ1Tniwmm1LftHwurpb6V4dNaDI10BKup4u6Tq7t/fYhjICiHR+5Q0/iAIWKgu9GJsfuSSOFDI9aeLld+91VP9VG3psmqwApTSrQOx54SdCfUkHfNlswf5FzkOxD+x7ie/1bdFU7RBIhYcbgxwhJg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 01 Feb 2023 05:40:18 +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: AQHZJxAhTWb1zeTHm029bSgcZo/2Yq6l4H6AgA7nVJCAAFMfgIAAHOxggAGXmACAARsywIAAc7oAgAFRxNA=
  • Thread-topic: [PATCH v2 11/40] xen/mpu: build up start-of-day Xen MPU memory region map

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Tuesday, January 31, 2023 5:28 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>;
> ayan.kumar.halder@xxxxxxxxxx
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Subject: Re: [PATCH v2 11/40] xen/mpu: build up start-of-day Xen MPU
> memory region map
> 
> 
> 
> On 31/01/2023 04:11, Penny Zheng wrote:
> > Hi Julien
> >
> >> -----Original Message-----
> >> From: Julien Grall <julien@xxxxxxx>
> >> Sent: Monday, January 30, 2023 5:40 PM
> >> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> >> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini
> >> <sstabellini@xxxxxxxxxx>; Bertrand Marquis
> >> <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> >> <Volodymyr_Babchuk@xxxxxxxx>
> >> Subject: Re: [PATCH v2 11/40] xen/mpu: build up start-of-day Xen MPU
> >> memory region map
> >>
> >> Hi Penny,
> >>
[...]
> >>
> >> I would suggest to investigate the cost of "hunting down each section".
> >> Depending on the result, we can discuss what the best approach.
> >>
> >
> > Correct me if I'm wrong, the complicated things in assembly you are
> > worried about is that we couldn't define the index for initial sections, no
> hardcoded to keep simple.
> 
> Correct.
> 
> > And function write_pr, ik, is really a big chunk of codes, however the
> > logic is simple there, just a bunch of "switch-cases".
> 
> I agree that write_pr() is a bunch of switch-cases. But there are a lot of
> duplication in it and the interface to use it is, IMHO, not intuitive.
> 
> >
> > If we are adding MPU regions in sequence as you suggested, while using
> > bitmap at the same time to record used entry.
> > TBH, this is how I designed at the very beginning internally. We found
> > that if we don't do reorg late-boot to keep fixed in front and
> > switching ones after, each time when we do vcpu context switch, not
> > only we need to hunt down switching ones to disable, while we add new
> > switch-in regions, using bitmap to find free entry is saying that the
> process is unpredictable. Uncertainty is what we want to avoid in Armv8-R
> architecture.
> 
> I don't understand why it would be unpredictable. For a given combination
> of platform/device-tree, the bitmap will always look the same. So the
> number of cycles/instructions will always be the same.
> 

In boot-time, it will be always the same. But if we still use bitmap to find 
free
entry(for switching MPU regions) on runtime, hmmm, I thought this part will
be unpredictable.

> This is not very different from the case where you split the MPU in two
> because
> 
> >
> > Hmmm, TBH, I really really like your suggestion to put
> > boot-only/switching regions into higher slot. It really saved a lot
> > trouble in late-init reorg and also avoids disabling MPU at the same
> > time. The split is a simple and easy-to-understand construction compared
> with bitmap too.
> 
> I would like to propose another split. I will reply to that in the thread 
> where
> you provided the MPU layout.
> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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