From patchwork Fri Aug 4 00:42:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13341035 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 3B6B9C001DF for ; Fri, 4 Aug 2023 00:43:42 +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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID :Mime-Version:Date:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8YA12p8ReGGt8gSov1978ZpM/iEKfJ7gQhNYf7vsF5c=; b=niT4hM/LJOo49A H3p13WYR3X1Oi7hPNxeB18ofaG+7UCCWoa5HayzVz/WDFfkG7AHg5xkf3sZSejV7TnLvGeUHZqPMn oyalx7fat0VQ7DHzEsY9q7quoDUEduaJTWsz7sm4haOmG2j+jFJ8UOGSqyePywXd64LYeCeg6ybfE kzQlDj/OMr/bwCBMEtUfQY28fHu/JM2641rWCO5e+Iw2nXE+d5qTHw1Mj/qcWE35sJbroEXkVm1yi nu1RjL8QzcwqM2uSgUgsQ3qjnbm6s4imnKivYgZTLtEd4oW783+YRRQhA0dlHMfNNgKH74hLEef5Q by1CQDDGGXyHIbNdxd4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRitp-00BBRd-1Y; Fri, 04 Aug 2023 00:42:37 +0000 Received: from mail-pg1-x54a.google.com ([2607:f8b0:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRitm-00BBPy-1L for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2023 00:42:35 +0000 Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-55c7bb27977so1293941a12.0 for ; Thu, 03 Aug 2023 17:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691109748; x=1691714548; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=vujMrPLoi5NFJy2gDTZldPvTGUeu9cCAa9LViNvzt/o=; b=XpCFpMvQd4gQvh5gquWQ2ZftAaXrBB47AdVh0lLXrYmERl4lD3tY2Oi2S5FLElr5kD criOJo8gVbtB4NFndShfIfXdRyq3hnbrsejCWk0QGXOzcK75QYhrXoPTI3JLxnKLsYtr twzk19agPK7WenGVGKqUaiqYW963b5aEsEAadUrL+1G5/6aeheEHuC3KoixXoqFlgZ+n LhOpmawTNHJuzxuxo5tH1UygVMDE5unyPCqT25hnvArOLk7TdoaMyK24G/6Zhd53jdxM l2h2/SNBHXg1gLP1ignbuQE8H/XS+yIxT8uRZbkocTzCvQ/YWzcy4KoPpD4d/xyARQj8 h03g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691109748; x=1691714548; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vujMrPLoi5NFJy2gDTZldPvTGUeu9cCAa9LViNvzt/o=; b=MskqOvJaAZEGaqwpRTEkYAEHMzqVn3LW6SNrlpHHQNh6ic5KBctG0qdBOOZDsm4taA QNQTR/WqG1Mm13sm3QyFx7itcMv/O04R0+QaDlJcRBKkcIUJqrLxwOhJjy4Fh4zqO30i Q2KQcpetNgjXZ6k82KGoUyJMP3dQUZjypVEwPftcNwW13v4QxuSit+A5syl/QpyGLSrm BQF9WVDw04GTp3aoifUL+vNNRCw4u9tKFn03uQ1tiLsJiwWSQCnGTNPSMfIvblq5O+7U 60UOTWFKR3O1u0EbJROLr+qkMhGAvf7KcnP+fBBtrYNGJA3vnjGC1HiEkygea9w2wgOi V4QQ== X-Gm-Message-State: AOJu0Ywq5ICIj3swxKbzgDlizfoHnAYmIgtgytcfTIGLrNeqh9Y+8/LH 3ML+tsTK4osPbJuJXvdwQ0sAhaGdbUQ= X-Google-Smtp-Source: AGHT+IEQjsVrWEka9KrysAVqongS+7aQWrT2bXGIhy4ffbBau7Yhoew+SCgRy4QDDK8SjLRgYnzvVZ01CJk= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:2349:b0:1bc:4c3d:eb08 with SMTP id c9-20020a170903234900b001bc4c3deb08mr1147plh.8.1691109748457; Thu, 03 Aug 2023 17:42:28 -0700 (PDT) Date: Thu, 3 Aug 2023 17:42:22 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230804004226.1984505-1-seanjc@google.com> Subject: [PATCH 0/4] KVM: selftests: ioctl() macro cleanups From: Sean Christopherson To: Marc Zyngier , Oliver Upton Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Sean Christopherson , Michal Luczaj X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_174234_454978_04E65548 X-CRM114-Status: GOOD ( 11.10 ) 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: , Reply-To: Sean Christopherson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Do some minor housekeeping on the ioctl() macros, and then teach them to detect and report when an ioctl() unexpectedly fails because KVM has killed and/or bugged the VM. Note, I'm 50/50 on whether or not the ARM patch is worthwhile, though I spent a stupid amount of time on it (don't ask), so darn it I'm at least posting it. Oh, and the To: will probably show up funky, but I'd like to take this through kvm-x86/selftests, not the ARM tree. Thanks! Sean Christopherson (4): KVM: selftests: Drop the single-underscore ioctl() helpers KVM: selftests: Add helper macros for ioctl()s that return file descriptors KVM: selftests: Use asserting kvm_ioctl() macros when getting ARM page sizes KVM: selftests: Add logic to detect if ioctl() failed because VM was killed .../selftests/kvm/include/kvm_util_base.h | 101 ++++++++++++------ .../selftests/kvm/lib/aarch64/processor.c | 18 ++-- tools/testing/selftests/kvm/lib/kvm_util.c | 17 +-- 3 files changed, 84 insertions(+), 52 deletions(-) base-commit: 240f736891887939571854bd6d734b6c9291f22e