1. 10 Feb, 2021 5 commits
  2. 09 Feb, 2021 30 commits
  3. 08 Feb, 2021 2 commits
  4. 04 Feb, 2021 3 commits
    • Sean Christopherson's avatar
      KVM: x86: Add helper to consolidate "raw" reserved GPA mask calculations · a8ac864a
      Sean Christopherson authored
      Add a helper to generate the mask of reserved GPA bits _without_ any
      adjustments for repurposed bits, and use it to replace a variety of
      open coded variants in the MTRR and APIC_BASE flows.
      
      No functional change intended.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20210204000117.3303214-11-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a8ac864a
    • Sean Christopherson's avatar
      KVM: x86/mmu: Add helper to generate mask of reserved HPA bits · 6f8e65a6
      Sean Christopherson authored
      Add a helper to generate the mask of reserved PA bits in the host.
      
      No functional change intended.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20210204000117.3303214-10-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6f8e65a6
    • Sean Christopherson's avatar
      KVM: x86: Use reserved_gpa_bits to calculate reserved PxE bits · 5b7f575c
      Sean Christopherson authored
      Use reserved_gpa_bits, which accounts for exceptions to the maxphyaddr
      rule, e.g. SEV's C-bit, for the page {table,directory,etc...} entry (PxE)
      reserved bits checks.  For SEV, the C-bit is ignored by hardware when
      walking pages tables, e.g. the APM states:
      
        Note that while the guest may choose to set the C-bit explicitly on
        instruction pages and page table addresses, the value of this bit is a
        don't-care in such situations as hardware always performs these as
        private accesses.
      
      Such behavior is expected to hold true for other features that repurpose
      GPA bits, e.g. KVM could theoretically emulate SME or MKTME, which both
      allow non-zero repurposed bits in the page tables.  Conceptually, KVM
      should apply reserved GPA checks universally, and any features that do
      not adhere to the basic rule should be explicitly handled, i.e. if a GPA
      bit is repurposed but not allowed in page tables for whatever reason.
      
      Refactor __reset_rsvds_bits_mask() to take the pre-generated reserved
      bits mask, and opportunistically clean up its code, e.g. to align lines
      and comments.
      
      Practically speaking, this is change is a likely a glorified nop given
      the current KVM code base.  SEV's C-bit is the only repurposed GPA bit,
      and KVM doesn't support shadowing encrypted page tables (which is
      theoretically possible via SEV debug APIs).
      
      Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20210204000117.3303214-9-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5b7f575c