<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/arch/x86/coco/sev/vc-handle.c, branch docs-mw</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-mw</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-mw'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2026-01-19T14:23:48+00:00</updated>
<entry>
<title>x86/sev: Rename sev_es_ghcb_handle_msr() to __vc_handle_msr()</title>
<updated>2026-01-19T14:23:48+00:00</updated>
<author>
<name>Borislav Petkov (AMD)</name>
<email>bp@alien8.de</email>
</author>
<published>2026-01-19T13:49:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9183c97e7e22591cfd258b5131493d5afcab4b08'/>
<id>urn:sha1:9183c97e7e22591cfd258b5131493d5afcab4b08</id>
<content type='text'>
Forgot to do that during the Secure AVIC review. :-\

No functional changes.

Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://patch.msgid.link/20260119141310.29605-1-bp@kernel.org
</content>
</entry>
<entry>
<title>x86/sev: Move the internal header</title>
<updated>2025-12-31T12:05:40+00:00</updated>
<author>
<name>Borislav Petkov (AMD)</name>
<email>bp@alien8.de</email>
</author>
<published>2025-12-04T12:48:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c1e8980fabf5d0106992a430284fac28bba053a6'/>
<id>urn:sha1:c1e8980fabf5d0106992a430284fac28bba053a6</id>
<content type='text'>
Move the internal header out of the usual include/asm/ include path
because having an "internal" header there doesn't really make it
internal - quite the opposite - that's the normal arch include path.

So move where it belongs and make it really internal.

No functional changes.

Reviewed-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20251204145716.GDaTGhTEHNOtSdTkEe@fat_crate.local
</content>
</entry>
<entry>
<title>x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled()</title>
<updated>2025-11-11T15:42:31+00:00</updated>
<author>
<name>Borislav Petkov (AMD)</name>
<email>bp@alien8.de</email>
</author>
<published>2025-10-30T16:59:11+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b2c1dd6c6f70a5a519532227358c82d4cfda5b36'/>
<id>urn:sha1:b2c1dd6c6f70a5a519532227358c82d4cfda5b36</id>
<content type='text'>
Drop one redundant definition, while at it.

There should be no functional changes.

Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://patch.msgid.link/20251031122122.GKaQSpwhLvkinKKbjG@fat_crate.local
</content>
</entry>
<entry>
<title>Merge branch 'x86/apic' into x86/sev, to resolve conflict</title>
<updated>2025-09-05T07:01:42+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2025-09-05T07:01:42+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0ca77f8d33e8136b8926775380506f78a8d04811'/>
<id>urn:sha1:0ca77f8d33e8136b8926775380506f78a8d04811</id>
<content type='text'>
 Conflicts:
	arch/x86/include/asm/sev-internal.h

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/sev: Move GHCB page based HV communication out of startup code</title>
<updated>2025-09-03T15:55:25+00:00</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ardb@kernel.org</email>
</author>
<published>2025-08-28T10:22:08+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=37dbd78f98a80e89b5413f4649d0fbd023d99b2f'/>
<id>urn:sha1:37dbd78f98a80e89b5413f4649d0fbd023d99b2f</id>
<content type='text'>
Both the decompressor and the core kernel implement an early #VC handler,
which only deals with CPUID instructions, and full featured one, which can
handle any #VC exception.

The former communicates with the hypervisor using the MSR based protocol,
whereas the latter uses a shared GHCB page, which is configured a bit later
during the boot, when the kernel runs from its ordinary virtual mapping,
rather than the 1:1 mapping that the startup code uses.

Accessing this shared GHCB page from the core kernel's startup code is
problematic, because it involves converting the GHCB address provided by the
caller to a physical address. In the startup code, virtual to physical address
translations are problematic, given that the virtual address might be a 1:1
mapped address, and such translations should therefore be avoided.

This means that exposing startup code dealing with the GHCB to callers that
execute from the ordinary kernel virtual mapping should be avoided too. So
move all GHCB page based communication out of the startup code, now that all
communication occurring before the kernel virtual mapping is up relies on the
MSR protocol only.

