From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [patch 2/2] xen/arm: Use p2m entry with lock protection Date: Tue, 30 Apr 2019 09:21:05 -0700 (PDT) Message-ID: References: <20190430053741.F1C0C2080C@mail.kernel.org> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1070403172-1556641266=:27577" Return-path: Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLVVD-0001Hc-CF for xen-devel@lists.xenproject.org; Tue, 30 Apr 2019 16:21:07 +0000 In-Reply-To: <20190430053741.F1C0C2080C@mail.kernel.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" To: Hillf Danton Cc: "xen-devel@lists.xenproject.org" , "Stefano Stabellini " List-Id: xen-devel@lists.xenproject.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1070403172-1556641266=:27577 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 30 Apr 2019, Hillf Danton wrote: > A new local variable is introduced for accessing p2m entry with lock protection. > Same comment about html and space damage. But the change looks correct. > > Cc: Stefano Stabellini > > Signed-off-by: Hillf Danton > > --- > >   > > --- a/arch/arm/xen/p2m.c 2019-04-30 12:32:05.363768200 +0800 > > +++ b/arch/arm/xen/p2m.c    2019-04-30 12:58:19.854334100 +0800 > > @@ -70,8 +70,9 @@ unsigned long __pfn_to_mfn(unsigned long > >              entry = rb_entry(n, struct xen_p2m_entry, rbnode_phys); > >              if (entry->pfn <= pfn && > >                            entry->pfn + entry->nr_pages > pfn) { > > +                  unsigned long mfn = entry->mfn + (pfn - entry->pfn); > >                     read_unlock_irqrestore(&p2m_lock, irqflags); > > -                  return entry->mfn + (pfn - entry->pfn); > > +                  return mfn; > >              } > >              if (pfn < entry->pfn) > >                     n = n->rb_left; > > -- > >   > > > --8323329-1070403172-1556641266=:27577 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --8323329-1070403172-1556641266=:27577-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F788C43219 for ; Tue, 30 Apr 2019 16:21:24 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E51AA21670 for ; Tue, 30 Apr 2019 16:21:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zh8oSqkq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E51AA21670 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLVVE-0001Ho-Fa; Tue, 30 Apr 2019 16:21:08 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLVVD-0001Hc-CF for xen-devel@lists.xenproject.org; Tue, 30 Apr 2019 16:21:07 +0000 X-Inumbo-ID: f4e3063a-6b63-11e9-ad06-bf5459f486d6 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f4e3063a-6b63-11e9-ad06-bf5459f486d6; Tue, 30 Apr 2019 16:21:07 +0000 (UTC) Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 381CC20835; Tue, 30 Apr 2019 16:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556641266; bh=PiqglrTGgAjlqWJx8ApuXRy8IWiv8lE9E1ZgOYfjvUk=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Zh8oSqkqDo1AvaWC2bJKTanD2jn7D0vCqQTllebs3SXBtR1erVGuyGuWlTJL3Ps+W h3Ln4Ml+AjxaWhsgBZD4u8fB8TONr+hB9LQGR6psaoDABm3DjCx0njHLE9tvapL91K m4XeYJssq0bXZmcNenmB5tZvzDee9zLMDxIAqjaw= Date: Tue, 30 Apr 2019 09:21:05 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Hillf Danton In-Reply-To: <20190430053741.F1C0C2080C@mail.kernel.org> Message-ID: References: <20190430053741.F1C0C2080C@mail.kernel.org> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1070403172-1556641266=:27577" Subject: Re: [Xen-devel] [patch 2/2] xen/arm: Use p2m entry with lock protection X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: "xen-devel@lists.xenproject.org" , "Stefano Stabellini " Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Message-ID: <20190430162105.Vba6ro0O2fFm9fuj41CEftDHpJ2puIshbCHizObIBpI@z> This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1070403172-1556641266=:27577 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 30 Apr 2019, Hillf Danton wrote: > A new local variable is introduced for accessing p2m entry with lock protection. > Same comment about html and space damage. But the change looks correct. > > Cc: Stefano Stabellini > > Signed-off-by: Hillf Danton > > --- > >   > > --- a/arch/arm/xen/p2m.c 2019-04-30 12:32:05.363768200 +0800 > > +++ b/arch/arm/xen/p2m.c    2019-04-30 12:58:19.854334100 +0800 > > @@ -70,8 +70,9 @@ unsigned long __pfn_to_mfn(unsigned long > >              entry = rb_entry(n, struct xen_p2m_entry, rbnode_phys); > >              if (entry->pfn <= pfn && > >                            entry->pfn + entry->nr_pages > pfn) { > > +                  unsigned long mfn = entry->mfn + (pfn - entry->pfn); > >                     read_unlock_irqrestore(&p2m_lock, irqflags); > > -                  return entry->mfn + (pfn - entry->pfn); > > +                  return mfn; > >              } > >              if (pfn < entry->pfn) > >                     n = n->rb_left; > > -- > >   > > > --8323329-1070403172-1556641266=:27577 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --8323329-1070403172-1556641266=:27577--