[Skiboot] [RFC PATCH 9/9] OPAL V4: local vm_map/unmap operations
Nicholas Piggin
npiggin at gmail.com
Wed May 6 17:22:09 AEST 2020
Excerpts from Gautham R Shenoy's message of May 6, 2020 3:53 pm:
> Hello Nicholas,
>
> On Sat, May 02, 2020 at 09:36:49PM +1000, Nicholas Piggin wrote:
>> This implements vm_map/unmap API that an OS can provide. The per-CPU
>> areas are advertised by OPAL_FIND_VM_AREA so page tables can be allocated
>> ahead of time.
>>
>> The ops must not sleep or cause IPIs.
>>
>> This allows skiboot to run entirely in virtual mode and not have to
>> drop to real mode to cope with vm_map().
>>
>> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
>
>
> [..snip..]
>
>
>> @@ -519,6 +525,37 @@ void os_printf(uint32_t log_level, const char *str)
>> os_ops.os_printf(log_level, str);
>> }
>>
>> +int64_t os_vm_map(uint64_t ea, uint64_t pa, uint64_t flags)
>> +{
>> + struct cpu_thread *cpu = this_cpu();
>> + uint64_t msr = mfmsr();
>> + int64_t ret;
>> +
>> + if (msr != cpu->opal_call_msr)
>> + mtmsrd(cpu->opal_call_msr, 0);
>> +
>> + ret = os_ops.os_vm_map(ea, pa, flags);
>> +
>> + if (msr != cpu->opal_call_msr)
>> + mtmsrd(cpu->opal_call_msr, 0);
>
> Should this be mtmsrd(msr, 0) , so that we return with the msr value
> that was set by someone up in the call stack ?
Yeah good catch. os_printf needs this as well I think.
Thanks,
Nick
More information about the Skiboot
mailing list