<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/virt/coco/sev-guest, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-08-15T15:05:39Z</updated>
<entry>
<title>virt: sev-guest: Satisfy linear mapping requirement in get_derived_key()</title>
<updated>2025-08-15T15:05:39Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2025-07-16T20:41:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c08ba63078dd6046c279df37795cb77e784e1ec9'/>
<id>urn:sha1:c08ba63078dd6046c279df37795cb77e784e1ec9</id>
<content type='text'>
Commit

  7ffeb2fc2670 ("x86/sev: Document requirement for linear mapping of guest request buffers")

added a check that requires the guest request buffers to be in the linear
mapping. The get_derived_key() function was passing a buffer that was
allocated on the stack, resulting in the call to snp_send_guest_request()
returning an error.

Update the get_derived_key() function to use an allocated buffer instead
of a stack buffer.

Fixes: 7ffeb2fc2670 ("x86/sev: Document requirement for linear mapping of guest request buffers")
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/9b764ca9fc79199a091aac684c4926e2080ca7a8.1752698495.git.thomas.lendacky@amd.com
</content>
</entry>
<entry>
<title>virt: sev-guest: Contain snp_guest_request_ioctl in sev-guest</title>
<updated>2025-06-18T20:55:30Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
<email>aik@amd.com</email>
</author>
<published>2025-06-11T04:08:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3f83ab6f9f1db9e8f0141c0c6b974f40b4aa0dcf'/>
<id>urn:sha1:3f83ab6f9f1db9e8f0141c0c6b974f40b4aa0dcf</id>
<content type='text'>
SNP Guest Request uses only exitinfo2 which is a return value from GHCB, has
meaning beyond ioctl and therefore belongs to struct snp_guest_req.

Move exitinfo2 there and remove snp_guest_request_ioctl from the SEV platform
code.

No functional change intended.

Signed-off-by: Alexey Kardashevskiy &lt;aik@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Reviewed-by: Dionna Glaze &lt;dionnaglaze@google.com&gt;
Link: https://lore.kernel.org/20250611040842.2667262-2-aik@amd.com
</content>
</entry>
<entry>
<title>configfs-tsm: Namespace TSM report symbols</title>
<updated>2025-05-02T19:52:16Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2025-03-04T07:14:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=71ded61bee2af97a218f9dfa0f4019cc4cd3b029'/>
<id>urn:sha1:71ded61bee2af97a218f9dfa0f4019cc4cd3b029</id>
<content type='text'>
In preparation for new + common TSM (TEE Security Manager)
infrastructure, namespace the TSM report symbols in tsm.h with an
_REPORT suffix to differentiate them from other incoming tsm work.

Cc: Yilun Xu &lt;yilun.xu@intel.com&gt;
Cc: Samuel Ortiz &lt;sameo@rivosinc.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Sami Mujawar &lt;sami.mujawar@arm.com&gt;
Cc: Steven Price &lt;steven.price@arm.com&gt;
Reviewed-by: Alexey Kardashevskiy &lt;aik@amd.com&gt;
Reviewed-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Reviewed-by: Kai Huang &lt;kai.huang@intel.com&gt;
Reviewed-by: Kuppuswamy Sathyanarayanan &lt;sathyanarayanan.kuppuswamy@linux.intel.com&gt;
Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;
Link: https://patch.msgid.link/174107246021.1288555.7203769833791489618.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.14-rc7' into x86/core, to pick up fixes</title>
<updated>2025-03-19T10:03:06Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2025-03-19T10:03:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=89771319e0f11314fcf6d22fcdd0c41e2d157ddc'/>
<id>urn:sha1:89771319e0f11314fcf6d22fcdd0c41e2d157ddc</id>
<content type='text'>
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>virt: sev-guest: Move SNP Guest Request data pages handling under snp_cmd_mutex</title>
<updated>2025-03-07T13:09:33Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
<email>aik@amd.com</email>
</author>
<published>2025-03-07T01:37:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3e385c0d6ce88ac9916dcf84267bd5855d830748'/>
<id>urn:sha1:3e385c0d6ce88ac9916dcf84267bd5855d830748</id>
<content type='text'>
Compared to the SNP Guest Request, the "Extended" version adds data pages for
receiving certificates. If not enough pages provided, the HV can report to the
VM how much is needed so the VM can reallocate and repeat.

