<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/sev-shared.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-04-22T16:38:28Z</updated>
<entry>
<title>x86/sev: Check for MWAITX and MONITORX opcodes in the #VC handler</title>
<updated>2024-04-22T16:38:28Z</updated>
<author>
<name>Tom Lendacky</name>
</author>
<published>2024-04-22T13:39:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e70316d17f6ab49a6038ffd115397fd68f8c7be8'/>
<id>urn:sha1:e70316d17f6ab49a6038ffd115397fd68f8c7be8</id>
<content type='text'>
The MWAITX and MONITORX instructions generate the same #VC error code as
the MWAIT and MONITOR instructions, respectively. Update the #VC handler
opcode checking to also support the MWAITX and MONITORX opcodes.

Fixes: e3ef461af35a ("x86/sev: Harden #VC instruction emulation somewhat")
Signed-off-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/453d5a7cfb4b9fe818b6fb67f93ae25468bc9e23.1713793161.git.thomas.lendacky@amd.com
</content>
</entry>
<entry>
<title>Merge branch 'linus' into x86/boot, to resolve conflict</title>
<updated>2024-03-12T08:55:57Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2024-03-12T08:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2e2bc42c8381d2c0e9604b59e49264821da29368'/>
<id>urn:sha1:2e2bc42c8381d2c0e9604b59e49264821da29368</id>
<content type='text'>
There's a new conflict with Linus's upstream tree, because
in the following merge conflict resolution in &lt;asm/coco.h&gt;:

  38b334fc767e Merge tag 'x86_sev_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Linus has resolved the conflicting placement of 'cc_mask' better
than the original commit:

  1c811d403afd x86/sev: Fix position dependent variable references in startup code

... which was also done by an internal merge resolution:

  2e5fc4786b7a Merge branch 'x86/sev' into x86/boot, to resolve conflicts and to pick up dependent tree

But Linus is right in 38b334fc767e, the 'cc_mask' declaration is sufficient
within the #ifdef CONFIG_ARCH_HAS_CC_PLATFORM block.

So instead of forcing Linus to do the same resolution again, merge in Linus's
tree and follow his conflict resolution.

 Conflicts:
	arch/x86/include/asm/coco.h

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'x86-build-2024-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2024-03-12T02:23:16Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-03-12T02:23:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d69ad12c786f0a4593c48c0658043aa4a5116b09'/>
<id>urn:sha1:d69ad12c786f0a4593c48c0658043aa4a5116b09</id>
<content type='text'>
Pull x86 build updates from Ingo Molnar:

 - Reduce &lt;asm/bootparam.h&gt; dependencies

 - Simplify &lt;asm/efi.h&gt;

 - Unify *_setup_data definitions into &lt;asm/setup_data.h&gt;

 - Reduce the size of &lt;asm/bootparam.h&gt;

* tag 'x86-build-2024-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Do not include &lt;asm/bootparam.h&gt; in several files
  x86/efi: Implement arch_ima_efi_boot_mode() in source file
  x86/setup: Move internal setup_data structures into setup_data.h
  x86/setup: Move UAPI setup structures into setup_data.h
</content>
</entry>
<entry>
<title>x86/sev: Move early startup code into .head.text section</title>
<updated>2024-03-04T17:12:37Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2024-02-27T15:19:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=428080c9b19bfda37c478cd626dbd3851db1aff9'/>
<id>urn:sha1:428080c9b19bfda37c478cd626dbd3851db1aff9</id>
<content type='text'>
In preparation for implementing rigorous build time checks to enforce
that only code that can support it will be called from the early 1:1
mapping of memory, move SEV init code that is called in this manner to
the .head.text section.

Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Tested-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://lore.kernel.org/r/20240227151907.387873-19-ardb+git@google.com
</content>
</entry>
<entry>
<title>x86/sev: Fix position dependent variable references in startup code</title>
<updated>2024-02-06T15:38:42Z</updated>
<author>
<name>Ard Biesheuvel</name>
</author>
<published>2024-02-03T12:53:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1c811d403afd73f04bde82b83b24c754011bd0e8'/>
<id>urn:sha1:1c811d403afd73f04bde82b83b24c754011bd0e8</id>
<content type='text'>
The early startup code executes from a 1:1 mapping of memory, which
differs from the mapping that the code was linked and/or relocated to
run at. The latter mapping is not active yet at this point, and so
symbol references that rely on it will fault.

Given that the core kernel is built without -fPIC, symbol references are
typically emitted as absolute, and so any such references occuring in
the early startup code will therefore crash the kernel.

While an attempt was made to work around this for the early SEV/SME
startup code, by forcing RIP-relative addressing for certain global
SEV/SME variables via inline assembly (see snp_cpuid_get_table() for
example), RIP-relative addressing must be pervasively enforced for
SEV/SME global variables when accessed prior to page table fixups.

