4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2017, Joyent, Inc.
25 */
26 /*
27 * Copyright (c) 2010, Intel Corporation.
28 * All rights reserved.
29 */
30
31 #include <sys/types.h>
32 #include <sys/t_lock.h>
33 #include <sys/param.h>
34 #include <sys/segments.h>
35 #include <sys/sysmacros.h>
36 #include <sys/signal.h>
37 #include <sys/systm.h>
38 #include <sys/user.h>
39 #include <sys/mman.h>
40 #include <sys/vm.h>
41
42 #include <sys/disp.h>
43 #include <sys/class.h>
1222 return (ENOTSUP);
1223 }
1224
1225 pgcnt_t
1226 num_phys_pages()
1227 {
1228 pgcnt_t npages = 0;
1229 struct memlist *mp;
1230
1231 #if defined(__xpv)
1232 if (DOMAIN_IS_INITDOMAIN(xen_info))
1233 return (xpv_nr_phys_pages());
1234 #endif /* __xpv */
1235
1236 for (mp = phys_install; mp != NULL; mp = mp->ml_next)
1237 npages += mp->ml_size >> PAGESHIFT;
1238
1239 return (npages);
1240 }
1241
1242 /* cpu threshold for compressed dumps */
1243 #ifdef _LP64
1244 uint_t dump_plat_mincpu_default = DUMP_PLAT_X86_64_MINCPU;
1245 #else
1246 uint_t dump_plat_mincpu_default = DUMP_PLAT_X86_32_MINCPU;
1247 #endif
1248
1249 int
1250 dump_plat_addr()
1251 {
1252 #ifdef __xpv
1253 pfn_t pfn = mmu_btop(xen_info->shared_info) | PFN_IS_FOREIGN_MFN;
1254 mem_vtop_t mem_vtop;
1255 int cnt;
1256
1257 /*
1258 * On the hypervisor, we want to dump the page with shared_info on it.
1259 */
1260 if (!IN_XPV_PANIC()) {
1261 mem_vtop.m_as = &kas;
1262 mem_vtop.m_va = HYPERVISOR_shared_info;
1263 mem_vtop.m_pfn = pfn;
1264 dumpvp_write(&mem_vtop, sizeof (mem_vtop_t));
1265 cnt = 1;
1266 } else {
1267 cnt = dump_xpv_addr();
1268 }
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2017, Joyent, Inc.
26 */
27 /*
28 * Copyright (c) 2010, Intel Corporation.
29 * All rights reserved.
30 */
31
32 #include <sys/types.h>
33 #include <sys/t_lock.h>
34 #include <sys/param.h>
35 #include <sys/segments.h>
36 #include <sys/sysmacros.h>
37 #include <sys/signal.h>
38 #include <sys/systm.h>
39 #include <sys/user.h>
40 #include <sys/mman.h>
41 #include <sys/vm.h>
42
43 #include <sys/disp.h>
44 #include <sys/class.h>
1223 return (ENOTSUP);
1224 }
1225
1226 pgcnt_t
1227 num_phys_pages()
1228 {
1229 pgcnt_t npages = 0;
1230 struct memlist *mp;
1231
1232 #if defined(__xpv)
1233 if (DOMAIN_IS_INITDOMAIN(xen_info))
1234 return (xpv_nr_phys_pages());
1235 #endif /* __xpv */
1236
1237 for (mp = phys_install; mp != NULL; mp = mp->ml_next)
1238 npages += mp->ml_size >> PAGESHIFT;
1239
1240 return (npages);
1241 }
1242
1243 int
1244 dump_plat_addr()
1245 {
1246 #ifdef __xpv
1247 pfn_t pfn = mmu_btop(xen_info->shared_info) | PFN_IS_FOREIGN_MFN;
1248 mem_vtop_t mem_vtop;
1249 int cnt;
1250
1251 /*
1252 * On the hypervisor, we want to dump the page with shared_info on it.
1253 */
1254 if (!IN_XPV_PANIC()) {
1255 mem_vtop.m_as = &kas;
1256 mem_vtop.m_va = HYPERVISOR_shared_info;
1257 mem_vtop.m_pfn = pfn;
1258 dumpvp_write(&mem_vtop, sizeof (mem_vtop_t));
1259 cnt = 1;
1260 } else {
1261 cnt = dump_xpv_addr();
1262 }
|