From patchwork Tue Aug 22 10:28:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 136530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp3568387vqi; Tue, 22 Aug 2023 04:53:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzU70fFdGwumakjXQ4PPlFfB32vPVmn0tglhFlVPOcXrjNQdGEdqejAYZRCZjMps6cXaOO X-Received: by 2002:a05:6a21:4987:b0:13f:9b98:c416 with SMTP id ax7-20020a056a21498700b0013f9b98c416mr6652364pzc.55.1692705205950; Tue, 22 Aug 2023 04:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692705205; cv=none; d=google.com; s=arc-20160816; b=rSFCCHTET1QqsgTX9H+BxRQRfiRYLJLZ7vmQfzvNAjgzmpdolTqD95+We2H1ByeeLI lVlVYNAq+hCC2bTqmxhR2mMrZcgZhCAS6Vge354bta9X1BqmR7egIeGDtSySL1xA3dsf uB+PKNFr6XnjDuYeEtIwJca7P5nwBKEL5AfS0oytiYvuv79RtUbpk3DvfQxfpyUTtFV/ syJj2tihWqvwplWrZpHmgiMLGylO6XxjqJiX03RYKN/eFScx5oOUeKmlNMobu/7oETlJ VKOn5Jd0xGkOr2QqhxtekyyzhgUHSdLO//rtG9in72Me7F38Ej/6a9i1aZza/iekuaz0 HN9A== 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=qr92OxGFOqrzzT62uN4Unre+nNh5WcDYqsLjP2A2vyw=; fh=KOHvfrtPZo8m2aMbKOMdkhiCZrHi4zcwUENYb/SDS/c=; b=bh+TSFRdjXz2PlLCnvVyc3yU7MG9KipoBBwn8p9O6ZV/hGD7zAQF89F9UMtz+TSNA2 ZtFV+FAXPGZvXSNLfqBFkeuSguu7C34j6NOrhzvXVBbVkxPpAHkTmqDt9vcgGPEiXZ+q lYBCpCRomUlDUriyh+XhoT9fr/7AvvCc5B7FtBSBqIFxnJVicwOeNC+Ox2iWzk1AT9yO ct0hK/+RUnLN+nabFet9mu3l4ZQkjsWzj0765wdj7mRuprrVcR9hNchrKXJU6aCJkQIK U8HrQjZjgemG0r4jAXV1BcL/Mz0RWjuvcaEuZZPDLj8MEmNyGA0p3uk7vqHqf871wYFD RqPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uqwRdGXr; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a637703000000b0055e48c43ab7si8433539pgc.470.2023.08.22.04.53.12; Tue, 22 Aug 2023 04:53:25 -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=@kernel.org header.s=k20201202 header.b=uqwRdGXr; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234138AbjHVK3k (ORCPT + 99 others); Tue, 22 Aug 2023 06:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232556AbjHVK3j (ORCPT ); Tue, 22 Aug 2023 06:29:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79410E51; Tue, 22 Aug 2023 03:29:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1259A65134; Tue, 22 Aug 2023 10:29:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAC36C433C7; Tue, 22 Aug 2023 10:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692700147; bh=IvGfBZV/2Fq02VPlpwX47hDqBBEMCLHL/8A28vWDXUc=; h=From:To:Cc:Subject:Date:From; b=uqwRdGXrLVVBzIrINCLqNlhho2l5dOyRLX1h/2OMPF3QFkA+7uotHE76sAa8VIjYF k+fhy01JNfiBFQ44lEw50tXOhL0YrJ4yLdtUEAxBPf3IktZr0ZlHHPODFVar1aziel 6RAyn4VX8VBpS8NgDz0+9S9X07mvyZiZrw/l0+QPZp82mbFJrWdaLBiSh+B+cp/JkM CBkVX7MpUB/q6pV1EIiqOoJNRElangAk5sKwHkFj6jNTZAFe031xrgJw+8pUewD0PN W1Jrn0Hu2smyWzlHqy4t8r4oA0hzgqG1LHyxnpWiB6AbxLlIe46kIFbrp3sPey0iv/ j66lhtnxaN+Jg== From: Jarkko Sakkinen To: linux-sgx@vger.kernel.org Cc: Jarkko Sakkinen , stable@vger.kernel.org, kernel test robot , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Jethro Beekman , Serge Ayoun , Sean Christopherson , linux-kernel@vger.kernel.org Subject: [PATCH] x86/sgx: Describe the parameters of sgx_calc_section_metric() Date: Tue, 22 Aug 2023 13:28:53 +0300 Message-Id: <20230822102853.15078-1-jarkko@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774930054347768145 X-GMAIL-MSGID: 1774930054347768145 Cc: stable@vger.kernel.org # v5.11+ Fixes: e7e0545299d8 ("x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308221542.11UpkVfp-lkp@intel.com/ Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c index 166692f2d501..388350b8f5e3 100644 --- a/arch/x86/kernel/cpu/sgx/main.c +++ b/arch/x86/kernel/cpu/sgx/main.c @@ -732,6 +732,10 @@ int arch_memory_failure(unsigned long pfn, int flags) } /** + * sgx_calc_section_metric() - Calculate an EPC section metric + * @low: low 32-bit word from CPUID:0x12:{2, ...} + * @high: high 32-bit word from CPUID:0x12:{2, ...} + * * A section metric is concatenated in a way that @low bits 12-31 define the * bits 12-31 of the metric and @high bits 0-19 define the bits 32-51 of the * metric.