Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1172807rbb; Mon, 26 Feb 2024 00:33:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU6XyFZLJTXQjpNiVuf7VECM+1dkPRDOwrj3HyHvqWq83OWoKMfWkDhjBFIgJFknoc2shpY4dK9cMrPyrxWr8XMQNGtI2IKrFIPHkcWvw== X-Google-Smtp-Source: AGHT+IHwj9zap47f6wFhEYFN2uLs3gEn8ISgqXfGQENea3cn57qI7paOkLUOz2lRdZ1KDHX+nhUw X-Received: by 2002:aa7:8a4f:0:b0:6e4:5e48:178b with SMTP id n15-20020aa78a4f000000b006e45e48178bmr4407005pfa.19.1708936386813; Mon, 26 Feb 2024 00:33:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708936386; cv=pass; d=google.com; s=arc-20160816; b=WqIc0elBzFht77zlFvMYBu+9mW/dwdLJG0MBHW5/c1vSXk5jsos6NvkrtAG1GO5S8Z tbwrbW5SXpZa2Ka0s7vJQikd7epFRBHDkUxlXySzQl1wi9ouG1OoPbKMcAY2SJj5Vx7q D/LNLoE60kVyVFgZvSA54c7874rMjNl7h3iw6O22lwW+9L4hUaGpuDWK4ZC0cMXxKpzD 2jpDmLr3PW6EtUib7wVmDzeLZ+j2oXMh/tLqHtAqQd9WS43q48TEgDzyvfYT+M7HBY30 6ohjanUKm48RVirxGK2mkFvihqsLeVndtqIqiRBmrpen8uT+XCQ9zeJPb5yZ00fLCgpL taCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+lTCEDjLxWwZQVsweEK+X7JAtYAVgLoCLPYpRbtJZK8=; fh=Itbyk7CEvizIrzGEESCqq3I2tZgG1kc/GkVOa3S7Hsg=; b=XQP+hXi+VhzgKHAau4PAPxfyIfj6aeEyjLpp+Q7aW6asJNBt3pY5yFOGdaDD0pLwQE wowRQcUjp3ij5bZfd3fb2laPtPSOG7ya+M+GF/Y1C5jz54IbcrD7f+cEyalnIgxbiJev 0mgS0qb01NXlpT+izRQmIJs6eVFPZdKLdkk7XwyCw0gt2lg42jv+o/G08SnGaMu0vhjd UmVEitG3hyzfqlpRY5ZdJ2/muqF4IwTiBjrJGqI+AzUue2cMspZzA5YmqudnOx0mGyMn iLQFsq5m/gsh1h9+xxos/VSsswZRwldXLFTIVYAQCGMirVuO5RiR/ywvLV+VeJdEPurG wygw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IDx2P+CM; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-80776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j73-20020a638b4c000000b00565db2812a0si3406843pge.60.2024.02.26.00.33.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 00:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IDx2P+CM; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-80776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80776-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 824EB280D56 for ; Mon, 26 Feb 2024 08:33:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C5205339A; Mon, 26 Feb 2024 08:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IDx2P+CM" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 3C93A4F8A0; Mon, 26 Feb 2024 08:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936069; cv=none; b=dSqOeekH0NEBwzgZOKN4coGrYUFSB1k2fRXKU+88KopL6y2ykgVPV8GJUVAoq9ZswQ+0wxcsUuNe4+yFmtIl1IEh39OVvDB+cK9y/D6j+naWCboMBzijx1HTJxIeK2ICjWb9FbVs0SajJj9mEcJkxiXbE1HN7FD2+4Sq3Pv9kpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936069; c=relaxed/simple; bh=yEg4v544YC7e+UFPcUmTBeIBNiztK9idn0tOEopCeIQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RO8fhbNt8HbNSiAxWg8n3kylaNFvAuTD2V1rnRG7HWpzYdoOwtQf+6glab7e1vxfs1YHLjL+Kp3FIICltAYwZO5MPBfn86IJomtRMirm5cZyziBcFwYV0eFU4dXcYHyh0/XNVA7HhmBHWngpaYhHny1eOrNP8OU3BSJkt3tkFgw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IDx2P+CM; arc=none smtp.client-ip=192.198.163.7 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=1708936067; x=1740472067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yEg4v544YC7e+UFPcUmTBeIBNiztK9idn0tOEopCeIQ=; b=IDx2P+CMzhL++faYjGDve/xKCONFD+CCHyUyPO+Jh+lhNV/Z0Ey5CmwU QhZDfTe7TgjTin7CWgOjc0k7Gn9gWqsRZV2eBQcqV/6ZuzRBmHuzWv+yl oePP2kAzD6idPWo2OX0LhduJARg5SoDS5CwsdYgw2C7GntHxlLA1oWYvZ g2GUwaOX9nfPje50nI86tMs5FPxJ82ae/K5GX2YsyeYRop9tXMhukE6+G z1wDQhq84wOZa/OrzSgIQh1CGmdCDolbO8UKO9EZPcRBezHgDdj9G76aq QFGGa0ltqNQRf285gFeUSfhNX86fSPdAgAejIC5nHqBz+jkqMsHq8b71f g==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="28631491" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="28631491" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:27:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="6474342" Received: from ls.sc.intel.com (HELO localhost) ([172.25.112.31]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:27:42 -0800 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , Kai Huang , chen.bo@intel.com, hang.yuan@intel.com, tina.zhang@intel.com Subject: [PATCH v19 015/130] KVM: Document KVM_MEMORY_MAPPING ioctl Date: Mon, 26 Feb 2024 00:25:17 -0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Isaku Yamahata Adds documentation of KVM_MEMORY_MAPPING ioctl. Signed-off-by: Isaku Yamahata --- v19: - newly added --- Documentation/virt/kvm/api.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 3ec0b7a455a0..667dc58f7d2f 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -6323,6 +6323,34 @@ a single guest_memfd file, but the bound ranges must not overlap). See KVM_SET_USER_MEMORY_REGION2 for additional details. +4.143 KVM_MEMORY_MAPPING +------------------------ + +:Capability: KVM_CAP_MEMORY_MAPPING +:Architectures: none +:Type: vcpu ioctl +:Parameters: struct kvm_memory_mapping(in/out) +:Returns: 0 on success, <0 on error + +KVM_MEMORY_MAPPING populates guest memory without running vcpu. + +:: + + struct kvm_memory_mapping { + __u64 base_gfn; + __u64 nr_pages; + __u64 flags; + __u64 source; + }; + +KVM_MEMORY_MAPPING populates guest memory in the underlying mapping. If source +is not zero and it's supported (it depends on underlying technology), the guest +memory content is populated with the source. If nr_pages is large, it may +return -EAGAIN and the values (base_gfn and nr_pages. source if not zero) are +updated to point the remaining range. + +The "flags" field is reserved for future extensions and must be '0'. + 5. The kvm_run structure ======================== -- 2.25.1