VirtualBox

Changeset 64153 in vbox for trunk/src


Ignore:
Timestamp:
Oct 5, 2016 12:34:24 PM (8 years ago)
Author:
vboxsync
Message:

Runtime/r0drv: fix for Linux kernels with CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS set (ticketref:16020)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c

    r62477 r64153  
    3939#include "r0drv/mp-r0drv.h"
    4040
     41#ifdef nr_cpumask_bits
     42# define VBOX_NR_CPUMASK_BITS   nr_cpumask_bits
     43#else
     44# define VBOX_NR_CPUMASK_BITS   NR_CPUS
     45#endif
    4146
    4247RTDECL(RTCPUID) RTMpCpuId(void)
     
    6368RTDECL(int) RTMpCpuIdToSetIndex(RTCPUID idCpu)
    6469{
    65     return idCpu < RTCPUSET_MAX_CPUS && idCpu < NR_CPUS ? (int)idCpu : -1;
     70    return idCpu < RTCPUSET_MAX_CPUS && idCpu < VBOX_NR_CPUMASK_BITS ? (int)idCpu : -1;
    6671}
    6772RT_EXPORT_SYMBOL(RTMpCpuIdToSetIndex);
     
    7075RTDECL(RTCPUID) RTMpCpuIdFromSetIndex(int iCpu)
    7176{
    72     return iCpu < NR_CPUS ? (RTCPUID)iCpu : NIL_RTCPUID;
     77    return iCpu < VBOX_NR_CPUMASK_BITS ? (RTCPUID)iCpu : NIL_RTCPUID;
    7378}
    7479RT_EXPORT_SYMBOL(RTMpCpuIdFromSetIndex);
     
    7782RTDECL(RTCPUID) RTMpGetMaxCpuId(void)
    7883{
    79     return NR_CPUS - 1; //???
     84    return VBOX_NR_CPUMASK_BITS - 1; //???
    8085}
    8186RT_EXPORT_SYMBOL(RTMpGetMaxCpuId);
     
    8590{
    8691#if defined(CONFIG_SMP)
    87     if (RT_UNLIKELY(idCpu >= NR_CPUS))
     92    if (RT_UNLIKELY(idCpu >= VBOX_NR_CPUMASK_BITS))
    8893        return false;
    8994
     
    140145{
    141146#ifdef CONFIG_SMP
    142     if (RT_UNLIKELY(idCpu >= NR_CPUS))
     147    if (RT_UNLIKELY(idCpu >= VBOX_NR_CPUMASK_BITS))
    143148        return false;
    144149# ifdef cpu_online
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette