From: "Jan Beulich" Subject: Re: [PATCH 1/2] x86/tboot: invalidate FIX_TBOOT_MAP_ADDRESS mapping after use Date: Thu, 05 Mar 2015 07:14:01 +0000 Message-ID: <54F81049020000780006671E@mail.emea.novell.com> References: <54E461B50200007800060ED5@mail.emea.novell.com> <54E4635E0200007800060EE1@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YTPys-0005Kp-GL for xen-devel@lists.xenproject.org; Thu, 05 Mar 2015 07:14:02 +0000 In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Gang Wei Cc: Andrew Cooper , xen-devel , Shane Wang List-Id: xen-devel@lists.xenproject.org >>> On 05.03.15 at 05:45, wrote: > On Feb 18, 2015 17:03, Jan Beulich wrote: >> In order for commit cbeeaa7d ("x86/nmi: fix shootdown of pcpus >> running in VMX non-root mode")'s re-use of that fixmap entry to not >> cause undesirable (in crash context) cross-CPU TLB flushes, invalidate >> the fixmap entry right after use. >> >> Signed-off-by: Jan Beulich >> >> --- a/xen/arch/x86/tboot.c >> +++ b/xen/arch/x86/tboot.c >> @@ -138,6 +138,7 @@ void __init tboot_probe(void) >> TXT_PUB_CONFIG_REGS_BASE + TXTCR_SINIT_BASE); >> tboot_copy_memory((unsigned char *)&sinit_size, >> sizeof(sinit_size), TXT_PUB_CONFIG_REGS_BASE + >> TXTCR_SINIT_SIZE); >> + __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0); >> } >> >> /* definitions from xen/drivers/passthrough/vtd/iommu.h >> @@ -476,6 +477,8 @@ int __init tboot_parse_dmar_table(acpi_t >> dmar_table_raw = xmalloc_array(unsigned char, dmar_table_length); >> tboot_copy_memory(dmar_table_raw, dmar_table_length, pa); >> dmar_table = (struct acpi_table_header *)dmar_table_raw; >> + __set_fixmap(FIX_TBOOT_MAP_ADDRESS, 0, 0); >> + >> rc = dmar_handler(dmar_table); >> xfree(dmar_table_raw); >> >> > > It might be better to move the fixmap invalidations into tboot_copy_memory > like below. I considered this, but dropped the idea due to resulting in several redundant invalidations. Jan