Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2393123ioo; Sat, 28 May 2022 12:13:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLxVNu9ftV1pXh46EZPYjAWIVsKJikpTtek0CPG345JOhPle3qPQZeJolahdpyvbyWV/C9 X-Received: by 2002:a17:90b:3ecd:b0:1dc:945e:41b1 with SMTP id rm13-20020a17090b3ecd00b001dc945e41b1mr14663149pjb.208.1653765198294; Sat, 28 May 2022 12:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653765198; cv=none; d=google.com; s=arc-20160816; b=sZYNsFfUlWJCkVbSt3IFMyr6X/wND57vabRAB+NFyaQ8JS+dC2K036jeFbZsLXPvVk I+QnKjuE5MwWp75ZIueRx2t3dw/SeFsXAZKHmbHm/NSyF/mItababObNS1KX4PII2x6d lz5z5JrKyxpU/bGd9/MU4nqkdBHWmHI9fWlA4/CO5t8S1fe8iB+YGrQ+U3KYd595/YmQ wLSpPVaeRMq5XCmu16CcqC7IqOFRhev6uAO13mdAbKHQWyo8GXlg+QrIEG7f1vaab6qc qhSvNFwJ1YPlj4GKLRtiUlVvk5Gx9kXgXUdeTO7MYNf7b8nlRxijMCTOQ1jsVRwXIPs4 x/wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/39Ay2W3dZvz5CSrhcM5tGznKevFDXYRyPK/KBEQ0NU=; b=Ywdi6XrDMH6/CFVrhfe/p+LzT+c/rwYQFou7h/Xf57gW0X0NJimYyV5uhfvRnumu39 vJHjljvMbjVXHt+tcT1y6la9hCmuvgkFqtd0UaJex0EA3AyGu0wiM1pJSKW9VsW2VE4p rJGjWc6dfEuoujE3IveSwmQsYAENOeXoQLGvTrjZiZL9jCdeCibxrT1OKMcvVVVDx6sk P0bcZfqTqp1qKsHvLaQ/Kgq+kTSxTZwjDIZ29r8jtJLoosZl/spl8CpQpBDQ9SVgbjJh to6Hrl798k0PLnITp9H12F2T/ew7B1CAXVKHUP7uBeFQDjA4AF9dEkocf9bgELgUD8Ka rUUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IrG6JN2/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id nb14-20020a17090b35ce00b001e299f85017si3674231pjb.63.2022.05.28.12.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:13:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IrG6JN2/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 185962EA12; Sat, 28 May 2022 11:49:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243825AbiEZQVH (ORCPT + 99 others); Thu, 26 May 2022 12:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiEZQVF (ORCPT ); Thu, 26 May 2022 12:21:05 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8127FB48B for ; Thu, 26 May 2022 09:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653582064; x=1685118064; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=nHe73Yb0QyfWDajqZj2XgEOhY5Zepq7qVF2OmswxRk0=; b=IrG6JN2/IffynQ8rDDwSY0X249kSA/D8oxuZ5HtlUIYQYfALZ9jKh7pH OwP6qOgarHsOL1FL9i0I/yEEAoHdLapNbXfXsF3HTMtlvBv/psgg0ioEQ Fk1JhsveGuKmWtY+xsN2BRk7CUqXl73+qe2djyoh1WhkUv+BxKn7u0WMR +z0juXf0j/qDjYscwPN/Aod+ihiDzYMgUH4wusP0F78wLnYwAuYF4hd2y ASspt+IOTcZ8jFJsb45kMZyrqCc/PrvdBP0mpmMcK8J6MmbylbVD0MXCB 4sbzZupHmH2ZgBAnmppR/Cco8A4JKqPnbgenScPOBbkbTHkHVDa607t8q Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10359"; a="256273001" X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="256273001" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 09:20:58 -0700 X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208";a="642953575" Received: from tjeziers-mobl1.amr.corp.intel.com (HELO [10.251.23.34]) ([10.251.23.34]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 09:20:57 -0700 Message-ID: <6350b927-4b3f-6f43-aa62-f8db19fa8d5b@intel.com> Date: Thu, 26 May 2022 09:20:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCHv3 3/3] x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page Content-Language: en-US To: "Kirill A. Shutemov" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, luto@kernel.org, peterz@infradead.org Cc: 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 References: <20220524221012.62332-1-kirill.shutemov@linux.intel.com> <20220524221012.62332-4-kirill.shutemov@linux.intel.com> From: Dave Hansen In-Reply-To: <20220524221012.62332-4-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 5/24/22 15:10, Kirill A. Shutemov wrote: > + /* > + * MMIO accesses suppose to be naturally aligned and therefore never > + * cross a page boundary. Seeing unaligned accesses indicates a bug or > + * load_unaligned_zeropad() that steps into unmapped shared page. Wait a sec though... We've been talking all along about how MMIO accesses are in some cases just plain old compiler-generated memory accesses. It's *probably* bad code that does this, but it's not necessarily a bug. It's kinda like the split lock detection patches. Those definitely found some stupid stuff, but it wasn't anything that I would have called an outright bug. Plus, in those cases, folks had explicitly opted in to more crashes on stupid stuff. That stupid stuff _might_ be rare enough that it's still OK to just punt on it and not emulate the instruction (aka. crash). Or, to say that TDX guests are opting in to being more fragile, just like with split lock detection. But, either of those would call for a very different comment.