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

Re: [PATCH v6 10/16] libs/guest: add xg_foreignmemory_copy_{from,to}


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Thu, 9 Jul 2026 11:07:47 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=vmLfQgiG1OKQw/Q65sHSdA5o0bfHAhfqA/NcY2EYuf0=; fh=aU3/UpxH5Blg8M5NzH55q/XY8irYVWQMVJdPeFRWhhg=; b=W4vxx+nSmXwvGCA4kLbQqSMx2hfzm71L+21h3hGRG5jux1gWVXGHurxicoIVrrjHUt M7edx9GTdx6imrGM2GdcTVbVg2eRsHQzpn7RPcevleMCnstgwlix9WfCFrcPIGk8V9BF UR+4XBOXcCmu+pRp1JJ4d1MOQ/Wt16rOt39YL7IIJMGPiqFUY+hWEH7ragomjw93SqhJ P/9CFjNUNPXBWsAgt/6m+941tsbgWnDmfUawdc6FXRZ25aZ6Zi33s/vfpJdK77KUhHDJ 1SgXhYaF5i/wJFQ6VxvFgpRpPvsQNxxaDGDYZx9+so+RUkOm66fy7GHAZ0aWN0YH2dXo MvUA==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1783591679; cv=none; d=google.com; s=arc-20260327; b=sYd+aURMBUyEKFjLOnIdRhpaBye9K2UFrlm5uoY3fvLQln8U1qusGCKt8BYePL8riS yoyNNHNgro/bnCXgAltMpSSk2+feI9XhJfHvHu13DaPrqdcz86ltSm8HAFtNrzbvbr4B ofq3afrSm4Dpu1evR0ZPCwL+G6mNJdJUWOEJa8jc7E9Lpw2xfafKjjTNr4NrhaQj05K1 jVHo/T+loaVukT7aEUHWdCQCIfJv8cEeGTjYZT1Vm8BM9GS9DuVvpQo6K/PzTId1N9lW H6qTWYOiEQ/EF3obPikaCz+hYtasjyO84qOMLiIp14VREG6I84jKuII8kt7z2tXnefwl cHvA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Thu, 09 Jul 2026 10:08:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, 8 Jul 2026 at 14:32, Anthony PERARD <anthony.perard@xxxxxxxxxx> wrote:
>
> On Fri, Jun 19, 2026 at 02:04:55PM +0100, Frediano Ziglio wrote:
> > This change prepare code to use a new "foreign copy" hypercall.
> > The new hypercall will copy memory from/to a foreign domain.
> > The new hypercall can be emulated with a sequence of:
> > - map foreign memory;
> > - copy memory;
> > - unmap foreign memory.
>
> I don't understand the point of this patch. The hypercall doesn't exist
> so there's nothing to emulate.

I think that imitating something else is the definition of "emulate",
we know what the hypercall should do so we emulate the wanted
behavior.

> I've notice there's a patch later in the series which introduce a new
> hypercall, but the changes to the library should come after the
> hypercall is been introduced, only then can we check if the emulation is
> correct, or even needed.

There are other changes after the hypercall.

In this case the new hypercall is to replace something that is already
there. The base idea is that the new hypercall is able to do 3 steps
together.
The reason to introduce the emulation first is that you can refactor
on the emulation without having to introduce the new hypercall.
Introducing the hypercall first would make testing more complicated as
bugs on the hypercall have to be taken into account and considered.
Also it is easier that way to enable or disable new code. For instance
you want to test for performance regression (in this case the code
emulated should not perform worse).

In the beginning the PoC was much more hacky and it was more similar
to the idea you have probably in mind. But a big part of the "hack"
was removing code, in particular the entire support for PV and the
verification code. Obviously that hacks could not be accepted so
instead I decided to change the code in a more incremental way not
removing things but instead changing to make it easier to use the
future hypercall. So I was able to test all cases (like PV)
incrementally and keep it working.

You are however the second person (after Andrew) to ask this, so a big
comment (probably in the commit message) is due.

>
> Cheers,
>

Frediano



 


Rackspace

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