ia64/xen-unstable

view xen/xsm/dummy.c @ 19191:a55919061d79

blktap: Fix check_gcrypt

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 11 10:44:42 2009 +0000 (2009-02-11)
parents ee62aaafff46
children 5966b71195b4
line source
1 /*
2 * This work is based on the LSM implementation in Linux 2.6.13.4.
3 *
4 * Author: George Coker, <gscoker@alpha.ncsc.mil>
5 *
6 * Contributors: Michael LeMay, <mdlemay@epoch.ncsc.mil>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2,
10 * as published by the Free Software Foundation.
11 */
13 #include <xen/sched.h>
14 #include <xsm/xsm.h>
16 static void dummy_security_domaininfo(struct domain *d,
17 struct xen_domctl_getdomaininfo *info)
18 {
19 return;
20 }
22 static int dummy_setvcpucontext(struct domain *d)
23 {
24 return 0;
25 }
27 static int dummy_pausedomain (struct domain *d)
28 {
29 return 0;
30 }
32 static int dummy_unpausedomain (struct domain *d)
33 {
34 return 0;
35 }
37 static int dummy_resumedomain (struct domain *d)
38 {
39 return 0;
40 }
42 static int dummy_domain_create(struct domain *d, u32 ssidref)
43 {
44 return 0;
45 }
47 static int dummy_max_vcpus(struct domain *d)
48 {
49 return 0;
50 }
52 static int dummy_destroydomain (struct domain *d)
53 {
54 return 0;
55 }
57 static int dummy_vcpuaffinity (int cmd, struct domain *d)
58 {
59 return 0;
60 }
62 static int dummy_scheduler (struct domain *d)
63 {
64 return 0;
65 }
67 static int dummy_getdomaininfo (struct domain *d)
68 {
69 return 0;
70 }
72 static int dummy_getvcpucontext (struct domain *d)
73 {
74 return 0;
75 }
77 static int dummy_getvcpuinfo (struct domain *d)
78 {
79 return 0;
80 }
82 static int dummy_domain_settime (struct domain *d)
83 {
84 return 0;
85 }
87 static int dummy_set_target (struct domain *d, struct domain *e)
88 {
89 return 0;
90 }
92 static int dummy_tbufcontrol (void)
93 {
94 return 0;
95 }
97 static int dummy_readconsole (uint32_t clear)
98 {
99 return 0;
100 }
102 static int dummy_sched_id (void)
103 {
104 return 0;
105 }
107 static int dummy_setdomainmaxmem (struct domain *d)
108 {
109 return 0;
110 }
112 static int dummy_setdomainhandle (struct domain *d)
113 {
114 return 0;
115 }
117 static int dummy_setdebugging (struct domain *d)
118 {
119 return 0;
120 }
122 static int dummy_perfcontrol (void)
123 {
124 return 0;
125 }
127 static int dummy_debug_keys (void)
128 {
129 return 0;
130 }
132 static int dummy_getcpuinfo (void)
133 {
134 return 0;
135 }
137 static int dummy_availheap (void)
138 {
139 return 0;
140 }
142 static int dummy_alloc_security_domain (struct domain *d)
143 {
144 return 0;
145 }
147 static void dummy_free_security_domain (struct domain *d)
148 {
149 return;
150 }
152 static int dummy_grant_mapref (struct domain *d1, struct domain *d2,
153 uint32_t flags)
154 {
155 return 0;
156 }
158 static int dummy_grant_unmapref (struct domain *d1, struct domain *d2)
159 {
160 return 0;
161 }
163 static int dummy_grant_setup (struct domain *d1, struct domain *d2)
164 {
165 return 0;
166 }
168 static int dummy_grant_transfer (struct domain *d1, struct domain *d2)
169 {
170 return 0;
171 }
173 static int dummy_grant_copy (struct domain *d1, struct domain *d2)
174 {
175 return 0;
176 }
178 static int dummy_grant_query_size (struct domain *d1, struct domain *d2)
179 {
180 return 0;
181 }
183 static int dummy_memory_adjust_reservation (struct domain *d1,
184 struct domain *d2)
185 {
186 return 0;
187 }
189 static int dummy_memory_stat_reservation (struct domain *d1, struct domain *d2)
190 {
191 return 0;
192 }
194 static int dummy_console_io (struct domain *d, int cmd)
195 {
196 return 0;
197 }
199 static int dummy_profile (struct domain *d, int op)
200 {
201 return 0;
202 }
204 static int dummy_kexec (void)
205 {
206 return 0;
207 }
209 static int dummy_schedop_shutdown (struct domain *d1, struct domain *d2)
210 {
211 return 0;
212 }
214 static int dummy_memory_pin_page(struct domain *d, struct page_info *page)
215 {
216 return 0;
217 }
219 static int dummy_evtchn_unbound (struct domain *d, struct evtchn *chn,
220 domid_t id2)
221 {
222 return 0;
223 }
225 static int dummy_evtchn_interdomain (struct domain *d1, struct evtchn
226 *chan1, struct domain *d2, struct evtchn *chan2)
227 {
228 return 0;
229 }
231 static void dummy_evtchn_close_post (struct evtchn *chn)
232 {
233 return;
234 }
236 static int dummy_evtchn_send (struct domain *d, struct evtchn *chn)
237 {
238 return 0;
239 }
241 static int dummy_evtchn_status (struct domain *d, struct evtchn *chn)
242 {
243 return 0;
244 }
246 static int dummy_evtchn_reset (struct domain *d1, struct domain *d2)
247 {
248 return 0;
249 }
251 static int dummy_alloc_security_evtchn (struct evtchn *chn)
252 {
253 return 0;
254 }
256 static void dummy_free_security_evtchn (struct evtchn *chn)
257 {
258 return;
259 }
261 static long dummy___do_xsm_op(XEN_GUEST_HANDLE(xsm_op_t) op)
262 {
263 return -ENOSYS;
264 }
266 static int dummy_add_range (struct domain *d, char *name, unsigned long s, unsigned long e)
267 {
268 return 0;
269 }
271 static int dummy_remove_range (struct domain *d, char *name, unsigned long s,
272 unsigned long e)
273 {
274 return 0;
275 }
277 #ifdef CONFIG_X86
278 static int dummy_shadow_control (struct domain *d, uint32_t op)
279 {
280 return 0;
281 }
283 static int dummy_getpageframeinfo (struct page_info *page)
284 {
285 return 0;
286 }
288 static int dummy_getmemlist (struct domain *d)
289 {
290 return 0;
291 }
293 static int dummy_hypercall_init (struct domain *d)
294 {
295 return 0;
296 }
298 static int dummy_hvmcontext (struct domain *d, uint32_t cmd)
299 {
300 return 0;
301 }
303 static int dummy_address_size (struct domain *d, uint32_t cmd)
304 {
305 return 0;
306 }
308 static int dummy_machine_address_size (struct domain *d, uint32_t cmd)
309 {
310 return 0;
311 }
313 static int dummy_hvm_param (struct domain *d, unsigned long op)
314 {
315 return 0;
316 }
318 static int dummy_hvm_set_pci_intx_level (struct domain *d)
319 {
320 return 0;
321 }
323 static int dummy_hvm_set_isa_irq_level (struct domain *d)
324 {
325 return 0;
326 }
328 static int dummy_hvm_set_pci_link_route (struct domain *d)
329 {
330 return 0;
331 }
333 static int dummy_apic (struct domain *d, int cmd)
334 {
335 return 0;
336 }
338 static int dummy_assign_vector (struct domain *d, uint32_t pirq)
339 {
340 return 0;
341 }
343 static int dummy_xen_settime (void)
344 {
345 return 0;
346 }
348 static int dummy_memtype (uint32_t access)
349 {
350 return 0;
351 }
353 static int dummy_microcode (void)
354 {
355 return 0;
356 }
358 static int dummy_physinfo (void)
359 {
360 return 0;
361 }
363 static int dummy_platform_quirk (uint32_t quirk)
364 {
365 return 0;
366 }
368 static int dummy_firmware_info (void)
369 {
370 return 0;
371 }
373 static int dummy_acpi_sleep (void)
374 {
375 return 0;
376 }
378 static int dummy_change_freq (void)
379 {
380 return 0;
381 }
383 static int dummy_getidletime (void)
384 {
385 return 0;
386 }
388 static int dummy_machine_memory_map (void)
389 {
390 return 0;
391 }
393 static int dummy_domain_memory_map (struct domain *d)
394 {
395 return 0;
396 }
398 static int dummy_mmu_normal_update (struct domain *d, struct domain *f,
399 intpte_t fpte)
400 {
401 return 0;
402 }
404 static int dummy_mmu_machphys_update (struct domain *d, unsigned long mfn)
405 {
406 return 0;
407 }
409 static int dummy_update_va_mapping (struct domain *d, struct domain *f,
410 l1_pgentry_t pte)
411 {
412 return 0;
413 }
415 static int dummy_add_to_physmap (struct domain *d1, struct domain *d2)
416 {
417 return 0;
418 }
420 static int dummy_sendtrigger (struct domain *d)
421 {
422 return 0;
423 }
425 static int dummy_test_assign_device (uint32_t machine_bdf)
426 {
427 return 0;
428 }
430 static int dummy_assign_device (struct domain *d, uint32_t machine_bdf)
431 {
432 return 0;
433 }
435 static int dummy_deassign_device (struct domain *d, uint32_t machine_bdf)
436 {
437 return 0;
438 }
440 static int dummy_bind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq *bind)
441 {
442 return 0;
443 }
445 static int dummy_pin_mem_cacheattr (struct domain *d)
446 {
447 return 0;
448 }
450 static int dummy_ext_vcpucontext (struct domain *d, uint32_t cmd)
451 {
452 return 0;
453 }
455 #endif
457 struct xsm_operations dummy_xsm_ops;
459 #define set_to_dummy_if_null(ops, function) \
460 do { \
461 if ( !ops->function ) \
462 { \
463 ops->function = dummy_##function; \
464 dprintk(XENLOG_DEBUG, "Had to override the " #function \
465 " security operation with the dummy one.\n"); \
466 } \
467 } while (0)
469 void xsm_fixup_ops (struct xsm_operations *ops)
470 {
471 set_to_dummy_if_null(ops, security_domaininfo);
472 set_to_dummy_if_null(ops, setvcpucontext);
473 set_to_dummy_if_null(ops, pausedomain);
474 set_to_dummy_if_null(ops, unpausedomain);
475 set_to_dummy_if_null(ops, resumedomain);
476 set_to_dummy_if_null(ops, domain_create);
477 set_to_dummy_if_null(ops, max_vcpus);
478 set_to_dummy_if_null(ops, destroydomain);
479 set_to_dummy_if_null(ops, vcpuaffinity);
480 set_to_dummy_if_null(ops, scheduler);
481 set_to_dummy_if_null(ops, getdomaininfo);
482 set_to_dummy_if_null(ops, getvcpucontext);
483 set_to_dummy_if_null(ops, getvcpuinfo);
484 set_to_dummy_if_null(ops, domain_settime);
485 set_to_dummy_if_null(ops, set_target);
486 set_to_dummy_if_null(ops, tbufcontrol);
487 set_to_dummy_if_null(ops, readconsole);
488 set_to_dummy_if_null(ops, sched_id);
489 set_to_dummy_if_null(ops, setdomainmaxmem);
490 set_to_dummy_if_null(ops, setdomainhandle);
491 set_to_dummy_if_null(ops, setdebugging);
492 set_to_dummy_if_null(ops, perfcontrol);
493 set_to_dummy_if_null(ops, debug_keys);
494 set_to_dummy_if_null(ops, getcpuinfo);
495 set_to_dummy_if_null(ops, availheap);
497 set_to_dummy_if_null(ops, evtchn_unbound);
498 set_to_dummy_if_null(ops, evtchn_interdomain);
499 set_to_dummy_if_null(ops, evtchn_close_post);
500 set_to_dummy_if_null(ops, evtchn_send);
501 set_to_dummy_if_null(ops, evtchn_status);
502 set_to_dummy_if_null(ops, evtchn_reset);
504 set_to_dummy_if_null(ops, grant_mapref);
505 set_to_dummy_if_null(ops, grant_unmapref);
506 set_to_dummy_if_null(ops, grant_setup);
507 set_to_dummy_if_null(ops, grant_transfer);
508 set_to_dummy_if_null(ops, grant_copy);
509 set_to_dummy_if_null(ops, grant_query_size);
511 set_to_dummy_if_null(ops, alloc_security_domain);
512 set_to_dummy_if_null(ops, free_security_domain);
513 set_to_dummy_if_null(ops, alloc_security_evtchn);
514 set_to_dummy_if_null(ops, free_security_evtchn);
516 set_to_dummy_if_null(ops, memory_adjust_reservation);
517 set_to_dummy_if_null(ops, memory_stat_reservation);
518 set_to_dummy_if_null(ops, memory_pin_page);
520 set_to_dummy_if_null(ops, console_io);
522 set_to_dummy_if_null(ops, profile);
524 set_to_dummy_if_null(ops, kexec);
525 set_to_dummy_if_null(ops, schedop_shutdown);
527 set_to_dummy_if_null(ops, add_range);
528 set_to_dummy_if_null(ops, remove_range);
530 set_to_dummy_if_null(ops, __do_xsm_op);
532 #ifdef CONFIG_X86
533 set_to_dummy_if_null(ops, shadow_control);
534 set_to_dummy_if_null(ops, getpageframeinfo);
535 set_to_dummy_if_null(ops, getmemlist);
536 set_to_dummy_if_null(ops, hypercall_init);
537 set_to_dummy_if_null(ops, hvmcontext);
538 set_to_dummy_if_null(ops, address_size);
539 set_to_dummy_if_null(ops, machine_address_size);
540 set_to_dummy_if_null(ops, hvm_param);
541 set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
542 set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
543 set_to_dummy_if_null(ops, hvm_set_pci_link_route);
544 set_to_dummy_if_null(ops, apic);
545 set_to_dummy_if_null(ops, assign_vector);
546 set_to_dummy_if_null(ops, xen_settime);
547 set_to_dummy_if_null(ops, memtype);
548 set_to_dummy_if_null(ops, microcode);
549 set_to_dummy_if_null(ops, physinfo);
550 set_to_dummy_if_null(ops, platform_quirk);
551 set_to_dummy_if_null(ops, firmware_info);
552 set_to_dummy_if_null(ops, acpi_sleep);
553 set_to_dummy_if_null(ops, change_freq);
554 set_to_dummy_if_null(ops, getidletime);
555 set_to_dummy_if_null(ops, machine_memory_map);
556 set_to_dummy_if_null(ops, domain_memory_map);
557 set_to_dummy_if_null(ops, mmu_normal_update);
558 set_to_dummy_if_null(ops, mmu_machphys_update);
559 set_to_dummy_if_null(ops, update_va_mapping);
560 set_to_dummy_if_null(ops, add_to_physmap);
561 set_to_dummy_if_null(ops, sendtrigger);
562 set_to_dummy_if_null(ops, test_assign_device);
563 set_to_dummy_if_null(ops, assign_device);
564 set_to_dummy_if_null(ops, deassign_device);
565 set_to_dummy_if_null(ops, bind_pt_irq);
566 set_to_dummy_if_null(ops, pin_mem_cacheattr);
567 set_to_dummy_if_null(ops, ext_vcpucontext);
568 #endif
569 }