As an exception, add a flag representing the need to apply the coherency
fix in order to avoid exporting CPUID* helpers because of the code
running too early for the *cpu_has* infrastructure.

Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/20250828102202.1849035-29-ardb+git@google.com
</content>
</entry>
<entry>
<title>x86/sev: Prevent SECURE_AVIC_CONTROL MSR interception for Secure AVIC guests</title>
<updated>2025-09-01T11:18:48+00:00</updated>
<author>
<name>Neeraj Upadhyay</name>
<email>Neeraj.Upadhyay@amd.com</email>
</author>
<published>2025-08-28T11:31:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=952aefeebb3339d8129f7ca7fdb8f4344b6543a7'/>
<id>urn:sha1:952aefeebb3339d8129f7ca7fdb8f4344b6543a7</id>
<content type='text'>
The SECURE_AVIC_CONTROL MSR holds the GPA of the guest APIC backing page and
bitfields to control enablement of Secure AVIC and whether the guest allows
NMIs to be injected by the hypervisor.

This MSR is populated by the guest and can be read by the guest to get the GPA
of the APIC backing page. The MSR can only be accessed in Secure AVIC mode.
Any attempt to access it when not in Secure AVIC mode results in #GP. So, the
hypervisor should not intercept it. A #VC exception will be generated
otherwise. If this occurs and Secure AVIC is enabled, terminate the guest
execution.

Signed-off-by: Neeraj Upadhyay &lt;Neeraj.Upadhyay@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tianyu Lan &lt;tiala@microsoft.com&gt;
Link: https://lore.kernel.org/20250828113119.209135-1-Neeraj.Upadhyay@amd.com
</content>
</entry>
<entry>
<title>x86/apic: Add support to send IPI for Secure AVIC</title>
<updated>2025-09-01T10:45:18+00:00</updated>
<author>
<name>Neeraj Upadhyay</name>
<email>Neeraj.Upadhyay@amd.com</email>
</author>
<published>2025-08-28T11:08:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2c6978ea1a85603fe7d401f7bb3a1fbcab21fde2'/>
<id>urn:sha1:2c6978ea1a85603fe7d401f7bb3a1fbcab21fde2</id>
<content type='text'>
Secure AVIC hardware accelerates only Self-IPI, i.e. on WRMSR to APIC_SELF_IPI
and APIC_ICR (with destination shorthand equal to Self) registers, hardware
takes care of updating the APIC_IRR in the APIC backing page of the vCPU.

For other IPI types (cross-vCPU, broadcast IPIs), software needs to take care
of updating the APIC_IRR state of the target vCPUs and to ensure that the
target vCPUs notice the new pending interrupt.

Add new callbacks in the Secure AVIC driver for sending IPI requests.  These
callbacks update the IRR in the target guest vCPU's APIC backing page. To
ensure that the remote vCPU notices the new pending interrupt, reuse the GHCB
MSR handling code in vc_handle_msr() to issue APIC_ICR MSR-write GHCB protocol
event to the hypervisor.

For Secure AVIC guests, on APIC_ICR write MSR exits, the hypervisor notifies
the target vCPU by either sending an AVIC doorbell (if target vCPU is running)
or by waking up the non-running target vCPU.

Co-developed-by: Kishon Vijay Abraham I &lt;kvijayab@amd.com&gt;
Signed-off-by: Kishon Vijay Abraham I &lt;kvijayab@amd.com&gt;
Signed-off-by: Neeraj Upadhyay &lt;Neeraj.Upadhyay@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Tianyu Lan &lt;tiala@microsoft.com&gt;
Link: https://lore.kernel.org/20250828110824.208851-1-Neeraj.Upadhyay@amd.com
</content>
</entry>
<entry>
<title>x86/sev: Improve handling of writes to intercepted TSC MSRs</title>
<updated>2025-08-12T10:33:58+00:00</updated>
<author>
<name>Nikunj A Dadhania</name>
<email>nikunj@amd.com</email>
</author>
<published>2025-07-22T07:48:53+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5eb1bcdb6a8c088514019c3a9bda5d565beed1af'/>
<id>urn:sha1:5eb1bcdb6a8c088514019c3a9bda5d565beed1af</id>
<content type='text'>
Currently, when a Secure TSC enabled SNP guest attempts to write to the
intercepted GUEST_TSC_FREQ MSR (a read-only MSR), the guest kernel response
incorrectly implies a VMM configuration error, when in fact it is the usual
VMM configuration to intercept writes to read-only MSRs, unless explicitly
documented.