Commit

  ae596615d93d ("virt: sev-guest: Reduce the scope of SNP command mutex")

moved handling of the allocated/desired pages number out of scope of said
mutex and create a possibility for a race (multiple instances trying to
trigger Extended request in a VM) as there is just one instance of
snp_msg_desc per /dev/sev-guest and no locking other than snp_cmd_mutex.

Fix the issue by moving the data blob/size and the GHCB input struct
(snp_req_data) into snp_guest_req which is allocated on stack now and accessed
by the GHCB caller under that mutex.

Stop allocating SEV_FW_BLOB_MAX_SIZE in snp_msg_alloc() as only one of four
callers needs it. Free the received blob in get_ext_report() right after it is
copied to the userspace. Possible future users of snp_send_guest_request() are
likely to have different ideas about the buffer size anyways.

Fixes: ae596615d93d ("virt: sev-guest: Reduce the scope of SNP command mutex")
Signed-off-by: Alexey Kardashevskiy &lt;aik@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Nikunj A Dadhania &lt;nikunj@amd.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250307013700.437505-3-aik@amd.com
</content>
</entry>
<entry>
<title>virt: sev-guest: Allocate request data dynamically</title>
<updated>2025-03-07T12:34:25Z</updated>
<author>
<name>Nikunj A Dadhania</name>
<email>nikunj@amd.com</email>
</author>
<published>2025-03-06T08:17:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ac7c06acaa3738b38e83815ac0f07140ad320f13'/>
<id>urn:sha1:ac7c06acaa3738b38e83815ac0f07140ad320f13</id>
<content type='text'>
Commit

  ae596615d93d ("virt: sev-guest: Reduce the scope of SNP command mutex")

narrowed the command mutex scope to snp_send_guest_request().  However,
GET_REPORT, GET_DERIVED_KEY, and GET_EXT_REPORT share the req structure in
snp_guest_dev. Without the mutex protection, concurrent requests can overwrite
each other's data. Fix it by dynamically allocating the request structure.

Fixes: ae596615d93d ("virt: sev-guest: Reduce the scope of SNP command mutex")
Closes: https://github.com/AMDESE/AMDSEV/issues/265
Reported-by: andreas.stuehrk@yaxi.tech
Signed-off-by: Nikunj A Dadhania &lt;nikunj@amd.com&gt;
Signed-off-by: Alexey Kardashevskiy &lt;aik@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250307013700.437505-2-aik@amd.com
</content>
</entry>
<entry>
<title>x86/mm: Reduce header dependencies in &lt;asm/set_memory.h&gt;</title>
<updated>2025-02-28T16:35:22Z</updated>
<author>
<name>Kevin Brodsky</name>
<email>kevin.brodsky@arm.com</email>
</author>
<published>2024-12-12T08:09:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=95c4cc5a585400982ae5b3bf9e3be6de71768376'/>
<id>urn:sha1:95c4cc5a585400982ae5b3bf9e3be6de71768376</id>
<content type='text'>
Commit:

  03b122da74b2 ("x86/sgx: Hook arch_memory_failure() into mainline code")

... added &lt;linux/mm.h&gt; to &lt;asm/set_memory.h&gt; to provide some helpers.

However the following commit:

  b3fdf9398a16 ("x86/mce: relocate set{clear}_mce_nospec() functions")

... moved the inline definitions someplace else, and now &lt;asm/set_memory.h&gt;
just declares a bunch of mostly self-contained functions.

No need for the whole &lt;linux/mm.h&gt; inclusion to declare functions; just
remove that include. This helps avoid circular dependency headaches
(e.g. if &lt;linux/mm.h&gt; ends up including &lt;linux/set_memory.h&gt;).

This change requires a couple of include fixups not to break the
build:

* &lt;asm/smp.h&gt;: including &lt;asm/thread_info.h&gt; directly relies on
  &lt;linux/thread_info.h&gt; having already been included, because the
  former needs the BAD_STACK/NOT_STACK constants defined in the
  latter. This is no longer the case when &lt;asm/smp.h&gt; is included from
  some driver file - just include &lt;linux/thread_info.h&gt; to stay out
  of trouble.

