Skip to content

Commit 3f3c8be

Browse files
committed
Merge tag 'for-linus-5.5a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: - a small series to remove the build constraint of Xen x86 MCE handling to 64-bit only - a bunch of minor cleanups * tag 'for-linus-5.5a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: Fix Kconfig indentation xen/mcelog: also allow building for 32-bit kernels xen/mcelog: add PPIN to record when available xen/mcelog: drop __MC_MSR_MCGCAP xen/gntdev: Use select for DMA_SHARED_BUFFER xen: mm: make xen_mm_init static xen: mm: include <xen/xen-ops.h> for missing declarations
2 parents 2981dcf + 23c1cce commit 3f3c8be

5 files changed

Lines changed: 56 additions & 36 deletions

File tree

arch/arm/xen/mm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <xen/interface/grant_table.h>
1616
#include <xen/interface/memory.h>
1717
#include <xen/page.h>
18+
#include <xen/xen-ops.h>
1819
#include <xen/swiotlb-xen.h>
1920

2021
#include <asm/cacheflush.h>
@@ -133,7 +134,7 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
133134
return;
134135
}
135136

136-
int __init xen_mm_init(void)
137+
static int __init xen_mm_init(void)
137138
{
138139
struct gnttab_cache_flush cflush;
139140
if (!xen_initial_domain())

arch/x86/include/asm/msr-index.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@
409409
#define MSR_AMD_PSTATE_DEF_BASE 0xc0010064
410410
#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140
411411
#define MSR_AMD64_OSVW_STATUS 0xc0010141
412+
#define MSR_AMD_PPIN_CTL 0xc00102f0
413+
#define MSR_AMD_PPIN 0xc00102f1
412414
#define MSR_AMD64_LS_CFG 0xc0011020
413415
#define MSR_AMD64_DC_CFG 0xc0011022
414416
#define MSR_AMD64_BU_CFG2 0xc001102a

drivers/xen/Kconfig

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -106,27 +106,27 @@ config XENFS
106106
If in doubt, say yes.
107107

108108
config XEN_COMPAT_XENFS
109-
bool "Create compatibility mount point /proc/xen"
110-
depends on XENFS
111-
default y
112-
help
113-
The old xenstore userspace tools expect to find "xenbus"
114-
under /proc/xen, but "xenbus" is now found at the root of the
115-
xenfs filesystem. Selecting this causes the kernel to create
116-
the compatibility mount point /proc/xen if it is running on
117-
a xen platform.
118-
If in doubt, say yes.
109+
bool "Create compatibility mount point /proc/xen"
110+
depends on XENFS
111+
default y
112+
help
113+
The old xenstore userspace tools expect to find "xenbus"
114+
under /proc/xen, but "xenbus" is now found at the root of the
115+
xenfs filesystem. Selecting this causes the kernel to create
116+
the compatibility mount point /proc/xen if it is running on
117+
a xen platform.
118+
If in doubt, say yes.
119119

120120
config XEN_SYS_HYPERVISOR
121-
bool "Create xen entries under /sys/hypervisor"
122-
depends on SYSFS
123-
select SYS_HYPERVISOR
124-
default y
125-
help
126-
Create entries under /sys/hypervisor describing the Xen
127-
hypervisor environment. When running native or in another
128-
virtual environment, /sys/hypervisor will still be present,
129-
but will have no xen contents.
121+
bool "Create xen entries under /sys/hypervisor"
122+
depends on SYSFS
123+
select SYS_HYPERVISOR
124+
default y
125+
help
126+
Create entries under /sys/hypervisor describing the Xen
127+
hypervisor environment. When running native or in another
128+
virtual environment, /sys/hypervisor will still be present,
129+
but will have no xen contents.
130130

131131
config XEN_XENBUS_FRONTEND
132132
tristate
@@ -141,7 +141,8 @@ config XEN_GNTDEV
141141

142142
config XEN_GNTDEV_DMABUF
143143
bool "Add support for dma-buf grant access device driver extension"
144-
depends on XEN_GNTDEV && XEN_GRANT_DMA_ALLOC && DMA_SHARED_BUFFER
144+
depends on XEN_GNTDEV && XEN_GRANT_DMA_ALLOC
145+
select DMA_SHARED_BUFFER
145146
help
146147
Allows userspace processes and kernel modules to use Xen backed
147148
dma-buf implementation. With this extension grant references to
@@ -270,7 +271,7 @@ config XEN_ACPI_PROCESSOR
270271
depends on XEN && XEN_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ
271272
default m
272273
help
273-
This ACPI processor uploads Power Management information to the Xen
274+
This ACPI processor uploads Power Management information to the Xen
274275
hypervisor.
275276

276277
To do that the driver parses the Power Management data and uploads
@@ -279,19 +280,19 @@ config XEN_ACPI_PROCESSOR
279280
SMM so that other drivers (such as ACPI cpufreq scaling driver) will
280281
not load.
281282

282-
To compile this driver as a module, choose M here: the module will be
283+
To compile this driver as a module, choose M here: the module will be
283284
called xen_acpi_processor If you do not know what to choose, select
284285
M here. If the CPUFREQ drivers are built in, select Y here.
285286

286287
config XEN_MCE_LOG
287288
bool "Xen platform mcelog"
288-
depends on XEN_DOM0 && X86_64 && X86_MCE
289+
depends on XEN_DOM0 && X86_MCE
289290
help
290291
Allow kernel fetching MCE error from Xen platform and
291292
converting it into Linux mcelog format for mcelog tools
292293

293294
config XEN_HAVE_PVMMU
294-
bool
295+
bool
295296

296297
config XEN_EFI
297298
def_bool y
@@ -308,15 +309,15 @@ config XEN_ACPI
308309
depends on X86 && ACPI
309310

310311
config XEN_SYMS
311-
bool "Xen symbols"
312-
depends on X86 && XEN_DOM0 && XENFS
313-
default y if KALLSYMS
314-
help
315-
Exports hypervisor symbols (along with their types and addresses) via
316-
/proc/xen/xensyms file, similar to /proc/kallsyms
312+
bool "Xen symbols"
313+
depends on X86 && XEN_DOM0 && XENFS
314+
default y if KALLSYMS
315+
help
316+
Exports hypervisor symbols (along with their types and addresses) via
317+
/proc/xen/xensyms file, similar to /proc/kallsyms
317318

318319
config XEN_HAVE_VPMU
319-
bool
320+
bool
320321

321322
config XEN_FRONT_PGDIR_SHBUF
322323
tristate

drivers/xen/mcelog.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int convert_log(struct mc_info *mi)
222222
struct mcinfo_global *mc_global;
223223
struct mcinfo_bank *mc_bank;
224224
struct xen_mce m;
225-
uint32_t i;
225+
unsigned int i, j;
226226

227227
mic = NULL;
228228
x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL);
@@ -248,7 +248,17 @@ static int convert_log(struct mc_info *mi)
248248
m.socketid = g_physinfo[i].mc_chipid;
249249
m.cpu = m.extcpu = g_physinfo[i].mc_cpunr;
250250
m.cpuvendor = (__u8)g_physinfo[i].mc_vendor;
251-
m.mcgcap = g_physinfo[i].mc_msrvalues[__MC_MSR_MCGCAP].value;
251+
for (j = 0; j < g_physinfo[i].mc_nmsrvals; ++j)
252+
switch (g_physinfo[i].mc_msrvalues[j].reg) {
253+
case MSR_IA32_MCG_CAP:
254+
m.mcgcap = g_physinfo[i].mc_msrvalues[j].value;
255+
break;
256+
257+
case MSR_PPIN:
258+
case MSR_AMD_PPIN:
259+
m.ppin = g_physinfo[i].mc_msrvalues[j].value;
260+
break;
261+
}
252262

