From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
Ben Catterall <Ben.Catterall@citrix.com>
Cc: xen-devel@lists.xenproject.org, keir@xen.org,
stefano.stabellini@citrix.com, ian.campbell@citrix.com,
tim@xen.org
Subject: Re: [PATCH v2 1/3] xen/domain_page: Convert map_domain_page_global() to using mfn_t
Date: Tue, 7 Jul 2015 11:07:26 +0100 [thread overview]
Message-ID: <559BA4DE.5000507@citrix.com> (raw)
In-Reply-To: <559BBF80020000780008D42A@mail.emea.novell.com>
On 07/07/15 11:01, Jan Beulich wrote:
>>>> On 02.07.15 at 14:04, <Ben.Catterall@citrix.com> wrote:
>> --- a/xen/include/xen/domain_page.h
>> +++ b/xen/include/xen/domain_page.h
>> @@ -41,11 +41,15 @@ unsigned long domain_page_map_to_mfn(const void *va);
>> * address spaces (not just within the VCPU that created the mapping). Global
>> * mappings can also be unmapped from any context.
>> */
>> -void *map_domain_page_global(unsigned long mfn);
>> +void *map_domain_page_global(mfn_t mfn);
>> void unmap_domain_page_global(const void *va);
>>
>> #define __map_domain_page(pg) map_domain_page(__page_to_mfn(pg))
>> -#define __map_domain_page_global(pg) map_domain_page_global(__page_to_mfn(pg))
>> +
>> +static inline void *__map_domain_page_global(struct page_info *pg)
> const
>
>> @@ -117,9 +121,17 @@ domain_mmap_cache_destroy(struct domain_mmap_cache *cache)
>> mfn_to_virt(smfn))
>> #define domain_page_map_to_mfn(va) virt_to_mfn((unsigned long)(va))
>>
>> -#define map_domain_page_global(mfn) mfn_to_virt(mfn)
>> -#define __map_domain_page_global(pg) page_to_virt(pg)
>> -#define unmap_domain_page_global(va) ((void)(va))
>> +static inline void *map_domain_page_global(mfn_t mfn)
>> +{
>> + return mfn_to_virt(mfn_x(mfn));
>> +}
>> +
>> +static inline void *__map_domain_page_global(struct page_info *pg)
> const
>
>> +{
>> + return page_to_virt(pg);
>> +}
>> +
>> +static inline void unmap_domain_page_global(void *va) {};
> And again (the more that the real function already has it that way).
Hmm. Both unmap_domain_page() and _global() should be updated to not
take a const void *va.
Just like free(), these functions are not performing a read-only
operation on the destination pointer, therefore must not be performed on
an actual const pointer.
~Andrew
next prev parent reply other threads:[~2015-07-07 10:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-02 12:04 [PATCH v2 1/3] xen/domain_page: Convert map_domain_page_global() to using mfn_t Ben Catterall
2015-07-02 12:04 ` [PATCH v2 2/3] xen/domain_page: Convert copy/clear_domain_page() " Ben Catterall
2015-07-07 10:03 ` Jan Beulich
2015-07-02 12:04 ` [PATCH v2 3/3] Convert map_domain_page() to use the new mfn_t type Ben Catterall
2015-07-07 10:10 ` Jan Beulich
2015-07-09 10:29 ` Ben Catterall
2015-07-09 10:38 ` Jan Beulich
2015-07-07 10:01 ` [PATCH v2 1/3] xen/domain_page: Convert map_domain_page_global() to using mfn_t Jan Beulich
2015-07-07 10:07 ` Andrew Cooper [this message]
2015-07-07 10:50 ` Jan Beulich
2015-07-13 16:56 ` Ian Jackson
2015-07-14 9:56 ` Jan Beulich
2015-07-14 10:54 ` Ian Jackson
2015-07-14 11:38 ` Jan Beulich
2015-07-07 15:12 ` Ian Campbell
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=559BA4DE.5000507@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ben.Catterall@citrix.com \
--cc=JBeulich@suse.com \
--cc=ian.campbell@citrix.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.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.