* sev-guest.c relies on &lt;asm/set_memory.h&gt; including &lt;linux/mm.h&gt;,
  so we just need to make that include explicit.

[ mingo: Cleaned up the changelog ]

Signed-off-by: Kevin Brodsky &lt;kevin.brodsky@arm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Link: https://lore.kernel.org/r/20241212080904.2089632-3-kevin.brodsky@arm.com
</content>
</entry>
<entry>
<title>x86/sev: Relocate SNP guest messaging routines to common code</title>
<updated>2025-01-07T10:16:46Z</updated>
<author>
<name>Nikunj A Dadhania</name>
<email>nikunj@amd.com</email>
</author>
<published>2025-01-06T12:46:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1e0b23b5d2d18b2bd2c66d8214072d700a8c350d'/>
<id>urn:sha1:1e0b23b5d2d18b2bd2c66d8214072d700a8c350d</id>
<content type='text'>
At present, the SEV guest driver exclusively handles SNP guest messaging. All
routines for sending guest messages are embedded within it.

To support Secure TSC, SEV-SNP guests must communicate with the AMD Security
Processor during early boot. However, these guest messaging functions are not
accessible during early boot since they are currently part of the guest
driver.

Hence, relocate the core SNP guest messaging functions to SEV common code and
provide an API for sending SNP guest messages.

No functional change, but just an export symbol added for
snp_send_guest_request() and dropped the export symbol on
snp_issue_guest_request() and made it static.

Signed-off-by: Nikunj A Dadhania &lt;nikunj@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://lore.kernel.org/r/20250106124633.1418972-5-nikunj@amd.com
</content>
</entry>
<entry>
<title>x86/sev: Carve out and export SNP guest messaging init routines</title>
<updated>2025-01-07T09:33:20Z</updated>
<author>
<name>Nikunj A Dadhania</name>
<email>nikunj@amd.com</email>
</author>
<published>2025-01-06T12:46:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c5529418d05079384af4dbbb6f6156344c2ffce2'/>
<id>urn:sha1:c5529418d05079384af4dbbb6f6156344c2ffce2</id>
<content type='text'>
Currently, the sev-guest driver is the only user of SNP guest messaging. All
routines for initializing SNP guest messaging are implemented within the
sev-guest driver and are not available during early boot.

In preparation for adding Secure TSC guest support, carve out APIs to allocate
and initialize the guest messaging descriptor context and make it part of
coco/sev/core.c. As there is no user of sev_guest_platform_data anymore,
remove the structure.

Signed-off-by: Nikunj A Dadhania &lt;nikunj@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://lore.kernel.org/r/20250106124633.1418972-4-nikunj@amd.com
</content>
</entry>
<entry>
<title>virt: sev-guest: Replace GFP_KERNEL_ACCOUNT with GFP_KERNEL</title>
<updated>2025-01-07T09:26:20Z</updated>
<author>
<name>Nikunj A Dadhania</name>
<email>nikunj@amd.com</email>
</author>
<published>2025-01-06T12:46:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=864884a0c29cc610a859b5210158112fd8675fe1'/>
<id>urn:sha1:864884a0c29cc610a859b5210158112fd8675fe1</id>
<content type='text'>
Replace GFP_KERNEL_ACCOUNT with GFP_KERNEL in the sev-guest driver code.
GFP_KERNEL_ACCOUNT is typically used for accounting untrusted userspace
allocations. After auditing the sev-guest code, the following changes are
necessary:

  * snp_init_crypto(): Use GFP_KERNEL as this is a trusted device probe
    path.

Retain GFP_KERNEL_ACCOUNT in the following cases for robustness and
specific path requirements:

  * alloc_shared_pages(): Although all allocations are limited, retain
    GFP_KERNEL_ACCOUNT for future robustness.

  * get_report() and get_ext_report(): These functions are on the unlocked
    ioctl path and should continue using GFP_KERNEL_ACCOUNT.

Suggested-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Nikunj A Dadhania &lt;nikunj@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20250106124633.1418972-3-nikunj@amd.com
</content>
</entry>
</feed>