Modify the intercepted TSC MSR #VC handling:
* Write to GUEST_TSC_FREQ will generate a #GP instead of terminating the
  guest
* Write to MSR_IA32_TSC will generate a #GP instead of silently ignoring it

However, continue to terminate the guest when reading from intercepted
GUEST_TSC_FREQ MSR with Secure TSC enabled, as intercepted reads indicate an
improper VMM configuration for Secure TSC enabled SNP guests.

  [ bp: simplify comment. ]

Fixes: 38cc6495cdec ("x86/sev: Prevent GUEST_TSC_FREQ MSR interception for Secure TSC enabled guests")
Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
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/20250722074853.22253-1-nikunj@amd.com
</content>
</entry>
<entry>
<title>x86/sev/vc: Fix EFI runtime instruction emulation</title>
<updated>2025-06-27T11:53:12+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2025-06-26T11:40:11+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7b22e0432981c2fa230f1b493082b7e67112c4aa'/>
<id>urn:sha1:7b22e0432981c2fa230f1b493082b7e67112c4aa</id>
<content type='text'>
In case efi_mm is active go use the userspace instruction decoder which
supports fetching instructions from active_mm.  This is needed to make
instruction emulation work for EFI runtime code, so it can use CPUID and
RDMSR.

EFI runtime code uses the CPUID instruction to gather information about
the environment it is running in, such as SEV being enabled or not, and
choose (if needed) the SEV code path for ioport access.

EFI runtime code uses the RDMSR instruction to get the location of the
CAA page (see SVSM spec, section 4.2 - "Post Boot").

The big picture behind this is that the kernel needs to be able to
properly handle #VC exceptions that come from EFI runtime services.
Since EFI runtime services have a special page table mapping for the EFI
virtual address space, the efi_mm context must be used when decoding
instructions during #VC handling.

  [ bp: Massage. ]

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Pankaj Gupta &lt;pankaj.gupta@amd.com&gt;
Link: https://lore.kernel.org/20250626114014.373748-2-kraxel@redhat.com
</content>
</entry>
<entry>
<title>x86/cpuid: Set &lt;asm/cpuid/api.h&gt; as the main CPUID header</title>
<updated>2025-05-15T16:23:55+00:00</updated>
<author>
<name>Ahmed S. Darwish</name>
<email>darwi@linutronix.de</email>
</author>
<published>2025-05-08T15:02:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=968e3000680713f712bcf02c51c4d7bb7d4d7685'/>
<id>urn:sha1:968e3000680713f712bcf02c51c4d7bb7d4d7685</id>
<content type='text'>
The main CPUID header &lt;asm/cpuid.h&gt; was originally a storefront for the
headers:

    &lt;asm/cpuid/api.h&gt;
    &lt;asm/cpuid/leaf_0x2_api.h&gt;

Now that the latter CPUID(0x2) header has been merged into the former,
there is no practical difference between &lt;asm/cpuid.h&gt; and
&lt;asm/cpuid/api.h&gt;.

Migrate all users to the &lt;asm/cpuid/api.h&gt; header, in preparation of
the removal of &lt;asm/cpuid.h&gt;.

Don't remove &lt;asm/cpuid.h&gt; just yet, in case some new code in -next
started using it.

Suggested-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Ahmed S. Darwish &lt;darwi@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Cooper &lt;andrew.cooper3@citrix.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: John Ogness &lt;john.ogness@linutronix.de&gt;
Cc: x86-cpuid@lists.linux.dev
Link: https://lore.kernel.org/r/20250508150240.172915-3-darwi@linutronix.de
</content>
</entry>
</feed>
