A mirror of the official Linux kernel repository just in case
Go to file
Paolo Bonzini e4ee544792 KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns
This check is currently performed by sev_gmem_post_populate(), but it
applies to all callers of kvm_gmem_populate(): the point of the function
is that the memory is being encrypted and some work has to be done
on all the gfns in order to encrypt them.

Therefore, check the KVM_MEMORY_ATTRIBUTE_PRIVATE attribute prior
to invoking the callback, and stop the operation if a shared page
is encountered.  Because CONFIG_KVM_PRIVATE_MEM in principle does
not require attributes, this makes kvm_gmem_populate() depend on
CONFIG_KVM_GENERIC_PRIVATE_MEM (which does require them).

Reviewed-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-07-26 14:46:15 -04:00
arch KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns 2024-07-26 14:46:15 -04:00
block
certs
crypto
Documentation KVM: x86: disallow pre-fault for SNP VMs before initialization 2024-07-26 14:46:14 -04:00
drivers crypto: ccp: Add the SNP_VLEK_LOAD command 2024-07-17 12:46:26 -04:00
fs
include KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns 2024-07-26 14:46:15 -04:00
init
io_uring
ipc
kernel
lib
LICENSES
mm
net
rust
samples
scripts
security
sound
tools KVM selftests for 6.11 2024-07-16 09:55:27 -04:00
usr
virt KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns 2024-07-26 14:46:15 -04:00
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.