debuggers.hg

view xen/include/asm-x86/microcode.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents ed76e4bbea83
children
line source
1 #ifndef ASM_X86__MICROCODE_H
2 #define ASM_X86__MICROCODE_H
4 #include <xen/percpu.h>
6 struct cpu_signature;
7 struct ucode_cpu_info;
9 struct microcode_ops {
10 int (*microcode_resume_match)(int cpu, struct cpu_signature *nsig);
11 int (*cpu_request_microcode)(int cpu, const void *buf, size_t size);
12 int (*collect_cpu_info)(int cpu, struct cpu_signature *csig);
13 int (*apply_microcode)(int cpu);
14 };
16 struct microcode_header_intel {
17 unsigned int hdrver;
18 unsigned int rev;
19 unsigned int date;
20 unsigned int sig;
21 unsigned int cksum;
22 unsigned int ldrver;
23 unsigned int pf;
24 unsigned int datasize;
25 unsigned int totalsize;
26 unsigned int reserved[3];
27 };
29 struct microcode_intel {
30 struct microcode_header_intel hdr;
31 unsigned int bits[0];
32 };
34 /* microcode format is extended from prescott processors */
35 struct extended_signature {
36 unsigned int sig;
37 unsigned int pf;
38 unsigned int cksum;
39 };
41 struct extended_sigtable {
42 unsigned int count;
43 unsigned int cksum;
44 unsigned int reserved[3];
45 struct extended_signature sigs[0];
46 };
48 struct equiv_cpu_entry {
49 uint32_t installed_cpu;
50 uint32_t fixed_errata_mask;
51 uint32_t fixed_errata_compare;
52 uint16_t equiv_cpu;
53 uint16_t reserved;
54 } __attribute__((packed));
56 struct microcode_header_amd {
57 uint32_t data_code;
58 uint32_t patch_id;
59 uint8_t mc_patch_data_id[2];
60 uint8_t mc_patch_data_len;
61 uint8_t init_flag;
62 uint32_t mc_patch_data_checksum;
63 uint32_t nb_dev_id;
64 uint32_t sb_dev_id;
65 uint16_t processor_rev_id;
66 uint8_t nb_rev_id;
67 uint8_t sb_rev_id;
68 uint8_t bios_api_rev;
69 uint8_t reserved1[3];
70 uint32_t match_reg[8];
71 } __attribute__((packed));
73 struct microcode_amd {
74 struct microcode_header_amd hdr;
75 unsigned int mpb[0];
76 };
78 struct cpu_signature {
79 unsigned int sig;
80 unsigned int pf;
81 unsigned int rev;
82 };
84 struct ucode_cpu_info {
85 struct cpu_signature cpu_sig;
86 union {
87 struct microcode_intel *mc_intel;
88 struct microcode_amd *mc_amd;
89 void *mc_valid;
90 } mc;
91 };
93 DECLARE_PER_CPU(struct ucode_cpu_info, ucode_cpu_info);
94 extern const struct microcode_ops *microcode_ops;
96 #endif /* ASM_X86__MICROCODE_H */