Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp938485iog; Wed, 15 Jun 2022 16:12:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tBQ7qwcQRKbTa2PP/f6YYj/75Kr5FzM+pDbISCJpxOlL9BG/o6wD6esMPEwjbBQyRa4QyY X-Received: by 2002:a17:902:f606:b0:168:ecca:44e with SMTP id n6-20020a170902f60600b00168ecca044emr1612088plg.144.1655334740275; Wed, 15 Jun 2022 16:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655334740; cv=none; d=google.com; s=arc-20160816; b=SUuo4A3NNYhlRAY1B6hZ2wA0QkI3jQARiEu6HxZPQYhkyro2dAz1RBZIEU4k0UG3ye vp0cAB9uIqaNObmKPtoMEifZtbMfo9GbBkU8w8wPSIwBJBrEyxm4yB9+bq5O1rmw32gY LwFZbiAWV0EU3WChSBlR1CtJtkMybgXRVJ18xH7ZM8HLY4fzIZO2WDwdFhfXPlAk5uzD df1IzAuBEduuLg++9rC1KtuouKEDgolK28OKvppXquSo9zbE6kvlZcQ86TeBwl5KcWmT h6ITCc1UOJQczUBMPjnwU5Z12IPE/VW2UWl+5rOgk4F/ryou5HPCud5fHliBGjPyDrp3 D55g== 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=TUXNlNzfNLWVN7b0rL0yGrotRQoaG00YqDF2FuZBGXQ=; b=wYr0ey/Dua7/yLHxfk+gxo9eTSVtP0gp/gnGgD9mnrnVXM1sL3kH1O7maHy/AKTGs6 PxJyAsNr168hy8to8QNGEBmx4DhwYqQt9UVtiMzdSE1wcyLNaFnsDs2zJP4D66GC9ErD 9O+41f8V8fwxaEOiu6ATFwmu3V3xtBbf7HsUzxvDCK/3/Wrxx0soizej1ufbgGuJipot Qr0rAGR4pRoTHrIiC6PBs52w2u6pm0Kd9RbkL4HbAHnD+RYYFW+fKTxKQmOYcQyvyaaB OTv8vFxYPOysV3CtL77CmQu2pEae15qEHc9+X9I1g0+RAl2x0nydOgfd5UQDpTGhituF aSGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dpSO5bwB; 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 c12-20020a655a8c000000b003fca31afbc1si354282pgt.564.2022.06.15.16.12.07; Wed, 15 Jun 2022 16:12:20 -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=dpSO5bwB; 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 S1347129AbiFOWnF (ORCPT + 99 others); Wed, 15 Jun 2022 18:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237675AbiFOWnE (ORCPT ); Wed, 15 Jun 2022 18:43:04 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7DC3B3E3 for ; Wed, 15 Jun 2022 15:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655332983; x=1686868983; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=GOkKIF1zj4v3HvWCe1Wl62pksKaDezBETS9z2NLNPsw=; b=dpSO5bwBCez9tzCVvujrP//3OAFBjTUB7739GI0erLcboqdmjLlnwmBD +0o4+XUjAdCtpv1WtxddWv9erwP9MI+IerP/UAhYAdFlMQ4ls4iSGDqgz Zgskd/s8BXRF13MDxenibpN1tmDfVDVkh3CuekCI2MPOhRybDjKicHcc0 AV3IScUZDcSXrCLMjsGBzeZifJTr35aWZs0KJeCt+ooq4qxdeeJeKWEyK uabsyn3UpzGm8N3g/3XGi8YHiKv0316j4XwPKJt8c0i99D4UfBHur8ex4 u7mDni0GLXgsD89BTTeb/6Udn/9Qx/HpUoS2q+kKohBPT2Vxt+T3VJBLO g==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="304554766" X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="304554766" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 15:43:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,302,1647327600"; d="scan'208";a="618667193" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 15 Jun 2022 15:42:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id BA860109; Thu, 16 Jun 2022 01:43:03 +0300 (EEST) Date: Thu, 16 Jun 2022 01:43:03 +0300 From: "Kirill A. Shutemov" To: Dave Hansen Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, luto@kernel.org, peterz@infradead.org, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, sathyanarayanan.kuppuswamy@linux.intel.com, seanjc@google.com, thomas.lendacky@amd.com, x86@kernel.org Subject: Re: [PATCHv4 3/3] x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page Message-ID: <20220615224303.el4qtowheu2rgpdn@black.fi.intel.com> References: <20220614120135.14812-1-kirill.shutemov@linux.intel.com> <20220614120135.14812-4-kirill.shutemov@linux.intel.com> <051fd468-11e6-308b-66c8-4de16ff80deb@intel.com> <20220615171042.oeumb3vs3ttu4rvd@black.fi.intel.com> <1d190555-2bb1-e483-2405-e28ddabead07@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d190555-2bb1-e483-2405-e28ddabead07@intel.com> X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 On Wed, Jun 15, 2022 at 02:55:13PM -0700, Dave Hansen wrote: > On 6/15/22 10:10, Kirill A. Shutemov wrote: > >> I thought this whole exercise was kicked off by hitting this in testing. > >> Am I remembering this wrong? > >> > >>> https://lore.kernel.org/all/20220517153444.11195-10-kirill.shutemov@linux.intel.com/ > >> Says: > >> > >>> This is an actual, real-world problem which was discovered during TDX > >>> testing. > >> Or were you considering this a different problem somehow? > > They are different. > > > > The patch by the link addresses issue of load_unaligned_zeropad() stepping > > onto unaccepted memory. This was triggered in practice. > > OK, so we've got two problems both triggered by > load_unaligned_zeropad(), but where the fixes are different. We > actually hit the "unaccepted memory one" in testing, but that made us > think about other problems in the area and that's where this one came up. I will reword it like this: The issue was discovered by analysis after triggering other issue with load_unaligned_zeropad(). Works for you? -- Kirill A. Shutemov