From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Zhang Subject: Re: [PATCH] KVM: x86: no need to check CPL for XSETBV on VMX Date: Fri, 15 Apr 2016 18:55:47 +0800 Message-ID: <5710C8B3.8060901@gmail.com> References: <57104A23.4070405@gmail.com> <5710BE49.4000702@redhat.com> <5710C463.4080308@gmail.com> <5710C5DB.1040800@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: Paolo Bonzini , "kvm@vger.kernel.org" , "rkrcmar@redhat.com" Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:34872 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753428AbcDOKz5 (ORCPT ); Fri, 15 Apr 2016 06:55:57 -0400 Received: by mail-pf0-f193.google.com with SMTP id r187so9827924pfr.2 for ; Fri, 15 Apr 2016 03:55:57 -0700 (PDT) In-Reply-To: <5710C5DB.1040800@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2016/4/15 18:43, Paolo Bonzini wrote: > > > On 15/04/2016 12:37, Yang Zhang wrote: >>> I don't think this is performance-sensitive, hence it's simpler to keep >>> the code as simple as possible. For example, if one added XSETBV >>> support to the emulator, your patch would introduce a bug. >> >> In what case we need to decode XSETBV? > > The emulator can be a way to unify code between vmx and svm. It is an > alternative to writing small wrapper functions such as kvm_set_xcr. I still think the correctness is important. But it's ok to leave it there since it doesn't cause any real problem so far. :) -- best regards yang