mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "David Vrabel" <david.vrabel@citrix.com>,
	"Juergen Gross" <JGross@suse.com>
Cc: "xen-devel" <xen-devel@lists.xenproject.org>,
	<boris.ostrovsky@oracle.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 3/3] xen: use correct type for physical addresses
Date: Fri, 09 Jan 2015 12:56:59 +0000	[thread overview]
Message-ID: <54AFDE2B0200007800053248@mail.emea.novell.com> (raw)
In-Reply-To: <54AFCED7.7040407@citrix.com>

>>> On 09.01.15 at 13:51, <david.vrabel@citrix.com> wrote:
> On 09/01/15 09:57, Jan Beulich wrote:
>>>>> On 08.01.15 at 18:01, <JGross@suse.com> wrote:
>>> @@ -284,7 +286,7 @@ static void __init xen_update_mem_tables(unsigned long pfn, unsigned long mfn)
>>>  	}
>>>  
>>>  	/* Update kernel mapping, but not for highmem. */
>>> -	if ((pfn << PAGE_SHIFT) >= __pa(high_memory))
>>> +	if (PFN_PHYS(pfn) >= (u64)(__pa(high_memory)))
>> 
>> I don't think you really need the cast on the right side - __pa()
>> should be returning a value of suitable type (and unsigned long
>> would be sufficient for anything up to and including high_memory).
> 
> I'd prefer:
> 
>     if (pfn >= PFN_DOWN(__pa(high_memory))

Even better indeed. Just one more point: Strictly speaking
__pa(high_memory) is invalid, as __pa() is defined for low
memory only. Hence perhaps PFN_UP(__pa(high_memory - 1))?

Jan


  reply	other threads:[~2015-01-09 12:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 17:01 [PATCH 0/3] xen: correct several bugs in new p2m list setup Juergen Gross
2015-01-08 17:01 ` [PATCH 1/3] xen: correct error for building p2m list on 32 bits Juergen Gross
2015-01-08 17:01 ` [PATCH 2/3] xen: correct race in alloc_p2m_pmd() Juergen Gross
2015-01-09 15:09   ` David Vrabel
2015-01-09 15:17     ` Juergen Gross
2015-01-08 17:01 ` [PATCH 3/3] xen: use correct type for physical addresses Juergen Gross
2015-01-09  9:57   ` [Xen-devel] " Jan Beulich
2015-01-09 12:51     ` David Vrabel
2015-01-09 12:56       ` Jan Beulich [this message]
2015-01-09 15:10         ` David Vrabel
2015-01-09 12:51   ` David Vrabel

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=54AFDE2B0200007800053248@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®