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

Re: [PATCH v6 1/9] xen: move do_vcpu_op() to arch specific code


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 27 Jun 2022 13:02:24 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=+YJvntpC1FV7apJyfockOE8dvjS/AQW83QBeu9E2bf0=; b=FGfoXn5sM7pYnmqK1qXK4kePiKMHxCR9NFJeinEO0dcooGSrr3sj1qqDxh+TheYqer1GhvXqdatIOVraPkpZ/kfiiFXtYQn3U8M8wQtjhBg7BBScRIA+PPw+4GQMH8dyxe1ylJVa1C0dMuO/RmxDkbCG+ZGaTvgzMjVFPtL76xmI/kbeqKiGI7g9fRMou3lq7bJaxamHnrLiQ/mONlQKsXMnGEdcm4Vncm/dpdgJcHrSuTSyV7h1t29pfhr4BIoaiNm2kG3ppnvcg/IfP/IZvmeqo5d547fUh+UlusxwyDsXTAimkeH7/JRE2WBLLpLnItBWVTyQ0d5A+c7Y4VzHsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NYEwiaLTdfAia2CMLXQfOu+z3Op3uKYHtSOH6RuFveWLXbphS41+msVWJ+QXTQ7KP3dNQa2W5z7PBcy6ECcgATnQVJG02kUkCEDBTS3YgG+8YZK6Izl5HbyhOTJVE2H25a9f/fGCYtVJYPOdvEuPzOsXtwXlfm6T/iGMaL0hl/FDeQRBBUy4isOT5TQrYxUOE9JHi7s57jKQIKz1G3xZnDND6XJdm2thtim0zpSJ60rxbxFbCSOcvDW6B+nSa01fmEZERfMQnEcW8Qb15IxUAbN8zi4JJn6iX8RSgt1di8Sfuhlh7zTjRofZsSuIdGf5iBVR+MlsSLVBH+8Lk3jFCw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Mon, 27 Jun 2022 11:02:50 +0000
  • Ironport-data: A9a23:rAujdql41RCIsA4aLwxUXP7o5gx3J0RdPkR7XQ2eYbSJt1+Wr1Gzt xIdXG6Ab/beZDamfI0nPo6ypEtTvpHczNNjHVRl/389QiMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EgLd9IR2NYy24DnWVzV4 LsenuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYbwUJIrz8uOEncCZiDWY5Y6Js6rPVGC3q2SCT5xWun3rE5dxLVRlzGLJCv+F9DCdJ6 OASLy0LYlabneWqzbmnS+5qwMM+MM3sO4BZsXZlpd3bJa9+HdafHOOXuJkBhGtYasNmRJ4yY +IDbjVidlLYagBnMVYLEpMu2uyvgxETdhUH9AnP/vFovgA/yiQy8fvXb+LNX+CIYuJnwmiTj U/i4UXmV0Ry2Nu3jGDtHmiXru3AhyTgQ6oJCaa1sPVthTW71mEVTREbS1a/if24kVKlHcJSL VQO/SgjprR081akJvHmRAGxqnOAuh8aWvJTHvc85QXLzbDbiy6bG2wFQzhpeNEg8sgsSlQC3 FKTg8ngAzAptbSPUG+c7Z+dtzb0Mi8QRUc8YisDQRoA8sPUiog5hRLSTf5uCKewyNbyHFnYw TqHsSw/jLU7ltMQ2uOw+lWvqy2ojojESEgy/Aq/dmCq9Ap9YKasYoW67l6d5vFFRLt1VXGEt XkA3s2BtuYHCMjVkDTXGb1RWra0+/yCLTvQx0Z1GIUs/Cis/Hjlep1M5DZ5JwFiNcNslSLVX XI/cDh5vPd7VEZGp4ctC25tI6zGFZTdKOk=
  • Ironport-hdrordr: A9a23:iipN4668E3xiQj/rfwPXwOjXdLJyesId70hD6qkoc20xTiSZ// rCoB1p726RtN93YgBapTngAtj5fZqyz/9ICOUqVotKGTOW2ldAT7sSl7cKoQeBJ8SWzIc06U 4jSdkcNDSaNzRHZLPBjjVQZOxO/DDoysqVbKzlvhBQpElRGsddBilCe3+mLnE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Jun 27, 2022 at 12:40:41PM +0200, Juergen Gross wrote:
> On 27.06.22 12:28, Roger Pau Monné wrote:
> > On Thu, Mar 24, 2022 at 03:01:31PM +0100, Juergen Gross wrote:
> > > The entry point used for the vcpu_op hypercall on Arm is different
> > > from the one on x86 today, as some of the common sub-ops are not
> > > supported on Arm. The Arm specific handler filters out the not
> > > supported sub-ops and then calls the common handler. This leads to the
> > > weird call hierarchy:
> > > 
> > >    do_arm_vcpu_op()
> > >      do_vcpu_op()
> > >        arch_do_vcpu_op()
> > > 
> > > Clean this up by renaming do_vcpu_op() to common_vcpu_op() and
> > > arch_do_vcpu_op() in each architecture to do_vcpu_op(). This way one
> > > of above calls can be avoided without restricting any potential
> > > future use of common sub-ops for Arm.
> > 
> > Wouldn't it be more natural to have do_vcpu_op() contain the common
> > code (AFAICT handlers for
> > VCPUOP_register_{vcpu_info,runstate_memory_area}) and then everything
> > else handled by the x86 arch_do_vcpu_op() handler?
> > 
> > I find the common prefix misleading, as not all the VCPUOP hypercalls
> > are available to all the architectures.
> 
> This would end up in Arm suddenly supporting the sub-ops it doesn't
> (want to) support today. Otherwise it would make no sense that Arm has
> a dedicated entry for this hypercall.

My preference would be for a common do_vcpu_op() that just contains
handlers for VCPUOP_register_{vcpu_info,runstate_memory_area} and then
an empty arch_ handler for Arm, and everything else moved to the x86
arch_ handler.  That obviously implies some code churn, but results in
a cleaner implementation IMO.

Also has the nice benefit of removing unreachable code from the Arm
build, which is also a MISRA-C rule.

> The "common" just wants to express that the code is common. I'm open
> for a better suggestion, though. :-)

Right, it lives in common/ anyway, so there's not a much better name.

Thanks, Roger.



 


Rackspace

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