ihk_mc_get_ikc_cpu(): Get IKC destination CPU

This commit is contained in:
Masamichi Takagi
2017-07-11 19:58:10 +09:00
parent 8d57ad9bc4
commit 72e3f5ee50
3 changed files with 19 additions and 11 deletions

View File

@ -32,11 +32,11 @@
//#define DEBUG_PRINT_AP
#ifdef DEBUG_PRINT_AP
#define dkprintf(...) kprintf(__VA_ARGS__)
#define ekprintf(...) kprintf(__VA_ARGS__)
#define dkprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#else
#define dkprintf(...) do { if (0) kprintf(__VA_ARGS__); } while (0)
#define ekprintf(...) kprintf(__VA_ARGS__)
#define dkprintf(...) do { } while (0)
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#endif
int num_processors = 1;
@ -48,7 +48,6 @@ extern struct ihk_os_monitor *monitor;
static void ap_wait(void)
{
struct ihk_mc_cpu_info *cpu_info = ihk_mc_get_cpu_info();
init_tick();
while (ap_stop) {
barrier();
@ -62,10 +61,13 @@ static void ap_wait(void)
if (find_command_line("hidos")) {
mcs_lock_node_t mcs_node;
int ikc_cpu = ihk_mc_get_ikc_cpu(ihk_mc_get_processor_id());
if(ikc_cpu < 0) {
ekprintf("%s,ihk_mc_get_ikc_cpu failed\n", __FUNCTION__);
}
mcs_lock_lock_noirq(&ap_syscall_semaphore, &mcs_node);
init_host_ikc2mckernel();
init_host_ikc2linux(cpu_info->ikc_cpus[ihk_mc_get_processor_id()]);
init_host_ikc2linux(ikc_cpu);
mcs_lock_unlock_noirq(&ap_syscall_semaphore, &mcs_node);
}

View File

@ -41,9 +41,11 @@
//#define DEBUG_PRINT_INIT
#ifdef DEBUG_PRINT_INIT
#define dkprintf kprintf
#define dkprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#else
#define dkprintf(...) do { if (0) kprintf(__VA_ARGS__); } while (0)
#define dkprintf(...) do { } while (0)
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#endif
int osnum = 0;
@ -360,7 +362,6 @@ extern int num_processors;
static void post_init(void)
{
struct ihk_mc_cpu_info *cpu_info = ihk_mc_get_cpu_info();
cpu_enable_interrupt();
while (!host_ikc_inited) {
@ -369,8 +370,12 @@ static void post_init(void)
}
if (find_command_line("hidos")) {
int ikc_cpu = ihk_mc_get_ikc_cpu(ihk_mc_get_processor_id());
if(ikc_cpu < 0) {
ekprintf("%s,ihk_mc_get_ikc_cpu failed\n", __FUNCTION__);
}
init_host_ikc2mckernel();
init_host_ikc2linux(cpu_info->ikc_cpus[ihk_mc_get_processor_id()]);
init_host_ikc2linux(ikc_cpu);
}
arch_setup_vdso();

View File

@ -62,6 +62,7 @@ int ihk_mc_get_nr_cores();
int ihk_mc_get_nr_linux_cores();
int ihk_mc_get_core(int id, unsigned long *linux_core_id, unsigned long *apic_id,
int *numa_id);
int ihk_mc_get_ikc_cpu(int id);
int ihk_mc_get_apicid(int linux_core_id);
void ihk_mc_delay_us(int us);