2020-08-19 21:21:25

by Connor Kuehl

[permalink] [raw]
Subject: [PATCH] docs: kvm: fix referenced ioctl symbol

The actual symbol that is exported and usable is
'KVM_MEMORY_ENCRYPT_OP', not 'KVM_MEM_ENCRYPT_OP'

$ git grep -l KVM_MEM_ENCRYPT_OP
Documentation/virt/kvm/amd-memory-encryption.rst

$ git grep -l KVM_MEMORY_ENCRYPT_OP
Documentation/virt/kvm/api.rst
arch/x86/kvm/x86.c
include/uapi/linux/kvm.h
tools/include/uapi/linux/kvm.h

While we're in there, update the KVM API category for
KVM_MEMORY_ENCRYPT_OP. It is called on a VM file descriptor.

Signed-off-by: Connor Kuehl <[email protected]>
---
Documentation/virt/kvm/amd-memory-encryption.rst | 6 +++---
Documentation/virt/kvm/api.rst | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/virt/kvm/amd-memory-encryption.rst b/Documentation/virt/kvm/amd-memory-encryption.rst
index 2d44388438cc..09a8f2a34e39 100644
--- a/Documentation/virt/kvm/amd-memory-encryption.rst
+++ b/Documentation/virt/kvm/amd-memory-encryption.rst
@@ -53,11 +53,11 @@ key management interface to perform common hypervisor activities such as
encrypting bootstrap code, snapshot, migrating and debugging the guest. For more
information, see the SEV Key Management spec [api-spec]_

-The main ioctl to access SEV is KVM_MEM_ENCRYPT_OP. If the argument
-to KVM_MEM_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled
+The main ioctl to access SEV is KVM_MEMORY_ENCRYPT_OP. If the argument
+to KVM_MEMORY_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled
and ``ENOTTY` if it is disabled (on some older versions of Linux,
the ioctl runs normally even with a NULL argument, and therefore will
-likely return ``EFAULT``). If non-NULL, the argument to KVM_MEM_ENCRYPT_OP
+likely return ``EFAULT``). If non-NULL, the argument to KVM_MEMORY_ENCRYPT_OP
must be a struct kvm_sev_cmd::

struct kvm_sev_cmd {
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index eb3a1316f03e..506c8426c583 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -4211,7 +4211,7 @@ H_GET_CPU_CHARACTERISTICS hypercall.

:Capability: basic
:Architectures: x86
-:Type: system
+:Type: vm
:Parameters: an opaque platform specific structure (in/out)
:Returns: 0 on success; -1 on error

--
2.25.4


2020-09-09 17:21:20

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH] docs: kvm: fix referenced ioctl symbol

On Wed, 19 Aug 2020 16:19:52 -0500
Connor Kuehl <[email protected]> wrote:

> The actual symbol that is exported and usable is
> 'KVM_MEMORY_ENCRYPT_OP', not 'KVM_MEM_ENCRYPT_OP'
>
> $ git grep -l KVM_MEM_ENCRYPT_OP
> Documentation/virt/kvm/amd-memory-encryption.rst
>
> $ git grep -l KVM_MEMORY_ENCRYPT_OP
> Documentation/virt/kvm/api.rst
> arch/x86/kvm/x86.c
> include/uapi/linux/kvm.h
> tools/include/uapi/linux/kvm.h
>
> While we're in there, update the KVM API category for
> KVM_MEMORY_ENCRYPT_OP. It is called on a VM file descriptor.
>
> Signed-off-by: Connor Kuehl <[email protected]>
> ---
> Documentation/virt/kvm/amd-memory-encryption.rst | 6 +++---
> Documentation/virt/kvm/api.rst | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/virt/kvm/amd-memory-encryption.rst b/Documentation/virt/kvm/amd-memory-encryption.rst
> index 2d44388438cc..09a8f2a34e39 100644
> --- a/Documentation/virt/kvm/amd-memory-encryption.rst
> +++ b/Documentation/virt/kvm/amd-memory-encryption.rst
> @@ -53,11 +53,11 @@ key management interface to perform common hypervisor activities such as
> encrypting bootstrap code, snapshot, migrating and debugging the guest. For more
> information, see the SEV Key Management spec [api-spec]_
>
> -The main ioctl to access SEV is KVM_MEM_ENCRYPT_OP. If the argument
> -to KVM_MEM_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled
> +The main ioctl to access SEV is KVM_MEMORY_ENCRYPT_OP. If the argument
> +to KVM_MEMORY_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled
> and ``ENOTTY` if it is disabled (on some older versions of Linux,
> the ioctl runs normally even with a NULL argument, and therefore will
> -likely return ``EFAULT``). If non-NULL, the argument to KVM_MEM_ENCRYPT_OP
> +likely return ``EFAULT``). If non-NULL, the argument to KVM_MEMORY_ENCRYPT_OP
> must be a struct kvm_sev_cmd::
>
> struct kvm_sev_cmd {
> diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> index eb3a1316f03e..506c8426c583 100644
> --- a/Documentation/virt/kvm/api.rst
> +++ b/Documentation/virt/kvm/api.rst
> @@ -4211,7 +4211,7 @@ H_GET_CPU_CHARACTERISTICS hypercall.
>
> :Capability: basic
> :Architectures: x86
> -:Type: system
> +:Type: vm
> :Parameters: an opaque platform specific structure (in/out)
> :Returns: 0 on success; -1 on error
>
So this appears to have fallen through the cracks. It looks correct to
me, so I've applied it, thanks.

jon