798 return (EIO);
799 }
800 break;
801 }
802 affinity_clear();
803 break;
804 case MEM_CACHE_ISRETIRED:
805 case MEM_CACHE_STATE:
806 return (ENOTSUP);
807 case MEM_CACHE_READ_TAGS:
808 #ifdef DEBUG
809 case MEM_CACHE_READ_ERROR_INJECTED_TAGS:
810 #endif
811 /*
812 * Read tag and data for all the ways at a given afar
813 */
814 afar = (uint64_t)(cache_info->index
815 << PN_CACHE_LINE_SHIFT);
816 mutex_enter(&cpu_lock);
817 affinity_set(cache_info->cpu_id);
818 (void) pause_cpus(NULL);
819 mutex_exit(&cpu_lock);
820 /*
821 * We bind ourself to a CPU and send cross trap to
822 * ourself. On return from xt_one we can rely on the
823 * data in clop being filled in. Normally one would
824 * do a xt_sync to make sure that the CPU has completed
825 * the cross trap call xt_one.
826 */
827 xt_one(cache_info->cpu_id,
828 (xcfunc_t *)(get_ecache_dtags_tl1),
829 afar, (uint64_t)(&clop));
830 mutex_enter(&cpu_lock);
831 (void) start_cpus();
832 mutex_exit(&cpu_lock);
833 affinity_clear();
834 switch (cache_info->cache) {
835 case L2_CACHE_TAG:
836 for (i = 0; i < PN_CACHE_NWAYS; i++) {
837 Lxcache_tag_data[i] =
838 clop.clo_data.chd_l2_data
|
798 return (EIO);
799 }
800 break;
801 }
802 affinity_clear();
803 break;
804 case MEM_CACHE_ISRETIRED:
805 case MEM_CACHE_STATE:
806 return (ENOTSUP);
807 case MEM_CACHE_READ_TAGS:
808 #ifdef DEBUG
809 case MEM_CACHE_READ_ERROR_INJECTED_TAGS:
810 #endif
811 /*
812 * Read tag and data for all the ways at a given afar
813 */
814 afar = (uint64_t)(cache_info->index
815 << PN_CACHE_LINE_SHIFT);
816 mutex_enter(&cpu_lock);
817 affinity_set(cache_info->cpu_id);
818 (void) pause_cpus(NULL, NULL);
819 mutex_exit(&cpu_lock);
820 /*
821 * We bind ourself to a CPU and send cross trap to
822 * ourself. On return from xt_one we can rely on the
823 * data in clop being filled in. Normally one would
824 * do a xt_sync to make sure that the CPU has completed
825 * the cross trap call xt_one.
826 */
827 xt_one(cache_info->cpu_id,
828 (xcfunc_t *)(get_ecache_dtags_tl1),
829 afar, (uint64_t)(&clop));
830 mutex_enter(&cpu_lock);
831 (void) start_cpus();
832 mutex_exit(&cpu_lock);
833 affinity_clear();
834 switch (cache_info->cache) {
835 case L2_CACHE_TAG:
836 for (i = 0; i < PN_CACHE_NWAYS; i++) {
837 Lxcache_tag_data[i] =
838 clop.clo_data.chd_l2_data
|