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

Re: [PATCH v5 1/4] xen: XENMEM_exchange should only be used/compiled for arch supporting PV guest


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 7 Jul 2021 16:06:14 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-SenderADCheck; bh=9B4QMoAz84sWLdKdNyycB29RXmYDNBP30HXYT4g+Bxg=; b=F6IiRzaTx+ciHTSN2DOYCOEEJRKRYfUc26AJMOaxZYHGUMZaghgBg5OKg/QjGLTxQ4/X1WjCSHJRnQm9Fobc8X/Vro8vweJ5I+6/x2qyEI0ePecnc/JKrZUiLvb79oN9bNByVrBUB7lIPIeO3BhX4a8YYAY3bsgcFLGHn9IvZ4SCanAFw3KIAEN3/MbXWhev1mog3hjr3QxrApra6pVSt2qeIzxIhAJMvKSa96/NCe2vQAt35GQdrsaQE+I0bhX0pCG8pbHZ6zR1dQwywx6WDanz8ZM+QkS2VBXdsJ2m3jc717CJSoQbU2G0fVh54pSHvwFFzVnYHp1zKrDANBSNGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A617n2hYtGDnvKWefrmlF7bm1BanZ72dWku0D1e9GzpzNf9X9I9bFSOFOwPdH4O2Z9wXAiKcvmzpREuk+BiS5pMbd2EIu/L2i06Ao0gNWuVV5Mb2yMUhqBDgAV+5xNsLNkBErPNfumij1pyJ5dZsGFXU/m2DXHXfcWPe/maBu+4SElykbFchrpye9MpWYI5w7gbBaKTwFVzcUY/NGtKrhpkvL6TkNthJkiAhNGOq8wMKpoLhphYZFTZD6iNsxDSr1Dhj1gobE8HxAsjPASGmD9JVq+WoJLUsKUMe9xtaVSbA1JSO0BMD3ZyLmclpO3clrY/tZIQSvCg6Dyr3VPxw0w==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 07 Jul 2021 14:06:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2021 15:39, Julien Grall wrote:
> On 05/07/2021 09:41, Jan Beulich wrote:
>> On 03.07.2021 19:11, Julien Grall wrote:
>>> Changes in v5:
>>>      - Removed the #ifdef CONFIG_X86 as they are not necessary anymore
>>>      - Used paging_mode_translate() rather than is_pv_domain()
>>
>> Is there a particular reason you use this in favor of steal_page()'s
>> paging_mode_external()?
> 
> This is what you suggested in v4 [1]. I can switch to 
> paging_mode_external() if this is what you now prefer.

Well, I did say this would be better than is_pv_*(). I probably didn't
pay enough attention to you already pointing out paging_mode_external()
in the description; I'm sorry. On x86 both are in sync anyway, and I
have to admit I don't see clearly enough which of the two would be the
right one to use here, partly because I'm afraid I also don't see why
steal_page() has such a restriction in the first place (which you now
build upon).

>>> @@ -815,6 +812,9 @@ static long 
>>> memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
>>>       if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
>>>           rc = -EFAULT;
>>
>> I'm afraid that for correctness of the interface you need to keep
>> this part even in the !PV case.
> 
> Xen never initializes the field nr_exchanged. Instead, it expects the 
> guest to set to 0. So I am not quite to sure why we would need to keep 
> this line.

Hmm, the public header is wrong then, as it documents the field as
[OUT] only _despite_ the shouting warning in point 5 of the comment.
I guess I never really understood why this sub-op differs from
others in where the continuation indicator lives.

Never mind then, indeed no code adjustment needed:
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

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