Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3624218ybl; Tue, 21 Jan 2020 04:18:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyM2sSQTh3dpBzTjojJS1F2Cu0WEGpopU1XMwgIuJ+Pd2I+o/qP6/uMCfO3fm9c4tNXUyV4 X-Received: by 2002:aca:d6c8:: with SMTP id n191mr2816697oig.103.1579609111592; Tue, 21 Jan 2020 04:18:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579609111; cv=none; d=google.com; s=arc-20160816; b=DW5huJoqjox5wPi0n01sbNUaj5om3kPca43izDO8VWFdQXYtpp11k32p9qAp5ltHt3 YNiZNfwFERTTANV91cGaqq2fB6mj1jDcUvdBbQu38cl4p1SI5fhTceE41w+4BxleXa81 l6Vl70N2gmGmjawTOph5jDPG+xwlMjl49j7Hmxb0Sxa9nzVLwXNUPmjfnr4q2LfjKhXj YT8T85cNqvaNPORtpA+nQ5MrkZRhXw5vnZvomSUaktI/7uzEeFwH1btIfgV/at3W8tf1 /DQw2LKsyhwTNvRhsxKBP/H5sllw7e1WqHsJNzOVsNNY7+E/uiTkCQ67rnCVbR4Kupkc 2cUw== 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=C9ocdms8YQdaluyA27aUHa1CM8I9Y3XHULzORwIWhX4=; b=OUXQrYLdWGkGtmPXwGdtR2fav00vmEAvBdVuW0ExYWiGEfzEF8orhUNMS0BfeipTWl 4y7WDbFycowClGAOUspeeu3aJQt/DHlpPOxQQWi73l7C7UhfKFS5J3qNPpu/KzeGMCs3 oUNP4uSP6XrOHjUmDsiQf+3h0LzVzb+bz2PpNxNo6w+1pLv0nT0ThyIdh7Bxsi9fvva3 DVXha41Fal56yAoulqby15xopK5wAD11yBAbw+yrhXR5Z7usBQ8EB4E7PqxKzctCH7xG 7C0Wp+/ze5E20WCofsHYy8ivzIWnP5BlI/ICNuDu8AIKZSbOHkk+G5frcdc7wcgR97df lHZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=csT5DPkB; 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 b145si19495351oii.67.2020.01.21.04.18.19; Tue, 21 Jan 2020 04:18:31 -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=csT5DPkB; 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 S1729211AbgAUMRU (ORCPT + 99 others); Tue, 21 Jan 2020 07:17:20 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56308 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727817AbgAUMRT (ORCPT ); Tue, 21 Jan 2020 07:17:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579609038; 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=C9ocdms8YQdaluyA27aUHa1CM8I9Y3XHULzORwIWhX4=; b=csT5DPkBfQOI1vRiQGYCf4hqOVec/OxEQKsuDD7Siz/QwMvlNY7Z5yXixfE87diev+DiZ7 hf+VdN+zPQFTTHBs+20sIBeQzer45Fcl9yeY24BJlVq1vl2wIlbU0K8z1i+HwvbFxvLT+w fTHKaA9OGZSPZ/9Z/fPBp/mdMAqev+I= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-DQ3FHtEWM0WJypjFkDOA2A-1; Tue, 21 Jan 2020 07:17:17 -0500 X-MC-Unique: DQ3FHtEWM0WJypjFkDOA2A-1 Received: by mail-wr1-f69.google.com with SMTP id c17so1227944wrp.10 for ; Tue, 21 Jan 2020 04:17:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=C9ocdms8YQdaluyA27aUHa1CM8I9Y3XHULzORwIWhX4=; b=m/otsfqe5cXA8rV8ah2o/IfT+P0djoy9+AT2GL4SE8JMqwlcYgM6uFDCOfRCGXKRX+ ebOAo3Vab3C9SBbts8hiWDikX7nZg6ScVbO7LK2ab7WXIrcJ/rr3N35b4Axhygy1kOWi EiHDVoFWL2vaUFqSt6UhUrIp9ivCX+YTsfci2IGyKVNkt1WtFRt+8h93G5uen26i/1R+ NWcsnph7+KrXKN0/HIOp9qxgi8ow5MJdCDDfpRaSybvkyZWwsoD+1VhJ8gA39TRQ7+m5 zBnp3YY3Pw+Qflt7KuIyio55pqdSBd6xAbl3W0GJLTUC/9XXI0yxQV2eOXjh1BymJLy5 JMBw== X-Gm-Message-State: APjAAAVDbRouqOj7sPhsCSEn39gVEQhhBDesNjB+26T1KMxp7nVQz2mR kcsPky78KoROVqdY3PG9jhHeJoT+IOxCkIORaW8Pwddkmi98tsj4BIG6wG8lWck14wkUiKBbJ0P GFqNz0mdhVutsE7gcI6dDCVrv X-Received: by 2002:a05:600c:210e:: with SMTP id u14mr4006436wml.28.1579609035979; Tue, 21 Jan 2020 04:17:15 -0800 (PST) X-Received: by 2002:a05:600c:210e:: with SMTP id u14mr4006409wml.28.1579609035662; Tue, 21 Jan 2020 04:17:15 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:b509:fc01:ee8a:ca8a? ([2001:b07:6468:f312:b509:fc01:ee8a:ca8a]) by smtp.gmail.com with ESMTPSA id j12sm53192472wrt.55.2020.01.21.04.17.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jan 2020 04:17:15 -0800 (PST) Subject: Re: [PATCH] selftests: KVM: AMD Nested SVM test infrastructure To: Auger Eric , 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: Paolo Bonzini Message-ID: Date: Tue, 21 Jan 2020 13:17:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Paolo