Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2380075ybi; Mon, 17 Jun 2019 03:56:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxj2ot1pD5SjULbzZ6D3dW8yTaKMq++JYHmb3NS9j8+yTFbTHUhG/30vFBp3W+5XsRCH+Fz X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr85697656plo.225.1560768995531; Mon, 17 Jun 2019 03:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560768995; cv=none; d=google.com; s=arc-20160816; b=l8ZWa1qg90G0UMwSWZAovj6d32FrDEkuvQMmn6+l5rgOgtF0mCgaawtL1CQUEf0wpl g01KncUE7cxAw7XeN0U8Sb52ZBWIcSYkOb47BwNLbvKpxQCg0xGyJ9mYCVdcd9enhKMt Rk93bGbBnt7I5XtQj+VO+Y9jPgUidkgb81An/U6ATyDH7PYGdEAUuB2ucwJaRBBD4s+d JM/3BDyye0P2l78Hzqe9otbaKzLm419iyO/jcOKEoDDt0ZyjUvh8WH32gemviiSRO4vb raHcHdLCnXaLrIumiI14kqL+mZGadsDZZFpZE2I3DQJTtC/9W74ICxwwW3k+7nGjb43d PzGQ== 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; bh=Ysd1XC4+oq7ZuOSQrlNV1S0+N5SGERZzYYQQHq+TwS0=; b=BNw1bdcRy37RuXQ+LcHjJ+In0DlKkySQMMd0J7ZtI+9buJht3BdRH5fVkx4qrFj3Xh SON55LmajTd33FqyCzKeSdwlH9YVHigOwUmSiJHH3nQS5fyT+EKIjLXtirBL0XzSOzon b65GIApukDx9Gipm0e4rpGVU4rSwv6fpwIkLWWKegJFH1xFN8uYy6aujPduiXCQmr2jy WIyfGHCgacVtXYRNiGC+uSWQmgIMbZqd2v39EhsZ8Xlf25N9Ey7PF/6KzaJZkVhk4QiZ 3nMsv3BsyJc7xYStARz4xdUyKRzNY9PCBD9KYZq+QF0j2x6xgD+kEmP3wXl/YvVhsyqU jolw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21si5405927pln.192.2019.06.17.03.56.20; Mon, 17 Jun 2019 03:56:35 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727385AbfFQK4C (ORCPT + 99 others); Mon, 17 Jun 2019 06:56:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:60332 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726174AbfFQK4B (ORCPT ); Mon, 17 Jun 2019 06:56:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A1C0CAB99; Mon, 17 Jun 2019 10:56:00 +0000 (UTC) Subject: Re: [RFC PATCH 16/16] xen/grant-table: host_addr fixup in mapping on xenhost_r0 To: Ankur Arora , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: pbonzini@redhat.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, sstabellini@kernel.org, joao.m.martins@oracle.com References: <20190509172540.12398-1-ankur.a.arora@oracle.com> <20190509172540.12398-17-ankur.a.arora@oracle.com> From: Juergen Gross Message-ID: Date: Mon, 17 Jun 2019 12:55:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190509172540.12398-17-ankur.a.arora@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.05.19 19:25, Ankur Arora wrote: > Xenhost type xenhost_r0 does not support standard GNTTABOP_map_grant_ref > semantics (map a gref onto a specified host_addr). That's because > since the hypervisor is local (same address space as the caller of > GNTTABOP_map_grant_ref), there is no external entity that could > map an arbitrary page underneath an arbitrary address. > > To handle this, the GNTTABOP_map_grant_ref hypercall on xenhost_r0 > treats the host_addr as an OUT parameter instead of IN and expects the > gnttab_map_refs() and similar to fixup any state that caches the > value of host_addr from before the hypercall. > > Accordingly gnttab_map_refs() now adds two parameters, a fixup function > and a pointer to cached maps to fixup: > int gnttab_map_refs(xenhost_t *xh, struct gnttab_map_grant_ref *map_ops, > struct gnttab_map_grant_ref *kmap_ops, > - struct page **pages, unsigned int count) > + struct page **pages, gnttab_map_fixup_t map_fixup_fn, > + void **map_fixup[], unsigned int count) > > The reason we use a fixup function and not an additional mapping op > in the xenhost_t is because, depending on the caller, what we are fixing > might be different: blkback, netback for instance cache host_addr in > via a struct page *, while __xenbus_map_ring() caches a phys_addr. > > This patch fixes up xen-blkback and xen-gntdev drivers. > > TODO: > - also rewrite gnttab_batch_map() and __xenbus_map_ring(). > - modify xen-netback, scsiback, pciback etc > > Co-developed-by: Joao Martins > Signed-off-by: Ankur Arora Without seeing the __xenbus_map_ring() modification it is impossible to do a proper review of this patch. Juergen