Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3554839ioo; Wed, 25 May 2022 03:20:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqpVnzF44NhntFseHgc4w6h9EqFDfUYXqwj9EB5FPXRGAEYqvHWpXf4az1Og6i3SJsD9Uz X-Received: by 2002:a17:902:c2d8:b0:15e:fa17:56cc with SMTP id c24-20020a170902c2d800b0015efa1756ccmr31858862pla.40.1653474054058; Wed, 25 May 2022 03:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653474054; cv=none; d=google.com; s=arc-20160816; b=o+IltS+V2baRmXIyNG+qLMwYv7poS2SMuY3NPEU/YfRcGhTyYpX4iCzKSPgYtQ0P1E GXbWod8NLRT5EUMM7ta5kzUQfRIuw8fCKHFo278EbboJ8rFkv20MHDeqK2ILKqcMtlA2 yHedDMcxBMHBUp8724Iulfmdw89FUZofNBPA0fctLOBzjnN1OABQjMCnHDIfN3vS2+d+ xirUWESlO/6HAwEYbKc7vW1lPYyLJx+02rPDAtFmzhI9TAw7mzTInQd3aKIogiXN5qOG kBSxvovXqoh93D40qbt4rN2MQ8i69sRo0v5LaYZgz32ZtZXHmUnV3wPSVbA0mm3zatz9 S1pA== 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=ekUAa8z/N3oEqY9djJHp3Sl7WnsiI7CdD5pzvC5ZD08=; b=nZwFbMlEtFPXIUkU4ch2x1VUl0CXy0GTFAwbUhUddwdoUJKal7bXgL9oZD5Dc+bYNw rXEz5SNFbvKaEQAxXoClB/7XyHs18FB4zWwlVbKkCgOB0hzaq7ODWWN2C7ID82riPxz1 /h7djyG8YNO0Ob8H5T2twHUnGxndDAzDp9O9H5HDcWst6frwKK+sZ6m9hySguUdZN5MY r5ooaV0ZgR5+64otGhDt7+vt7dW+vi/XWYMUNaN6s0VzB0RzISnxeeS4UZC/zfbMX6u5 pdfRCne8rfBvACH5MRs9BDyJ+e4PznhC5qdXWnqmekGpCy10Cubj0PiewlZE7Erib+j+ DCHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TWjIstwP; 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 nu8-20020a17090b1b0800b001e0182829cdsi3053348pjb.155.2022.05.25.03.20.37; Wed, 25 May 2022 03:20:54 -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=TWjIstwP; 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 S242055AbiEXWK1 (ORCPT + 99 others); Tue, 24 May 2022 18:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241885AbiEXWKZ (ORCPT ); Tue, 24 May 2022 18:10:25 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E6C82140 for ; Tue, 24 May 2022 15:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653430224; x=1684966224; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=F+feAdRIPxV0YvrrVp/PT8H8XfZ+9kRwvIudCvjphlU=; b=TWjIstwPbcIKB9K6xYeJeaONim5DjD0C9oGzwAZQ/WRjHuuNzyasNQnm CDN+963BU2R/80w8RzTbVNgxZmNr597wX4d1C/wD8dVFUD2HTAUeLVVP+ uzzUNYyL9B194OdcOWFm6/svfGW9eSfAjp/FFc4bXS9tjPnrAHpyJuJLs y2wBWHlNxXEnwRGDJyFPWLHfZVwX3uqyu7odjV8yNejXun2iSTArxAdwn vq2/ydpvh0ww0Mt+CKa/H/4we8lEsqOtRt4FlQGHp0vVISYyV7ENL03qY I1fJ0cgqErTDRzm5wcP1PP6s0lxGp7vcvegxOlHEVl8Iip78D/y65iMC6 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="271236769" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="271236769" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 15:10:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="676596686" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 24 May 2022 15:10:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id EE0B8109; Wed, 25 May 2022 01:10:21 +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: [PATCHv3 0/3] Fix for load_unaligned_zeropad() in TDX guest Date: Wed, 25 May 2022 01:10:09 +0300 Message-Id: <20220524221012.62332-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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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. 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 | 154 +++++++++++++++++++++++++++------------- 1 file changed, 104 insertions(+), 50 deletions(-) -- 2.35.1