Re: [PATCH v2 2/3] Implement CPU model driver for PowerPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 17, 2012 at 4:21 PM, Michal Privoznik <mprivozn@xxxxxxxxxx> wrote:
> Oh, I've just hit 'Send' without noticing ....
>
> On 15.10.2012 11:07, Li Zhang wrote:
>> Currently, the CPU model driver is not implemented for PowerPC.
>> Host's CPU information is needed to exposed to guests' XML file some
>> time.
>>
>> This patch is to implement the callback functions of CPU model driver.
>>
>> Signed-off-by: Li Zhang <zhlcindy@xxxxxxxxxxxxxxxxxx>
>> ---
>>  po/POTFILES.in        |    1 +
>>  src/cpu/cpu_map.xml   |   14 ++
>>  src/cpu/cpu_powerpc.c |  587 +++++++++++++++++++++++++++++++++++++++++++++++--
>>  3 files changed, 586 insertions(+), 16 deletions(-)
>>
>
>> +
>> +static uint32_t ppc_mfpvr(void)
>> +{
>> +    uint32_t pvr;
>> +    asm ("mfpvr %0"
>> +        : "=r"(pvr));
>
> ... there is no such instruction on Intel processors. So I've made this
> function and ...
>
>> +    return pvr;
>> +}
>> +
>> +static void
>> +PowerPCDataFree(union cpuData *data)
>> +{
>> +    if (data == NULL)
>> +        return;
>> +
>> +    VIR_FREE(data);
>> +}
>> +
>>  static union cpuData *
>>  PowerPCNodeData(void)
>>  {
>> @@ -42,40 +552,85 @@ PowerPCNodeData(void)
>>          return NULL;
>>      }
>>
>> +    data->ppc.pvr = ppc_mfpvr();
>> +
>
> ... this assignment conditional; just wrapped it with:
> #if defined(__powerpc__) || defined(__powerpc64__)
>
OK, Thanks.

> Michal


-- 

Best Regards
-Li

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]