Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4727683pxv; Tue, 6 Jul 2021 07:48:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWfQRF/G6jF7nw1QFPoHLWqFnbPl+GNYaQxQi/gV1SWM6yTK+E9Ng/k5/Uo0eNGo73l20i X-Received: by 2002:a17:907:94cb:: with SMTP id dn11mr10243480ejc.420.1625582910293; Tue, 06 Jul 2021 07:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625582910; cv=none; d=google.com; s=arc-20160816; b=YWN3QR3fGkVuOMI4Ohbvw1pZqZdgV66t4Nx1OqhKYFHI4HaFILBCIyk7DNWkw9ru0B gdLiozBXSVNmDmOztyDOjZ0LMxt3w+t8pB045QTuo/Hh607dfw14PCQLGrKF+IXmCAgn RA2ZcjuaSYMYVhoczaMKjePCays0us0sGg1RUW3rMdnu6bw80RnmLeQ92Qer8z842C68 dMdnsnN5ttMqVSEydX5diMPAKdlAyxmWeeuDJVj/PwGDKons1Iv+kSvXKCN/KFWKlRbk 6WBa22Ux1Ei9pP/L84AzTu+MXg6cVeBpR0sC0L0MU/ATVwQ6puRcf+j2+A0Q8goWHX3F +BEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2zEi3JA5vxYLnytmbscJHpgEdeSyuxKHDnYYh4/c/i4=; b=Wl/R/xaoyIEF9wukVtFP7RDWFi2N2ijYPj+F2qxOcZjY2A/HvP2XiIyk6KaU4zKzNY aXVDIGbKHhqDDM4ReSejHRl7ZcBnu/ecMb92eCR+tZMnXt9YoXSVk5//g1lCSZwlbVBe Pp+nhXfMdRliY7mKj0s2zboAbDctq9+M0aVRt292Z5IB3iy7hI3qJZNV1ZqP4cmpTU0w CmG/0JOmIz8v05NT5m/lXbmF0VQQWubdfEpMVnlVms7V8gc8zgfMKfb5SQPI0GjdFVFF ZDjH7SVTH50lRWvvLbwjcYJ1BXaShyI8cdlCRN9RbSHX6kzDEnbRLwswacRw6q5OAZk+ GA5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zqgg0Sy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz15si15011928ejc.417.2021.07.06.07.48.02; Tue, 06 Jul 2021 07:48:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Zqgg0Sy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231872AbhGFOtq (ORCPT + 99 others); Tue, 6 Jul 2021 10:49:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60845 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbhGFOto (ORCPT ); Tue, 6 Jul 2021 10:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625582825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2zEi3JA5vxYLnytmbscJHpgEdeSyuxKHDnYYh4/c/i4=; b=Zqgg0Sy2PmxLNaIbgZ00EI+5sLyvOfKLGWJ8HFU1ffgcI2qEo0NhDzEQ6Io5QToNV98Pxu 29YhsNr1ihQ87FSeKjKAvAUob5kwEgcxB53W/V3NwEpe/v/sa3+sqzTVKabebxB48bvqLE cPwa8KlYUxo0Ck3NhD5Q/CKCvCuAPnE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-Eq5cTJJtNWiwaqK_4tv15w-1; Tue, 06 Jul 2021 10:47:04 -0400 X-MC-Unique: Eq5cTJJtNWiwaqK_4tv15w-1 Received: by mail-wr1-f70.google.com with SMTP id a4-20020adffb840000b02901304c660e75so4065654wrr.19 for ; Tue, 06 Jul 2021 07:47:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2zEi3JA5vxYLnytmbscJHpgEdeSyuxKHDnYYh4/c/i4=; b=uFsl+EpFrHaig2g1RR+dQoDt2v1He0NfU208fo35d/Wds+FIVvHDdFapr+Us2u7XW7 fMr9tgiQjQTAr5uXWs5tOZohJS/D9lB6gdmaQ4ST9ydfX6SS7egO+eUYZxih9am+6acb Zc5uUf4/b/IkBq1i6kdTFB6SERhGAq4EG23Ks/QEOjRWq/FGXJNW5p13MQnEWBcwHGeR O/b6qAhjCy7L5aPxYsp43HZ/HVA7iQXR7bsXRLguf/qfzjWhH8KXPsalLD7erv4FR7sx zDCxQAgA0sTfYR/5FkqrlmrpsQ9vzjWDNzDf4Q5jiai4zNV5AtB/iADjDpPQXx3nQHuC mvkQ== X-Gm-Message-State: AOAM533X+63DilLKrO9/xxILWlJ1A8ZfX6LIsRqnmJNiQtcomz8crD0t /XZWgv7xseesixFOYafoiKZCkivF6jvFaZMSKJcYiMyZMS5FwCPnWeJlCZ6+LVNPgU4yhJVstIs lQIOA496dXs+51JO1xzRMNcUK X-Received: by 2002:a1c:7915:: with SMTP id l21mr1227694wme.62.1625582823376; Tue, 06 Jul 2021 07:47:03 -0700 (PDT) X-Received: by 2002:a1c:7915:: with SMTP id l21mr1227662wme.62.1625582823199; Tue, 06 Jul 2021 07:47:03 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id a12sm2879128wrh.26.2021.07.06.07.47.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jul 2021 07:47:01 -0700 (PDT) Subject: Re: [RFC PATCH v2 62/69] KVM: VMX: MOVE GDT and IDT accessors to common code To: isaku.yamahata@intel.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , erdemaktas@google.com, Connor Kuehl , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: isaku.yamahata@gmail.com, Sean Christopherson References: <461baaa98c6b8c324ee297b76717d623d92bc510.1625186503.git.isaku.yamahata@intel.com> From: Paolo Bonzini Message-ID: <524b2da2-21ae-f810-c513-f1a8325f4da9@redhat.com> Date: Tue, 6 Jul 2021 16:46:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <461baaa98c6b8c324ee297b76717d623d92bc510.1625186503.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/07/21 00:05, isaku.yamahata@intel.com wrote: > From: Sean Christopherson > > Signed-off-by: Sean Christopherson > Signed-off-by: Isaku Yamahata > --- > arch/x86/kvm/vmx/main.c | 6 ++++-- > arch/x86/kvm/vmx/vmx.c | 12 ------------ > 2 files changed, 4 insertions(+), 14 deletions(-) > > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c > index b619615f77de..8e03cb72b910 100644 > --- a/arch/x86/kvm/vmx/main.c > +++ b/arch/x86/kvm/vmx/main.c > @@ -311,7 +311,8 @@ static int vt_set_efer(struct kvm_vcpu *vcpu, u64 efer) > > static void vt_get_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > { > - vmx_get_idt(vcpu, dt); > + dt->size = vmread32(vcpu, GUEST_IDTR_LIMIT); > + dt->address = vmreadl(vcpu, GUEST_IDTR_BASE); > } > > static void vt_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > @@ -321,7 +322,8 @@ static void vt_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > > static void vt_get_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > { > - vmx_get_gdt(vcpu, dt); > + dt->size = vmread32(vcpu, GUEST_GDTR_LIMIT); > + dt->address = vmreadl(vcpu, GUEST_GDTR_BASE); > } > > static void vt_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index 40843ca2fb33..d69d4dc7c071 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -3302,24 +3302,12 @@ static void vmx_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) > *l = (ar >> 13) & 1; > } > > -static void vmx_get_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > -{ > - dt->size = vmcs_read32(GUEST_IDTR_LIMIT); > - dt->address = vmcs_readl(GUEST_IDTR_BASE); > -} > - > static void vmx_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > { > vmcs_write32(GUEST_IDTR_LIMIT, dt->size); > vmcs_writel(GUEST_IDTR_BASE, dt->address); > } > > -static void vmx_get_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > -{ > - dt->size = vmcs_read32(GUEST_GDTR_LIMIT); > - dt->address = vmcs_readl(GUEST_GDTR_BASE); > -} > - > static void vmx_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt) > { > vmcs_write32(GUEST_GDTR_LIMIT, dt->size); > Reviewed-by: Paolo Bonzini