253263
mic = NULL;
254264
x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK);

include/xen/interface/xen-mca.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ struct mc_info {
183183
DEFINE_GUEST_HANDLE_STRUCT(mc_info);
184184

185185
#define __MC_MSR_ARRAYSIZE 8
186-
#define __MC_MSR_MCGCAP 0
187186
#define __MC_NMSRS 1
188187
#define MC_NCAPS 7
189188
struct mcinfo_logical_cpu {
@@ -332,7 +331,11 @@ struct xen_mc {
332331
};
333332
DEFINE_GUEST_HANDLE_STRUCT(xen_mc);
334333

335-
/* Fields are zero when not available */
334+
/*
335+
* Fields are zero when not available. Also, this struct is shared with
336+
* userspace mcelog and thus must keep existing fields at current offsets.
337+
* Only add new fields to the end of the structure
338+
*/
336339
struct xen_mce {
337340
__u64 status;
338341
__u64 misc;
@@ -353,6 +356,9 @@ struct xen_mce {
353356
__u32 socketid; /* CPU socket ID */
354357
__u32 apicid; /* CPU initial apic ID */
355358
__u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */
359+
__u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */
360+
__u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */
361+
__u64 ppin; /* Protected Processor Inventory Number */
356362
};
357363

358364
/*

0 commit comments

Comments
 (0)