All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>,
	Julien Grall <jgrall@amazon.com>
Subject: Re: [PATCH v6 1/9] xen: move do_vcpu_op() to arch specific code
Date: Mon, 27 Jun 2022 13:35:58 +0200	[thread overview]
Message-ID: <YrmWHrqwJOnb0iPr@Air-de-Roger> (raw)
In-Reply-To: <e0b54db4-af1a-fb54-e6e5-ef0b71194091@suse.com>

On Mon, Jun 27, 2022 at 01:08:11PM +0200, Juergen Gross wrote:
> On 27.06.22 13:02, Roger Pau Monné wrote:
> > 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.
> 
> I'd be fine with that.
> 
> I did it in V2 of the (then secret) series, and Jan replied:
> 
>   I'm afraid I don't agree with this movement. I could see things getting
>   moved that are purely PV (on the assumption that no new PV ports will
>   appear), but anything that's also usable by PVH / HVM ought to be usable
>   in principle also by Arm or other PV-free ports.

I see. My opinion is that when other ports need those functions they
should be pulled out of arch code into common code, until then it just
adds confusion to have them in common code.

I will take a look at the current patch, as we need to make progress
on this.

Thanks, Roger.


  reply	other threads:[~2022-06-27 11:36 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 14:01 [PATCH v6 0/9] xen: drop hypercall function tables Juergen Gross
2022-03-24 14:01 ` [PATCH v6 1/9] xen: move do_vcpu_op() to arch specific code Juergen Gross
2022-06-07  5:00   ` Juergen Gross
2022-06-27 10:28   ` Roger Pau Monné
2022-06-27 10:40     ` Juergen Gross
2022-06-27 11:02       ` Roger Pau Monné
2022-06-27 11:08         ` Juergen Gross
2022-06-27 11:35           ` Roger Pau Monné [this message]
2022-06-27 11:47             ` Juergen Gross
2022-06-27 13:00   ` Roger Pau Monné
2022-03-24 14:01 ` [PATCH v6 2/9] xen: harmonize return types of hypercall handlers Juergen Gross
2022-06-29  6:24   ` Juergen Gross
2022-07-06 19:22     ` Christopher Clark
2022-07-07 16:12       ` Christopher Clark
2022-03-24 14:01 ` [PATCH v6 3/9] xen: don't include asm/hypercall.h from C sources Juergen Gross
2022-03-24 14:01 ` [PATCH v6 4/9] xen: include compat/platform.h from hypercall.h Juergen Gross
2022-03-24 14:01 ` [PATCH v6 5/9] xen: generate hypercall interface related code Juergen Gross
2022-07-11 10:18   ` Jan Beulich
2022-07-11 10:50     ` Juergen Gross
2022-03-24 14:01 ` [PATCH v6 6/9] xen: use generated prototypes for hypercall handlers Juergen Gross
2022-03-24 14:01 ` [PATCH v6 7/9] xen/x86: call hypercall handlers via generated macro Juergen Gross
2022-03-24 14:01 ` [PATCH v6 8/9] xen/arm: " Juergen Gross
2022-03-24 14:01 ` [PATCH v6 9/9] xen/x86: remove cf_check attribute from hypercall handlers Juergen Gross
2022-04-08 10:36   ` Dario Faggioli
2022-04-19  8:01 ` [PATCH v6 0/9] xen: drop hypercall function tables Juergen Gross
2022-05-04  7:53   ` Juergen Gross
2022-05-18  9:45     ` Juergen Gross
2022-05-18  9:50       ` Jan Beulich
2022-06-07  5:05       ` Juergen Gross
2022-06-23 13:07       ` Juergen Gross
2022-07-06  7:30 ` Henry Wang
2022-07-06  8:57   ` Jan Beulich
2022-07-06  9:35     ` Henry Wang
2022-07-07 16:10 ` ***PING***: " Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YrmWHrqwJOnb0iPr@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgrall@amazon.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.