Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp950461lko; Tue, 13 Jul 2021 13:41:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHRvw6ycZ0GiQuYzpT9BMaAjqPrVMyx/0aKhlP0wtky8KI8pN9+up7ZTqoi8Y9ft5LL49W X-Received: by 2002:a17:906:4f05:: with SMTP id t5mr7909690eju.351.1626208915649; Tue, 13 Jul 2021 13:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626208915; cv=none; d=google.com; s=arc-20160816; b=NQb9U7gCMOcsBc1qYhxb7OW+3vA606UKfdW1u6NSDfSsiA4suFn1UXpwu9RKtRXhvf pvmqgC+nZcNRK/uUEIyvbMd+g3HE8j1Y/sfojHTYH25JH969hugkUn8lIlxLpgp4ro9r 2Ndzx32JvnA/EnYpxBxbpqmvUQfz+Eqt+EQ8aEnfEGHBnpw9nvtKHSwPM2W4+Bw/NwVM ivUN161ZE1WpmEP7p3l/DOtQhJD+EBlZmHClU6SQOugcnVxyxyiVK0odrr5osG9Uon+Y tribNAGUUKc/I4ekE7Zq+GAt2uJTE4wdXjUcDqpC/FfiGZXtvyivpNXZ0xrf98NYq+gS /4UA== 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=vAEz6tbBq7rYrMMnkx41TwsKhbqefEUfL96yExQSeis=; b=wxg8Gtyj2vaBFXhqzSLVWEBiCWaaDUr44na4h4ZvTFwdcZzMY+Fg+FwM1tPfIulKfd a8jJyszIWYfTTeXrnnDauRcRksbVaKJulpITHoXsCXKsoiCflx2LvVL8iBPX6wSg+UEl rneeI5SM17Lj42wKPS3yzpiW8CIGLIhJbph+JPJQPkj1472+ZAR/u9GVNIo1+7bkx12P l6Y9ByNvBjssASywhgq9XyRPUl44gP4XDvX82VaFCN4ask/VjNfiMVBdC56ogO3hEIU4 ZQOxrz0jU1BQJnXwRC7GjEPfZ6JSMwgkMYyZUwoTOG4cofZi/cxTa8ImFXE06xa04UND vf2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vXnVzvAm; 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 p20si21224491edq.601.2021.07.13.13.41.33; Tue, 13 Jul 2021 13:41:55 -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=20161025 header.b=vXnVzvAm; 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 S235043AbhGMUmB (ORCPT + 99 others); Tue, 13 Jul 2021 16:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231499AbhGMUmB (ORCPT ); Tue, 13 Jul 2021 16:42:01 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12715C0613DD for ; Tue, 13 Jul 2021 13:39:11 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id p9so12785387pjl.3 for ; Tue, 13 Jul 2021 13:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vAEz6tbBq7rYrMMnkx41TwsKhbqefEUfL96yExQSeis=; b=vXnVzvAmDrRF8FTIsxLeNffuHPTEaCiYb4YtzDpnJgAQPgXvS5lawhS8/WpTLy6Vo8 XlS/V+9queLMhMPiBN3DLqU2fxswvlBmwcLsjpD2m5ckBzHUhDYMteAj2jmdG4vTJfog NU5w6EgdvzWFrdlyYRIGFeE75quGdFyU8yJBd214cGiixfntXOFbiMbPSCeRXmpB4Kvw eF95YGDWecVO/K9fGyUaoAhWC/2xHXoluwTYXaQqEmoEywCIGKTh01ebamJj6d05BlT8 2Q7lSXC0DvKkNpfCZb/zgF0QjpTWOs5uzuEdlE8SsZJg2Z97Y0tQ9ph7APv7V+7TkLMh L0ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vAEz6tbBq7rYrMMnkx41TwsKhbqefEUfL96yExQSeis=; b=iWN026RFsYHFG5P+95MPmNKdtFsM+zQ+pmi9OM79vwl7pOpqF89PoAjdDxtHtgVBVg ryOeTwXYmrXXLXqWYa9rAexgllWPRCn3nEyFsBXZvMgXnc7qPHGeb3u551cIaPnldgiU AkscnUW34wed/yeCqC1zDdWGJ25hvpIS/ipwbGvFw2Eh4hGfF+SXH8IHLkmPPzJgFEnB N1zcgVBYNKu+NFtaitpEOT7VYSA0B3ouZ4yuGytEv78mOcas/BmvfNdea8X0Nd+5RR2U njEZ3d6J8oK1tp0MyQXCS8bc9R1ideaY+Jmro5JLGb9gegfS1jynj+0YURvi0sAexrhS CdqA== X-Gm-Message-State: AOAM532L/fYJjaa2yO98/ZDQNigm/Pt8aNoM1frDvCMpABkK2xkapn2p /0Qqowwb0VnRCbVtTQl8GUZOHQ== X-Received: by 2002:a17:90a:1785:: with SMTP id q5mr99843pja.38.1626208750366; Tue, 13 Jul 2021 13:39:10 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id d29sm37603pfq.193.2021.07.13.13.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 13:39:09 -0700 (PDT) Date: Tue, 13 Jul 2021 20:39:06 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: 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 , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, isaku.yamahata@gmail.com, Sean Christopherson , Xiaoyao Li Subject: Re: [RFC PATCH v2 22/69] KVM: x86: Add vm_type to differentiate legacy VMs from protected VMs Message-ID: References: <8eb87cd52a89d957af03f93a9ece5634426a7757.1625186503.git.isaku.yamahata@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 06, 2021, Paolo Bonzini wrote: > On 03/07/21 00:04, isaku.yamahata@intel.com wrote: > > struct kvm_arch { > > + unsigned long vm_type; > > Also why not just int or u8? Heh, because kvm_dev_ioctl_create_vm() takes an "unsigned long" for the type and it felt wrong to store it as something else. Storing it as a smaller field should be fine, I highly doubt we'll get to 256 types anytime soon :-) I think kvm_x86_ops.is_vm_type_supported() should take the full size though.