Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp37852rdb; Fri, 5 Jan 2024 01:46:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyt6ETCkRMPmuvbM+LSPogoT7eW2OcxkMkWt47c8r6t8di6Ai6m8MBLK0R8JOTBH9QQbhn X-Received: by 2002:a05:6512:3d05:b0:50e:7b9e:359c with SMTP id d5-20020a0565123d0500b0050e7b9e359cmr1086330lfv.29.1704447960897; Fri, 05 Jan 2024 01:46:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704447960; cv=none; d=google.com; s=arc-20160816; b=0GQbZcSJhQWos7nFY/8MYvsI+kk9Y4E824kpRUIsdcnjQ4obXNHAxdsZ5fuG5pklLH 7BxmFoI2uh2U1XGUMdDmyka++nSBvAF4FI4dVX5TgPIfemJ5tbPDFKAWFkJQeqPdCfe7 b+8PSFowD17cmd51UwpecZyCAK0O/534d7/7oNLx9fvHzH81vXhdLzZsiRKNqbXRvuTG LC+mISDslZRfYyw3Re0M3m1Rgw68nJwdJbWoE0qkj22tdD7Eva3T5JNZ/l+iOicHxpC7 sV1vqxPi/1U7gJgv6bf4W3WPy8HdtpjT9g1X7SWeYUj5wfDLDyKfDCzGMsw9BLAG3vZF aUZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=szf+rwTJHrFVbPVxjfEiR3qSFR2jeAJjGD32sAPWQKk=; fh=7+Mp40O15i8480Y3Lx1xUfrNoWlx4dq3oRO8LaTgnuQ=; b=K5hRY6NW+LcYO1Llcd1N+je/4t7+xyIGyxhuE880CdO3zZWyvpJ/htDOsbLrCcmSKv 7ZJhCQV+xcxagmY5VevTSKATW7vAVOyPxgjJtWCfceC2h+zs4mJHtWaB5ojP0CKlbQBz YcEoEOnISOathV8etTJauivusdC91Bm7bJgp2Kj6OpFLlz6qa6bH0e16TeVImGBkwzbu bgkiwKjhVXAL/erpIwdEUbTkeiuHyGtJYhAeo9dAgCikydzvTmWWWF7oMO5T8nlZCgjz Fo8SeHxz5FNM0JR3ykyq00p/+9lKg/xyGZLlLNJAJf4SQu3HbuF+NR+0aBYDDGc6Nsh8 BHGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fnuyo02r; spf=pass (google.com: domain of linux-kernel+bounces-17682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f22-20020a50d556000000b00554c82eabe5si478201edj.481.2024.01.05.01.46.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 01:46:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fnuyo02r; spf=pass (google.com: domain of linux-kernel+bounces-17682-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DD5531F23D6B for ; Fri, 5 Jan 2024 09:45:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA42E24B35; Fri, 5 Jan 2024 09:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fnuyo02r" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8FE8249E9; Fri, 5 Jan 2024 09:45:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704447943; x=1735983943; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Ipngyt99PQBot25YTtxsZ8y9PD4Q1alyU7StkGQNfLY=; b=fnuyo02rSKwwPWrsZFROs7v/XHn9dr5YDWhie/bbv5+7sNUQx1Kx9e6t 3pLdO95MBos9DmdsTw9bWomhj2XsM4LXWvOp4ESTBClk0nPmgXyZEmYVB WsqbHUHC5qjLzn4RJAjG/+1rFx6kjrqfKp2cafqu797EewAd5/VZQ0bHH CdVekDRYa96g6968LeqNeZEdIBIWn9vizSVeuNERsZEECkbH5rNvkhax+ 98yPQ0dNV7CPZe/p9plKBOir7VhYDbSlHeSkll9bjjLr1wChGshvdFwYh /t3CV6Oxx1nD7ok1wy4E0WJqIweTnd3o1nmexXLUkHq/89ACpKIAPKsFt w==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="10959501" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="10959501" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 01:45:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="784158335" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="784158335" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 01:45:36 -0800 From: Yan Zhao To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: pbonzini@redhat.com, seanjc@google.com, olvaffe@gmail.com, kevin.tian@intel.com, zhiyuan.lv@intel.com, zhenyu.z.wang@intel.com, yongwei.ma@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, gurchetansingh@chromium.org, kraxel@redhat.com, zzyiwei@google.com, ankita@nvidia.com, jgg@nvidia.com, alex.williamson@redhat.com, maz@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, Yan Zhao Subject: [PATCH 4/4] KVM: selftests: Set KVM_MEM_NON_COHERENT_DMA as a supported memslot flag Date: Fri, 5 Jan 2024 17:16:24 +0800 Message-Id: <20240105091624.24822-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240105091237.24577-1-yan.y.zhao@intel.com> References: <20240105091237.24577-1-yan.y.zhao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Update test_invalid_memory_region_flags() to treat KVM_MEM_NON_COHERENT_DMA as a supported memslot flag. Signed-off-by: Yan Zhao --- tools/testing/selftests/kvm/set_memory_region_test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/kvm/set_memory_region_test.c b/tools/testing/selftests/kvm/set_memory_region_test.c index 075b80dbe237..2d6f961734db 100644 --- a/tools/testing/selftests/kvm/set_memory_region_test.c +++ b/tools/testing/selftests/kvm/set_memory_region_test.c @@ -335,6 +335,9 @@ static void test_invalid_memory_region_flags(void) #if defined __aarch64__ || defined __x86_64__ supported_flags |= KVM_MEM_READONLY; + + if (kvm_has_cap(KVM_CAP_USER_CONFIGURE_NONCOHERENT_DMA)) + supported_flags |= KVM_MEM_NON_COHERENT_DMA; #endif #ifdef __x86_64__ -- 2.17.1