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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3BE2C001DB for ; Fri, 4 Aug 2023 17:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fNeOVkWya1S1vg9fUq+ca4Z+ajCVhpZRG6yHz5IYVgY=; b=nF3+bfY5VkxbE/gZb10MvpDkqR pNbWoip6x8VuT/jEknXyQ9x35ifmYIHpC5EiytChgyGJG6+NY8g/JBIKrsKikcJuLAs6oLs1uIVQa H8+6JjWIdxTziIoq93RoKVCnSoihSJUaz8sZTbJtUMcARr9kLX0N1A5uMIWNjzAo6MawMRTtDthGr HSNUb/ihz1Jiko88JRJR/pZRTIS5BSQdo0LJ+IW69mU6uIPDfSnnkmVGhkWHiygryCu/jzQyoGKCV g5KeDqENcIX5iYcsj2KZhh0CLSSuC1WvM+nAvDy/bkMMYM54bP0RV+sZ3uZAue1iBXW/k0KH1Ekoo Ig+ZrXwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRya3-00Cto4-1x; Fri, 04 Aug 2023 17:27:15 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRya1-00CtmZ-2T for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2023 17:27:15 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-57320c10635so25877287b3.3 for ; Fri, 04 Aug 2023 10:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691170029; x=1691774829; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=0XNCE0THmMSplRGDYFiIYwKZfHJYXKQUWjyM6yzp218=; b=ioU7Xhc/g9qgs9gG71lCacbcGZecZKnk09it5Wjzn2tVrX3fgSS2tCjX0UJGYNzPJl eXFA165dQDgVzSZPWS4dcgb+pPYBrcGh026AEPvE4uNbDgNrYZqkNSkaPZKHcTUKmwBm dxsmh7ephRFh1G8wQbMJXhfximF2cj4DhGKNHDjqaT8r9l6r0sL1PI0zouj9bI3atq/d IJ/yKmmEQrpgHKveDl5xLOedKR4ibfnJ5dvcOMP6fyU5qYsTyKBHRxxsn9JabxZo6zog RWwC/HqKx9pD1TcDTr3AH+U/YQ8ltr1Mrt0ZsbH+vNJ84ZndKhmF1NaKGmBGEAxeCDzw LOUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691170029; x=1691774829; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0XNCE0THmMSplRGDYFiIYwKZfHJYXKQUWjyM6yzp218=; b=gHZX054rii15owWOgPj+ZQacp/KCFa+LMt4hU6PckxieFndzdq0ZWFy7cCU+SPanTT zgj48t+mD/mFUA0DPQqrnSCAvSkiehz8hcALXG8IyeMYpagZCuPxCkUOk4QDZmD6f+Xx 4hIblfRzQCVYo73qhoaCb07Rk9zVRqT2F4py6UqgaYAvqw9GbjVQV2yxyk/824Be6GQi def1JBGJfRloEJG2WaLh9cy0ugoBJzuuLSA1R/MevoEIOW5bzkatXb8jhWqW3yQxxqkN O0wVcK6IT9e/tGxve3/SF7TZNq1IiXTNsJaQ2XM8ZJBa0ERlq/SNrDfVwRIVdgIfDCAa EDYQ== X-Gm-Message-State: AOJu0YzNGt4sJdwSwZgvXnInShmURM7sLaS5GaF9dDxKh3vOYwRYtIiV 0EDjCEIBdYukbV29HpJlcPRMaJ4yc4w= X-Google-Smtp-Source: AGHT+IHY1jyESYvdqjtEUOWN5kpmBlG2/bzs9/bKSXZUMXovofE5m64qKwapLGFKQLq4x4vgTmvsT5rlOJ0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:ef12:0:b0:583:491b:53d3 with SMTP id o18-20020a81ef12000000b00583491b53d3mr15983ywm.9.1691170029578; Fri, 04 Aug 2023 10:27:09 -0700 (PDT) Date: Fri, 4 Aug 2023 10:27:07 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230804004226.1984505-1-seanjc@google.com> <20230804004226.1984505-3-seanjc@google.com> Message-ID: Subject: Re: [PATCH 2/4] KVM: selftests: Add helper macros for ioctl()s that return file descriptors From: Sean Christopherson To: Oliver Upton Cc: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Michal Luczaj X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230804_102713_801398_E08FE7AB X-CRM114-Status: GOOD ( 14.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 04, 2023, Oliver Upton wrote: > Hi Sean, > > On Thu, Aug 03, 2023 at 05:42:24PM -0700, Sean Christopherson wrote: > > Add KVM, VM, and vCPU scoped helpers for ioctl()s that return file > > descriptors, i.e. deduplicate code for asserting success on ioctls() for > > which a positive return value, not just zero, is considered success. > > > > Signed-off-by: Sean Christopherson > > I appreciate the desire to eliminate duplicate code, but I think the > naming just muddies the waters. TBH, when I first read the diff w/o the > changelog, I thought you were describing the input fd (i.e. 'kvm_fd', > 'vm_fd', 'vcpu_fd'). I don't think explicitly spelling out the condition > each time (i.e. ret >= 0) is all that difficult. Yeah, but it's not just a desire to dedup code, I also am trying to funnel as many "ioctl() succeeded" asserts as possible into common code so that they naturally benefit from things like patch 4 (detecting dead/bugged VMs). I agree the naming sucks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel