Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1099566rwd; Tue, 16 May 2023 11:47:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jV8+g4re9Ogy/5BD1rVIw6Udk5jYo0i2GeegG6lHhgG2NzEV8YgRmNqAS0/zU5xJ59fVx X-Received: by 2002:a17:903:185:b0:1aa:db0f:1aba with SMTP id z5-20020a170903018500b001aadb0f1abamr46548094plg.47.1684262847920; Tue, 16 May 2023 11:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684262847; cv=none; d=google.com; s=arc-20160816; b=gw8XgI3M+f8o0fZHFdMB2+bYrm9Vm2f7P9biTBWfUHs/5Kr/WyIG0EThtaxm4i+h0i F+bliJ9vaqGcSotM5N1vUq50KWS9kA/02ZhufQzntftQWs6adN/2Ldk2uiEquMj7lpNf bwfLxJH5EVGf49K/+i2p647J1AhfCOUDfnfAczsg/dz/MHuW4LjxV0WrfqSepk7gVmP4 2oDigRVNaneCFifDaqXcwa6vyz0LIt3Q29DPeanYXuXIPSuAAtEUh21YsMZa8+5CcbCc K3brsNcd8NUKz43hO9weriBwm7QfjMqRNk3g20VboQX7yTuybU0S/G5cJE8EbzHh6lfu z2XA== 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=h1IC5Du4s+rB6lI+ZptTZERfabS0oTlbNW5MVGmb3FA=; b=KR4TRWhvQiyZ4/Mi8e+Hwf393ZqRmNLXaheIlipFMD+fV3rakUtNfqDj0dbjje0YOj 9Y8icKjAE35ikgpXz1woTMhS1MJJSjc76G6ZNgtBnmgjptjOd6mLfv0fEzf6zm/SBXCR 0mruiW5xJRR7re+u4SCzSgfs4y+0M5HCHT0peWsqsQM9S7jTyvgcnR18mAlpkeZrboDr DPg6FQxY1t482bdPyeGTepk4RruYjLpmdbo7lK6bQH31PDLRjaXjCxRjlZzAhm+Q6N7l kMJfCe0+o+64YFpEKeaggbf0oU2dLutefzkolI2oOakI7LelpIippEGrfAs1EMLTejld p/9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Eq3EzPCU; 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 m9-20020a170902db0900b001ac68acb1e8si20696913plx.518.2023.05.16.11.47.13; Tue, 16 May 2023 11:47:27 -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=Eq3EzPCU; 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 S230005AbjEPS1d (ORCPT + 99 others); Tue, 16 May 2023 14:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjEPS1b (ORCPT ); Tue, 16 May 2023 14:27:31 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D08C49E; Tue, 16 May 2023 11:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684261650; x=1715797650; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=h1IC5Du4s+rB6lI+ZptTZERfabS0oTlbNW5MVGmb3FA=; b=Eq3EzPCUE/j5/hyIH+5inO79UjRCxodnSfG2mqrrJ7odbyg4hTUkNxcv H1OzcJQ03K2muavEDZ6s9B5+vAZC1H8Bq2oXBnGLUrICJmX85J1bqAz4i G/9Aa/VGsArQKcBkJkhd8ZzBpnORT2vzjAj+zvMw3VNvutRq+qs0M0OHq Rs6DtBWAUzJOtRaueViEcrA5IamvYuD1DEQZ2erF+wIgMy1jkowSR68+C Dqo0sR+N2uVf8pKtrDH+YPelVXC+ws3SuImaF4RE1KHB6g+PAW2kYaPtz R5FLSGGnSpXEFOFlldYYEOwS01r3X+8qQIuXlNmx4SUVbSfukmzEuCeXx g==; X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="351587627" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="351587627" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 11:27:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="771162721" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="771162721" Received: from mtpanu-mobl1.amr.corp.intel.com (HELO [10.212.203.6]) ([10.212.203.6]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 11:27:16 -0700 Message-ID: <6fe42f66-819c-f2c8-176b-759c1c5a9cf5@intel.com> Date: Tue, 16 May 2023 11:27:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCHv11 6/9] efi/unaccepted: Avoid load_unaligned_zeropad() stepping into unaccepted memory Content-Language: en-US To: Ard Biesheuvel , "Kirill A. Shutemov" Cc: Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Mel Gorman , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Dave Hansen References: <20230513220418.19357-1-kirill.shutemov@linux.intel.com> <20230513220418.19357-7-kirill.shutemov@linux.intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 5/16/23 11:08, Ard Biesheuvel wrote: >> But, this approach does not work for unaccepted memory. For TDX, a load >> from unaccepted memory will not lead to a recoverable exception within >> the guest. The guest will exit to the VMM where the only recourse is to >> terminate the guest. >> > Does this mean that the kernel maps memory before accepting it? As > otherwise, I would assume that such an access would page fault inside > the guest before triggering an exception related to the unaccepted > state. Yes, the kernel maps memory before accepting it (modulo things like DEBUG_PAGEALLOC).