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

Re: [PATCH v3 2/9] xen/arm: add cache coloring initialization for domains


  • To: Carlo Nonato <carlo.nonato@xxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Nov 2022 17:40:14 +0100
  • 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=fpXqnltry/DVMttgSGxzUaNst09c34V5O+Xj2fwDYdk=; b=fQiPvkNhMV8fPDtUfwn14cU7pfPh/34+ltqAjNzxxnz/+MB5nZuRG/KtatUW1x2WbK6PceQDlDay1tiANp48tPyAim/mlOq0O/4fIBORqqTv2zGh8sJ9nMMLsV0FZFpSm3CKUB3CKJa0N3FKPpDkyAyETrGNmELJXf9XKOeEOw2DQSJ5ExX3B6CdnLJZ1ysnuncaSnDywnVxwLQHy98IWahC1kfpYm8srElbSOq1v51sxymS3G8yAdoePQ6w6Cykeg4rxot5Ks+RhkLRogGQWWriISK270xFzo2z3JlaZAs+QIUa9KVNapNU+xEXcIC7fCHobUcHvA8X4i5RroYqVw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ks9eTSKH/yTsHTFmwW2TQ9W42ta4+y34Slr/0glkj84coLlBGlmm+qT/xITAy6ZCnQI89XF/sm2afnv3Ocj35KBzFf5tCMHwWZ06lYXxcQcBgux8u7dm6dCDCKXiaowhAcGKxw2h2p2TUcxK7Dgru3u/xryyUtc9jAW8SNbnQXBBymejj4eTFe8IOfVv5uExsikejQS14/0GvlBca5bPwvBFDiIykAAj18kXcPHXkJyZi4747VNUAUStLrEnwMtkcmDc5lUxyIsW9/vQ6xqSSya/CfanodNjluLAsnkN7DBTWV0ZHinvF7h7U7+D4LAi9mMNzOuxXmhABifg0fW5NA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: marco.solieri@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, andrea.bastoni@xxxxxxxxxxxxxxx, lucmiccio@xxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 21 Nov 2022 16:40:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.11.2022 17:23, Carlo Nonato wrote:
> On Mon, Nov 21, 2022 at 4:14 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 21.11.2022 15:50, Carlo Nonato wrote:
>>> I want to ask you some questions about this patch because in the previous
>>> version me and Julien have discussed how cache colors should be passed in
>>> domain creation. You should be able to read that discussion, anyway here is
>>> a link to it
>>>
>>> https://marc.info/?l=xen-devel&m=166151802002263
>>
>> I've looked at the first few entries, without finding an answer to ...
>>
>>> In short, using struct xen_arch_domainconfig works fine only when domctl
>>> hypercall is issued. That struct contains a XEN_GUEST_HANDLE so it
>>> should point to guest memory and must not be used when creating a domain
>>> from Xen itself (i.e. dom0 or dom0less domains). The easy way to go is then
>>> changing the domain_create() signature to require also a color array and its
>>> length to be passed in for these latter cases.
>>> Are you ok with that? See below for more comments.
>>
>> ... my immediate question: Does supplying the colors necessarily need to
>> done right at domain creation? Wouldn't it suffice to be done before first
>> allocating memory to the new domain, i.e. via a separate domctl (and then
>> for Xen-created domains via a separate Xen-internal function, which the
>> new domctl handling would also call)? Or do colors also affect the
>> allocation of struct domain itself (and pointers hanging off of it)?
> 
> This would be really good. The only problem I can see is the p2m allocation
> which is done during domain creation. With the current set of patches it
> results in a "Failed to allocate P2M pages" since we want to have p2m tables
> allocated with the same color of the domain and a null page is returned
> because we have no colors.

Hmm, I see. It would seem to me that this p2m init really is happening
too early. Ideally domain_create would merely mean creating a largely
empty container, with stuff being populated subsequently as necessary.
But I guess this is too much of a re-work to be done in the context
here, plus of course I may be overlooking something which actually
makes it necessary for domain creation to be structured the way it is
right now. (Imo the reason for the early minimal population of the p2m,
added only quite recently, wasn't a good one, and the vGIC init would
better be deferred. Yet once again I may lack details on why that's not
possible.)

Jan



 


Rackspace

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