No description
Find a file
David Matlack 6a97575d5c KVM: x86/mmu: Cache the access bits of shadowed translations
Splitting huge pages requires allocating/finding shadow pages to replace
the huge page. Shadow pages are keyed, in part, off the guest access
permissions they are shadowing. For fully direct MMUs, there is no
shadowing so the access bits in the shadow page role are always ACC_ALL.
But during shadow paging, the guest can enforce whatever access
permissions it wants.

In particular, eager page splitting needs to know the permissions to use
for the subpages, but KVM cannot retrieve them from the guest page
tables because eager page splitting does not have a vCPU.  Fortunately,
the guest access permissions are easy to cache whenever page faults or
FNAME(sync_page) update the shadow page tables; this is an extension of
the existing cache of the shadowed GFNs in the gfns array of the shadow
page.  The access bits only take up 3 bits, which leaves 61 bits left
over for gfns, which is more than enough.

Now that the gfns array caches more information than just GFNs, rename
it to shadowed_translation.

While here, preemptively fix up the WARN_ON() that detects gfn
mismatches in direct SPs. The WARN_ON() was paired with a
pr_err_ratelimited(), which means that users could sometimes see the
WARN without the accompanying error message. Fix this by outputting the
error message as part of the WARN splat, and opportunistically make
them WARN_ONCE() because if these ever fire, they are all but guaranteed
to fire a lot and will bring down the kernel.

Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220516232138.1783324-18-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-06-24 04:51:58 -04:00
arch KVM: x86/mmu: Cache the access bits of shadowed translations 2022-06-24 04:51:58 -04:00
block for-5.19/drivers-2022-06-02 2022-06-03 10:25:56 -07:00
certs
crypto
Documentation KVM: x86/MMU: Allow NX huge pages to be disabled on a per-vm basis 2022-06-24 04:51:49 -04:00
drivers fix for breakage in #work.fd this window 2022-06-05 17:14:03 -07:00
fs fix for breakage in #work.fd this window 2022-06-05 17:14:03 -07:00
include KVM: x86/MMU: Allow NX huge pages to be disabled on a per-vm basis 2022-06-24 04:51:49 -04:00
init This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
ipc These changes update the ipc sysctls so that they are fundamentally 2022-06-03 15:54:57 -07:00
kernel KVM/riscv fixes for 5.19, take #1 2022-06-09 09:45:00 -04:00
lib Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
LICENSES
mm Hot fixes for 5.19-rc1. 2022-06-05 17:05:38 -07:00
net bluetooth: don't use bitmaps for random flag accesses 2022-06-05 16:28:41 -07:00
samples
scripts A set of objtool fixes: 2022-06-05 09:45:27 -07:00
security Cleanups (and one fix) around struct mount handling. 2022-06-04 19:00:05 -07:00
sound USB / Thunderbolt changes for 5.19-rc1 2022-06-03 11:17:49 -07:00
tools KVM: selftests: Cache binary stats metadata for duration of test 2022-06-24 04:51:51 -04:00
usr
virt KVM: Do not zero initialize 'pfn' in hva_to_pfn() 2022-06-20 06:21:36 -04:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap Hot fixes for 5.19-rc1. 2022-06-05 17:05:38 -07:00
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: Limit KVM RISC-V entry to existing selftests 2022-06-09 09:18:22 +05:30
Makefile Linux 5.19-rc1 2022-06-05 17:18:54 -07:00
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 Restructured Text 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.