Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3453946imb; Tue, 5 Mar 2019 09:40:58 -0800 (PST) X-Google-Smtp-Source: APXvYqywUJmP9Rbr/ehSJGW/3NhwK26w9ok7Z7ENrtBpgsoYQ57//xjVQ+4EYJoM5+OUmmritIXl X-Received: by 2002:a17:902:87:: with SMTP id a7mr2367413pla.295.1551807658162; Tue, 05 Mar 2019 09:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807658; cv=none; d=google.com; s=arc-20160816; b=kGAoN7/g2PxHxwvhp0eb/0AQ097FuIedPwgV+3YiD4VQTUIXOC7URM8eqeUVcY+ilQ LRlBa0dPSJ0++oVLeI3ZoeYnKV/aie2O/K/LzJEv+0EtDbr9nwXBYZvaUs5/SHVIpqD4 sCnHTmd0lCmyO4pm/M6YVazCprk9psQEwVBVl6O1Qyb14j43CbVLyzVoVo2qIpNla4kU FFydEzJeDYfkI2NAIyIpJggMCjhXU5xlcnYXtvgjG8CMr+NfKWR5BmapP8W5yRuCnijB lDhJeFdnX2DaOP+UGWap7qNjBRZGOn9WMn5d0PVTHeOVKyTsE7TYbrdM1b7lftEIReDp twPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=8L6L0RbmJb0lQrN/0Bpz9tVd7ocWMIQA1VbY3g4sDMU=; b=Mo2+fhK4uFGptoH8YJHigqDeMAN9NpF3W53KF9rPSZ9+EjxCT9B0HccIDuD8Q09ofw z12SfT7YoTwOsyXl8eBeIItzZj4pAvN7UAb72UwShrL7yGESLn4J4ecjECWt483KmsIX BIDo/hxCtSV3laOkJ6EWJNlBKIr+tAy31iLjU9Al9XyAWXnvgQcddV6c50wjQ1MSqGr/ wINa/HBvqp2C/6zFjUCNJuBUjrzn3/VfLcNov3/6Wom1zKXfKHzHZWH7wJrSo2KB91Zy 11mu0UC0ipmqrPxlasyZ9V9xbvyrrXoQ3vj/0X1lqBtq+jGH86C6c54jsYtk0BG/DEsD /4dQ== 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 g9si8647019pfd.234.2019.03.05.09.40.42; Tue, 05 Mar 2019 09:40:58 -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; 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 S1726763AbfCEQt5 (ORCPT + 99 others); Tue, 5 Mar 2019 11:49:57 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:40719 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbfCEQt4 (ORCPT ); Tue, 5 Mar 2019 11:49:56 -0500 Received: by mail-qt1-f194.google.com with SMTP id j36so9627450qta.7 for ; Tue, 05 Mar 2019 08:49:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8L6L0RbmJb0lQrN/0Bpz9tVd7ocWMIQA1VbY3g4sDMU=; b=R3AAp5F/9mthGc+AiLeRXExTR/1hSR+0U1d9jynlxBgxAJCtUOSyPzMzWgElJXDXPo UtGABOadAnsXM++C4u/3BVSmG7zKSMFt0SAsk08ToaTR8mfSilAhJt4A2/qsY0BR/qVO P/c61+8rHeI8IM01eL/A8VXvZ0WLGzoNsb+Vc3kwwcfXkxiC4bCT0pvVN/e7zNhIaJnL bwIJ3xTPWAqfd0p2djQT3/R8KCD76ymMbY9MVeJr2me7TbeA9Rl7ArXRk0YbQzlkbUm9 VNl7sZsfHLQ+hRaS7dGTx4Wl/+H2b3NJmcundpSN8AkzR31G0LClolZcuSX+IlgBMaDi xgnw== X-Gm-Message-State: APjAAAW9don6XzE23vgxSxnwCh8PQP+cPnJJC9tJg4Qe4NBlSU1e+Rkz nbM0wpj4ES4MSRfi7SkW+gIrxElvFmV0CLd6Zj5t5ATX X-Received: by 2002:a0c:81ee:: with SMTP id 43mr2713413qve.180.1551804595883; Tue, 05 Mar 2019 08:49:55 -0800 (PST) MIME-Version: 1.0 References: <20190305133057.3998926-1-arnd@arndb.de> <35654e1a-d066-0581-749f-7e3b65023988@oracle.com> <9a285a75-b9ea-37a9-b5bd-ba2a068dd944@suse.com> In-Reply-To: <9a285a75-b9ea-37a9-b5bd-ba2a068dd944@suse.com> From: Arnd Bergmann Date: Tue, 5 Mar 2019 17:49:38 +0100 Message-ID: Subject: Re: [PATCH] [v2] xen: avoid link error on ARM To: Juergen Gross Cc: Boris Ostrovsky , Stefano Stabellini , Oleksandr Andrushchenko , Paul Durrant , Linux Kernel Mailing List , xen-devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 3:57 PM Juergen Gross wrote: > On 05/03/2019 14:43, Boris Ostrovsky wrote: > > On 3/5/19 8:30 AM, Arnd Bergmann wrote: > >> @@ -809,15 +789,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) > >> goto out; > >> > >> if (xen_feature(XENFEAT_auto_translated_physmap)) { > >> - struct remap_pfn r = { > >> - .mm = vma->vm_mm, > >> - .pages = vma->vm_private_data, > >> - .prot = vma->vm_page_prot, > >> - }; > >> - > >> - rc = apply_to_page_range(r.mm, kdata.addr, > >> - kdata.num << PAGE_SHIFT, > >> - remap_pfn_fn, &r); > >> + rc = xen_remap_vma_range(vma, kdata.addr, kdata.num << PAGE_SHIFT); > > > > I wonder whether drivers/xen/xlate_mmu.c might be a good place for these > > routines. > > Hmm, probably. This would require a stub in the header to avoid > problems in case of CONFIG_XEN_AUTO_XLATE not defined, though > (the #ifdef is already there). > > I think this is the cleanest solution. Putting it into xlate_mmu.c was my first attempt, but I was not sure how to solve the dependency on CONFIG_XEN_AUTO_XLATE. So xen_feature(XENFEAT_auto_translated_physmap)) would be guaranteed to return false if CONFIG_XEN_AUTO_XLATE is disabled? Arnd