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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32B48C04FDE for ; Sat, 10 Dec 2022 01:48:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbiLJBsT (ORCPT ); Fri, 9 Dec 2022 20:48:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiLJBsR (ORCPT ); Fri, 9 Dec 2022 20:48:17 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39CF310545 for ; Fri, 9 Dec 2022 17:48:16 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so9959035pjs.4 for ; Fri, 09 Dec 2022 17:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=y+mZaxqrf16SOvU4T4amo68YYff+Aio6hmzF4Lq3mwk=; b=cPB1PRjIjqGXgaKo8CMFxdM4garoBeOIt12F0NkqM6Z58Pxof81vbzQCY3Nnhpi4ib CoRUuzTDKGWrQ/s1D5JZW+htpjp0EYoqufGG3ZiMU5e27xZA6tple3R6hJjKQf2KCcZu nGTxHHmw6CvIegvFKsg4CNaWPFUGWm0ANDZiybEuiVWPCGQ6ek2Q//9HjGCNEk29nTT8 pzW33RxmGYtrQVnXPs6+dIsvba55W0v/toW8ypWrNPYIXJqjvCevsqBU006hysNRGCY3 YQDPdvRv0+WkRBMs+prg0IbLHV/brZR/48Zvpt8e9/NhTwmp3bC0lANCvmzHAjyH2mti FKaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=y+mZaxqrf16SOvU4T4amo68YYff+Aio6hmzF4Lq3mwk=; b=dr9lqdroMKc9mRUHWx+IZUGMY+v3NYZLTpi7hzipIULr4dhT+3uVCcTA3XrS7PAbxR LpCrPlEq5k3x8JomWni65Q1l1o50Nhmb36l9tWbjCayDJkzyaYmTmRd9vyIE2VbMZpxf otEunG93J8ELy9rgM9i1oYFBAIw2AK4mYFCbVSML/27Lv6ZRrXE4RjeN3AfkNiUGNWsp px/5L8qMGQ8KFiNnN3tMul80brCIW5IdMZ+RM/jDcTmR/x7J5upmUEBvVfyHE0qe3jH1 TnYM1TGacR0++O78GHSwVOJ9O73nFcnoo30rgUCu/7M5O0ku9rzro4Gs8WmouezHgW4D nwxw== X-Gm-Message-State: ANoB5pnIHyVU6hFwnNffZsI2kHmnVaMbTDQGlx6OXEu3y0wAtTbz1BdJ oDo6xmwOtJis8nfHlxll4BYTZg== X-Google-Smtp-Source: AA0mqf4fMR39Ehk9JSfVhh0GjRlhI2XVjPC//spVAQ5AfeXItJD5XT7p+m66qSVhzJiA2L8HEoBuVA== X-Received: by 2002:a17:903:40cd:b0:189:858f:b5c0 with SMTP id t13-20020a17090340cd00b00189858fb5c0mr109490pld.0.1670636895607; Fri, 09 Dec 2022 17:48:15 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id o14-20020a170902d4ce00b0018999a3dd7esm1925340plg.28.2022.12.09.17.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 17:48:15 -0800 (PST) Date: Sat, 10 Dec 2022 01:48:11 +0000 From: Sean Christopherson To: David Matlack Cc: Vipin Sharma , pbonzini@redhat.com, vkuznets@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Patch v3 12/13] KVM: selftests: Make vCPU exit reason test assertion common. Message-ID: References: <20221205191430.2455108-1-vipinsh@google.com> <20221205191430.2455108-13-vipinsh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 09, 2022, David Matlack wrote: > On Mon, Dec 05, 2022 at 11:14:29AM -0800, Vipin Sharma wrote: > > Make ASSERT_EXIT_REASON() macro and replace all exit reason test assert > > statements with it. > > > > No functional changes intended. > > > > Suggested-by: David Matlack > > Signed-off-by: Vipin Sharma > > Reviewed-by: David Matlack > > > --- > > .../testing/selftests/kvm/aarch64/psci_test.c | 4 +-- > > .../testing/selftests/kvm/include/test_util.h | 10 ++++++++ > [...] > > .../selftests/kvm/x86_64/xapic_ipi_test.c | 6 +---- > > .../selftests/kvm/x86_64/xen_shinfo_test.c | 7 +----- > > .../selftests/kvm/x86_64/xen_vmcall_test.c | 5 +--- > > 44 files changed, 71 insertions(+), 293 deletions(-) > > Nice diff stat :) I like the diffstat too, but I think we need a slightly different name for the macro. "EXIT_REASON" can be interpreted as "hardware exit reason" or "KVM exit (to userspace) reason". Most usage will be fairly obvious, but I'd like to avoid confusion when swapping between selftests and KVM-unit-tests (which often asserts on the hardware exit reason). The name will be a bit longer, but I don't think line length with ever be a problem. And most people will just copy+paste so finger fatigue likeliy won't be an issue either. I also vote to prefix it with TEST, i.e. TEST_ASSERT_KVM_EXIT_REASON(), for consistency and to make it very clear it's a TEST_ASSERT() wrapper. ASSERT_EQ() makes me twitch every time I see it. This is definitely a personal preference (or problem) I can survive with though :-)