[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v8 16/16] microcode: block #NMI handling when loading an ucode
- To: Chao Gao <chao.gao@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <JBeulich@xxxxxxxx>
- Date: Mon, 5 Aug 2019 12:11:01 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dg8TJ3+Zvq4OJPh/OVxOpvH4h7RsYISV9ITZGvB9g4Q=; b=FN1GwxF4tboLR9Ou6xnRk/5/OiOF+n6fcKaTRxyxi9YR8ua1CdnDaBnvDEsAJRU7CspX1zS6M4OdIc/StRTZRyhHU4Mpb89fjt3v1KpFSpi6yB/6eJp7lHVcZ5K8fRkchT4p4UW3nM191KeW3XyVNZXt68NLjkRZ3V+ZZN99zanF0T6bG/ewDFwhwqnBYCV9+60lap69bTr8Xf0+gYSbmsxFFEotuNW4T00kLpdoDpb1JaE/cZ10ZGlnlyj9x0aFgQrUpxBhcx+KbYo018HVJHwJBsetQuO7O8EHXqegj7FtG2uWg0yuMV9p1ZpXEx50EgFPe3XNoaM2stQ+6RcNAw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oF2uH/7FSFdNYqxczIo+Ttfv//vR0kHKC5HvCMNutMov22kt7NcRTVB+mcCVrOGq8su7X/ybtPckyObxDDntf6rpCj1hCSWkJSYX/YNlgn1HOLq+UdGf6hh+HTj9/CXgPTkXRJVMAAH7NgzkGez2HEa0Ho6fjZqX35EO5n5au/ck8Yu5FdG3nRF8gWJg77aF8pAZmnCPIbs5/Tue9RapCd9JD23ZrT8KytSfv5V7qq8zjpcO3ohGP7pKjK1EMcR9BR4UOQ/fYrmPtUz7+g9XZEevdCcR+N+rWBSdyov3zGH0oUUU0ELuvncRTa/FnBtBNwCoqfEiMwXx34DxRR2XBA==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ashok Raj <ashok.raj@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 05 Aug 2019 12:12:06 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVSFKrqDJQeAvFNUKw2nxS+/LtoqbsfQuA
- Thread-topic: [PATCH v8 16/16] microcode: block #NMI handling when loading an ucode
On 01.08.2019 12:22, Chao Gao wrote:
> @@ -439,12 +440,37 @@ static int do_microcode_update(void *patch)
> return ret;
> }
>
> +static int microcode_nmi_callback(const struct cpu_user_regs *regs, int cpu)
> +{
> + bool print = false;
> +
> + /* The first thread of a core is to load an update. Don't block it. */
> + if ( cpu == cpumask_first(per_cpu(cpu_sibling_mask, cpu)) )
> + return 0;
> +
> + if ( loading_state == LOADING_ENTERED )
> + {
> + cpumask_set_cpu(cpu, &cpu_callin_map);
> + printk(XENLOG_DEBUG "CPU%u enters %s\n", smp_processor_id(),
> __func__);
Here and ...
> + print = true;
> + }
> +
> + while ( loading_state == LOADING_ENTERED )
> + rep_nop();
> +
> + if ( print )
> + printk(XENLOG_DEBUG "CPU%u exits %s\n", smp_processor_id(),
> __func__);
... here - why smp_processor_id() when you can use "cpu"? And what
use is __func__ here?
The rep_nop() above also presumably wants to be cpu_relax() again.
But on the whole I was really hoping for more aggressive disabling
of NMI handling, more like (but of course not quite as heavy as)
the crash path wiring the IDT entry to trap_nop(). Andrew, I'm
curious to learn what you're thinking would be best here.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|