Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp970856pxb; Thu, 21 Oct 2021 13:06:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB6pD+PoyeQIB6sbAAwHmmYhsiuStOgqqrccUuB685iIgPGoHyvF0E8Fuk+UmrZn02an9U X-Received: by 2002:a63:6ac8:: with SMTP id f191mr5867015pgc.386.1634846760233; Thu, 21 Oct 2021 13:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634846760; cv=none; d=google.com; s=arc-20160816; b=EpSUC5wEhdpzRbuWk1cAhcTCvTAtgIa4mWmA3SGiO2VNgJ/AgzfjlLdFMK9fmjqa35 a4jZK6+GAYfOAHpPHFqFmctmXbpRePtk8ofVTgj16p6OnWvwnOXBW7B/ivxWJgo7j5Uz 56zfKFSNlqntgUZGAIiQL+bevZJYi48WWKsxz1L80d2hqNqv9ANlhnlvSqFn9lHzuEbQ MDyHLyhTfudSh6nG6gS1xgYoZj7GunhhEAimpn4ezNtX4gmvdISFJRlnzhVAl1AlVZgl XH/xbh10BlmIw4NcuDsTONqTQ92ALOThY5+QNEVgmTHUPKtKXTOVOzjwKC0jpfzVyeCM O26A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BJdYaoVntWzrTJu7xhe7fmZqFzNwWeTLt9gWbNrG0tI=; b=vdiCmNAPOI7lXQuIXT7smN93vZiUA3VewiE6PLTKhhmdTcFVSfcYS1KoPkX7VFgVPw A2iryxdOUuZCgsjTkbxmBvh6xST+LZ7puErByRvC9A8ZNulEddWOGJHQvHWy/3RQOvY1 +wPvPLv+VhmhQBHhybG6yU4QMkRscmNZAZJZwDdx6BBc+oZE7DLhCec2IXsWnxUoYC3s IlTg3yY0joGzkuY2eqhBhVLWREYaJHAh8of6lbe2N267GBNP7lf4o78zc9eJjSrNmnwu uNcqEZS5fcb/Fh1/uGnWHFdmLPe55eYtgMUvLNBzagBJ6Qcwinf57aAm95xiPJwcFbBf P3/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DyZK5Ujs; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id om4si14344254pjb.12.2021.10.21.13.05.47; Thu, 21 Oct 2021 13:06:00 -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=@google.com header.s=20210112 header.b=DyZK5Ujs; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbhJUUG7 (ORCPT + 99 others); Thu, 21 Oct 2021 16:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbhJUUG7 (ORCPT ); Thu, 21 Oct 2021 16:06:59 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16DFFC0613B9 for ; Thu, 21 Oct 2021 13:04:43 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id m26so1629965pff.3 for ; Thu, 21 Oct 2021 13:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BJdYaoVntWzrTJu7xhe7fmZqFzNwWeTLt9gWbNrG0tI=; b=DyZK5UjsLM2sesHrMIFKiCLvbwjjm6pRQYaHN6kh2bjdpBd+o7evkX3d9O/HB2gCVy 9HS0r8ymYKhTg12KN8I4CrhlEfdKv4Xk3ALOHQ4mXeLFdHKKF+mUYFzEPXic2/yH4KVi GzZ0x5/cF9q2KuyWxEkNaSc070B2tZ9WFJBm2oolGEsbcrdTtb/fnQYFp+UQqugJPxij Ov2JgMaSOXUiH81fVFEKMW7mQWqRLHkh6qm7U7+SkK1mPCgCd04d+lxPNvXVHHt2g2Zl Uq8MNQ8zSwMpdqGt7Nn/BOQsbipMtnMmbuRW9zbbDQGiS12bvzZfiCd+zwc53SUEULGQ aGtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BJdYaoVntWzrTJu7xhe7fmZqFzNwWeTLt9gWbNrG0tI=; b=dAsawY0fSq6o2OXg/SzliS5VLHrowSX7U6XSdf7wd3qK1arSOrzphCv7iGLDn1aS4E QuMJn2ODbXPLvMpkyI0Qc9zrGr4g1u1GntdDk8rLrH5fEES+l5y9AB02x7AdCvfT0OX6 8/vtSElWBLmaeFl755mg5HmRPJpb3gx9b/BhxtyYTHozLR6ehK7zJBMu5WwIef9UQV0G OEuFC7BR7z6yCznPeWhBI5690+jGyUh6aF9n8JM5Rtn+9dQVwlnBAcJTJrOs4VCUFj0r tSM96GpiI/FzpTqzVvgeBtAk1YFdtT0JPIX5DDLmr7ONs7u3/AUB+Th6frtd4YDuDzZE RvFQ== X-Gm-Message-State: AOAM532VOSDtDHCXQq11etAwvx+Dskt+I4kXnx4wasjT2n8Nb/xV6y/T lkPVEBENyGFVDk5A8rwD3I+xHg== X-Received: by 2002:a05:6a00:24c1:b0:457:a10e:a0e with SMTP id d1-20020a056a0024c100b00457a10e0a0emr7511096pfv.63.1634846682353; Thu, 21 Oct 2021 13:04:42 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id f21sm7567450pfc.203.2021.10.21.13.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 13:04:41 -0700 (PDT) Date: Thu, 21 Oct 2021 20:04:38 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, fwilhelm@google.com, oupton@google.com Subject: Re: [PATCH 0/8] KVM: SEV-ES: fixes for string I/O emulation Message-ID: References: <20211013165616.19846-1-pbonzini@redhat.com> <435767c0-958d-f90f-d11a-cff42ab1205c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <435767c0-958d-f90f-d11a-cff42ab1205c@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021, Paolo Bonzini wrote: > On 13/10/21 18:56, Paolo Bonzini wrote: > > This series, namely patches 1 and 8, fix two bugs in string I/O > > emulation for SEV-ES: > > > > - first, the length is completely off for "rep ins" and "rep outs" > > operation of size > 1. After setup_vmgexit_scratch, svm->ghcb_sa_len > > is in bytes, but kvm_sev_es_string_io expects the number of PIO > > operations. > > > > - second, the size of the GHCB buffer can exceed the size of > > vcpu->arch.pio_data. If that happens, we need to go over the GHCB > > buffer in multiple passes. > > > > The second bug was reported by Felix Wilhelm. The first was found by > > me by code inspection; on one hand it seems *too* egregious so I'll be > > gladly proven wrong on this, on the other hand... I know I'm bad at code > > review, but not _that_ bad. String I/O was completely busted on the Linux guest side as well, I wouldn't be the least bit surprised if KVM were completely broken as well (reviewing now...).