On 09.04.2024 14:06, Sergiy Kibrik wrote: > Separate Intel nonfatal MCE initialization code from generic MCE code, the > same > way it is done for AMD code. This is to be able to later make intel/amd MCE > code optional in the build. > > Convert to Xen coding style. Clean up unused includes. Remove seemingly > outdated comment about MCE check period. > > No functional change intended. > > Signed-off-by: Sergiy Kibrik <sergiy_kib...@epam.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com> with ... > --- /dev/null > +++ b/xen/arch/x86/cpu/mcheck/intel-nonfatal.c > @@ -0,0 +1,85 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Non Fatal Machine Check Exception Reporting > + * (C) Copyright 2002 Dave Jones. <da...@codemonkey.org.uk> > + */ > + > +#include <xen/event.h> > + > +#include "mce.h" > +#include "vmce.h" > + > +static struct timer mce_timer; > + > +#define MCE_PERIOD MILLISECS(8000) > +#define MCE_PERIOD_MIN MILLISECS(2000) > +#define MCE_PERIOD_MAX MILLISECS(16000) > + > +static uint64_t period = MCE_PERIOD; > +static int adjust = 0; > +static int variable_period = 1; > + > +static void cf_check mce_checkregs(void *info) > +{ > + mctelem_cookie_t mctc; > + struct mca_summary bs; > + static uint64_t dumpcount = 0; > + > + mctc = mcheck_mca_logout(MCA_POLLER, this_cpu( poll_bankmask), > + &bs, NULL); > + > + if ( bs.errcnt && mctc != NULL ) > + { > + adjust++; > + > + /* If Dom0 enabled the VIRQ_MCA event, then notify it. ... comment style here corrected, too (which I'll try t to remember to take care of while committing). Jan