# HG changeset patch # User Alexander Kudryavtsev # Date 1314793075 -14400 # Node ID 2ac064c0cc7929f27cfc75a905624447c34ac91b # Parent 1828b3073c503b4add8b3c61adc2b579c81be3fe Allow Palacios to get physical APIC ID of current cpu diff -r 1828b3073c50 -r 2ac064c0cc79 arch/x86_64/kernel/palacios/palacios.c --- a/arch/x86_64/kernel/palacios/palacios.c Wed Aug 31 16:16:25 2011 +0400 +++ b/arch/x86_64/kernel/palacios/palacios.c Wed Aug 31 16:17:55 2011 +0400 @@ -256,11 +256,14 @@ } /** - * Returns the CPU ID that the caller is running on. + * Returns the CPU ID that the caller is running on. If phys == 0, returns logical CPU ID. + * Else, returns physical CPU ID (APIC ID). */ static unsigned int -palacios_get_cpu(void) +palacios_get_cpu(int phys) { + if(phys) + return cpu_info[this_cpu].physical_id; return this_cpu; }