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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A60A6C43381 for ; Thu, 28 Mar 2019 16:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 701FF2082F for ; Thu, 28 Mar 2019 16:31:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rblwavdd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727648AbfC1QbK (ORCPT ); Thu, 28 Mar 2019 12:31:10 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53916 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbfC1QbH (ORCPT ); Thu, 28 Mar 2019 12:31:07 -0400 Received: by mail-wm1-f68.google.com with SMTP id q16so4252775wmj.3; Thu, 28 Mar 2019 09:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=iiCevEMImsZgRqC+/6iVwE8y+Po1ZvYFlUVr8KtDGxs=; b=rblwavdd+smcxhNbM72fPuiwNqoZedqcVfC7Og2a88aHsT9PYGCmy00fG5Hmgwz+1/ B6FBXJCabhxSV7K8dl9a+kuOulz9n0Svm1sJjK3Fbm5uOT1xb4OoHRUSR4mxLhbUv0vz 4yyGSnwpDdKDFn/12jGFLosYTVyU/ZdAbK/grb76cQGvZGRVQfwVUhRRx00BULAaxzUW s6iF03ANAbdz/z7/A6SUBzGdZkOby54IkqmD5vcD/pw/LTtAshug8Qfp1Ol3zUJoo/Nf Effk04MA4tS8dkmNDjr9jkyrfDbqIv4TLgqc9Ij+RtnKjmp5Cx4DEiKEC79mYqaDZrZ0 FEAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=iiCevEMImsZgRqC+/6iVwE8y+Po1ZvYFlUVr8KtDGxs=; b=jLI29c9iRrgh4nnEB/HOxLJNbZFbxCITjULcs2jilJAI/NAXGWbvVVTGCYRXyhwmg9 zbAT6n8JIarvgrHJzPN++2avzzX8f+iHm6soo0dfh+7hdV5dZ+KA7yJj1ezUGNcuR40b OKgYY06NOBbgW1iDoa3XAbfmZK0/fK5DQFyBFHyzpC6VIPHsQ6qF9foaz5JZ+TT8Q4sN BQMwX/C8bA4hX4dXlrV3YgsbOomWlVgJ6Sf9oOhEy/rdBHOGscjnPoVFvt4XzGHBKKY8 1Amw0X4WgmA5fhMUGxKxmMVK8BNxfUI3r2ztztx+/fR/Mi9CM1cjbKYnyU69eHD6f3gS +fLQ== X-Gm-Message-State: APjAAAUWw2Vw9Ah80jVKBX5t3hoW9AT7hDiqGC6gOuugZOUSDpGDFhrB j7Qb86ZJjLQug/ZbLWmwrHCqaLWr X-Google-Smtp-Source: APXvYqzVha+tuscNauT562UaYczH8rZOZw5Q9wllC0hxqjUfg9A9S99LuRr/bchNcpbFH8LChDLAtg== X-Received: by 2002:a7b:cf18:: with SMTP id l24mr539788wmg.132.1553790665672; Thu, 28 Mar 2019 09:31:05 -0700 (PDT) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id a11sm2967165wrx.5.2019.03.28.09.31.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 09:31:05 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: npmccalum@redhat.com Subject: [PATCH] Documentation: kvm: clarify KVM_SET_USER_MEMORY_REGION Date: Thu, 28 Mar 2019 17:31:02 +0100 Message-Id: <1553790662-35327-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The documentation does not mention how to delete a slot, add the information. Reported-by: Nathaniel McCallum Signed-off-by: Paolo Bonzini --- Documentation/virtual/kvm/api.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index f39969d0121e..67068c47c591 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -1114,14 +1114,12 @@ struct kvm_userspace_memory_region { #define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) #define KVM_MEM_READONLY (1UL << 1) -This ioctl allows the user to create or modify a guest physical memory -slot. When changing an existing slot, it may be moved in the guest -physical memory space, or its flags may be modified. It may not be -resized. Slots may not overlap in guest physical address space. -Bits 0-15 of "slot" specifies the slot id and this value should be -less than the maximum number of user memory slots supported per VM. -The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS, -if this capability is supported by the architecture. +This ioctl allows the user to create, modify or delete a guest physical +memory slot. Bits 0-15 of "slot" specify the slot id and this value +should be less than the maximum number of user memory slots supported per +VM. The maximum allowed slots can be queried using KVM_CAP_NR_MEMSLOTS, +if this capability is supported by the architecture. Slots may not +overlap in guest physical address space. If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of "slot" specifies the address space which is being modified. They must be @@ -1130,6 +1128,10 @@ KVM_CAP_MULTI_ADDRESS_SPACE capability. Slots in separate address spaces are unrelated; the restriction on overlapping slots only applies within each address space. +Deleting a slot is done by passing zero for memory_size. When changing +an existing slot, it may be moved in the guest physical memory space, +or its flags may be modified, but it may not be resized. + Memory for the region is taken starting at the address denoted by the field userspace_addr, which must point at user addressable memory for the entire memory slot size. Any object may back this memory, including -- 1.8.3.1