diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2008-04-17 01:46:09 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-04-17 01:47:00 -0400 |
commit | aa24f7f08baca5aa9201901131cbdd0b14deceb6 (patch) | |
tree | 31f9194686ca8f18262da6e75823926c7a448cb6 /drivers/s390/sysinfo.c | |
parent | f60c768c387026499bbdefdd807d9124ae2b3a8c (diff) |
[S390] KVM preparation: split sysinfo definitions for kvm use
drivers/s390/sysinfo.c uses the store system information intruction to query
the system about information of the machine, the LPAR and additional
hypervisors. KVM has to implement the host part for this instruction.
To avoid code duplication, this patch splits the common definitions from
sysinfo.c into a separate header file include/asm-s390/sysinfo.h for KVM use.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/sysinfo.c')
-rw-r--r-- | drivers/s390/sysinfo.c | 100 |
1 files changed, 1 insertions, 99 deletions
diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c index 291ff6235fe2..43fffa3b099d 100644 --- a/drivers/s390/sysinfo.c +++ b/drivers/s390/sysinfo.c | |||
@@ -11,111 +11,13 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
13 | #include <asm/ebcdic.h> | 13 | #include <asm/ebcdic.h> |
14 | #include <asm/sysinfo.h> | ||
14 | 15 | ||
15 | /* Sigh, math-emu. Don't ask. */ | 16 | /* Sigh, math-emu. Don't ask. */ |
16 | #include <asm/sfp-util.h> | 17 | #include <asm/sfp-util.h> |
17 | #include <math-emu/soft-fp.h> | 18 | #include <math-emu/soft-fp.h> |
18 | #include <math-emu/single.h> | 19 | #include <math-emu/single.h> |
19 | 20 | ||
20 | struct sysinfo_1_1_1 { | ||
21 | char reserved_0[32]; | ||
22 | char manufacturer[16]; | ||
23 | char type[4]; | ||
24 | char reserved_1[12]; | ||
25 | char model_capacity[16]; | ||
26 | char sequence[16]; | ||
27 | char plant[4]; | ||
28 | char model[16]; | ||
29 | }; | ||
30 | |||
31 | struct sysinfo_1_2_1 { | ||
32 | char reserved_0[80]; | ||
33 | char sequence[16]; | ||
34 | char plant[4]; | ||
35 | char reserved_1[2]; | ||
36 | unsigned short cpu_address; | ||
37 | }; | ||
38 | |||
39 | struct sysinfo_1_2_2 { | ||
40 | char format; | ||
41 | char reserved_0[1]; | ||
42 | unsigned short acc_offset; | ||
43 | char reserved_1[24]; | ||
44 | unsigned int secondary_capability; | ||
45 | unsigned int capability; | ||
46 | unsigned short cpus_total; | ||
47 | unsigned short cpus_configured; | ||
48 | unsigned short cpus_standby; | ||
49 | unsigned short cpus_reserved; | ||
50 | unsigned short adjustment[0]; | ||
51 | }; | ||
52 | |||
53 | struct sysinfo_1_2_2_extension { | ||
54 | unsigned int alt_capability; | ||
55 | unsigned short alt_adjustment[0]; | ||
56 | }; | ||
57 | |||
58 | struct sysinfo_2_2_1 { | ||
59 | char reserved_0[80]; | ||
60 | char sequence[16]; | ||
61 | char plant[4]; | ||
62 | unsigned short cpu_id; | ||
63 | unsigned short cpu_address; | ||
64 | }; | ||
65 | |||
66 | struct sysinfo_2_2_2 { | ||
67 | char reserved_0[32]; | ||
68 | unsigned short lpar_number; | ||
69 | char reserved_1; | ||
70 | unsigned char characteristics; | ||
71 | unsigned short cpus_total; | ||
72 | unsigned short cpus_configured; | ||
73 | unsigned short cpus_standby; | ||
74 | unsigned short cpus_reserved; | ||
75 | char name[8]; | ||
76 | unsigned int caf; | ||
77 | char reserved_2[16]; | ||
78 | unsigned short cpus_dedicated; | ||
79 | unsigned short cpus_shared; | ||
80 | }; | ||
81 | |||
82 | #define LPAR_CHAR_DEDICATED (1 << 7) | ||
83 | #define LPAR_CHAR_SHARED (1 << 6) | ||
84 | #define LPAR_CHAR_LIMITED (1 << 5) | ||
85 | |||
86 | struct sysinfo_3_2_2 { | ||
87 | char reserved_0[31]; | ||
88 | unsigned char count; | ||
89 | struct { | ||
90 | char reserved_0[4]; | ||
91 | unsigned short cpus_total; | ||
92 | unsigned short cpus_configured; | ||
93 | unsigned short cpus_standby; | ||
94 | unsigned short cpus_reserved; | ||
95 | char name[8]; | ||
96 | unsigned int caf; | ||
97 | char cpi[16]; | ||
98 | char reserved_1[24]; | ||
99 | |||
100 | } vm[8]; | ||
101 | }; | ||
102 | |||
103 | static inline int stsi(void *sysinfo, int fc, int sel1, int sel2) | ||
104 | { | ||
105 | register int r0 asm("0") = (fc << 28) | sel1; | ||
106 | register int r1 asm("1") = sel2; | ||
107 | |||
108 | asm volatile( | ||
109 | " stsi 0(%2)\n" | ||
110 | "0: jz 2f\n" | ||
111 | "1: lhi %0,%3\n" | ||
112 | "2:\n" | ||
113 | EX_TABLE(0b,1b) | ||
114 | : "+d" (r0) : "d" (r1), "a" (sysinfo), "K" (-ENOSYS) | ||
115 | : "cc", "memory" ); | ||
116 | return r0; | ||
117 | } | ||
118 | |||
119 | static inline int stsi_0(void) | 21 | static inline int stsi_0(void) |
120 | { | 22 | { |
121 | int rc = stsi (NULL, 0, 0, 0); | 23 | int rc = stsi (NULL, 0, 0, 0); |