Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6280954iob; Tue, 10 May 2022 14:47:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO2pPqMiOdmG6P12HKy1zVstWkHqE2747SCik1YcnAZyyyFyKOGzlS5mvyQF3JoBMdN0+m X-Received: by 2002:aa7:8e44:0:b0:50c:fc0e:8d25 with SMTP id d4-20020aa78e44000000b0050cfc0e8d25mr22045972pfr.81.1652219275652; Tue, 10 May 2022 14:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652219275; cv=none; d=google.com; s=arc-20160816; b=w63pkrSFzn5Psq1GQ/BRlrYSYHGgcqHzrE3Y626MhnIYVgC+dqcacNKJzvLY6QZxg7 WKcXM7hD6Fo6tTKiXNwR49cQs9tKbR88maT7ZJDrXL1tZodek4Tyx1Lrx+VmvIuAB6ir 8XD/3/5tbKGUEIb7Q37cuV07GfFW6byFKLVxC95YSTjWs90dDiE0kWGbllcefT3Omj5D JmbMVR2WlLYjGo0UHmBpYQMifZmjuV5tqykaZJP+ay4yOzT+oiQbFG8lcRibelEzONtz DhydthdLS8uBmsOzeOEde/rPNjRKiv12vBxSaG6TbSSWXi5+lm1lVjOW9JJMOdvu475a NFMQ== 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=YwlI4SOdaCiIF2T0fRasnf3pb0Dz0W+PbTJT112BTbI=; b=lFaAMOwXUD2ZTvoNHluir/fR3HL0d0nVsmvAoQFqCB9nQjIzXemy8AxRRPTYuAwILn ujrhCNGMdE89HaXgQhm1+O9u1sraqncb+yUx455IMBeMZ3FjQ6w/1XHUOS0QFd26ilc0 fa+QbugtT8YGJSumgPnmAxeIoNb/O+MYjIn/iXxyjw+PwAbZYmVdozHTlVJNZVxU8bXB OBAGcjoBVBAamqvrtIiP11bRCkJ4T1hoLgngFjGdzPbVT1SGvtFlj5bx4e4MtZukBaTg rO7YCfr2W6ua0Bgzvk/Jy0cHy+Zuluxu/29v4BT7drK+yJjJCJNn6i+a/PQZ2wDliOqV iI8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qtivRA6U; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a635602000000b003ab020bfc7fsi530641pgb.587.2022.05.10.14.47.39; Tue, 10 May 2022 14:47:55 -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=@alien8.de header.s=dkim header.b=qtivRA6U; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245738AbiEJScZ (ORCPT + 99 others); Tue, 10 May 2022 14:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348808AbiEJScX (ORCPT ); Tue, 10 May 2022 14:32:23 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F1994E38A; Tue, 10 May 2022 11:32:21 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1E0DA1EC0354; Tue, 10 May 2022 20:32:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1652207536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=YwlI4SOdaCiIF2T0fRasnf3pb0Dz0W+PbTJT112BTbI=; b=qtivRA6UZ8N6glsgC7YCH4Cm2zMMzUrDPR5yH/pAfaBCOygYNvflOfciVP7oT8Np8O/88W CgzdPyC6lZl0zGjd536DXox2BLwQQZXRDAB0JHlgjwISgp0GqwOGue4hyBNWd+iqwogCc/ /bYQ0+dDaSjuHp0NUl7USPvcr5qTq8s= Date: Tue, 10 May 2022 20:32:23 +0200 From: Borislav Petkov To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Dave Hansen , Brijesh Singh , Mike Rapoport , David Hildenbrand , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv5 08/12] x86/mm: Provide helpers for unaccepted memory Message-ID: References: <20220425033934.68551-1-kirill.shutemov@linux.intel.com> <20220425033934.68551-9-kirill.shutemov@linux.intel.com> <20220506161359.4j5j5fxrw53fdbyr@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220506161359.4j5j5fxrw53fdbyr@box.shutemov.name> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, 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 Fri, May 06, 2022 at 07:13:59PM +0300, Kirill A. Shutemov wrote: > Failure to accept the memory is fatal. Why pretend it is not? > > For TDX it will result in a crash on the first access. Prolonging the > suffering just make it harder to understand what happened. Ok then. Does that panic message contain enough info so that the acceptance failure can be debugged? Just "Cannot accept memory" doesn't seem very helpful to me... > That's true. Note also that the check is inherently racy. Other CPU can > get the range or subrange accepted just after spin_unlock(). > > The check indicates that accept_memory() has to be called on the range > before first access. > > Do you have problem with a name? Maybe has_unaccepted_memory()? I have a problem with the definition of this function, what it is supposed to do and how it is supposed to be used. Right now, it looks weird and strange: is it supposed to check for *all* in-between (start, end)? It doesn't, atm, so what's the meaning of @start and @end then at all? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette