|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Re: xen crash in tmem: checking a xen pfn for domain own
On 21/09/2010 00:03, "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx> wrote:
> if ( is_hvm_domain(current->domain) )
> {
> xmfn = mfn_x(gfn_to_mfn_unshare(current->domain, cmfn, &t, 2));
> if (t != p2m_ram_rw || xmfn == INVALID_MFN)
> return NULL;
> }
> else
> {
> xmfn = cmfn;
> if (!mfn_valid(xmfn))
> return NULL;
> }
This is needlessly cumbersome. You can do it without the if(is_hvm):
xmfn = mfn_x(gfn_to_mfn(current->domain, cmfn, &t);
if ((t != p2m_ram_rw) || !mfn_valid(xmfn))
return NULL;
(Didn't use hfn_to_mfn_unshare as you have decided against it.)
Rest of the code looks fine.
-- Keir
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|