The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Binbin Wu <binbin.wu@linux.intel.com>
To: Sohil Mehta <sohil.mehta@intel.com>
Cc: kvm@vger.kernel.org, x86@kernel.org,
	Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>, Shuah Khan <shuah@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"Chang S . Bae" <chang.seok.bae@intel.com>,
	Kai Huang <kai.huang@intel.com>,
	Fuad Tabba <fuad.tabba@linux.dev>, Chao Gao <chao.gao@intel.com>,
	Yosry Ahmed <yosry@kernel.org>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Matlack <dmatlack@google.com>,
	Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>,
	Kishen Maloor <kishen.maloor@intel.com>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v4 2/7] KVM: x86: Use linear_read_system() to read the TSS I/O bitmap
Date: Wed, 19 Aug 2026 13:26:25 +0800	[thread overview]
Message-ID: <23707851-e446-4687-9d4f-b01953637db0@linux.intel.com> (raw)
In-Reply-To: <2f8e907e-1c77-416d-90be-9428ce8242f6@intel.com>

On 8/19/2026 1:03 PM, Sohil Mehta wrote:
> Thank you for reviewing the patch.
> 
> On 8/18/2026 8:19 PM, Binbin Wu wrote:
>> On 8/6/2026 9:15 AM, Sohil Mehta wrote:
>>> TSS I/O permission bitmap reads are implicit supervisor accesses which
>>> are subject to Linear Address Space Separation (LASS) enforcement.
>>
>> I am not sure about it.
>>
>> According to SDM vol 3a (253668-089US), Chapter "LINEAR-ADDRESS PRE-PROCESSING",
>> section "MODE-BASED ACCESSES AND LINEAR-ADDRESS-SPACE PARTITIONING", it defines
>> and limits "implicit supervisor-mode accesses" to the following operations:
> 
> The way I understand it, this list isn't exhaustive. The wording in
> those sections, "Such accesses include the following.." and "Examples of
> such accesses include.." suggests that this is not limiting.
> 
>> - accesses to the global descriptor table (GDT) or local descriptor table (LDT)
>>   to load a segment descriptor
>> - accesses to the interrupt descriptor table (IDT) when delivering an interrupt
>>   or exception
>> - accesses to the task-state segment (TSS) as part of a task switch or change of
>>   CPL
>> - accesses to a user posted-interrupt descriptor (UPID) during user-interrupt
>>   notification processing
>>
> 
> For example, this doesn't list the SENDUIPI instruction's access to the
> UITT (IA32_UINTR_TT). That one is an implicit supervisor-mode access to
> a kernel address at CPL = 3.
> 
> In section 5.6.1 (Determination of Access Rights), immediately following
> the above examples the SDM says:  "All these accesses are called
> implicit supervisor-mode accesses regardless of CPL."
> 
>> IIUC, the TSS I/O bitmap read during ordinary instruction execution
>> (under CPL = 3) rather than during a task switch or CPL transition, I don't
>> think they fall under the classification of implicit supervisor-mode accesses.
>>
> AFAIU, the entire TSS struct (including the I/O bitmap portion) is
> mapped at struct cpu_entry_area using CPU_ENTRY_AREA_BASE with
> PAGE_KERNEL_RO permissions. So bit 63 will always be 1 and U/S = 0.
> 
> Yes, the TSS I/O bitmap access happens at CPL = 3 but it still has to be
> an implicit supervisor access. If it weren't, any user instruction
> access to the I/O bitmap would always generate a fault (even without
> LASS), right?
> 

You are right.
I replied too quickly before fully recalling how these knobs work.

> 
> Sohil
> 
> 


  parent reply	other threads:[~2026-08-19  5:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  1:15 [PATCH v4 0/7] KVM: x86: Add LASS virtualization support Sohil Mehta
2026-08-06  1:15 ` [PATCH v4 1/7] KVM: x86: Add an emulator flag to differentiate branch targets from fetches Sohil Mehta
2026-08-06  1:15 ` [PATCH v4 2/7] KVM: x86: Use linear_read_system() to read the TSS I/O bitmap Sohil Mehta
2026-08-19  3:19   ` Binbin Wu
2026-08-19  5:03     ` Sohil Mehta
2026-08-19  5:21       ` H. Peter Anvin
2026-08-19  5:26       ` Binbin Wu [this message]
2026-08-06  1:15 ` [PATCH v4 3/7] KVM: x86: Add LASS violation checks during instruction emulation Sohil Mehta
2026-08-19  5:58   ` Binbin Wu
2026-08-06  1:15 ` [PATCH v4 4/7] KVM: VMX: Implement LASS violation check Sohil Mehta
2026-08-19  8:49   ` Binbin Wu
2026-08-06  1:15 ` [PATCH v4 5/7] KVM: x86: Virtualize LASS and advertise support to userspace Sohil Mehta
2026-08-19  9:01   ` Binbin Wu
2026-08-06  1:15 ` [PATCH v4 6/7] KVM: selftests: Add coverage for LASS CPUID and CR4 handling Sohil Mehta
2026-08-06  1:15 ` [PATCH v4 7/7] selftests/x86: Add a userspace test for LASS enforcement Sohil Mehta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23707851-e446-4687-9d4f-b01953637db0@linux.intel.com \
    --to=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chang.seok.bae@intel.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dmatlack@google.com \
    --cc=fuad.tabba@linux.dev \
    --cc=hpa@zytor.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kai.huang@intel.com \
    --cc=kishen.maloor@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=reddybalavignesh9979@gmail.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    --cc=yosry@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox