All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Stefano Stabellini <sstabellini@kernel.org>" <sstabellini@kernel.org>
Subject: [patch 2/2] xen/arm: Use p2m entry with lock protection
Date: Tue, 30 Apr 2019 13:37:35 +0800	[thread overview]
Message-ID: <E1hLLTC-0002do-79@lists.xenproject.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 727 bytes --]

A new local variable is introduced for accessing p2m entry with lock protection.

Cc: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Hillf Danton <hdanton@sina.com>
---

--- 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;
--


[-- Attachment #1.2: Type: text/html, Size: 3233 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Hillf Danton <hdanton@sina.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Stefano Stabellini <sstabellini@kernel.org>" <sstabellini@kernel.org>
Subject: [Xen-devel] [patch 2/2] xen/arm: Use p2m entry with lock protection
Date: Tue, 30 Apr 2019 13:37:35 +0800	[thread overview]
Message-ID: <E1hLLTC-0002do-79@lists.xenproject.org> (raw)
Message-ID: <20190430053735.y9dTBjJF2cty8GvYhwLkBARmkXg-a902sCMPhQMkeoE@z> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 727 bytes --]

A new local variable is introduced for accessing p2m entry with lock protection.

Cc: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Hillf Danton <hdanton@sina.com>
---

--- 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;
--


[-- Attachment #1.2: Type: text/html, Size: 3233 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-04-30  5:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  5:37 Hillf Danton [this message]
2019-04-30  5:37 ` [Xen-devel] [patch 2/2] xen/arm: Use p2m entry with lock protection Hillf Danton
     [not found] <20190430053741.F1C0C2080C@mail.kernel.org>
2019-04-30 16:21 ` Stefano Stabellini
2019-04-30 19:56   ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1hLLTC-0002do-79@lists.xenproject.org \
    --to=hdanton@sina.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.