Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1567122

Re: [v3 PATCH 00/10] x86: Enable User-Mode Instruction Prevention

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.szaf.org!news.unit0.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [v3 PATCH 00/10] x86: Enable User-Mode Instruction Prevention
Date Thu, 26 Jan 2017 07:00:01 +0100
Message-ID <t3Lgd-3vx-3@gated-at.bofh.it> (permalink)
References <t3CmB-6vC-5@gated-at.bofh.it> <t3CFY-6Do-13@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.33,287,1477983600"; d="scan'208";a="1099070896"
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.10.4-0ubuntu2
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 33
Organization linux.* mail to news gateway
X-Original-Cc Ingo Molnar <mingo@redhat.com>, Thomas Gleixner <tglx@linutronix.de>, Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@suse.de>, Peter Zijlstra <peterz@infradead.org>, Andrew Morton <akpm@linux-foundation.org>, Brian Gerst <brgerst@gmail.com>, Chris Metcalf <cmetcalf@mellanox.com>, Dave Hansen <dave.hansen@linux.intel.com>, Paolo Bonzini <pbonzini@redhat.com>, Liang Z Li <liang.z.li@intel.com>, Masami Hiramatsu <mhiramat@kernel.org>, Huang Rui <ray.huang@amd.com>, Jiri Slaby <jslaby@suse.cz>, Jonathan Corbet <corbet@lwn.net>, "Michael S. Tsirkin" <mst@redhat.com>, Paul Gortmaker <paul.gortmaker@windriver.com>, Vlastimil Babka <vbabka@suse.cz>, Chen Yucong <slaoub@gmail.com>, Alexandre Julliard <julliard@winehq.org>, Fenghua Yu <fenghua.yu@intel.com>, Stas Sergeev <stsp@list.ru>, "Ravi V. Shankar" <ravi.v.shankar@intel.com>, Shuah Khan <shuah@kernel.org>, linux-kernel@vger.kernel.org, x86@kernel.org, linux-msdos@vger.kernel.org, wine-devel@winehq.org
X-Original-Date Wed, 25 Jan 2017 21:51:16 -0800
X-Original-Message-ID <1485409876.41148.49.camel@ranerica-desktop>
X-Original-References <20170125202353.101059-1-ricardo.neri-calderon@linux.intel.com> <98393c2c-4d1e-d8bb-b693-ec26ea919a4c@zytor.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1567122

Show key headers only | View raw


Hi Peter,
On Wed, 2017-01-25 at 12:34 -0800, H. Peter Anvin wrote:
> On 01/25/17 12:23, Ricardo Neri wrote:
> >  * SMSW returns the value with which the CR0 register is programmed in
> >    head_32/64.S at boot time. This is, the following bits are enabed:
> >    CR0.0 for Protection Enable, CR.1 for Monitor Coprocessor, CR.4 for
> >    Extension Type, which will always be 1 in recent processors with UMIP;
> >    CR.5 for Numeric Error, CR0.16 for Write Protect, CR0.18 for Alignment
> >    Mask. Additionally, in x86_64, CR0.31 for Paging is set.
> 
> SMSW only returns CR0[15:0], so the reference here to CR0[31:16] seems odd.

I checked again the latest version (from Dec 2016) of the Intel Software
Development Manual. The documentation for SMSW states the following:

SMSW r16 operand size 16, store CR0[15:0] in r16
SMSW r32 operand size 32, zero-extend CR0[31:0], and store in r32
SMSW r64 operand size 64, zero-extend CR0[63:0], and store in r64

When the operand is a memory location, yes, it only returns CR0[15:0]

Also, in the tests that I ran I wrote the result of SMSW to a 64-bit
register. I get 0x80050033. It seems to me that it does write as many
bits as the register operand can hold.

Am I missing something?

Thanks and BR,
Ricardo
> 
> 	-hpa
> 
> 

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[v3 PATCH 00/10] x86: Enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
  [v3 PATCH 07/10] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
    Re: [v3 PATCH 07/10] x86: Add emulation code for UMIP instructions "H. Peter Anvin" <hpa@zytor.com> - 2017-01-25 21:50 +0100
      Re: [v3 PATCH 07/10] x86: Add emulation code for UMIP instructions Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-26 07:00 +0100
  [v3 PATCH 01/10] x86/mpx: Do not use SIB index if index points to R/ESP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
  [v3 PATCH 09/10] x86: Enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
  [v3 PATCH 03/10] x86/mpx, x86/insn: Relocate insn util functions to a new insn-kernel Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
    Re: [v3 PATCH 03/10] x86/mpx, x86/insn: Relocate insn util  functions to a new insn-kernel Masami Hiramatsu <mhiramat@kernel.org> - 2017-01-26 03:30 +0100
  [v3 PATCH 10/10] selftests/x86: Add tests for User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
  [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit addressing encodings Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
    Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit  addressing encodings Andy Lutomirski <luto@amacapital.net> - 2017-01-25 23:00 +0100
      Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit addressing encodings "H. Peter Anvin" <hpa@zytor.com> - 2017-01-25 23:10 +0100
      Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit  addressing encodings Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-26 07:00 +0100
        Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit  addressing encodings Andy Lutomirski <luto@amacapital.net> - 2017-01-26 18:20 +0100
          Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit  addressing encodings Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-27 04:50 +0100
  [v3 PATCH 02/10] x86/mpx: Fail decoding when SIB baseR/EBP is and no displacement is used Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
  [v3 PATCH 08/10] x86/traps: Fixup general protection faults caused by UMIP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
  [v3 PATCH 04/10] x86/insn-kernel: Add a function to obtain register offset in ModRM Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-25 21:30 +0100
    Re: [v3 PATCH 04/10] x86/insn-kernel: Add a function to obtain  register offset in ModRM Masami Hiramatsu <mhiramat@kernel.org> - 2017-01-26 03:20 +0100
      Re: [v3 PATCH 04/10] x86/insn-kernel: Add a function to obtain  register offset in ModRM Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-26 07:10 +0100
        Re: [v3 PATCH 04/10] x86/insn-kernel: Add a function to obtain  register offset in ModRM Masami Hiramatsu <mhiramat@kernel.org> - 2017-01-27 09:00 +0100
  Re: [v3 PATCH 00/10] x86: Enable User-Mode Instruction Prevention "H. Peter Anvin" <hpa@zytor.com> - 2017-01-25 21:50 +0100
    Re: [v3 PATCH 00/10] x86: Enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-01-26 07:00 +0100

csiph-web