__startup_64() already handles this issue for select non-SEV/SME global
variables using fixup_pointer(), which adjusts the pointer relative to a
`physaddr` argument. To avoid having to pass around this `physaddr`
argument across all functions needing to apply pointer fixups, introduce
a macro RIP_RELATIVE_REF() which generates a RIP-relative reference to
a given global variable. It is used where necessary to force
RIP-relative accesses to global variables.

For backporting purposes, this patch makes no attempt at cleaning up
other occurrences of this pattern, involving either inline asm or
fixup_pointer(). Those will be addressed later.

  [ bp: Call it "rip_rel_ref" everywhere like other code shortens
    "rIP-relative reference" and make the asm wrapper __always_inline. ]

Co-developed-by: Kevin Loughlin &lt;kevinloughlin@google.com&gt;
Signed-off-by: Kevin Loughlin &lt;kevinloughlin@google.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/all/20240130220845.1978329-1-kevinloughlin@google.com
</content>
</entry>
<entry>
<title>x86: Do not include &lt;asm/bootparam.h&gt; in several files</title>
<updated>2024-01-30T14:17:24Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2024-01-12T09:44:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=103bf75fc928d16185feb216bda525b5aaca0b18'/>
<id>urn:sha1:103bf75fc928d16185feb216bda525b5aaca0b18</id>
<content type='text'>
Remove the include statement for &lt;asm/bootparam.h&gt; from several files
that don't require it and limit the exposure of those definitions within
the Linux kernel code.

  [ bp: Massage commit message. ]

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Acked-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Link: https://lore.kernel.org/r/20240112095000.8952-5-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>x86/sev: Harden #VC instruction emulation somewhat</title>
<updated>2024-01-29T16:08:22Z</updated>
<author>
<name>Borislav Petkov (AMD)</name>
</author>
<published>2024-01-05T10:14:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3ef461af35a8c74f2f4ce6616491ddb355a208f'/>
<id>urn:sha1:e3ef461af35a8c74f2f4ce6616491ddb355a208f</id>
<content type='text'>
Compare the opcode bytes at rIP for each #VC exit reason to verify the
instruction which raised the #VC exception is actually the right one.

Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Acked-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Link: https://lore.kernel.org/r/20240105101407.11694-1-bp@alien8.de
</content>
</entry>
<entry>
<title>arch/x86: Fix typos</title>
<updated>2024-01-03T10:46:22Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2024-01-03T00:40:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54aa699e8094efb7d7675fefbc03dfce24f98456'/>
<id>urn:sha1:54aa699e8094efb7d7675fefbc03dfce24f98456</id>
<content type='text'>
Fix typos, most reported by "codespell arch/x86".  Only touches comments,
no code changes.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Link: https://lore.kernel.org/r/20240103004011.1758650-1-helgaas@kernel.org
</content>
</entry>
<entry>
<title>Merge tag 'sev_fixes_for_v6.6' of //git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2023-10-20T01:12:08Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2023-10-20T01:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0df072ab65ef020091dc69c37c797f2650498472'/>
<id>urn:sha1:0df072ab65ef020091dc69c37c797f2650498472</id>
<content type='text'>
Pull x86 fixes from Borislav Petkov:
 "Take care of a race between when the #VC exception is raised and when
  the guest kernel gets to emulate certain instructions in SEV-{ES,SNP}
  guests by:

   - disabling emulation of MMIO instructions when coming from user mode

   - checking the IO permission bitmap before emulating IO instructions
     and verifying the memory operands of INS/OUTS insns"

* tag 'sev_fixes_for_v6.6' of //git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/sev: Check for user-space IOIO pointing to kernel space
  x86/sev: Check IOBM for IOIO exceptions from user-space
  x86/sev: Disable MMIO emulation from user mode
</content>
</entry>
<entry>
<title>x86/sev: Check for user-space IOIO pointing to kernel space</title>
<updated>2023-10-17T08:58:16Z</updated>
<author>
<name>Joerg Roedel</name>
</author>
<published>2023-10-16T12:42:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63e44bc52047f182601e7817da969a105aa1f721'/>
<id>urn:sha1:63e44bc52047f182601e7817da969a105aa1f721</id>
<content type='text'>
Check the memory operand of INS/OUTS before emulating the instruction.
The #VC exception can get raised from user-space, but the memory operand
can be manipulated to access kernel memory before the emulation actually
begins and after the exception handler has run.

  [ bp: Massage commit message. ]

Fixes: 597cfe48212a ("x86/boot/compressed/64: Setup a GHCB-based VC Exception handler")
Reported-by: Tom Dohrmann &lt;erbse.13@gmx.de&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Cc: &lt;stable@kernel.org&gt;
</content>
</entry>
</feed>
