Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1117703pxb; Thu, 21 Oct 2021 16:17:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBjEpeuCfDnqchHSUQ5riUt5sM1EOFtIhvURtv2nYvuZsnDZJs5AHyKOlRClSm3JBk47wX X-Received: by 2002:a05:6402:229b:: with SMTP id cw27mr2866525edb.137.1634858253458; Thu, 21 Oct 2021 16:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634858253; cv=none; d=google.com; s=arc-20160816; b=aHF3aU3ZLS27V7TKay4YWXkKGgPCY7j5vt0Ljoc75k2ufP4IRnLRPcyPWm5PwUKJMd rTwVUjIZe/pnKRnC4BJLJy9YAWh3W9nG42dXMBIvIfo9tCdZpSP/EDETjdg/2AHeTyRH ewyp6vZSIt7JCRYB9y5JXBDcR5/6HUVUmH6uSCNf/a3yWh65qc2Zd7G2hrisDzOfA/WA 8OSClo6xBDRwI5K6y+WToozRwHnMuHM/LwY5uumMVgDFMC/1+sSCzFdbiPRj9P0eQgIq Z7Y8sj5/PwFV1ljYzapVPcc4pTiWJN77v16gw0dRnSD3WudUFO4CLFOwb3F3G73rDI4n NNKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=OKrO9YzFcRiGqjjKTmisNjn2sm4kl4HIEvLRafGurGw=; b=FOQ/RYDr2/EbDeI2s7clzyEH3g9AZAlkQBKBl3XyUdBfaQM38CdRfbChv44as+/2Ri 772uo9gI3eFPHZQ0ru+zgEcALPAlEBabEU2XBl0QfuXVkhr5I6/SNPjhLW6h44bSaJqn wVeX0Q7sVJg2xp/pupoZSA4wcMm5ZB6txswjuy+Japp2CmfYllhlsA6nXhmMaEXgSacf rMOgCOQusjrr3AFu9E/81k9Tw7cXc+v0lBOmdJc+CwhtU4KtjBeyXucl+LxoHBAjw2Xo ktBoz6mVjnbUQ8BzyoUpH4w5BpQmzQMIaNlo8B9vWXsW1aJveRXTA1gXhpqx8lcBEDGc YRYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FNEgkIwR; 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 e1si4088767edm.372.2021.10.21.16.17.09; Thu, 21 Oct 2021 16:17:33 -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=FNEgkIwR; 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 S232139AbhJUXRO (ORCPT + 99 others); Thu, 21 Oct 2021 19:17:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20694 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232282AbhJUXRN (ORCPT ); Thu, 21 Oct 2021 19:17:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634858097; 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=OKrO9YzFcRiGqjjKTmisNjn2sm4kl4HIEvLRafGurGw=; b=FNEgkIwRI6bu2lZYfSz3UsTSvtTp4SNtB+kXuGBbeH1Y5Bim/NZIaeORVlButh25GyshkT 042Oe5zrB2WddtJwpWuWTOEQ0CIzFg3PUOipx+UP4fGScZaeIAty889PxUMgOdXPCDCr7y w2bCinwBfjKPwOlpwgc7BDRH7dYmU/Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-1JLtYFXkOciPSk-m9q_4zQ-1; Thu, 21 Oct 2021 19:14:54 -0400 X-MC-Unique: 1JLtYFXkOciPSk-m9q_4zQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE3C1802B7E; Thu, 21 Oct 2021 23:14:52 +0000 (UTC) Received: from starship (unknown [10.40.192.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96DFA60862; Thu, 21 Oct 2021 23:14:50 +0000 (UTC) Message-ID: <33411fb1d0a98057249ae27a86909b03be21c8e2.camel@redhat.com> Subject: Re: [PATCH 7/8] KVM: SEV-ES: keep INS functions together From: Maxim Levitsky To: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: fwilhelm@google.com, seanjc@google.com, oupton@google.com, stable@vger.kernel.org Date: Fri, 22 Oct 2021 02:14:49 +0300 In-Reply-To: <20211013165616.19846-8-pbonzini@redhat.com> References: <20211013165616.19846-1-pbonzini@redhat.com> <20211013165616.19846-8-pbonzini@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-10-13 at 12:56 -0400, Paolo Bonzini wrote: > Make the diff a little nicer when we actually get to fixing > the bug. No functional change intended. > > Cc: stable@vger.kernel.org > Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/x86.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index ef4d6a0de4d8..a485e185ad00 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -12377,15 +12377,6 @@ int kvm_sev_es_mmio_read(struct kvm_vcpu *vcpu, gpa_t gpa, unsigned int bytes, > } > EXPORT_SYMBOL_GPL(kvm_sev_es_mmio_read); > > -static int complete_sev_es_emulated_ins(struct kvm_vcpu *vcpu) > -{ > - memcpy(vcpu->arch.sev_pio_data, vcpu->arch.pio_data, > - vcpu->arch.pio.count * vcpu->arch.pio.size); > - vcpu->arch.pio.count = 0; > - > - return 1; > -} > - > static int kvm_sev_es_outs(struct kvm_vcpu *vcpu, unsigned int size, > unsigned int port, unsigned int count) > { > @@ -12401,6 +12392,15 @@ static int kvm_sev_es_outs(struct kvm_vcpu *vcpu, unsigned int size, > return 0; > } > > +static int complete_sev_es_emulated_ins(struct kvm_vcpu *vcpu) > +{ > + memcpy(vcpu->arch.sev_pio_data, vcpu->arch.pio_data, > + vcpu->arch.pio.count * vcpu->arch.pio.size); > + vcpu->arch.pio.count = 0; > + > + return 1; > +} > + > static int kvm_sev_es_ins(struct kvm_vcpu *vcpu, unsigned int size, > unsigned int port, unsigned int count) > { Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky