Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp397851lqs; Tue, 5 Mar 2024 05:34:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU1ZA1Nu+4gFJWbWDxPk8PbQjeU0nAItGNKandtvBR6wIgpNHE1pUvxmCgKXDPh8TNGnZOJxjhYhC5QFYOBlT3LMPLBqSd/Zg0h+rd05A== X-Google-Smtp-Source: AGHT+IGeOVUGfdRW2xm01zEXdLvZ1F1x1NIqR7L3wXgTSNb2z4uNZ7kPRzwU/L2wj5b8eMcwwqBy X-Received: by 2002:a17:906:a8c:b0:a43:f66a:17f7 with SMTP id y12-20020a1709060a8c00b00a43f66a17f7mr7889391ejf.19.1709645696002; Tue, 05 Mar 2024 05:34:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709645695; cv=pass; d=google.com; s=arc-20160816; b=ue4sndb3bApq9Ak6UclK0fbdKVcObxP9n9yQfHf7SDDPxCjZg+T9vRjEkhx6PvUH/p PIIsMeTMBEEAJ+3q4CmU8/NVYLzSkAiCoYHo96kydAzwV3fiw41oeE7lI67yI9QO3vH2 4RHSIs+q39/L2JFoAuckRpU3G1IFWAurufW+y07n5fSVnIKbr2B4+RwQi7KWfT7KYXp9 /wbd8Sm1QDKo/xai85XgMNVDqjWBlhkkGbmAIYlNIeS/2JXhecNHwFUo4/K+3rFmuOMw kwoPtr7MkVVU05wlkU23DtBmjMI+ehJkmoXvIUHCz8hRrIJy5/xaG+GhcT6Io1pQYevj 6iYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=pIkZSMkkRKM2ftXQepv9UGxsAg+f7oq49/YynUa9VTw=; fh=cblvNNDIHNWyPjoLRdO1bHHwqpsVi6g1htpxpsV+epI=; b=xWj3b9ZL6K7pTevKb1iHU2bsngrsQduBiH18QWd7pEuIMX+hmGU3Vtc6ukZsXQu63j SD6KrMs9zhEHXjmr098oMVdNoS2o4AIkniUJ9G7J0wLrp7ahvftVxe7o/IRLoN6ZV806 TxHocLHN74KHKhMvL6aNWxlSDO5nXlT33mOeyA2EtcvFPxKqgjyUVWCm/QPcit3YskfW kLNC0q1o3RzefGcvJc/PGb4xUW2+qGk5eD3MRFHSVrM4imC+SPDC+g7Nghoy47RA8KBk rcIYmrQjfvPt4ttU2Z5RnCytxb7icazZdNDVAYm3ppmt8+mCdOb4xf5SfsYIXVGUwY8p QlYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BHtwhx+j; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92449-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w26-20020a17090633da00b00a3cf1cb2eb8si4984778eja.869.2024.03.05.05.34.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 05:34:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92449-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BHtwhx+j; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-92449-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 91E451F24015 for ; Tue, 5 Mar 2024 13:34:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 818DE85C6C; Tue, 5 Mar 2024 13:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BHtwhx+j" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C4638592E for ; Tue, 5 Mar 2024 13:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709645677; cv=none; b=la6e0OMVkVBHZtZGd2UzL9HeEpAD2zh8HKBQ8pnK3asViNz9bltWPCARrh/TQpTwzdcpxoiP8szC8VroaLeAZnkJk+YJWS+BF2lD0CIpp200uxPZr7mOjnVebns2e4Ken96fxNPD5QStaquCf87huYPGIRtOVXiq2Ztfux2o5+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709645677; c=relaxed/simple; bh=SOkpQmUlX6bJE0MCdVCGdLOMO7UfDnzeTRQD48ZaR4g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j4yHjoBz8wiWARLg/w8zKcPTaYbrMhGoxzKrESrsg0iExsdx4cRJc46g+FNaMFU5gZHYriVn9a1ghHFVePRsy4P9tA/iRADmXFGnxWKC3y1Gxv3h3cTkVjrTkQbSPGaT4adsCVJLmap/pofPInzgf9ARqP8TA4hLBtq+K5o4Mk0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BHtwhx+j; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709645675; 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:autocrypt:autocrypt; bh=pIkZSMkkRKM2ftXQepv9UGxsAg+f7oq49/YynUa9VTw=; b=BHtwhx+jcsjOOtuWajn+0Nmypy0VHRRdxgCTlHn75NAfoD+vvDvRe7DK0kzqV4q5y52wJY 6ey5hVRT0iXpn33AsbrwaDcp5fwRncR7YB1+SMaCY0wLrr5z1DNkrVQi33knIIoD+1YKSl 4ls4JcmTwXsi8+4GyJdFNNmJu/6k1ZI= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-9UlZZBZVM-mbYmqwJlZ4xA-1; Tue, 05 Mar 2024 08:34:33 -0500 X-MC-Unique: 9UlZZBZVM-mbYmqwJlZ4xA-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a35ef7abe08so401983566b.2 for ; Tue, 05 Mar 2024 05:34:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709645672; x=1710250472; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pIkZSMkkRKM2ftXQepv9UGxsAg+f7oq49/YynUa9VTw=; b=ZBdbNYmADwdOq6TpBZN43aJXC3PSRP0Hi6zh/d8OXGcoPFYSy4jrsMeqeEmK/ycpQn bt12a8/gn+Y7FaeTbI+WIr9PldhF2f+bLPBIUGrwmOts/l6yCoLySlwbUTEvEYS/fui7 RHPPuooDwcqn/J5Jd7jzixqiV47aJUSemNNisaIpHIu0RS/ALUPcgxujesTXm4PIL5NW 4+4HT924RVaPh0wrCdBsR/o3ed/Qpzm+Io0SgPEKi3K1EDbKjYVAjqJ2cd537HJQkL8G uyXGLMIUaQ6g7Y1ZwO/9NRJ/l/uZNLwCiAOF+nuD9QqErxATeHQ0irlvJGznEHF50I0a qYTw== X-Gm-Message-State: AOJu0YydCdH4MxefYxpB5AjDxXyJK2ZiBqRWn7pKZFz077+++/oXSIfY dQyk8Rx2rPHfwmXuZXr3S1MyCk50CzALF5zU8BYxW3psJ6Df5303VsJFTtMdvpJh/mMl1Uo6cvI 4UHropUUKYNT/WsUPnNgUOZTGQDVyfymr3HpKQd8PcYQCIzywoSo67Bhf2oZIlA== X-Received: by 2002:a17:906:16ca:b0:a45:62bc:6b0a with SMTP id t10-20020a17090616ca00b00a4562bc6b0amr3425495ejd.65.1709645672545; Tue, 05 Mar 2024 05:34:32 -0800 (PST) X-Received: by 2002:a17:906:16ca:b0:a45:62bc:6b0a with SMTP id t10-20020a17090616ca00b00a4562bc6b0amr3425481ejd.65.1709645672248; Tue, 05 Mar 2024 05:34:32 -0800 (PST) Received: from [192.168.10.118] ([151.49.77.21]) by smtp.googlemail.com with ESMTPSA id lh21-20020a170906f8d500b00a4421cb0fb3sm6026709ejb.215.2024.03.05.05.34.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Mar 2024 05:34:31 -0800 (PST) Message-ID: <5dc760b7-b77e-4824-bab2-213d5e822c4a@redhat.com> Date: Tue, 5 Mar 2024 14:34:25 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 13/15] KVM: SEV: define VM types for SEV and SEV-ES Content-Language: en-US To: Xu Yilun Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, seanjc@google.com, michael.roth@amd.com, aik@amd.com References: <20240226190344.787149-1-pbonzini@redhat.com> <20240226190344.787149-14-pbonzini@redhat.com> From: Paolo Bonzini Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd w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OLriF dNr9NvE1QGmGyIcbw2NIVEBOK/GWxkS5+dmxM2iD4Jdaf2nSn3jlHjEXoPwpMs0KZsgdU0pP JQzMUMwmB1wM8JxovFlPYrhNT9MAEQEAAcLBMwQYAQIACQUCVEJx7gIbDAAKCRB+FRAMzTZp sadRDqCctLmYICZu4GSnie4lKXl+HqlLanpVMOoFNnWs9oRP47MbE2wv8OaYh5pNR9VVgyhD OG0AU7oidG36OeUlrFDTfnPYYSF/mPCxHttosyt8O5kabxnIPv2URuAxDByz+iVbL+RjKaGM GDph56ZTswlx75nZVtIukqzLAQ5fa8OALSGum0cFi4ptZUOhDNz1onz61klD6z3MODi0sBZN Aj6guB2L/+2ZwElZEeRBERRd/uommlYuToAXfNRdUwrwl9gRMiA0WSyTb190zneRRDfpSK5d usXnM/O+kr3Dm+Ui+UioPf6wgbn3T0o6I5BhVhs4h4hWmIW7iNhPjX1iybXfmb1gAFfjtHfL xRUr64svXpyfJMScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0 JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/4/24 16:32, Xu Yilun wrote: >> @@ -247,6 +247,9 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp) >> if (kvm->created_vcpus) >> return -EINVAL; >> >> + if (kvm->arch.vm_type != KVM_X86_DEFAULT_VM) > ^ > > IIUC it should be KVM_X86_SEV_VM? No, this is the legacy ioctl that only works with default-type VMs. Paolo