Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3597063ybl; Tue, 21 Jan 2020 03:48:29 -0800 (PST) X-Google-Smtp-Source: APXvYqyrFtL0yZQM/k8DTdqv2kAPYlXiztDORCpJwl/JQd3MeXeasnBWMl369AxltQ5PW9Hrsc1T X-Received: by 2002:a9d:6745:: with SMTP id w5mr3289157otm.52.1579607309488; Tue, 21 Jan 2020 03:48:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579607309; cv=none; d=google.com; s=arc-20160816; b=CHZNSKHcl62kNULLBJ1yuRGuHIkneUT/84g8ZxfmYrQUtf7REKz+oz2hUx/Mzczbqg miGBGftwAwqEhN0GDJYF6RCTwZWetHNQ3uzsZtkA8KPSQXGxMf+5hFlNQdEcskHuQQbr DrPlChbUdoBgCmArG3f99CafvlIkY5v6eQlncjPfbqX0qVHK8H6s/yQfgvDZB346C80B Hvl0CXjUuY0uqSyqpZ2jvWcBeIxLaDkgzhjLBkALv1NDLATaa5xSNfBK7AS0XESoSLLH Bpzrbxd8LMopjOiosqCD9x1EA/3jAqRayzN9eW5JO/b/c8/rzrTn/QT9ZqAbh46arXYb jGyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=uX1VzSMfdN4ap89a7gOpBGNu3Gszqn3pc1p3J0UV56o=; b=IcdllpPs/w00k3XwQNUcP5mjTFckiBnOePNLQUNSRAGHel5zwhHHDRkRIinLtvD1AP 1vpKI9Rou6Xcyjpb3K/9BqJ2MAZpEkFZSevrvTpNku1xNwOPAm5WnsM9ajKk9RcK7pR0 bCchVsSTYOQz2kS1tfUEfw0xpBvSBxd5TmveKViVLZ6/94p+HOLx51icJhUVwJL4VePE EKEK/TvPq7J5PAtapm91fWYnmNFf0Kcvb4q4bNFwldbecIoVxBlCuGZ2U2k2g78uoEbO +z5t1ljUbCteJ4oqAWwOqrok1zoXyW1LzRVmutL0zy+5hO1fmumO5rWfeVd3DzRy02tI DcQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d0l6JDBg; 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 v9si18962181ote.229.2020.01.21.03.48.17; Tue, 21 Jan 2020 03:48:29 -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=d0l6JDBg; 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 S1728831AbgAULrF (ORCPT + 99 others); Tue, 21 Jan 2020 06:47:05 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:25978 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726052AbgAULrF (ORCPT ); Tue, 21 Jan 2020 06:47:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579607224; 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: in-reply-to:in-reply-to:references:references; bh=uX1VzSMfdN4ap89a7gOpBGNu3Gszqn3pc1p3J0UV56o=; b=d0l6JDBgm41wlXtswPD/hUVioPwMlMgs2onIl0ymmkC1s8QT4zeUYW1bFPfrCSB6YSqooS 4owTxM4/v+IH6gEFU4uje33ZM1b89opxZG6AwWa9Vrwh7N8akvEQ2YjyvPcMJLpHhoks8G TAh9T0fWR1Tgqfxsb2S29vlu38moZCQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-371-_Nht7sUyPlmHvSzXTXm4tA-1; Tue, 21 Jan 2020 06:47:00 -0500 X-MC-Unique: _Nht7sUyPlmHvSzXTXm4tA-1 Received: by mail-wr1-f71.google.com with SMTP id r2so1195502wrp.7 for ; Tue, 21 Jan 2020 03:47:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=uX1VzSMfdN4ap89a7gOpBGNu3Gszqn3pc1p3J0UV56o=; b=pN82dzwBzlFLD9ea/WzF7SPRw/1rOH++ibXFdGo1bY30FivXmvc+fXDTXpuntD2H3E 3NDzJYJk98vrqcAdpj0342FK6S58lUm4co4QZzCxMfbJ0C3kwDFxu739NTVo+fLMUSSD hHQvq7Yi1PMjllIfUjEIFYENl/kRPA6XKzzkQuqTDkutde0R0SmFvdQxkk9i7CDRDmmM m5kejbQgqpty/m7gLoSGRNMQbjA08OogJiDQ2Kv00ZA3nMEpkbmA51GLz8uFLAbrHcRS viPEG5nQWZGJk1qF/nLz1jzxxJUF/w4mSsr44f3BuBZ9oEhWO3Sd6qIbS6EGthrnivDf EF3A== X-Gm-Message-State: APjAAAXOEakK8330cH0LLRLj1vIeGem/POG60NIDHt7YCC6kYFgA3gzr zubrn31TRkr4tA106FQz4BtsJ7XbaGDf/muC+3cM3cOJi3jVut9ZNbWVSb2/xy2uh2bGlxGGLjF mg1/IYAwHauFkuy/Dubp6698x X-Received: by 2002:a7b:cd11:: with SMTP id f17mr3920169wmj.48.1579607219492; Tue, 21 Jan 2020 03:46:59 -0800 (PST) X-Received: by 2002:a7b:cd11:: with SMTP id f17mr3920145wmj.48.1579607219287; Tue, 21 Jan 2020 03:46:59 -0800 (PST) Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id b21sm3865365wmd.37.2020.01.21.03.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 03:46:58 -0800 (PST) From: Vitaly Kuznetsov To: Auger Eric Cc: thuth@redhat.com, drjones@redhat.com, eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com Subject: Re: [PATCH] selftests: KVM: AMD Nested SVM test infrastructure In-Reply-To: References: <20200117173753.21434-1-eric.auger@redhat.com> <87pnfeflgb.fsf@vitty.brq.redhat.com> Date: Tue, 21 Jan 2020 12:46:57 +0100 Message-ID: <877e1lf2vi.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Auger Eric writes: > Hi Vitaly, > > On 1/20/20 11:53 AM, Vitaly Kuznetsov wrote: >> Eric Auger writes: >> ... >>> + >>> +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. > > But if the consensus is to keep each tests separate, I will do. > No, I wasn't asking for that, it's just that the 'tests' array looks like we're going to add more and more here (like we do in kvm-unit-tests). If it's not the case you can probably simplify the code by executing these three checks consequently without defining any 'sub-test' stuctures (like we do for other selftests). But I don't have a strong opinion on this so we can keep things the way they are. -- Vitaly