Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3653076ybl; Tue, 21 Jan 2020 04:51:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwDFPrhncItdeSYgqeL5W0wSsM5H8IWH8pVDwON/6eC/Dy9xI8M4MTdLS1gu7tWaUTipmpE X-Received: by 2002:a9d:67c1:: with SMTP id c1mr3475447otn.161.1579611097987; Tue, 21 Jan 2020 04:51:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579611097; cv=none; d=google.com; s=arc-20160816; b=C7s3lYXbqX2oEgms9i6gnVv2a7wFVNW+j11IVMBsfm8ISqvhnvnihmP8GJtxdIG9L4 Kc8roCpowLX74vYlFne2xSNaugjc3Za2qbFR3GupLZSwiKnwCwoHJ9zOMC9Isy4W08wh ewL9elL33yVgqix+vzq7+X1uZW5MhJ5gGkeTnDXCtUWFLMCmLXqzoYx73ii4o4CtjVPE p0N4lAaNp0J8+9oi366oV5ANIosVs4wFPxAzJdZSq50UV8zHX1cudHtRp1TOLpdQZ1nL DIsWmK9v9pEGZaFkZmctkrpnafNru9gerQGudznctIpuQc7zm0SKmM9oSysf1jyQYYKF Xcwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=/u+aNCzOBVungikO7RcpOytmRG3Ie/4OtPBspKlfTPE=; b=dcNu3xfJWFy841VHP0k+F00XQjzjRTjSMmQV0qW4E8QRAvmaEpHbuWQWGzq88s4rwl Xbx8DaTeS4KKT4niLAl9b2bQZB6uOsL1gv6cqxYEilkEQM0kBXwKgQp6Jah1B0RYkKqI dNz/gUcmaLg8zC22DUmt3p/3UL34Ag98sxzAyrQcTzZafoOQiUkVDeShiAr4Rru7hotK wCs8ZUrXzXmi5XSKWagtfQZJ355vtFsqnZLO+upnBz30V8WRzsOgviwTSR6uDUN6Ploo K8BOfNVQpe7jpXnlx+Tnuv4GAZ+faPEeXD8qBREaqGA0LEA0cKdgsaXYwEkuJd4sd3iB +kWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UxnvebkQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id u5si24074378otg.99.2020.01.21.04.51.25; Tue, 21 Jan 2020 04:51:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UxnvebkQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729636AbgAUMuQ (ORCPT + 99 others); Tue, 21 Jan 2020 07:50:16 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20016 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726968AbgAUMuP (ORCPT ); Tue, 21 Jan 2020 07:50:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579611014; 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=/u+aNCzOBVungikO7RcpOytmRG3Ie/4OtPBspKlfTPE=; b=UxnvebkQ1d4T2VGbir9rUxJIahsG/SEGMgNm6w2rZeC9jq9q0jkTSpFO4nICfDrG/6/zhf xzFJpLbmg958gnjAWxB0nfxAGHtIgWp4FSJSfqkzaF7KlIvnyV+NAX3MauD0YDXoSPST6P 6V75BzbPzUdhh1+evR3O4qgFsWZDT4E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-llc0_N6CObuBHsMi73hPTg-1; Tue, 21 Jan 2020 07:50:11 -0500 X-MC-Unique: llc0_N6CObuBHsMi73hPTg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A80CF100E2E6; Tue, 21 Jan 2020 12:50:10 +0000 (UTC) Received: from [10.36.117.108] (ovpn-117-108.ams2.redhat.com [10.36.117.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D09BC19757; Tue, 21 Jan 2020 12:50:08 +0000 (UTC) Subject: Re: [PATCH] selftests: KVM: AMD Nested SVM test infrastructure To: Paolo Bonzini , Vitaly Kuznetsov Cc: thuth@redhat.com, drjones@redhat.com, eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20200117173753.21434-1-eric.auger@redhat.com> <87pnfeflgb.fsf@vitty.brq.redhat.com> From: Auger Eric Message-ID: <06c0cb50-75f4-2c25-c064-37e0709575c4@redhat.com> Date: Tue, 21 Jan 2020 13:50:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vitaly, Paolo, On 1/21/20 1:17 PM, Paolo Bonzini wrote: > On 21/01/20 12:12, Auger Eric wrote: >>>> + >>>> +static struct test tests[] = { >>>> + /* name, supported, custom setup, l2 code, exit code, custom check, finished */ >>>> + {"vmmcall", NULL, NULL, l2_vmcall, SVM_EXIT_VMMCALL}, >>>> + {"vmrun", NULL, NULL, l2_vmrun, SVM_EXIT_VMRUN}, >>>> + {"CR3 read intercept", NULL, prepare_cr3_intercept, l2_cr3_read, SVM_EXIT_READ_CR3}, >>>> +}; >>> selftests are usualy not that well structured :-) E.g. we don't have >>> sub-tests and a way to specify which one to run so there is a single >>> flow when everything is being executed. I'd suggest to keep things as >>> simple as possibe (especially in the basic 'svm' test). >> In this case the differences between the tests is very tiny. One line on >> L2 and one line on L1 to check the exit status. I wondered whether it >> deserves to have separate test files for that. I did not intend to run >> the subtests separately nor to add many more subtests but rather saw all >> of them as a single basic test. More complex tests would be definitively >> separate. > > I would just leave this deeper kind of test to kvm-unit-tests and keep > selftests for API tests. So this would mean basically only keep (and > inline) the vmmcall test. OK this makes sense. I implemented those 3 basic tests as a proof of concept but this definitively overlaps with kvm-unit-tests coverage. I will focus on new tests and leverage the kselftest framework instead. Thanks Eric > > Paolo >