// SPDX-License-Identifier: GPL-2.0 #include <linux/types.h> #include <linux/crash_dump.h> #include <xen/interface/xen.h> #include <xen/hvm.h> #include "mmu.h" #ifdef CONFIG_PROC_VMCORE /* * This function is used in two contexts: * - the kdump kernel has to check whether a pfn of the crashed kernel * was a ballooned page. vmcore is using this function to decide * whether to access a pfn of the crashed kernel. * - the kexec kernel has to check whether a pfn was ballooned by the * previous kernel. If the pfn is ballooned, handle it properly. * Returns 0 if the pfn is not backed by a RAM page, the caller may * handle the pfn special in this case. */
static int xen_oldmem_pfn_is_ram(unsigned long pfn) { struct xen_hvm_get_mem_type a = { .domid = DOMID_SELF, .pfn = pfn, }; int ram; if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) return -ENXIO; switch (a.mem_type) { case HVMMEM_mmio_dm: ram = 0; break; case HVMMEM_ram_rw: case HVMMEM_ram_ro: default: ram = 1; break; } return ram; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Kuznetsov | 74 | 100.00% | 1 | 100.00% |
Total | 74 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Kuznetsov | 52 | 100.00% | 1 | 100.00% |
Total | 52 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Kuznetsov | 59 | 100.00% | 1 | 100.00% |
Total | 59 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Kuznetsov | 30 | 100.00% | 1 | 100.00% |
Total | 30 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Vitaly Kuznetsov | 236 | 99.58% | 1 | 50.00% |
Greg Kroah-Hartman | 1 | 0.42% | 1 | 50.00% |
Total | 237 | 100.00% | 2 | 100.00% |