Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1398788iog; Tue, 14 Jun 2022 05:28:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7gBSslC7uONdSL5ZihGexEb6VXO8jrBXfZAhUi2vAU3WvlTbyQZgF0hH/6zpCStnCvWzp X-Received: by 2002:a50:d097:0:b0:42d:d158:4e61 with SMTP id v23-20020a50d097000000b0042dd1584e61mr5916160edd.42.1655209709697; Tue, 14 Jun 2022 05:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655209709; cv=none; d=google.com; s=arc-20160816; b=KN3RglDN5SfzFWpJKti3K3ucGSCfuMzFqh4YkyoKzWb7pIa2iM9YwpnrfnZAnGr4Ar kti43Y+SInaisR5FIpUo4i67aqBROuWeoXRQMI7/vqcf8fzehzsAzrb296FcNGwZFavU GRYBqYGYGzRGeCtnPN6MbU09Z7yZ5TaZaCUR1NefrMETp+NBClrywjfx4Em4Bn4oE9Fx Kn6XMj5Juk4mSZ0839+LbanJPbiz9b2+94eQLxpX1OD59AeYHNEfsSuj7fQrprqsoLGz 2zfA+zQOtgVWPtJ0cZzYoXm4i+v6BY5RvzkkLBoBBPY3t1Z072xhd0CVJ//5xtu5WeIA hs9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HzNACa9diUapfqaciGPFEEpHTUvDoHQymSTQ5U7SDY0=; b=vdIbY1921ZGbMSCUwheTBD8jtLSd3xQprBO4DTq4vmpsxi40Q/U53NVGfXglKUnSbX KEnPv2zA8uVVURgbWUQrGPsf7Y+IGrTE3lGvz4/ZYkCJIpkedIVXs3y0nodPD4wreBle zH57/XBpPwxOWX0tsmv08ZdCwIeR9MuI4zcfODqJELQT8MEquTq44iI8WpD+ncfEuvlh ShQKSrdaJukblqHjt8lIU4CBptMyckyrBb0Vked/LqgYymykFlGrPtQ1ZtMYha4WsDtf oe3UVntnzcWn99a0ETEIwfYFZTY25VKa1KJYU9JK1/3/fKM1F20Sjchtg0epSTMTLLas VKWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UCxVWJPe; 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 4-20020a170906310400b006ff2b8755a6si9330062ejx.393.2022.06.14.05.28.00; Tue, 14 Jun 2022 05:28:29 -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=UCxVWJPe; 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 S1355599AbiFNMBk (ORCPT + 99 others); Tue, 14 Jun 2022 08:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243641AbiFNMBi (ORCPT ); Tue, 14 Jun 2022 08:01:38 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 083F34755C for ; Tue, 14 Jun 2022 05:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655208097; x=1686744097; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sQ+7xgbA7GrBKRkaQXzkDulkXu4yc8Go4H019plaIso=; b=UCxVWJPehtmN9If7n4GJDfCUP4iga4fog/5aswqPygxv68F9DtcQKPak 0pFS9btRhWEkdW8dsxSttjXKV/HlQKQuRN34NTEu8zm9QsE0VXGI/KUHk Uup/ZKMZvN2oUvlxEtOE4gsgQhxbGnUuYNQ/x6m2HNRBw7TC2YLL+Pl8u DhKqi63/iuwNU6HTboHOjP7LeeexjAJBUzLMRQpy2qzCQfFXSpdbe0ltF bCvIp/KL4GGauJ1UEy1WoalCOrwENRg9DB500m5T408NX1MiCJ0JFEjll Vgk/hesfHJaP0q/qUXcAe23Uk6U31fxidMbOeC731iUi/6HxtD7Qa/hbm A==; X-IronPort-AV: E=McAfee;i="6400,9594,10377"; a="304007391" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="304007391" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 05:01:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="588429520" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 14 Jun 2022 05:01:32 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id D3A09346; Tue, 14 Jun 2022 15:01:36 +0300 (EEST) From: "Kirill A. Shutemov" To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@intel.com, 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, "Kirill A. Shutemov" Subject: [PATCHv4 0/3] An updated version of the load_unaligned_zeropad() fix Date: Tue, 14 Jun 2022 15:01:32 +0300 Message-Id: <20220614120135.14812-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 An updated version of the load_unaligned_zeropad() fix. v4: - Allow unaligned MMIO access, but fail split page accesses; - Explicit switch() in ve_instr_len() helper; - Update comments; v3: - Rework load_unaligned_zeropad() fix: fail misaligned MMIO accesses instead of upfront exception fixups; - Add ve_instr_len() helper to wrap access to ve->instr_len; - Add Reviewed-by from Sathya; v2: - Clarify RIP adjustments during #VE handling; - Fix early #VE handling; - Fix comment and commit message; Kirill A. Shutemov (3): x86/tdx: Fix early #VE handling x86/tdx: Clarify RIP adjustments in #VE handler x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page arch/x86/coco/tdx/tdx.c | 187 +++++++++++++++++++++++++++++----------- 1 file changed, 136 insertions(+), 51 deletions(-) -- 2.35.1