# HG changeset patch # User tristan.gingold@xxxxxxxx # Node ID 0a93b24399b4e1acc26f576703734c52d220890f # Parent 7b272e8de8289517da9e7bb477118545d6014c4d xen_pal_emulator: implements VM_SUMMARY and VM_INFO. Signed-off-by: Tristan Gingold diff -r 7b272e8de828 -r 0a93b24399b4 xen/arch/ia64/xen/dom_fw.c --- a/xen/arch/ia64/xen/dom_fw.c Thu Apr 6 04:51:55 2006 +++ b/xen/arch/ia64/xen/dom_fw.c Thu Apr 6 06:57:02 2006 @@ -200,7 +200,7 @@ unsigned long r9 = 0; unsigned long r10 = 0; unsigned long r11 = 0; - long status = -1; + long status = PAL_STATUS_UNIMPLEMENTED; if (running_on_sim) return pal_emulator_static(index); @@ -254,24 +254,53 @@ status = ia64_pal_cache_summary(&r9,&r10); break; case PAL_VM_SUMMARY: - // FIXME: what should xen return for these, figure out later - // For now, linux does the right thing if pal call fails - // In particular, rid_size must be set properly! - //status = ia64_pal_vm_summary( - // (pal_vm_info_1_u_t *) &r9, - // (pal_vm_info_2_u_t *) &r10); + { + /* Use xen-specific values. + hash_tag_id is somewhat random! */ + const pal_vm_info_1_u_t v1 = + {.pal_vm_info_1_s = + { .vw = 1, + .phys_add_size = 44, + .key_size = 16, + .max_pkr = 15, + .hash_tag_id = 0x30, + .max_dtr_entry = NDTRS - 1, + .max_itr_entry = NITRS - 1, + .max_unique_tcs = 2, + .num_tc_levels = 1}}; + const pal_vm_info_2_u_t v2 = + { .pal_vm_info_2_s = { .impl_va_msb = 50, + .rid_size = 18, + .reserved = 0 }}; + r9 = v1.pvi1_val; + r10 = v2.pvi2_val; + status = PAL_STATUS_SUCCESS; + } + break; + case PAL_VM_INFO: + if (in1 != 0 || in2 == 0 || in2 > 2) { + /* There is only one level. */ + status = PAL_STATUS_EINVAL; + } + else { + const pal_tc_info_u_t v = + { .pal_tc_info_s = {.num_sets = 1, + .associativity = 1, + .num_entries = 1, + .pf = 1, + .unified = 0, + .reduce_tr = 0, + .reserved = 0}}; + r9 = v.pti_val; + /* Only support PAGE_SIZE tc. */ + r10 = PAGE_SIZE; + status = PAL_STATUS_SUCCESS; + } break; case PAL_RSE_INFO: status = ia64_pal_rse_info( &r9, (pal_hints_u_t *) &r10); - break; - case PAL_VM_INFO: - status = ia64_pal_vm_info( - in1, - in2, - (pal_tc_info_u_t *) &r9, - &r10); break; case PAL_REGISTER_INFO: status = ia64_pal_register_info(in1, &r9, &r10); @@ -296,7 +325,7 @@ while(1) printk("xen_pal_emulator: PAL_PERF_MON_INFO " "can't copy to user!!!!\n"); - status = -1; + status = PAL_STATUS_UNIMPLEMENTED; break; } }