Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp64456lqp; Fri, 12 Apr 2024 10:31:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3iQgxp7yCNRyaMtuTnS4T0djpVgP5HO35N4QeO+KjF9+dbnoKt3BVJsIgSYt0pk1VaoodFuNxJPRO+IAvg1H8767UVTO4AzGEbYodkg== X-Google-Smtp-Source: AGHT+IE8d/ptTsCSWhrogaqebBGTZPS+OCKWxzJEQZlYNWf3XR20zPwdvdT/Hjq9WZzuzVJRiCb3 X-Received: by 2002:a54:4405:0:b0:3c6:d4d:5810 with SMTP id k5-20020a544405000000b003c60d4d5810mr3326718oiw.49.1712943110339; Fri, 12 Apr 2024 10:31:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712943110; cv=pass; d=google.com; s=arc-20160816; b=WuFYCKRUpbHV85j9y27F9r6vsml4SyKYR7rr9lfjdiEA7a9KuVERWq095RUJ4XtH1D ObLkaeV+UbOujJQZfpPjPgLEFdkBm49VNknK2lnfsUUJXx/yhjmSeDKjXjTLCHk4Szsd +7Wl9p7Dp0lhQzTv33afd+Xb0elynbJYjjxNXslMD3io6QRdljhh56yMLbfV6EcEOUE6 aQ1ZuSJib6AF04bp+a50IqIU10QRFDnBj0vhqm74OJQHI7SmZDs6BUopnWhZt+n3tjVV PR+uEJjKubuhyA1NyJsE9BprimnnzZn3Y73AImhiCWelPJRrO3YfHVj6US65Fs6GXsyM D7tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=UqhHzZFYUp+DqgfZWIdIcTWKVPBXmdVYsGeGc02Y2WU=; fh=EQFru0J+871aV1EPCExMJWBVF7ZlGqccLIRThS+9d/8=; b=jwyGYMTNUAYMDsQddT6r70AtBTknXvtldVYY0dtWA5RJP9WFmBY4nAarCyToZMWAp9 UFLoTpbsI9GwE2IoYJLcogFzvDb4zf4rxzgf54F4RRQZREv1ptzDUCO8aoKIGL+rb7hz U4AQaEc/B3b+lqO7Xa0mqZ2fYnWxhY1WAwhWJinZ/uvNBbylkrj2+9MOuPTjBJ2b0GJV WcIGROg2cjeO4EX/sCrcFJ1Gw0be77OsqR5jCKlzdU4dQd7VjopqxUDGjGGNWpj760uR hvrZb551iAuFfQTC39iygFH/iqR4I9+pfkqcv/NVvoSltmk9Qx9d8O25Ojti8wyVWATe WvbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eKKRrOyb; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-143128-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 7-20020ac85907000000b004346100ebe8si4249380qty.538.2024.04.12.10.31.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 10:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143128-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eKKRrOyb; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-143128-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4AE921C20D93 for ; Fri, 12 Apr 2024 17:31:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E11D814F13B; Fri, 12 Apr 2024 17:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eKKRrOyb" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85C0914EC76; Fri, 12 Apr 2024 17:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712943049; cv=none; b=PdHVKee6f6KbyeUC72ZbCdLEsaUxPI5tbso3mwunMs8Vf+5OnaD5kzs8qJGM6f2Jn7N+7JiqMPXOIfxAXFFUzJq87yTebyKFN1heZN4ALO+cvox9PZdrgTU1SFcr21eAwTA7Mpi3Ea4a/YTSd8DUbQsiZN2jOaJjxE4yITGtYqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712943049; c=relaxed/simple; bh=0q/n4BB5A4qfKK7WTII1e9HuGi84JwM3B21N0UMYoMo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tiIZ9BVbcMitdQJZDQB+dGCGCnRVTR9k6PKuKjuvQO9iF1CpNFb8/0ijiPvGoq0gyZzSJcaLBVKln0QggzUVC+H+dQGicUtRlnQsQRTWzgYvMKWh4Zg3+AnHClk04Io+g/BdoghOJr8SZnf7dEmhf66rmmbK+3RtfONpKv3SP/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eKKRrOyb; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712943048; x=1744479048; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0q/n4BB5A4qfKK7WTII1e9HuGi84JwM3B21N0UMYoMo=; b=eKKRrOybPFyQitMwSC8LilydS1LD+NAA3RKncuHdtoUbcsaiPtuRC4zx UtVK5fELIYAdXX2liXAv1Yb1hJQBy5EwA1ETWlg9OHNbfiJFioYF5wcme jKCUD0TF6LuhmWSD1Gj94/6vm0NSSDZUyBQrr6oW9zFtyGpJO+3txNEug qzNggYevA4X6MvYHwf2R6E2VdU5D47DNSvYoZMfc1qn8zGTDjxi7TBmKc mprn6qs1vy/88KZj0gba0+Pmj116N61pm28yGzk5G1+NTjyWDxdx7Pzaa nC+S8ErSGhF/SdFSaYYch/KvlBsX+gqLzrrvHcM805nAw4pnh37DzfH4v A==; X-CSE-ConnectionGUID: dsqflwa8Q7K5Iwdn+80Wbw== X-CSE-MsgGUID: SE20U8scR1G2W+0jQ3LQrQ== X-IronPort-AV: E=McAfee;i="6600,9927,11042"; a="11365694" X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="11365694" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 10:30:43 -0700 X-CSE-ConnectionGUID: zPCuEzLMT5miAOxrOYdj0Q== X-CSE-MsgGUID: OFOLKwADSD+tETiNBK/HVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="21780778" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 10:30:43 -0700 From: Jithu Joseph To: ilpo.jarvinen@linux.intel.com, hdegoede@redhat.com, markgross@kernel.org Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, rostedt@goodmis.org, sathyanarayanan.kuppuswamy@intel.com, ravi.v.shankar@intel.com, patches@lists.linux.dev Subject: [PATCH 3/3] platform/x86/intel/ifs: Disable irq during one load stage Date: Fri, 12 Apr 2024 10:23:49 -0700 Message-Id: <20240412172349.544064-4-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240412172349.544064-1-jithu.joseph@intel.com> References: <20240412172349.544064-1-jithu.joseph@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit One of the stages in IFS image loading process involves loading individual chunks (test patterns) from test image file to secure memory. Driver issues a WRMSR(MSR_AUTHENTICATE_AND_COPY_CHUNK) operation to do this. This operation can take up to 5 msec, and if an interrupt occurs in between, the AUTH_AND_COPY_CHUNK u-code implementation aborts the operation. Interrupt sources such as NMI or SMI are handled by retrying. Regular interrupts may occur frequently enough to prevent this operation from ever completing. Disable irq on local cpu around the aforementioned WRMSR to allow the operation to complete. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ashok Raj --- drivers/platform/x86/intel/ifs/load.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index 584c44387e10..39f19cb51749 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -233,7 +233,9 @@ static int copy_hashes_authenticate_chunks_gen2(struct device *dev) chunk_table[0] = starting_chunk_nr + i; chunk_table[1] = linear_addr; do { + local_irq_disable(); wrmsrl(MSR_AUTHENTICATE_AND_COPY_CHUNK, (u64)chunk_table); + local_irq_enable(); rdmsrl(MSR_CHUNKS_AUTHENTICATION_STATUS, chunk_status.data); err_code = chunk_status.error_code; } while (err_code == AUTH_INTERRUPTED_ERROR && --retry_count); -- 2.25.1