nested.c (597473720f4dc69749542bfcfed4a927a43d935e) nested.c (753ed9c95c37d058e50e7d42bbe296ee0bf6670d)
1// SPDX-License-Identifier: GPL-2.0
2
3/*
4 * Hyper-V nested virtualization code.
5 *
6 * Copyright (C) 2018, Microsoft, Inc.
7 *
8 * Author : Lan Tianyu <Tianyu.Lan@microsoft.com>

--- 33 unchanged lines hidden (view full) ---

42
43 flush->address_space = as;
44 flush->flags = 0;
45
46 status = hv_do_hypercall(HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE,
47 flush, NULL);
48 local_irq_restore(flags);
49
1// SPDX-License-Identifier: GPL-2.0
2
3/*
4 * Hyper-V nested virtualization code.
5 *
6 * Copyright (C) 2018, Microsoft, Inc.
7 *
8 * Author : Lan Tianyu <Tianyu.Lan@microsoft.com>

--- 33 unchanged lines hidden (view full) ---

42
43 flush->address_space = as;
44 flush->flags = 0;
45
46 status = hv_do_hypercall(HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE,
47 flush, NULL);
48 local_irq_restore(flags);
49
50 if (!(status & HV_HYPERCALL_RESULT_MASK))
50 if (hv_result_success(status))
51 ret = 0;
52
53fault:
54 trace_hyperv_nested_flush_guest_mapping(as, ret);
55 return ret;
56}
57EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping);
58

--- 28 unchanged lines hidden (view full) ---

87}
88EXPORT_SYMBOL_GPL(hyperv_fill_flush_guest_mapping_list);
89
90int hyperv_flush_guest_mapping_range(u64 as,
91 hyperv_fill_flush_list_func fill_flush_list_func, void *data)
92{
93 struct hv_guest_mapping_flush_list **flush_pcpu;
94 struct hv_guest_mapping_flush_list *flush;
51 ret = 0;
52
53fault:
54 trace_hyperv_nested_flush_guest_mapping(as, ret);
55 return ret;
56}
57EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping);
58

--- 28 unchanged lines hidden (view full) ---

87}
88EXPORT_SYMBOL_GPL(hyperv_fill_flush_guest_mapping_list);
89
90int hyperv_flush_guest_mapping_range(u64 as,
91 hyperv_fill_flush_list_func fill_flush_list_func, void *data)
92{
93 struct hv_guest_mapping_flush_list **flush_pcpu;
94 struct hv_guest_mapping_flush_list *flush;
95 u64 status = 0;
95 u64 status;
96 unsigned long flags;
97 int ret = -ENOTSUPP;
98 int gpa_n = 0;
99
100 if (!hv_hypercall_pg || !fill_flush_list_func)
101 goto fault;
102
103 local_irq_save(flags);

--- 16 unchanged lines hidden (view full) ---

120 goto fault;
121 }
122
123 status = hv_do_rep_hypercall(HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST,
124 gpa_n, 0, flush, NULL);
125
126 local_irq_restore(flags);
127
96 unsigned long flags;
97 int ret = -ENOTSUPP;
98 int gpa_n = 0;
99
100 if (!hv_hypercall_pg || !fill_flush_list_func)
101 goto fault;
102
103 local_irq_save(flags);

--- 16 unchanged lines hidden (view full) ---

120 goto fault;
121 }
122
123 status = hv_do_rep_hypercall(HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST,
124 gpa_n, 0, flush, NULL);
125
126 local_irq_restore(flags);
127
128 if (!(status & HV_HYPERCALL_RESULT_MASK))
128 if (hv_result_success(status))
129 ret = 0;
130 else
129 ret = 0;
130 else
131 ret = status;
131 ret = hv_result(status);
132fault:
133 trace_hyperv_nested_flush_guest_mapping_range(as, ret);
134 return ret;
135}
136EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping_range);
132fault:
133 trace_hyperv_nested_flush_guest_mapping_range(as, ret);
134 return ret;
135}
136EXPORT_SYMBOL_GPL(hyperv_flush_guest_mapping_range);