Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5545538rwd; Mon, 12 Jun 2023 06:39:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DJqVv0oyyhaqUNFS0/u3VMIOE5AYZddCvX5Ps9xG9XrUBwZj8GN/kk8W6i87tBzB4S7K5 X-Received: by 2002:a17:903:41ce:b0:1b1:ac87:b47a with SMTP id u14-20020a17090341ce00b001b1ac87b47amr8127887ple.65.1686577187287; Mon, 12 Jun 2023 06:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686577187; cv=none; d=google.com; s=arc-20160816; b=0ZiEbFH4Iz0mvunzgyFnM9yw2Dy/cqsZApMd6brTaFP8FnyE1BoOq27gQhF/JpzgS/ 2Dw5IAvAozU7EVo0PdmaUBHHdD+FU80J4MK3yRCo6CFmFh9Ahr9eF4+7PsHCRiTnDPig XOLsWldM4E09+wPS+XaxVC7P3YPSxTEI/FuXLiSb1tN1zprypi5pF5HFUvlsS7tTVTbC sbZQBSdxhVjTqDOjE6fvgLoMBKaequY9w3ToQhNPlEIzyE2oAz8ganh7JKRVu+PVAvqO zRyw91MRFQVZXAAWdO0zCqv7s6Nr1MTc67NwvdXHHE9AUOYR6vDfoPxESvHnEqA4UkZD MmSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=vZoKC/MwKaHETBU4QYrwaiY2RwOdMO/7wtzKE5z+wFg=; b=IA6HUG7G+4Gk+KPlrDSW129uFODQejXnpyeMpfzWng4vQkDE9MHJDKr5VsKLPKa7G/ CUaDQsZU6wuZ+d6W/v3nSeGR31jj/u7ehSYLJyBFRT5wj9ZFPuVJmMwEKa7QDy+/Kc8K gnitefI5+9WJlY/V2RshlDtNqlaGXF/8IlKw3+QZHL4asxfNH3VkEPec/v4ixDYc+V3f B3sSMA1TRfv6+mFa6JJ6IYXfK2glXTPrw3CfLDleigdolw0tf1sgfchpIZlWQuK2Yz1d JrbhQrju1O753dU+WEJxJwaBqyywY8atv0brUMlWB+daXjxa/jpiZye8sUXMUK/x7AUn yoaQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a17090ace0500b0025bdb373e38si2135776pju.96.2023.06.12.06.39.35; Mon, 12 Jun 2023 06:39:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234848AbjFLNSV convert rfc822-to-8bit (ORCPT + 99 others); Mon, 12 Jun 2023 09:18:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234182AbjFLNSU (ORCPT ); Mon, 12 Jun 2023 09:18:20 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63400E51 for ; Mon, 12 Jun 2023 06:18:18 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-173-0FOEeq_-OMq-Pc0lsQH2SA-1; Mon, 12 Jun 2023 14:18:14 +0100 X-MC-Unique: 0FOEeq_-OMq-Pc0lsQH2SA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 12 Jun 2023 14:18:01 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Mon, 12 Jun 2023 14:18:01 +0100 From: David Laight To: "'kirill.shutemov@linux.intel.com'" , "Huang, Kai" CC: "kvm@vger.kernel.org" , "Hansen, Dave" , "david@redhat.com" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "Luck, Tony" , "Chatre, Reinette" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "tglx@linutronix.de" , "Yamahata, Isaku" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Shahar, Sagi" , "peterz@infradead.org" , "imammedo@redhat.com" , "Gao, Chao" , "Brown, Len" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Huang, Ying" , "Williams, Dan J" Subject: RE: [PATCH v11 18/20] x86: Handle TDX erratum to reset TDX private memory during kexec() and reboot Thread-Topic: [PATCH v11 18/20] x86: Handle TDX erratum to reset TDX private memory during kexec() and reboot Thread-Index: AQHZnSRWXDaSmJ22okO690LL2Ubsg6+HJc9w Date: Mon, 12 Jun 2023 13:18:01 +0000 Message-ID: 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> <20230612114843.n7vvoh7m2rk4la56@box.shutemov.name> In-Reply-To: <20230612114843.n7vvoh7m2rk4la56@box.shutemov.name> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 From: kirill.shutemov@linux.intel.com > Sent: 12 June 2023 12:49 > > On Mon, Jun 12, 2023 at 10:27:44AM +0000, Huang, Kai wrote: > > Does it make sense? > > I understand your logic. AFAICS, it is correct (smp_mb() instead of __mb() > would be better), but it is not justified from complexity PoV. Given that x86 performs writes pretty much in code order. Do you need anything more than a compile barrier? > This lockless exercise gave me a pause to understand. > > Lockless doesn't buy you anything here, only increases complexity. > Just take a lock. Indeed... David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)