~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/xen/hvm.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* Simple wrappers around HVM functions */
  3 #ifndef XEN_HVM_H__
  4 #define XEN_HVM_H__
  5 
  6 #include <xen/interface/hvm/params.h>
  7 #include <asm/xen/hypercall.h>
  8 
  9 static const char *param_name(int op)
 10 {
 11 #define PARAM(x) [HVM_PARAM_##x] = #x
 12         static const char *const names[] = {
 13                 PARAM(CALLBACK_IRQ),
 14                 PARAM(STORE_PFN),
 15                 PARAM(STORE_EVTCHN),
 16                 PARAM(PAE_ENABLED),
 17                 PARAM(IOREQ_PFN),
 18                 PARAM(BUFIOREQ_PFN),
 19                 PARAM(TIMER_MODE),
 20                 PARAM(HPET_ENABLED),
 21                 PARAM(IDENT_PT),
 22                 PARAM(DM_DOMAIN),
 23                 PARAM(ACPI_S_STATE),
 24                 PARAM(VM86_TSS),
 25                 PARAM(VPT_ALIGN),
 26                 PARAM(CONSOLE_PFN),
 27                 PARAM(CONSOLE_EVTCHN),
 28         };
 29 #undef PARAM
 30 
 31         if (op >= ARRAY_SIZE(names))
 32                 return "unknown";
 33 
 34         if (!names[op])
 35                 return "reserved";
 36 
 37         return names[op];
 38 }
 39 static inline int hvm_get_parameter(int idx, uint64_t *value)
 40 {
 41         struct xen_hvm_param xhv;
 42         int r;
 43 
 44         xhv.domid = DOMID_SELF;
 45         xhv.index = idx;
 46         r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
 47         if (r < 0) {
 48                 pr_err("Cannot get hvm parameter %s (%d): %d!\n",
 49                        param_name(idx), idx, r);
 50                 return r;
 51         }
 52         *value = xhv.value;
 53         return r;
 54 }
 55 
 56 #define HVM_CALLBACK_VIA_TYPE_VECTOR 0x2
 57 #define HVM_CALLBACK_VIA_TYPE_SHIFT 56
 58 #define HVM_CALLBACK_VECTOR(x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\
 59                 HVM_CALLBACK_VIA_TYPE_SHIFT | (x))
 60 
 61 void xen_setup_callback_vector(void);
 62 
 63 int xen_set_upcall_vector(unsigned int cpu);
 64 
 65 #endif /* XEN_HVM_H__ */
 66 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php