All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: "Lengyel, Tamas" <tamas.lengyel@intel.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
	"Cooper, Andrew" <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] tools/libs/ctrl: add and export xc_memory_op
Date: Thu, 19 May 2022 16:31:12 +0200	[thread overview]
Message-ID: <403a66db-143a-7d05-1d0f-5a7d30721e34@suse.com> (raw)
In-Reply-To: <CY4PR11MB0056943EA3C905629887A4E3FBD09@CY4PR11MB0056.namprd11.prod.outlook.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 3072 bytes --]

On 19.05.22 15:59, Lengyel, Tamas wrote:
> 
> 
>> -----Original Message-----
>> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
>> Juergen Gross
>> Sent: Thursday, May 19, 2022 9:33 AM
>> To: Lengyel, Tamas <tamas.lengyel@intel.com>; xen-devel@lists.xenproject.org
>> Cc: Wei Liu <wl@xen.org>; Anthony PERARD <anthony.perard@citrix.com>;
>> Cooper, Andrew <andrew.cooper3@citrix.com>
>> Subject: Re: [PATCH] tools/libs/ctrl: add and export xc_memory_op
>>
>> On 19.05.22 15:27, Tamas K Lengyel wrote:
>>> Add and export xc_memory_op so that do_memory_op can be used by tools
>>> linking with libxc. This is effectively in the same spirit as the
>>> existing xc_domctl and xc_sysctl functions, which are already exported.
>>>
>>> In this patch we move do_memory_op into xc_private.h as a static
>>> inline function and convert its 'cmd' input from int to unsigned int
>>> to accurately reflect what the hypervisor expects. No other changes are made
>> to the function.
>>>
>>> Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
>>> ---
>>>    tools/include/xenctrl.h      |  1 +
>>>    tools/libs/ctrl/xc_private.c | 63 +++---------------------------------
>>>    tools/libs/ctrl/xc_private.h | 58 ++++++++++++++++++++++++++++++++-
>>>    3 files changed, 63 insertions(+), 59 deletions(-)
>>>
>>> diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h index
>>> 95bd5eca67..484e354412 100644
>>> --- a/tools/include/xenctrl.h
>>> +++ b/tools/include/xenctrl.h
>>> @@ -1597,6 +1597,7 @@ int xc_vmtrace_set_option(xc_interface *xch,
>>> uint32_t domid,
>>>
>>>    int xc_domctl(xc_interface *xch, struct xen_domctl *domctl);
>>>    int xc_sysctl(xc_interface *xch, struct xen_sysctl *sysctl);
>>> +long xc_memory_op(xc_interface *xch, unsigned int cmd, void *arg,
>>> +size_t len);
>>>
>>>    int xc_version(xc_interface *xch, int cmd, void *arg);
>>>
>>> diff --git a/tools/libs/ctrl/xc_private.c
>>> b/tools/libs/ctrl/xc_private.c index c0422662f0..6a247d2b1f 100644
>>> --- a/tools/libs/ctrl/xc_private.c
>>> +++ b/tools/libs/ctrl/xc_private.c
>>> @@ -326,64 +326,6 @@ int xc_flush_mmu_updates(xc_interface *xch, struct
>> xc_mmu *mmu)
>>>        return flush_mmu_updates(xch, mmu);
>>>    }
>>>
>>> -long do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len)
>>
>> Why don't you just rename this function and modify the users to use the new
>> name?
> 
> For two reasons:
> 1) having the do_memory_op as a static inline is consistent with how do_domctl and do_sysctl are implemented, so logically that's what I would expect to see for the memory_op hypercall as well.

It is much more complicated than the do_domctl and do_sysctl inlines.

Additionally it is being used by libxenguest, so making it an inline would
expose lots of libxenctrl internals to libxenguest.

> 2) the patch itself is cleaner because there is no churn in all the files that previously called do_memory_op.

OTOH all callers are in Xen, so its no deal to change those.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2022-05-19 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 13:27 [PATCH] tools/libs/ctrl: add and export xc_memory_op Tamas K Lengyel
2022-05-19 13:32 ` Juergen Gross
2022-05-19 13:59   ` Lengyel, Tamas
2022-05-19 14:31     ` Juergen Gross [this message]
2022-05-19 15:03       ` Lengyel, Tamas

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=403a66db-143a-7d05-1d0f-5a7d30721e34@suse.com \
    --to=jgross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=tamas.lengyel@intel.com \
    --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.