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

Re: [PATCH v7 8/8] xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}


  • To: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Sat, 14 Oct 2023 01:30:21 +0000
  • Accept-language: zh-CN, 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=BPR5YLQuD21gt7bgzmHE/AjHWx5JZ6+N61QStTYGmxw=; b=GGf9juaTYdJBdaA705QXfj+yUyjWq5t8i+LZ1iekEwq3dmmviRBhhG3SxK+HJB7phhSHPU08A20k5mGOjVCJPG9I5fR27D5SQoERwLRHPdk193yk1PS3LZiGFpracFlc3/AWyfc5wnyCNbYGoYcuJnZbrThtHgwSkv5d3tjH7sj42zCUD+iMctn72lyMSAEk+jA8BqtdsBPE1obsvq022utfdwCLBhW6tTeXBAgdnsHtGq00d6ISmvdwF1Lrr6voz2WL7ZmTs3LQRk7Z8iCbJAXa+Zg/WroGyrjp+K4cQU+K+2x/NaLgv3KHQ8wp6h2r8b6XUVQVsQy9xXgIesQIBg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y9TkeNUqGYb3TnkYbvwr+cndZsTQuQizn2KjXsXB2aw2tezSAoyreooOfQXBOLD/j1tvES5Iu9nNe/ey+Phbk5PSHB7FzQcD3MQ5KPu8E8M2H9QaZ+y3z2RcGV7bs+A+flJG0YEnXXykyzAF9HsAQrne640MasjJTS7l8C/T8nexEyqT2LLG1+GeDkjrG+FaqpBFeOpWgxs8cCw2hAlH4mKGedeqwG5W/kWgeDy1LxfCvnKgiXOUEmok9I2ZvO34s0MxyKgdyLr5M/uu19ngFSze3BnTeCTdeenzhgYsu+rZ0E79ZqFg5fR06ZcL1Pny3DTgAmyqxg6o4tvArYrRcg==
  • 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>, Penny Zheng <Penny.Zheng@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
  • Delivery-date: Sat, 14 Oct 2023 01:30:44 +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: AQHZ+kyDxYKGSy7Hi0WFFm+WJG77tLBIEmwAgAB07AA=
  • Thread-topic: [PATCH v7 8/8] xen/arm: mmu: move MMU specific P2M code to mmu/p2m.{c,h}

Hi Julien,

(Sending this email directly “To:” Bertrand and Stefano to catch their 
attention about
one question that you ask them)

> On Oct 14, 2023, at 02:31, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Henry,
> 
> some more remarks.
> 
> On 09/10/2023 02:03, Henry Wang wrote:
>> +/*
>> + * Invalidate all entries in the root page-tables. This is
>> + * useful to get fault on entry and do an action.
>> + *
>> + * p2m_invalid_root() should not be called when the P2M is shared with
>> + * the IOMMU because it will cause IOMMU fault.
>> + */
>> +void p2m_invalidate_root(struct p2m_domain *p2m)
> 
> I think this function doesn't make sense for the MPU. What would invalidate?
> 
> The only caller outside of the file is in arch_domain_creation_finished(). 
> This was used for set/way emulation which I believe will be difficult to 
> implement efficiently for the MPU (see my other reply to this patch).
> 
> So I would consider to move arch_domain_creation_finished() in mmu/p2m.c or 
> creating a new function p2m_domain_creation_finished() which is called from 
> arch_domain_creation_finished().

Yeah make sense, I will do the suggested change in v8.

> [...]
> 
>> +/*
>> + * Clean & invalidate RAM associated to the guest vCPU.
>> + *
>> + * The function can only work with the current vCPU and should be called
>> + * with IRQ enabled as the vCPU could get preempted.
>> + */
>> +void p2m_flush_vm(struct vcpu *v)
> I believe an implementation of p2m_flush_vm() would be quite expensive for 
> the MPU. It would be better to not emulate set/way for now.
> 
> It would also feel a bit odd to leave it unimplemented and called from 
> check_for_vcpu_work(). So maybe we want to rename it. I don't have a goood 
> name suggestion though. Bertrand, Stefano?

See the beginning of this email.

Kind regards,
Henry

> 
> [...]
> 
> -- 
> Julien Grall


 


Rackspace

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