From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05AF4C4332F for ; Thu, 21 Oct 2021 15:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D95F6611CE for ; Thu, 21 Oct 2021 15:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbhJUPmH (ORCPT ); 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-Google-Smtp-Source: ABdhPJygh/ogpMADSEAhV2C8uWQCpemdTM07xs0eaiEzrKhYcoDbjxPGQQV7n6IACgfuReFhO5i+1A== 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