lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD9E936.3030001@redhat.com>
Date:	Thu, 14 Jun 2012 16:37:58 +0300
From:	Avi Kivity <avi@...hat.com>
To:	zhangyanfei <zhangyanfei@...fujitsu.com>
CC:	mtosatti@...hat.com, ebiederm@...ssion.com, luto@....edu,
	Joerg Roedel <joerg.roedel@....com>, dzickus@...hat.com,
	paul.gortmaker@...driver.com, ludwig.nussel@...e.de,
	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	kexec@...ts.infradead.org, Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 3/5] KVM-INTEL: Add new module vmcsinfo-intel to fill
 VMCSINFO

On 05/16/2012 10:55 AM, zhangyanfei wrote:
> This patch implements a new module named vmcsinfo-intel. The
> module fills VMCSINFO with the VMCS revision identifier,
> and encoded offsets of VMCS fields.
> 
> Note, offsets of fields below will not be filled into VMCSINFO:
> 1. fields defined in Intel specification (Intel® 64 and
>    IA-32 Architectures Software Developer’s Manual, Volume
>    3C) but not defined in *vmcs_field*.
> 2. fields don't exist because their corresponding control bits
>    are not set.
> 
> +
> +/*
> + * We separate these five control fields from other fields
> + * because some fields only exist on processors that support
> + * the 1-setting of control bits in the five control fields.
> + */

I thought this was checked only during VMENTRY.  So perhaps you don't
need this special casing.

In fact you might be able to

   // pre-fill vmcs with patterns

  for (i = 0; i < 64k; ++i)
      if (vmcs_read_checking(i, &pattern)) {
           // decode pattern
      } else
           // field does not exist (VM Instruction error 12), ignore

with no knowledge of the control fields, or of any field name.


> +
> +/*
> + * The format of VMCSINFO is given below:
> + *   +-------------+--------------------------+
> + *   | Byte offset | Contents                 |
> + *   +-------------+--------------------------+
> + *   | 0           | VMCS revision identifier |
> + *   +-------------+--------------------------+
> + *   | 4           | <field><encoded offset>  |
> + *   +-------------+--------------------------+
> + *   | 16          | <field><encoded offset>  |
> + *   +-------------+--------------------------+
> + *   ......
> + *
> + * The first 32 bits of VMCSINFO contains the VMCS revision
> + * identifier.
> + * The remainder of VMCSINFO is used for <field><encoded offset>
> + * sets. Each set takes 12 bytes: field occupys 4 bytes
> + * and its corresponding encoded offset occupys 8 bytes.
> + *
> + * Encoded offsets are raw values read by vmcs_read{16, 64, 32, l},
> + * and they are all unsigned extended to 8 bytes for each
> + * <field><encoded offset> set has the same size.
> + * We do not decode offsets here. The decoding work is delayed
> + * in userspace tools.

It's better to do the decoding here, or no one will know how to do it.
Also have an nfields field.
-- 
error compiling committee.c: too many arguments to function


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