Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4271615pxj; Wed, 12 May 2021 01:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt96xmTs8frrxQsdfp3NhZPMeMowD40EyhHUgZBoasLcXilnZy1sKjCuWLkPJuBE9JYnbZ X-Received: by 2002:a05:6602:27c2:: with SMTP id l2mr25530070ios.71.1620808925200; Wed, 12 May 2021 01:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620808925; cv=none; d=google.com; s=arc-20160816; b=ztA9canO4uZGqpSFV+l9k1ctdNsu4rSOSwXYsoLaOwjp6zsgqztwE0wXl+ljFpk6No HcLoBDSCfuCF3HHvPMEf+pf98J1GE+K+AYnRAcU34AWVYrZ/QDrEtEnClcaqPYNpy8ip C7NmUuCCptMYfqGtOrVwgZD08qdrkhgI95qpGuKNIvtyc4nCfxhmG6sHlJe1m7jD+z15 02dTgU11RwqPaMjiCyW8uqqMpQV9HqVOSb9an8IV8GM9f1cmQ/QZkE3dLFCQaYlx5PTU Yhr2EpgHJHjOHtoAwvKeSn9r0X2lc7JhkFD1qNQ/g4JMQgBJRp3+twZqpd3seIKvGHK2 q0pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aCbHCS/vOTKYin2zVWEkVMKtygd54jsqUMQnCeOW+uc=; b=Uc81knuPlczd9fs/eWqwAN6SDSmBioPdFpRJK62Ymem2EbOO8sOSXVi+D/A4TVwDVd ZKrj3GofOLqn8mT7JBjduF6BMk4GN4BSj+ChgvhVHGqX0mNI+/Si4krgGeavy3pcVlTL cJPBkTJyW3ouytk+dz6Gf/ywTzBcQHlAKOpd878U6002C6NM750lqEzMgBzPerWcMaA3 UMAP7/zj9PKAoCmJRXnCRwWV0K2qqgFY8X2K942wDACdf0omfbgJotdt1r5br5PhKbqg Hxqd4Ia1s6tMs1WMPWWnRu4bA/1ltAv9AcNJy7oIcCxGAWx7XUkP6R6YFysdk2YfC8tk n6Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mODRj1Lg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si16611863ily.19.2021.05.12.01.41.52; Wed, 12 May 2021 01:42:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mODRj1Lg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230253AbhELIl7 (ORCPT + 99 others); Wed, 12 May 2021 04:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbhELIl7 (ORCPT ); Wed, 12 May 2021 04:41:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA44C061574 for ; Wed, 12 May 2021 01:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aCbHCS/vOTKYin2zVWEkVMKtygd54jsqUMQnCeOW+uc=; b=mODRj1LgtJLzzvrYKwVvo6YQmv H1xn8XO1ggz/R6cI7fhVQ0b8uRtAE7Stn1jf8kKKoXCaIGUJnNbrL9egNfRgRr3UP2yoL+iECBrxA KQTCWrhyCTHXEV7l0AUCOz6jiXZhdr6VB96cgpTEM2D45cyuB5CygI0O5lfbQ7vNwuyWHFzo4j4aQ dBgAw392tEl7Gw5WtrCjRZwHQUWoS02KFnojLtAksh8CwgVKKTXQpa/N86pijUquhumtTM2kgN4rE 95eJeaQHwuEDt7fNjNCKti2NnYLQTYkMe+kDLQGADqOXrtkSYm/bGVaWShxHbKM9+Uvhzx+9RJazC el2itSWg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lgkN9-0086NA-34; Wed, 12 May 2021 08:38:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8ED2E300242; Wed, 12 May 2021 10:37:37 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 761162BA8A549; Wed, 12 May 2021 10:37:37 +0200 (CEST) Date: Wed, 12 May 2021 10:37:37 +0200 From: Peter Zijlstra To: Lai Jiangshan Cc: Thomas Gleixner , LKML , x86@kernel.org, Joerg Roedel , Borislav Petkov Subject: Re: [patch 1/2 v2] x86/cpu: Init AP exception handling from cpu_init_secondary() Message-ID: References: <20210507110210.147106915@linutronix.de> <20210507114000.429303187@linutronix.de> <87wns8ko48.ffs@nanos.tec.linutronix.de> <87k0o6gtvu.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 05:25:35PM +0800, Lai Jiangshan wrote: > > > On 2021/5/11 05:29, Thomas Gleixner wrote: > > From: Borislav Petkov > > > > SEV-ES guests require properly setup task register with which the TSS > > descriptor in the GDT can be located so that the IST-type #VC exception > > handler which they need to function properly, can be executed. > > > > This setup needs to happen before attempting to load microcode in > > ucode_cpu_init() on secondary CPUs which can cause such #VC exceptions. > > > > Simplify the machinery by running that exception setup from a new function > > cpu_init_secondary() and explicitly call cpu_init_exception_handling() for > > the boot CPU before cpu_init(). The latter prepares for fixing and > > simplifying the exception/IST setup on the boot CPU. > > > > There should be no functional changes resulting from this patch. > > > > [ tglx: Reworked it so cpu_init_exception_handling() stays seperate ] > > > > Signed-off-by: Borislav Petkov > > Signed-off-by: Thomas Gleixner > > > For both patches: > > Reviewed-by: Lai Jiangshan Acked-by: Peter Zijlstra (Intel)