Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp456136imn; Fri, 29 Jul 2022 12:10:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vD0Vwcqmi+CkONsth9b/vmTqknVjfouq7ImG+ngwLfKT82b/fFgbzj9mrqYRaeraxIYrB9 X-Received: by 2002:a05:6402:4311:b0:43c:3515:bda2 with SMTP id m17-20020a056402431100b0043c3515bda2mr4877362edc.288.1659121849959; Fri, 29 Jul 2022 12:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659121849; cv=none; d=google.com; s=arc-20160816; b=Loh4X3c1C5FEEYYlqgkdiriQB1pf6/DgLfYSge2m0DQ/xUOTYN8oT5jr2x8byaM6Lb JObzOk32lF1A2L4tmdM9b5yriOPd/AiawxS330UnlfMr9NAJ3obyoe3PwQ2kbCj5fXfZ qgt68EnUHvwSfWs4Od7xlPGa2LydfEh0g26B0GvHMeZccCVjNhRCcWFSTyX6UjHtfOTJ 0MD84ymrts47BAYBfXes1wq+9cinO/1FgzzzYmlNWKMGoTAlN4UErM6TQCbGhjrWEIsI 6NEFmBjKg6LCxQuTpBYscU1y7WybLLr3/9JhNMbAjeAXLVr1MDON8gJOgaSXpr7lZ4t+ 4Btw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=x3emzjWgosCOjU8g9Qz0WRZKv7VJv+tSrISHTRNm1LA=; b=kzOKGG7xFZX5zlwSRcWlG0dVqJ4OcftoekSnqn+cuyZHjjPAqpkCtpGh9omggz0BrG S0acWwieTb0QkH763vZsfvnLodYNEKCoiyu5Ozljt4v1dpE8xf3ieZaQj/xCXul0ashu F0Ri3R+muWCtjBC1Vp44Mnd1JFIPyweJMx/N/R6SQWndDEECUxTTJl2bmCl0I85SmJDE p9lx8wJGqNTkD5xvV9bKsuGs/zVmghdgb/5oXMuAAfr3dam1uhnIaHquXgeCYpkieGgh 3ZnIzM6BujxSvwJ+xul2n7R9X2LfdJmXmoXJ+9qVq+roGWnQx/mg6GbidIwfJ1yrFl+6 yPPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eaKtlBGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a50c94d000000b0043bd6cf51d1si3841340edh.530.2022.07.29.12.10.24; Fri, 29 Jul 2022 12:10:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eaKtlBGx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238612AbiG2TIl (ORCPT + 99 others); Fri, 29 Jul 2022 15:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237395AbiG2TIk (ORCPT ); Fri, 29 Jul 2022 15:08:40 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B651F12F for ; Fri, 29 Jul 2022 12:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659121719; x=1690657719; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qjcVM8mE/4KKr2AbzDjZ4JT5g02rfXfdHRMcCiuIE+0=; b=eaKtlBGxtO5TAjr3N5VSq8mssbCFPkg7T+QkIAfCnAQ0alAufCkmjxXd MO5GhLBy0CGwg4KILU0Z/HFhNecNP/yd5O69YRy+uKuyz0/0beiS70oJL CNoOf7a8n9ZAnIq+3VeA64kyaRf44xLHJMWyGftYh5AAioH0GU5ER6D7v iolFXi3N+M8eKfDj8gKPNT0YVbRe8LJLN5BbVozW2helNbWiTD1YFHeaT 7ALNpC+eqDzOUgae34/Kkwpwc8r7QJrVqX1CY4+dSziwfmlr+Pgm7rhx+ CjwyL2JAO8tSUwkyBIqTpoPprlBQgm4RhdLtujKDPfzAxTsDhKhFkgb3n A==; X-IronPort-AV: E=McAfee;i="6400,9594,10423"; a="286386378" X-IronPort-AV: E=Sophos;i="5.93,201,1654585200"; d="scan'208";a="286386378" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2022 12:08:39 -0700 X-IronPort-AV: E=Sophos;i="5.93,201,1654585200"; d="scan'208";a="669365319" Received: from svdas-mobl.amr.corp.intel.com (HELO [10.209.20.175]) ([10.209.20.175]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2022 12:08:38 -0700 Message-ID: <377f6c30-bdfc-55a4-bda7-f29c60c53300@intel.com> Date: Fri, 29 Jul 2022 12:08:38 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 1/2] x86/sev: Use per-CPU PSC structure in prep for unaccepted memory support Content-Language: en-US To: Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "Kirill A. Shutemov" , "H. Peter Anvin" , Michael Roth , Joerg Roedel , Andy Lutomirski , Peter Zijlstra References: <20220614120231.48165-1-kirill.shutemov@linux.intel.com> <658c455c40e8950cb046dd885dd19dc1c52d060a.1659103274.git.thomas.lendacky@amd.com> <9da5204f-5c8f-b47b-bcc6-d68ca63db08d@amd.com> From: Dave Hansen In-Reply-To: <9da5204f-5c8f-b47b-bcc6-d68ca63db08d@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/22 07:25, Tom Lendacky wrote: >> Considering that runtime acceptance is already single-threaded[1] *and* >> there's a fallback method, why not just have a single copy of this >> guarded by a single lock? > > This function is called for more than just memory acceptance. It's also > called for any changes from or to private or shared, which isn't > single-threaded. I think this tidbit from the changelog threw me off: > Protect the use of the per-CPU structure by disabling interrupts during > memory acceptance. Could you please revise that to accurately capture the impact of this change?