Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp154076imp; Wed, 20 Feb 2019 16:30:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IZouslfhJD1KUoasp00dsw9RzwUy/mdE3ZHy20MYS6lj6mYuC6pYE16H9gsnanTVN5u0nid X-Received: by 2002:a62:5c87:: with SMTP id q129mr25242999pfb.180.1550709055642; Wed, 20 Feb 2019 16:30:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550709055; cv=none; d=google.com; s=arc-20160816; b=mBh2KTrZsxhpW9gtn3hurouDqyuLpiOaFg8C+5r/ctKtQHYhoM5pXAgOh9730jO3+G NKtc07VnXoN4fK+q0MnMHod8i8z4GSKD3Ls3XvkBdtTDSDolEfmimB4ak96mTyDKzSc5 6ObsLWVjm9V0Nsi5P/6BgaGrHkngvASazTfwmJVzJdB/BwQQ6WJ/maWLAse4fESQ5E7a 0yVXljq8wG48IQxGd1FnLDKppn9yQ/KQUMEe3JoeAopcQ03YwhW8BJ+VSg5d1hxzNFkG VBCdjkvDHSAiJcnx1dPCDYGr6JKNvOawHwzWBzxt8F6LLjFnGRN5XXjfp+1ytDn2h/Aw MzGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1xLGvszPYPyOSKoIYzMs5Zwpc4JSnGc/udVZjL/KiJI=; b=oFcrNeiDUyWBXUc02ke4/LDqdSz59ApyGWfglAwVZazrE8JpB9MLD4bWKWuRl0n5Za 02vJGkchdOSxMnBjZ7bZLZ0gycd/Llf45kM1TPryTOtAjQoo5sIBzrRGrwz1HWnyNcAh kavfmaJoGGN6t96hbK9KdQKm6zeNyY46syL73HUFg4jXWCvDVmUSbXL3ZlyqW6xrzViE /IwRyUg8HJg/86/vTHSqadoJBXycm1z4RmCEuTo7IFY2TZyVptnwZ71C22UcgwqDjwHA 98VISueD5zYMII/8fASUNRckeUuEL3aY0K9UDHpaecheeCvbh9NahAQLX/Dzc+RWfcJZ fNLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=lBkQ0KwE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u71si15115087pgd.579.2019.02.20.16.30.40; Wed, 20 Feb 2019 16:30:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=lBkQ0KwE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbfBUAaP (ORCPT + 99 others); Wed, 20 Feb 2019 19:30:15 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34834 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfBUAaP (ORCPT ); Wed, 20 Feb 2019 19:30:15 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1L0Smcl102165; Thu, 21 Feb 2019 00:28:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=1xLGvszPYPyOSKoIYzMs5Zwpc4JSnGc/udVZjL/KiJI=; b=lBkQ0KwENN2nISYDlRdgwXi3hmpUfyd9zJamhRac0NCZNu5z7Kq2/My8HTFHhuakPILK T7j2lfLhmp5dhd6RnMX7uyX9pDg3UaB1OfTr32iKjUHJYAiH7JM4doVBYYMT9DECswRM 53H19rY6m5TRTUeY+3cHUL5sFPEQeaUyyXllPE7MbSoXeuvGOFCV9t8SGm6UXnV0tIHc wDFd9iP2i62eLRU4wNZ3l38N1mFGHAegLjKpF+H1UV1v3rZSAmjMPod7C8l9F/ND4dU1 54f/mp5QRcncS1J5spbJ4uQvU/L0y162IOLAyJWGjam8nykrMpHqWBqO8rkyqH8nUI6t gg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2qp81ed64y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Feb 2019 00:28:52 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1L0Skhk028166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Feb 2019 00:28:47 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x1L0SjIh029159; Thu, 21 Feb 2019 00:28:45 GMT Received: from [10.156.74.184] (/10.156.74.184) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Feb 2019 16:28:45 -0800 Subject: Re: [PATCH RFC 00/39] x86/KVM: Xen HVM guest support To: Paolo Bonzini , Joao Martins , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Boris Ostrovsky , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org References: <20190220201609.28290-1-joao.m.martins@oracle.com> <35051310-c497-8ad5-4434-1b8426a317d2@redhat.com> From: Ankur Arora Message-ID: <6bc9183d-82db-f4d8-9dc1-e14dea3e354e@oracle.com> Date: Wed, 20 Feb 2019 16:29:00 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <35051310-c497-8ad5-4434-1b8426a317d2@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9173 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902210003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/20/19 1:09 PM, Paolo Bonzini wrote: > On 20/02/19 21:15, Joao Martins wrote: >> 2. PV Driver support (patches 17 - 39) >> >> We start by redirecting hypercalls from the backend to routines >> which emulate the behaviour that PV backends expect i.e. grant >> table and interdomain events. Next, we add support for late >> initialization of xenbus, followed by implementing >> frontend/backend communication mechanisms (i.e. grant tables and >> interdomain event channels). Finally, introduce xen-shim.ko, >> which will setup a limited Xen environment. This uses the added >> functionality of Xen specific shared memory (grant tables) and >> notifications (event channels). > > I am a bit worried by the last patches, they seem really brittle and > prone to breakage. I don't know Xen well enough to understand if the > lack of support for GNTMAP_host_map is fixable, but if not, you have to > define a completely different hypercall. I assume you are aware of most of this, but just in case, here's the flow when a backend driver wants to map a grant-reference in the host: it allocates an empty struct page (via ballooning) and does a map_grant_ref(GNTMAP_host_map) hypercall. In response, Xen validates the grant-reference and maps it onto the address associated with the struct page. After this, from the POV of the underlying network/block drivers, these struct pages can be used as just regular pages. To support this in a KVM environment, where AFAICS no remapping of pages is possible, the idea was to make minimal changes to the backend drivers such that map_grant_ref() could just return the PFN from which the backend could derive the struct page. To ensure that backends -- when running in this environment -- have been modified to deal with these new semantics, our map_grant_ref() implementation explicitly disallows the GNTMAP_host_map flag. Now if I'm reading you right, you would prefer something more straightforward -- perhaps similar semantics but a new flag that makes this behaviour explicit? > > Of course, tests are missing. You should use the > tools/testing/selftests/kvm/ framework, and ideally each patch should > come with coverage for the newly-added code. Agreed. Thanks Ankur > > Thanks, > > Paolo >