Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp745642pxb; Thu, 21 Oct 2021 08:42:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn41fJpro2cHaVNpLJN3MYOuFQ9QR90x3u3mzgk2L2kb4coIyl30hDWwNPk0fMqwk0ji+/ X-Received: by 2002:a05:6402:515a:: with SMTP id n26mr8597466edd.68.1634830954705; Thu, 21 Oct 2021 08:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634830954; cv=none; d=google.com; s=arc-20160816; b=jqMhPze5UrE82rih+o4AkIUeEa1mhkYT3jDbFqcvCTMbO3LT/sl+zPFqwOAnbb/fz3 oRcreti9YpBfLi8JjoTUhfTqosA/+KbVcHdv/YibTsFUsYY+YnhHY1u6arBj6yUTgq9h hg70eIy+Dnuwwe8wN5dWLPQoT15wduVv6BNlbpOxK1WEdbEWW6facXjLZfAvA6QjgF/p 1X8yjYIZ5WQa53rlmMJOMwII2Zsv30JQiWaqamQBSF03Nvy66X07RPw2anKJwuYxwvta W28rXRw/vgPdv0b6A2EH5UJ9XPat5+4P9wnXCuogsZFmneDNKZv1H+mhUxLGKepXvAhA W/yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=h0wouENnTmUtJmbKlkejDb+c662f3yls2DMMpli4OF8=; b=RE6uZjb5lY0ZXookUmLYy0hU4GHqjmQVpPqSSclInhmbLRy4xDjOVFk1vtMOeTiU25 wRbuQddPYtMlV2Scv/IS2qRHvnLDgJJRxPUUsdJog458uDTMwmmLFUguSek7x305G9Nr PuJM+lLo1jjeqi66xZXHIVJi4sJCYKBi6uDwvLLTIqv3014TJoExrqXSU0TZ++0pxnYc GwB+985ty/aw2KyrogHoXmpghyOw+HH/cS1hA/mwpWv8hSOu9Tp53lvBIq/6X1eGFmm8 jTFK5hSsbxmaVkL++jNiLpQ34HjVqWdY+nBuUernJbgzzL4PIVsq4F6LJZP30lfHpXss 4pMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AeCXBsvW; 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 88si7370924edf.116.2021.10.21.08.42.10; Thu, 21 Oct 2021 08:42:34 -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=AeCXBsvW; 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 S231509AbhJUPmH (ORCPT + 99 others); Thu, 21 Oct 2021 11:42:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20062 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbhJUPmF (ORCPT ); Thu, 21 Oct 2021 11:42:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634830789; 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=h0wouENnTmUtJmbKlkejDb+c662f3yls2DMMpli4OF8=; b=AeCXBsvWGk5s3misTkqws7qoh4sZQDuO4JpQ2UnK1WqxKaWIT+EKbbOsTue7mRbgVKLF0t dI322dlY1gEb138c9lBTOQ90diFR+Sl21S/PybkXFya2Nzn+bMDHj9Brv793MXAVUx2GFs e5E9Ke8qXTiI9FYGdNeMDVvateiNzOE= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-210-ODVCc0vIPYawF197p2sY_w-1; Thu, 21 Oct 2021 11:39:47 -0400 X-MC-Unique: ODVCc0vIPYawF197p2sY_w-1 Received: by mail-ed1-f71.google.com with SMTP id x5-20020a50f185000000b003db0f796903so735444edl.18 for ; Thu, 21 Oct 2021 08:39:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=h0wouENnTmUtJmbKlkejDb+c662f3yls2DMMpli4OF8=; b=cva6HWf/11FlWVW93eS6DsWs1J5DXneGUPdfxyqKW2NkdWACORqyL6yNvkOQ8s4urr mPi4/6nefpeO/BAHL6pjUtSMY5Q+NKPWJ2JmmBMtc4Hp+frEK9ULrMlXhD3u8LJvzMbJ vmmLaHxMvDpJpKYv/FZo1kTA1rb+zkafPJISrWzTHHDGHPXMXmYUr2o5JnzqHA5xWwg/ 6Em+kKXPuWSfscrf3x7QjwRIuPF+hzVSkiXY8LAjnP7Z2Vgd7y9W9rELv5DiPV5sg5jL ARCrRDRTjmXerEMmTnLZndLzI3RFBaiY+LGHORXXNHiKLASa/y+mBx/jlQCL9Yo4bSRx 5bqQ== X-Gm-Message-State: AOAM5339sTJV5pVz3vOdRieGiNHcMWDFbdgXYnexcKZkP4cbdLxl2uXk yKoVDPsFbA+ZU8C/wIVrIqg4LH2Q4Miw/x4pDJ/4YT4XIGgzKc8GsSlqaWnOFILzOgxO/lNviG/ g8ROfdZQ2X6w6NQu60Rfh5bSq X-Received: by 2002:a17:906:a94b:: with SMTP id hh11mr8204101ejb.85.1634830786752; Thu, 21 Oct 2021 08:39:46 -0700 (PDT) X-Received: by 2002:a17:906:a94b:: with SMTP id hh11mr8204075ejb.85.1634830786573; Thu, 21 Oct 2021 08:39:46 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id z1sm3065807edc.68.2021.10.21.08.39.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 08:39:45 -0700 (PDT) Message-ID: <80a69f94-23ca-3ca9-4c77-14e09683dc7d@redhat.com> Date: Thu, 21 Oct 2021 17:39:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [RFC 06/16] KVM: selftests: add library for creating/interacting with SEV guests Content-Language: en-US To: Michael Roth , linux-kselftest@vger.kernel.org Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Nathan Tempelman , Marc Orr , Steve Rutherford , Sean Christopherson , Mingwei Zhang , Brijesh Singh , Tom Lendacky , Varad Gautam , Shuah Khan , Vitaly Kuznetsov , David Woodhouse , Ricardo Koller , Jim Mattson , Wanpeng Li , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" References: <20211005234459.430873-1-michael.roth@amd.com> <20211006203710.13326-1-michael.roth@amd.com> From: Paolo Bonzini In-Reply-To: <20211006203710.13326-1-michael.roth@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/21 22:37, Michael Roth wrote: > +struct sev_sync_data { > + uint32_t token; > + bool pending; > + bool done; > + bool aborted; > + uint64_t info; > +}; > + Please add a comment explaining roughly the design and what the fields are for. Maybe the bools can be replaced by an enum { DONE, ABORT, SYNC, RUNNING } (running is for pending==false)? Also, for the part that you can feel free to ignore: this seems to be similar to the ucall mechanism. Is it possible to implement the ucall interface in terms of this one (or vice versa)? One idea could be to: - move ucall to the main lib/ directory - make it use a struct of function pointers, whose default implementation would be in the existing lib/ARCH/ucall.c files - add a function to register the struct for the desired implementation - make sev.c register its own implementation Thanks, Paolo