Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp636717rwb; Thu, 11 Aug 2022 07:32:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6fjIsv7SxEwVjpq7xnHZA/8Vyq9AqMvNvvZ56LIDSFztWJoTdeV34/4C/Sj7jwG0RQajZp X-Received: by 2002:a17:907:6e93:b0:733:a08:1ed6 with SMTP id sh19-20020a1709076e9300b007330a081ed6mr6126983ejc.233.1660228358304; Thu, 11 Aug 2022 07:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660228358; cv=none; d=google.com; s=arc-20160816; b=E8+bXQETPevrJilT8HmY+pfwnypdnyTq5JDMvSH3itcW6fT0OAmKfMw9s4AQ8Yrn/H SFZG7yrYV0KlWu5rZsDadCqslZ4rg9N+AvphhdhOPjZt8xlwzT0/YM29E8Bx/QRo8Bqw tsTzqfeN+TxV3Rcz9VB/Ed43Ma/kCv5+e6gf2CrTZpJWaq86ZDAUB11Uh5RaAdjqSgtF yUWs+6QIy7ftkptXwTLaQ020BpKU+qVA4pA3Gt8dy9l5J4nQzdlNFs4yAkGjCICU9Tpb 8PksCv9E+fvHgawTFwWWL1waPnh6M1aYyR4Inms6Y9I0lADEtG58Wf3l2ibGDpWGenKM Sq3A== 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=Q1UCXPGlK9ZEkriLpD7+N2yKPvd0z3A6a2z6f1v9+Bo=; b=0iCETE1Lm/2/XTmkXX5PA2pGjpXramh+pz+Bsib494Uzp5O9wPqcNrWwlx8an9gV8c UKhGd0KHniE6gFnIibhhX6OJKFnUfKxjEjG+1vDuW1LddrBBMlKN4hSgdFANu7dqyE2W 9JHuvFSsPEmcDKeULf1nU6CKlNhClpsE+zEEwha9Ux8Jmcw+YaCdIwVo2srJwcAAzFTB pGcYz3MSlUBTRR+VUtp1zA4K6CEf+FWwMEOVR/sx2wkwNATlJDFElxaGFLCu8vMh51ij gjd42g+ExNJvdwjyhFt5koS7l/y8tIgMoj6sTt3VTJDikxEmdZfIqS740Ncl3lgWm2HL ICUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Nldl+5Pi; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 qk37-20020a1709077fa500b00718d033df13si8315042ejc.678.2022.08.11.07.32.00; Thu, 11 Aug 2022 07:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=Nldl+5Pi; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S235486AbiHKO2I (ORCPT + 99 others); Thu, 11 Aug 2022 10:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235509AbiHKO2F (ORCPT ); Thu, 11 Aug 2022 10:28:05 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 865BF7B1CD; Thu, 11 Aug 2022 07:28:02 -0700 (PDT) Received: from zn.tnic (p200300ea971b9854329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971b:9854:329c:23ff:fea6:a903]) (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 0E4B81EC04E4; Thu, 11 Aug 2022 16:27:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1660228077; 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=Q1UCXPGlK9ZEkriLpD7+N2yKPvd0z3A6a2z6f1v9+Bo=; b=Nldl+5PixfhbhO4eEPFiuay5moOBlgPYXxT4tquajDJ80buKA8ustrVZnGOugYUz2yeVIa 6hINhKTqWDWfKf7cMCGHg8eU0u16CCkbqDK9T/1waCQXi5SL4XMaoPFkK4d4arYeiryh9w wuA8CCtq1Dbz2MYTUDemutSSXgNdqik= Date: Thu, 11 Aug 2022 16:27:53 +0200 From: Borislav Petkov To: "Kalra, Ashish" Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "linux-mm@kvack.org" , "linux-crypto@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "jroedel@suse.de" , "Lendacky, Thomas" , "hpa@zytor.com" , "ardb@kernel.org" , "pbonzini@redhat.com" , "seanjc@google.com" , "vkuznets@redhat.com" , "jmattson@google.com" , "luto@kernel.org" , "dave.hansen@linux.intel.com" , "slp@redhat.com" , "pgonda@google.com" , "peterz@infradead.org" , "srinivas.pandruvada@linux.intel.com" , "rientjes@google.com" , "dovmurik@linux.ibm.com" , "tobin@ibm.com" , "Roth, Michael" , "vbabka@suse.cz" , "kirill@shutemov.name" , "ak@linux.intel.com" , "tony.luck@intel.com" , "marcorr@google.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "alpergun@google.com" , "dgilbert@redhat.com" , "jarkko@kernel.org" Subject: Re: [PATCH Part2 v6 09/49] x86/fault: Add support to handle the RMP fault for user address Message-ID: References: <0ecb0a4781be933fcadeb56a85070818ef3566e7.1655761627.git.ashish.kalra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 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-crypto@vger.kernel.org On Wed, Aug 10, 2022 at 10:00:57PM +0000, Kalra, Ashish wrote: > This is more like a sanity check and returning 1 will cause the fault > handler to return and ignore the fault for current #PF case. If the > page got unmapped, the fault will not happen again and there will be > no retry, so the fault in this case is being ignored. I know what will happen. I'm asking you to make this explicit in the code because this separate define documents the situation. One more return type != 0 won't hurt. > Ok, so you are suggesting that we remove this check and simply keep > this function wrapping around __split_huge_pmd(). This becomes a > generic utility function. Yes, it is in generic code so it better be generic function. That's why I'm questioning the vendor-specific check there. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette