All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sathyanarayanan Kuppuswamy  <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Dave Hansen <dave.hansen@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, Shuah Khan <shuah@kernel.org>
Cc: "H . Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Tony Luck <tony.luck@intel.com>, Andi Kleen <ak@linux.intel.com>,
	Kai Huang <kai.huang@intel.com>,
	Wander Lairson Costa <wander@redhat.com>,
	Isaku Yamahata <isaku.yamahata@gmail.com>,
	marcelo.cerri@canonical.com, tim.gardner@canonical.com,
	khalid.elmously@canonical.com, philip.cox@canonical.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH v11 1/3] x86/tdx: Add TDX Guest attestation interface driver
Date: Sun, 28 Aug 2022 17:19:33 -0700	[thread overview]
Message-ID: <c6ccbcac-c5b1-f460-01e2-e1b6684b6e65@linux.intel.com> (raw)
In-Reply-To: <dcf53e6b-d60f-5d6b-029a-38df68d66302@intel.com>

Hi,

On 8/28/22 1:14 PM, Dave Hansen wrote:
> On 8/26/22 08:06, Kuppuswamy Sathyanarayanan wrote:
>> +struct tdx_report_req {
>> +	__u8  subtype;
>> +	__u64 reportdata;
>> +	__u32 rpd_len;
>> +	__u64 tdreport;
>> +	__u32 tdr_len;
>> +};
> 
> Please do take a look at how the compiler ends up building that structure.
> 
> If you sized things to "save space", the way the compiler treats that
> structure may surprise you.  You might also want to look at how a 32-bit
> compile deals with it versus a 64-bit one.

Since it is only used in user/kernel ABI, I did not consider the size
issue. But I understand your point. The size of this struct in a 64-bit
system is 40 bytes. So we did not gain anything with using different member
sizes. In a 32-bit system, size due to padding is less compared to 64-bit.

I will re-arrange the struct as below. With this change, the size will come
down to 32 bytes.

struct tdx_report_req {
        __u64 reportdata;;
        __u64 tdreport;
        __u32 rpd_len
        __u32 tdr_len;
        __u8 subtype;
};



-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

  reply	other threads:[~2022-08-29  0:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 15:06 [PATCH v11 1/3] x86/tdx: Add TDX Guest attestation interface driver Kuppuswamy Sathyanarayanan
2022-08-26 15:06 ` [PATCH v11 2/3] selftests: tdx: Test TDX attestation GetReport support Kuppuswamy Sathyanarayanan
2022-08-26 15:06 ` [PATCH v11 3/3] Documentation/x86: Document TDX attestation process Kuppuswamy Sathyanarayanan
2022-08-29  2:50   ` Bagas Sanjaya
2022-08-29  3:05     ` Sathyanarayanan Kuppuswamy
2022-08-27  7:33 ` [PATCH v11 1/3] x86/tdx: Add TDX Guest attestation interface driver Greg Kroah-Hartman
2022-08-28  1:38   ` Sathyanarayanan Kuppuswamy
2022-08-27  7:45 ` Bagas Sanjaya
2022-08-28  1:52   ` Sathyanarayanan Kuppuswamy
2022-08-28 20:14 ` Dave Hansen
2022-08-29  0:19   ` Sathyanarayanan Kuppuswamy [this message]
2022-08-29  5:30     ` Greg Kroah-Hartman
2022-08-29 20:09       ` Sathyanarayanan Kuppuswamy
2022-08-29 20:28         ` Dave Hansen
2022-08-29 20:34           ` Sathyanarayanan Kuppuswamy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6ccbcac-c5b1-f460-01e2-e1b6684b6e65@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=isaku.yamahata@gmail.com \
    --cc=kai.huang@intel.com \
    --cc=khalid.elmously@canonical.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=marcelo.cerri@canonical.com \
    --cc=mingo@redhat.com \
    --cc=philip.cox@canonical.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tim.gardner@canonical.com \
    --cc=tony.luck@intel.com \
    --cc=wander@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.