Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7354612rwl; Fri, 30 Dec 2022 07:21:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtQMf0uUjqyY1wLEytnx6QN0wEGfhU4Bpg7zYjP18s5cWRMR7IIsbTk7BaP+G6fLZ43Yp/1 X-Received: by 2002:a17:906:958:b0:7c0:be4d:46d6 with SMTP id j24-20020a170906095800b007c0be4d46d6mr24799454ejd.59.1672413660320; Fri, 30 Dec 2022 07:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672413660; cv=none; d=google.com; s=arc-20160816; b=WvOHjEsr2+Je2sJKJU7V88j8x+iw1DbeDRNapT6iYx1W8fBWIs3miveMHpLmkuFtmp M12HxpYXWsdox4JkjzhQ9bgT0v/J0Lcv01dRuQ47BAYc7B62dcdq9+6l3mhM2WlSFqMz B8aLLw0+ANN/N2nimcrh8ga+FZbvvDxymwjayFPPNn/H7yf3j/QqyUcilppM1r8w2pAT HdpAtP8uoDbarXI+tsuF6EycuVvkkTUWKccCnogLQRwlB5z91RJzdsXGa83bGOFqKdEk uItl37xwnkaabLjSAuW9INBrUCkfUcPyfg8ClKEg1zqDLQ9XZFX6W/j6MWTT/0WIB4jb S4GQ== 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=v7JqIbXBwu5zXf3dB3Vk1VhJgOxoY6xrgtjvqXYM/Iw=; b=G/KId08waOqiYW/m+6Mi0+DKNhdZa6nXzBpPi8r6J8aRfcQeu4JAH9VZ7xo7DXDI1W XuPXmfaV4rUbrgyoxaimG+ViWnZkdGVJYjoo3XrwDU35cLrWqDzXyiRReXPX5l+7hM5z CmSq7dLefSqNVP+dum9uVj0KRTfw8zpIIwX1Ex4uJC0n7IOFsiMAMDPd0UequI6mdQRC /NtMGUgTT/4R2SgKWDL1xohsqgWLqPugS/V7hi4TCOwedDPyGrakAdZJE1q1qxG/8GNQ X3X+QR7i/Qbe0u3gMHqxfXJoATOuu/FGnVxdPe0FTjXNGu2kgKB0CtzHXf1jPf2kkfQ/ pzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mCZxNJ8x; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt5-20020a170907728500b0084514612c2esi17097112ejc.614.2022.12.30.07.20.35; Fri, 30 Dec 2022 07:21:00 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=mCZxNJ8x; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbiL3PUS (ORCPT + 99 others); Fri, 30 Dec 2022 10:20:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbiL3PUQ (ORCPT ); Fri, 30 Dec 2022 10:20:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1665F140A8; Fri, 30 Dec 2022 07:20:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BBEF8B81A94; Fri, 30 Dec 2022 15:20:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28DB5C433D2; Fri, 30 Dec 2022 15:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672413613; bh=mEIlsiCgiRPca7MIEp0cdGq/tH1/+rGW8cuwJMfMUf0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mCZxNJ8xqKIPIJ+QzzzJsJR394Fy8eD+SyWyhwuthJnpMbOqI03lzjQlKaZrPnhtS Ex1DArvhBsu807BjZBxNYrsfhTEwNm6gPc+An3kcRaLoEkMB6M19c4DMQj+b8KtvoC AAs1inzY1AJFjgVryP/yF34N+gMVaJfGmsqP5raUF0AICJPo8GNlmJr72nTldohUta 0sYmdo5g0HompG0016vu/uyg1CDUgQFGjKM7tgoYjIlbtY4C//M+9klpIcSf8bHC0f rZpiXp1bcEAcktV+pJeryrhe6rOAEcE9v748PNKLwKhLMS6tukBOdDyABD1ieJFwnO /fvcjwbaC5ogQ== Date: Fri, 30 Dec 2022 17:19:49 +0200 From: Mike Rapoport To: Borislav Petkov Cc: Michael Roth , Ashish Kalra , 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, thomas.lendacky@amd.com, 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, 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 07/49] x86/sev: Invalid pages from direct map when adding it to RMP table Message-ID: References: <243778c282cd55a554af9c11d2ecd3ff9ea6820f.1655761627.git.ashish.kalra@amd.com> <20221219150026.bltiyk72pmdc2ic3@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Mon, Dec 19, 2022 at 09:08:31PM +0100, Borislav Petkov wrote: > On Mon, Dec 19, 2022 at 09:00:26AM -0600, Michael Roth wrote: > > We implemented this approach for v7, but it causes a fairly significant > > performance regression, particularly for the case for npages > 1 which > > this change was meant to optimize. > > > > I still need to dig in a big but I'm guessing it's related to flushing > > behavior. > > Well, AFAICT, change_page_attr_set_clr() flushes once at the end. > > Don't you need to flush when you modify the direct map? > > > It would however be nice to have a set_direct_map_default_noflush() > > variant that accepted a 'npages' argument, since it would be more > > performant here and also would potentially allow for restoring the 2M > > direct mapping in some cases. Will look into this more for v8. > > set_pages_direct_map_default_noflush() > > I guess. > > Although the name is a mouthful so I wouldn't mind having those > shortened. I had a patch that just adds numpages parameter: https://lore.kernel.org/lkml/20201123095432.5860-4-rppt@kernel.org/ The set_direct_map*() are not too widely used, so it's not a big deal to update all callers. > In any case, as long as that helper is properly defined and documented, > I don't mind. > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette > -- Sincerely yours, Mike.