RE: [PATCH Part2 v6 10/49] x86/fault: Add support to dump RMP entry on fault

From: Kalra, Ashish
Date: Wed Jun 22 2022 - 14:08:46 EST


[AMD Official Use Only - General]

>> > +void dump_rmpentry(u64 pfn)
>> > +{
>> > + unsigned long pfn_end;
>> > + struct rmpentry *e;
>> > + int level;
>> > +
>> > + e = __snp_lookup_rmpentry(pfn, &level);
>> > + if (!e) {
>>
>> __snp_lookup_rmpentry may return -errno so this should be:
>>
>> if (e != 1)

>Sorry, actually it should be:

> if (IS_ERR_OR_NULL(e)) {

I will fix this accordingly.

>> > +
>> > + while (pfn < pfn_end) {
>> > + e = __snp_lookup_rmpentry(pfn, &level);
>> > + if (!e)
>>
>> if (e != 1)
>>

>and this too:

> if (IS_ERR_OR_NULL(e))

Same here.

Thanks,
Ashish