Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1236855pxb; Fri, 1 Oct 2021 06:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVrMTO4ojfxI8PbZCjVc3WQD46C8d60aJU4RkpE6ADEt5gezEblJLkJUT2pOUCNr/K3zBW X-Received: by 2002:a63:d30e:: with SMTP id b14mr9714002pgg.454.1633095184696; Fri, 01 Oct 2021 06:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633095184; cv=none; d=google.com; s=arc-20160816; b=WeKOJ94EOcR93aaGRbBwjGlVIgrGrF6X6BYB/kwsxefPg4PQ8MQeY6g3RJ6wxTmP2V pkRCu67tVcXGezRPzOD1SqKLyrqdU/djKlP2V54gORtievcj5yR3nh3YAYI/Yo+NAqVA nESco2O9TxLRNmr8shAGjMCkuuvPyN7U7yWNdQ98OtsHhF4CCt+trPtFyrwW+84LBBX4 xJDvPHBWVJih9+NpmLnuIhtiG6uOJWpygZ1iovtoBl0gbqmY8+QSivtROZaPajYWp8ol 9KN9BRP2rweZRAMLhE66Nma04cB/ndfcQ5LLAnl30xrKgctbfbsz7lPhugXl3/2nkwzi ZGKg== 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=LsEowLyh+XDnn2t+V7KKl/KkGlcM7KUzAyO5EF9PelU=; b=km0ideKS2OIV0pEUS0skHYGP14nsT3FZI/QJzeUZq2/oa3iQvvvIFjOXCGLCM2B9u2 vejQ2CSIBQR4y0+BZyIgTOMUrA3zjOr0gM3R1cotco5lbp/9YA5z102VUwvURxAzWjaf TM3EkuhG94z804KHKiuExsKyPdA8NILSURSeiHX2bxsl8ZzzrI9TmCsZuYnU4rScQ6Mp NYw1td6xtwnmAKDlv2Xzu7uElM8X5JKgWHF7XxBuklB3jJW/Sqn281yz5Io6WwMg8xKo FpH8o61JF2Kgq69+ZRK1wCGut3gpQEJiei3tXpa8UXZndFf+MNBWpN3AXEwc6+oIuNA+ 11DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KHtf6VZT; 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 l3si7311932plh.50.2021.10.01.06.32.47; Fri, 01 Oct 2021 06:33:04 -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=KHtf6VZT; 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 S231549AbhJANc5 (ORCPT + 99 others); Fri, 1 Oct 2021 09:32:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbhJANc5 (ORCPT ); Fri, 1 Oct 2021 09:32:57 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31BFDC061775 for ; Fri, 1 Oct 2021 06:31:13 -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=LsEowLyh+XDnn2t+V7KKl/KkGlcM7KUzAyO5EF9PelU=; b=KHtf6VZTQ2V5Ue4llu9QH1ZCEA 1RPA2NF523PAZ6zJyOEIC2axBkQIiH+pHOOvxiqbmRN+97Q5qO2dTE2Yp9K5IF3SjaaSZMsYf3VbZ wuFgxQ+3amELNgoKIQPBsVV9OIAjofy70Nhi8kJFaExv+/7nVrE1hhRrMRnu0jO8MZ1qGkZPULxgG ogqlpjs6RCa+OtYm8i08dzHNQ4iBLYuK94E3HmAnkOyag/FsopG07/qGPHdqyHv6q9zcjuCpJ++yV +KAHzUvwrBdcVDy8uIS+dhMgL6aEvw1n9CKA+Mf4gqI5S8j2HjKFtGnYzZZcQNPLEHg7RdCYyl8So UUE+kpNg==; 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 #2 (Red Hat Linux)) id 1mWIbs-00Dvnw-SL; Fri, 01 Oct 2021 13:30:10 +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 DAEAB30214E; Fri, 1 Oct 2021 15:29:55 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C66692C53BFE3; Fri, 1 Oct 2021 15:29:55 +0200 (CEST) Date: Fri, 1 Oct 2021 15:29:55 +0200 From: Peter Zijlstra To: Joerg Roedel Cc: Borislav Petkov , Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Brijesh Singh Subject: Re: [PATCH] x86/sev: Fully map the #VC exception stacks Message-ID: References: <113eca80a14cd280540c38488fd31ac0fa7bf36c.1633063250.git.thomas.lendacky@amd.com> 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 Fri, Oct 01, 2021 at 03:00:38PM +0200, Joerg Roedel wrote: > On Fri, Oct 01, 2021 at 02:58:28PM +0200, Borislav Petkov wrote: > > On Fri, Oct 01, 2021 at 01:50:24PM +0200, Joerg Roedel wrote: > > > Yeah, I think the right fix is to export cea_map_percpu_pages() and move > > > the cea_map_stack() macro to a header and use it to map the VC stacks. > > > > I'll do you one better: Put the #VC stack mapping into > > percpu_setup_exception_stacks(), where it naturally belongs and where > > the other stacks are being mapped instead of doing everything "by hand" > > like now and exporting random helpers. > > The VC stack is only allocated and mapped when SEV-ES is detected, so > they can't always be mapped by generic code. It's just a few pages per cpu, is that worth it? Why not have it unconditinoally allocated in the right place when it finds the CPU is SEV capable?