Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBCA6C54E71 for ; Wed, 21 May 2025 15:05:59 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.992036.1375817 (Exim 4.92) (envelope-from ) id 1uHl0p-00074q-EJ; Wed, 21 May 2025 15:05:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 992036.1375817; Wed, 21 May 2025 15:05:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uHl0p-00074j-Ap; Wed, 21 May 2025 15:05:43 +0000 Received: by outflank-mailman (input) for mailman id 992036; Wed, 21 May 2025 15:05:41 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uHl0n-00074d-TC for xen-devel@lists.xenproject.org; Wed, 21 May 2025 15:05:41 +0000 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [2a00:1450:4864:20::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0fa91340-3655-11f0-a2fa-13f23c93f187; Wed, 21 May 2025 17:05:41 +0200 (CEST) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-ad1d1f57a01so1214204366b.2 for ; Wed, 21 May 2025 08:05:41 -0700 (PDT) Received: from [10.1.248.227] ([80.188.125.198]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d06dcafsm932478666b.54.2025.05.21.08.05.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 May 2025 08:05:39 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0fa91340-3655-11f0-a2fa-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1747839940; x=1748444740; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5wuPi4LjeIrSrlnLi0ue8bh6SPLZgSeygRov7Xu7hTM=; b=gVsmqXnHH75gOfkmBTIfWcz5l64kMAz2gXcjlpAOsylsRH2oSEAMsNr4JNTa7r5VoY kAY1NfxPR/9HkZl+oD2WsydfY4UMu0zSK4FFY7q/Qd8VuPiZ4FI55JDkPWbtHmeONbIx oPZ3sMy+5FVQfjTCvWm0gDee7Sx1c43jSSx5Ey5gRAnyq239mk6R8AzI/HdmFXfJoZBt aTlUvtYzYWypnTufPNMnIjL930qj//0HSiAHx5qCeztLov8pmAg3KICLKaEcSuTj030F 8PCtRNR09A0rdr+87yGp+UaRIeJbr4HaxB8HffQJ1DG63wItH0oZWOk+jetwb7I37bUs kBPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747839940; x=1748444740; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5wuPi4LjeIrSrlnLi0ue8bh6SPLZgSeygRov7Xu7hTM=; b=JbVnqm8wDcoldhDHK2ueqfoQPnpiAIRrks9cov4bWzeQEYPw3yfKxtcYP3z5iDQ/BM vpO0HLolJXxHWhJ3LfB9ZCsSnnWaCfr800vcCbdSSQdOzETyzJDwy/60Q5yol3qgv4s2 MELmlni8bUumefp4UPwEU5YY/DIP3CjpDqu0o6cqGG/CGTQix4JfAGcjm5RPW86+Yy70 Vis0ZqBZkeni4YwZuP4eVoGT8JismI7RBQfLbB42EDBqigc+w2SU8XM0566greCZKZ1L zFtYVzwxfwu7LcdGlb71q32bp82pYMO7ZLRXoF3QP1jgK2eA62aMjfLV+ehqy221KSZM OgiQ== X-Forwarded-Encrypted: i=1; AJvYcCVmZbWYWQs1nTt2x3ooSjDHPtAflrHUik6kyVXaMZyWiIOcsayESAulxrMKlcYXiZsuLkDAn0LmuGE=@lists.xenproject.org X-Gm-Message-State: AOJu0YzRaA8pxGDhSpD7DyGAmSJ0wQYH93K1Br7wAHajsCC/u2bHD+JC LVS4VI4EE452Gf0OZ2MX8/NtUgq639KkJbLKHw/qTac65ATMkjEoIjigIbKn1MAigw== X-Gm-Gg: ASbGnctVoog7qKCuMY9DtXj7/k+8UVJ72+3bFOSL1hCSLSQPcGX/arySdLLZcc/Mg7F jmUBDZvWadN7Zgmam1BEgE4/KBqrlPysjpunBKRLNGdlJqRMVBmTub2pdXKGCfyCkFIzyWVuDvu Ufgj0pqT6trlGexNanLF2QVynHWfW51g74K4sovZkW4oUbNMXsYKBd1G11I3feBXoG2n0H9rXUq Y0nYaB2IhCLrt+KE5bDVse7fQeprYas/H1b+6AjFcyflchUXZGTO4sSWB2ZuYcm2jorAp2L3Iju CtE6qnthfKZchao83sYnqiujwqlVuRcFJ4fHclKduuqjvpznGfVPMHgJ1xVcVw== X-Google-Smtp-Source: AGHT+IEHG2qmB2LmzH3T0Zgn0rsKH84tg2w3jalJkB8NuWD2TTIccKDZvfqK+R3Ygm+t7XDwnb/JPQ== X-Received: by 2002:a17:907:728e:b0:ad5:5198:b2ad with SMTP id a640c23a62f3a-ad55198bc52mr1558639866b.48.1747839940014; Wed, 21 May 2025 08:05:40 -0700 (PDT) Message-ID: Date: Wed, 21 May 2025 17:05:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/22] x86/include/asm/intel-txt.h: constants and accessors for TXT registers and heap To: Andrew Cooper , Sergii Dmytruk Cc: "Daniel P. Smith" , Ross Philipson , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Lukasz Hawrylko , =?UTF-8?Q?Mateusz_M=C3=B3wka?= , trenchboot-devel@googlegroups.com, xen-devel@lists.xenproject.org References: Content-Language: en-US From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 14.05.2025 16:55, Andrew Cooper wrote: > On 13/05/2025 6:05 pm, Sergii Dmytruk wrote: >> +/* >> + * Always use private space as some of registers are either read-only or not >> + * present in public space. >> + */ >> +static inline uint64_t read_txt_reg(int reg_no) > > unsigned int reg > > I'd be tempted to name it simply txt_read().  I don't think the extra > "_reg" is a helpful suffix, and it makes the APIs consistent with > txt_reset().  But I expect others may have opinions here. +1 >> +static inline void txt_reset(uint32_t error) >> +{ >> + write_txt_reg(TXTCR_ERRORCODE, error); >> + write_txt_reg(TXTCR_CMD_NO_SECRETS, 1); >> + write_txt_reg(TXTCR_CMD_UNLOCK_MEM_CONFIG, 1); >> + write_txt_reg(TXTCR_CMD_RESET, 1); >> + while (1); > > for ( ;; ) >     cpu_relax(); > > please. With (style nit) another blank between the semicolons. Jan