On 10/05/2019 14:21, Jan Beulich wrote:
>
>> @@ -2795,54 +2795,54 @@ void audit_p2m(struct domain *d,
>>      spin_lock(&d->page_alloc_lock);
>>      page_list_for_each ( page, &d->page_list )
>>      {
>> -        mfn = mfn_x(page_to_mfn(page));
>> +        mfn = page_to_mfn(page);
>>  
>> -        P2M_PRINTK("auditing guest page, mfn=%#lx\n", mfn);
>> +        P2M_PRINTK("auditing guest page, mfn=%"PRI_mfn"\n", mfn_x(mfn));
>>  
>>          od = page_get_owner(page);
>>  
>>          if ( od != d )
>>          {
>> -            P2M_PRINTK("wrong owner %#lx -> %p(%u) != %p(%u)\n",
>> -                       mfn, od, (od?od->domain_id:-1), d, d->domain_id);
>> +            P2M_PRINTK("wrong owner %"PRI_mfn" -> %p(%u) != %p(%u)\n",
>> +                       mfn_x(mfn), od, (od?od->domain_id:-1), d, 
>> d->domain_id);
> Please be careful not to drop 0x prefixes from the resulting output
> (which are an effect of the # flag that you delete), at least when
> log messages contain a mix of hex and dec numbers. (I am, btw,
> not convinced that switching to PRI_mfn here is helpful.)
>
> Also would you mind fixing the formatting (missing blanks) here?

Please also fix the od? conditional while making this change.  %pd was
specifically designed to cope with a NULL pointer to avoid gymnastics
like this in debugging code.

I'd rewrite it entirely to something like "mfn %"PRI_mfn" owner %pd !=
%pd\n"

~Andrew

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

Reply via email to