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

Re: [PATCH 1/2] gnttab: remove guest_physmap_remove_page() call from gnttab_map_frame()


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 21 Sep 2021 12:12:05 +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; bh=6+EB9aYIW2YQDYMOKVNo1MDsa3unHdTbAmMooPXfIzc=; b=h/oeeAeN8oiXz2wfgF+O0UypXXGuk27CDVhZVebWwONAqlZAxkanQuyGJKKn+u5NbESzl/wRb+LyxNs4cH6SvN3iOpYjd2T05OyOfh0TDzLHT4lPBDsejQsulVpfW3P2GWtMwZbj96O3rn+h/uyHfR50q1lHzFNV92PYNU1w+htgIWp+4Bfz9EFhnGdeB/69L44BEU70UVkookeMLtHY8uwKlPFAxYMqRJBcNvGlJymigIrE9W7mUC/rOFjVRD4djk2CamzNF7Eh5cXrX9S3ofl4SOjGvbPEquKXyH1TNplnm6iqOlFddoNC6nPkG/aQYiNYw2583g6ZVy7u+pdTCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QrdM/TiPbB/PyQkrpF9hDDzHgJ1RmVGMm2x25t34AtHBN8eEqZFdNEns/YxRVSe9YMs8EafngSeD0Ekk48r9+3rjva2uu1xVYsveY/iArnKIptMMI+IcDASXlaj83cXhxeIRAy67ffJb2g9rYmtW2HlsKbktDW3hgx/6HktMD97Tk0l7R+zzVLYKn6BNhZCyGBrzQTxakvdQMfuVA+B9/BINBaNEyW93oOntRXPW31tMOsJIcLORGzx9LtTN4ForBDuRzCL8xf35ujyJgcwgrw0shkJBvIfOpVsrT0ef61iBIwhj0N1oZ4lJaGcFej521e6Vow55oipzhPO3cLUp6w==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 21 Sep 2021 10:12:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.09.2021 10:32, Roger Pau Monné wrote:
> On Mon, Sep 20, 2021 at 05:27:17PM +0200, Jan Beulich wrote:
>> On 20.09.2021 12:20, Roger Pau Monné wrote:
>>> On Mon, Sep 13, 2021 at 08:41:47AM +0200, Jan Beulich wrote:
>>>> --- a/xen/include/asm-arm/grant_table.h
>>>> +++ b/xen/include/asm-arm/grant_table.h
>>>> +        if ( gfn_eq(ogfn, INVALID_GFN) || gfn_eq(ogfn, gfn) ||           \
>>>
>>> I'm slightly confused by this checks, don't you need to check for
>>> gfn_eq(gfn, INVALID_GFN) (not ogfn) in order to call
>>> guest_physmap_remove_page?
>>
>> Why? It's ogfn which gets passed to the function. And it indeed is the
>> prior GFN's mapping that we want to remove here.
>>
>>> Or assuming that ogfn is not invalid can be used to imply a removal?
>>
>> That implication can be (and on x86 is) used for the incoming argument,
>> i.e. "gfn". I don't think "ogfn" can serve this purpose.
> 
> I guess I'm confused due to the ogfn checks done on the Arm side that
> are not performed on x86. So on Arm you always need to explicitly
> unhook the previous GFN before attempting to setup a new mapping,
> while on x86 you only need to do this when it's a removal in order to
> clear the entry?

The difference isn't with guest_physmap_add_entry() (both x86 and
Arm only insert a new mapping there), but with
xenmem_add_to_physmap_one(): Arm's variant doesn't care about prior
mappings. And gnttab_map_frame() gets called only from there. This
is effectively what the first paragraph of the description is about.

> So you are effectively only removing the call to
> guest_physmap_remove_page in gnttab_map_frame for x86, because Arm
> will still perform it in gnttab_set_frame_gfn.

Yes.

> This seems like a limitation of Arm's guest_physmap_add_entry.

As per above I'm viewing this as a limitation of Arm's
xenmem_add_to_physmap_one().

Jan




 


Rackspace

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