Re: [PATCH v3 2/5] tsm-mr: Add tsm-mr sample code
From: kernel test robot
Date: Tue Apr 08 2025 - 22:12:21 EST
Hi Cedric,
kernel test robot noticed the following build errors:
[auto build test ERROR on 0af2f6be1b4281385b618cb86ad946eded089ac8]
url: https://github.com/intel-lab-lkp/linux/commits/Cedric-Xing/tsm-mr-Add-TVM-Measurement-Register-support/20250408-032813
base: 0af2f6be1b4281385b618cb86ad946eded089ac8
patch link: https://lore.kernel.org/r/20250407-tdx-rtmr-v3-2-54f17bc65228%40intel.com
patch subject: [PATCH v3 2/5] tsm-mr: Add tsm-mr sample code
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250409/202504090703.LtAt1UZI-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250409/202504090703.LtAt1UZI-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504090703.LtAt1UZI-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
In file included from samples/tsm-mr/tsm_mr_sample.c:8:
>> include/linux/tsm-mr.h:81:58: error: use of undeclared identifier 'nr_mrs'
81 | const struct tsm_measurement_register *mrs __counted_by(nr_mrs);
| ^
1 error generated.
vim +/nr_mrs +81 include/linux/tsm-mr.h
b6f2f446f66ff9 Cedric Xing 2025-04-07 47
b6f2f446f66ff9 Cedric Xing 2025-04-07 48 #define TSM_MR_(mr, hash) \
b6f2f446f66ff9 Cedric Xing 2025-04-07 49 .mr_name = #mr, .mr_size = hash##_DIGEST_SIZE, \
b6f2f446f66ff9 Cedric Xing 2025-04-07 50 .mr_hash = HASH_ALGO_##hash, .mr_flags = TSM_MR_F_READABLE
b6f2f446f66ff9 Cedric Xing 2025-04-07 51
b6f2f446f66ff9 Cedric Xing 2025-04-07 52 /**
b6f2f446f66ff9 Cedric Xing 2025-04-07 53 * struct tsm_measurements - Defines the CC-specific measurement facility and
b6f2f446f66ff9 Cedric Xing 2025-04-07 54 * methods for updating measurement registers (MRs).
b6f2f446f66ff9 Cedric Xing 2025-04-07 55 * @name: Optional parent directory name.
b6f2f446f66ff9 Cedric Xing 2025-04-07 56 * @mrs: Array of MR definitions.
b6f2f446f66ff9 Cedric Xing 2025-04-07 57 * @nr_mrs: Number of elements in @mrs.
b6f2f446f66ff9 Cedric Xing 2025-04-07 58 * @refresh: Callback function to load/sync all MRs from TVM hardware/firmware
b6f2f446f66ff9 Cedric Xing 2025-04-07 59 * into the kernel cache.
b6f2f446f66ff9 Cedric Xing 2025-04-07 60 * @write: Callback function to write to the MR specified by the parameter @mr.
b6f2f446f66ff9 Cedric Xing 2025-04-07 61 *
b6f2f446f66ff9 Cedric Xing 2025-04-07 62 * @refresh takes two parameters:
b6f2f446f66ff9 Cedric Xing 2025-04-07 63 *
b6f2f446f66ff9 Cedric Xing 2025-04-07 64 * * @tm - points back to this structure.
b6f2f446f66ff9 Cedric Xing 2025-04-07 65 * * @mr - points to the MR (an element of @mrs) being read (hence triggered
b6f2f446f66ff9 Cedric Xing 2025-04-07 66 * this callback).
b6f2f446f66ff9 Cedric Xing 2025-04-07 67 *
b6f2f446f66ff9 Cedric Xing 2025-04-07 68 * Note that @refresh is invoked only when an MR with %TSM_MR_F_LIVE set is
b6f2f446f66ff9 Cedric Xing 2025-04-07 69 * being read and the cache is stale. However, @refresh must reload not only
b6f2f446f66ff9 Cedric Xing 2025-04-07 70 * the MR being read (@mr) but also all MRs with %TSM_MR_F_LIVE set.
b6f2f446f66ff9 Cedric Xing 2025-04-07 71 *
b6f2f446f66ff9 Cedric Xing 2025-04-07 72 * @write takes an additional parameter besides @tm and @mr:
b6f2f446f66ff9 Cedric Xing 2025-04-07 73 *
b6f2f446f66ff9 Cedric Xing 2025-04-07 74 * * @data - contains the bytes to write and whose size is @mr->mr_size.
b6f2f446f66ff9 Cedric Xing 2025-04-07 75 *
b6f2f446f66ff9 Cedric Xing 2025-04-07 76 * Both @refresh and @write should return 0 on success and an appropriate error
b6f2f446f66ff9 Cedric Xing 2025-04-07 77 * code on failure.
b6f2f446f66ff9 Cedric Xing 2025-04-07 78 */
b6f2f446f66ff9 Cedric Xing 2025-04-07 79 struct tsm_measurements {
b6f2f446f66ff9 Cedric Xing 2025-04-07 80 const char *name;
b6f2f446f66ff9 Cedric Xing 2025-04-07 @81 const struct tsm_measurement_register *mrs __counted_by(nr_mrs);
b6f2f446f66ff9 Cedric Xing 2025-04-07 82 size_t nr_mrs;
b6f2f446f66ff9 Cedric Xing 2025-04-07 83 int (*refresh)(const struct tsm_measurements *tm,
b6f2f446f66ff9 Cedric Xing 2025-04-07 84 const struct tsm_measurement_register *mr);
b6f2f446f66ff9 Cedric Xing 2025-04-07 85 int (*write)(const struct tsm_measurements *tm,
b6f2f446f66ff9 Cedric Xing 2025-04-07 86 const struct tsm_measurement_register *mr, const u8 *data);
b6f2f446f66ff9 Cedric Xing 2025-04-07 87 };
b6f2f446f66ff9 Cedric Xing 2025-04-07 88
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki