Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7093446rwd; Mon, 19 Jun 2023 18:18:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WK6acc3Kr6YA9zy5rpp3X7wg0SWfMrLbwIPfrpmsiqjDVEnC0h0Np27mvaw5mszJ9EIHH X-Received: by 2002:a17:902:c24d:b0:1b2:450f:9cb with SMTP id 13-20020a170902c24d00b001b2450f09cbmr8048304plg.51.1687223882644; Mon, 19 Jun 2023 18:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687223882; cv=none; d=google.com; s=arc-20160816; b=uXStMmIiE8VpFFH62XfiDAakVFevqyEuKhnR2K7QH6DAonp32qcz0ElWkjnWY9LHCz Zpzn7suUXH1mrPSy0TfdayfPHvRZiHo7x1qYfzvgo7w2aFlnoqd2PNFIDIj+SzZKzw5P RZJtwiZOS39zXdlWcreRLeEAloAef4cwxwz4Vbl7n1WNPOKB3WFgh20nQeXg8Y0UyIAm LloJ+AywP6NXd/1OT7iiG1fQcwFsWKPp0BsWIu+sIGGa05qXJR1AokWbW+PVxgam0I4L 0Qv1Pf0poz5oQkSdzBBrRFaytksumY3jEYGsgMxdQN0S4jrMRnktULxNuK7TmpVmLvy5 6vKA== 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=F0gDDCWhCRVSQgfvszRu9MBrtcrE3cRWfiqXRR47oMY=; b=Sk9Bl1l1xsQZCwD3iNKiT1eh4XcMsYGgHKMOvHFiKGpaE+kRAFxGISafN0MaWq3M5D GNGEINyEoiBSf47LFyqVjdtWnzSZwLzP1akITiExPnly3qUjVpeGFsNmCzgSn3QKdZBm nvh83QdbyYhLAuY5e7+/2sMhHtfIz0qnreWR0iVhJRZVX5NuxOutcB+LwjtztiwVhUxM df+agJ+s3TShAnWqmH2aT2riV0rA/mQ6D3KYlLBJgGAogLyqNeoudXfpBMJKG+iBQJsi E0lvyZrYRzb7TZjFR6kOIApIgDIYt++6dW9fE0W441NPhEY8L2dWrnrxmSoDk7tkkqfs CNVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LGo9aCAq; 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 s11-20020a170903200b00b001b00256b95bsi719946pla.644.2023.06.19.18.17.50; Mon, 19 Jun 2023 18:18:02 -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=LGo9aCAq; 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 S229651AbjFTBGf (ORCPT + 99 others); Mon, 19 Jun 2023 21:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjFTBGe (ORCPT ); Mon, 19 Jun 2023 21:06:34 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E93BD9C; Mon, 19 Jun 2023 18:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687223193; x=1718759193; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=VHof60/+vU8A0IEg7SMylUsXJOqbW8P6DsjVQClaj6M=; b=LGo9aCAqlCCtMp668IHW5/RXUDWilcU395bMRHfwidpx61QdhEuj5vH0 meBBzA/X7z6hT9x14RQUIlJkjPpinxA4fLcpA3lozYBbmuAqobVjnNm1R 7rFcePaCSCGD0dnMvWMc9m5iE7+P3XMtUjYhihyq21ap5KtfTiseMQ+u8 KCz7sppnZ7FHhZNQKbTm1UnkqTcQ+3GfcvazsWTvW6OiVDVGk+VigQWBY Y1ciiwFeVyrglBEidrPMsXDIJO59GFnd82qOklScpX97AoR8i1lyQcYy+ HhIbDvUjzepYYfme7VOk3uvcPejdTLae5DZJj56m0SeCEZGB69Pb4mKH2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10746"; a="362277231" X-IronPort-AV: E=Sophos;i="6.00,255,1681196400"; d="scan'208";a="362277231" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2023 18:06:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10746"; a="858376029" X-IronPort-AV: E=Sophos;i="6.00,255,1681196400"; d="scan'208";a="858376029" Received: from alaird-mobl2.amr.corp.intel.com (HELO [10.212.177.39]) ([10.212.177.39]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2023 18:06:30 -0700 Message-ID: <4069285d-1653-4cbf-a3b3-24727697754b@intel.com> Date: Mon, 19 Jun 2023 18:06:30 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v11 18/20] x86: Handle TDX erratum to reset TDX private memory during kexec() and reboot Content-Language: en-US To: "Huang, Kai" , "kirill.shutemov@linux.intel.com" Cc: "kvm@vger.kernel.org" , "Luck, Tony" , "david@redhat.com" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "linux-kernel@vger.kernel.org" , "Chatre, Reinette" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "tglx@linutronix.de" , "linux-mm@kvack.org" , "Yamahata, Isaku" , "Shahar, Sagi" , "peterz@infradead.org" , "imammedo@redhat.com" , "Gao, Chao" , "Brown, Len" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Huang, Ying" , "Williams, Dan J" References: <5aa7506d4fedbf625e3fe8ceeb88af3be1ce97ea.1685887183.git.kai.huang@intel.com> <20230609132301.uvvp27yr5kpenl6f@box.shutemov.name> <58f34b4b81b6d6b37d3386dec0f073e6eb7a97ff.camel@intel.com> <20230612075830.jbrdd6ysz4qq7wdf@box.shutemov.name> <4c7effc3abe71aa1cbee41f3bd46b97aed40be26.camel@intel.com> <48d5a29a-878c-665d-6ac2-6f0563bf6f3c@intel.com> <5782c8c2bb3e76a802e4a81c553a21edbaee7c47.camel@intel.com> <20230619144651.kvmscndienyfr3my@box.shutemov.name> <63477d22-26ef-dd08-a3b0-93931b7d1d16@intel.com> <0be5634f390015ee6badb3f2b2154ad90eb70434.camel@intel.com> From: Dave Hansen In-Reply-To: <0be5634f390015ee6badb3f2b2154ad90eb70434.camel@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 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_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 6/19/23 17:56, Huang, Kai wrote: > Any comments to below? Nothing that I haven't already said in this thread: > Just use a normal old atomic_t or set_bit()/test_bit(). They have > built-in memory barriers are are less likely to get botched. I kinda made a point of literally suggesting "atomic_t or set_bit()/test_bit()". I even told you why: "built-in memory barriers". Guess what READ/WRITE_ONCE() *don't* have. Memory barriers.