rust/pv: Fix some comments

The library is used by multiple PV related tools, not only for managing
the guest secret store.
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2024-10-15 16:55:34 +00:00
committed by Steffen Eiden
parent 17aba9322e
commit fe2946f76c
13 changed files with 21 additions and 21 deletions

View File

@@ -90,7 +90,7 @@ impl<C: Zeroize> Confidential<C> {
&self.0
}
/// Get an immutable reference to the contained value
/// Get a mutable reference to the contained value
///
/// NOTE that modifications to a mutable reference can trigger reallocation.
/// e.g. a [`Vec`] might expand if more space needed. -> preallocate enough space

View File

@@ -214,8 +214,8 @@ pub fn create_file<P: AsRef<Path>>(path: P) -> Result<File> {
/// If this function encounters an "end of file" before completely filling
/// the buffer, it returns an error. The contents of `buf` are unspecified in this case.
///
/// If aber so hast du mmmeny other read error is encountered then this function immediately
/// returns. The contents of `buf` are unspecified in this case.
/// If any other read error occurs, this function returns immediately. The
/// contents of `buf` are unspecified in this case.
///
/// If this function returns an error, it is unspecified how many bytes it
/// has read, but it will never read more than would be necessary to

View File

@@ -95,7 +95,7 @@ pub trait UvCmd {
///
/// # Returns
///
/// The IOCTL cmd for this UvCmd usually something like `uv_ioctl!(CMD_NR)`
/// The IOCTL cmd for this `UvCmd` usually something like `uv_ioctl!(CMD_NR)`
fn cmd(&self) -> u64 {
uv_ioctl(Self::UV_IOCTL_NR)
}
@@ -162,7 +162,7 @@ pub enum UvcSuccess {
RC_MORE_DATA = UvDevice::RC_MORE_DATA,
}
/// The UvDevice is a (virtual) device on s390 machines to send Ultravisor commands(UVCs) from
/// The `UvDevice` is a (virtual) device on s390 machines to send Ultravisor commands(UVCs) from
/// userspace.
///
/// On s390 machines with Ultravisor enabled (Secure Execution guest & hosts) the device at

View File

@@ -242,10 +242,10 @@ impl ffi::uvio_attest {
///
/// # SAFETY
/// It is safe to call this function iff:
/// - arcb.len() < u32::MAX
/// - additional.len() < u32::MAX
/// - user_len() <= 256
/// - pointyer fit into an u64
/// - `arcb.len() < u32::MAX`
/// - `additional.len() < u32::MAX`
/// - `user_len() <= 256`
/// - pointer fits into an u64
unsafe fn new(
arcb: &[u8],
measurement: &mut [u8],

View File

@@ -28,7 +28,7 @@ pub const UVIO_IOCTL_LOCK_SECRETS_NR: u8 = 4;
/// Programs can use this struct to communicate with the uvdevice via IOCTLs
/// `argument_{addr,len}` specifies in/out data depending on the request
///
/// 'uv_rc' and `uv_rrc` are the response and reason response codes from the
/// `uv_rc` and `uv_rrc` are the response and reason response codes from the
/// Ultravisor.
///
/// `flags` is currently unused and to be set zero
@@ -55,7 +55,7 @@ assert_size!(uvio_ioctl_cb, 0x40);
/// If the bit is set in both, `supp_uvio_cmds` and `supp_uv_cmds`,
/// the uvdevice and the Ultravisor support that call.
///
/// Note that bit 0 (UVIO_IOCTL_UVDEV_INFO_NR) is always zero for `supp_uv_cmds`
/// Note that bit 0 (`UVIO_IOCTL_UVDEV_INFO_NR`) is always zero for `supp_uv_cmds`
/// as there is no corresponding UV-call.
#[repr(C)]
#[derive(Debug, Copy, Clone, AsBytes, FromZeroes, FromBytes)]
@@ -103,7 +103,7 @@ pub struct uvio_attest {
}
assert_size!(uvio_attest, 0x138);
/// corresponds to the UV_IOCTL macro
/// corresponds to the `UV_IOCTL` macro
pub(crate) const fn uv_ioctl(nr: u8) -> u64 {
iowr(UVIO_TYPE_UVC, nr, size_of::<uvio_ioctl_cb>())
}

View File

@@ -54,7 +54,7 @@ impl AddCmd {
/// # Errors
///
/// This function will return an error if the provided data does not start with the
/// ['crate::AddSecretRequest'] magic Value.
/// [`crate::AddSecretRequest`] magic Value.
pub fn new<R: Read>(bin_add_secret_req: &mut R) -> Result<Self> {
let mut data = Vec::with_capacity(PAGESIZE);
bin_add_secret_req.read_to_end(&mut data)?;

View File

@@ -177,7 +177,7 @@ impl FromIterator<SecretEntry> for SecretList {
}
impl SecretList {
/// Creates a new SecretList.
/// Creates a new `SecretList`.
///
/// The content of this list will very likely not represent the status of the guest in the
/// Ultravisor. Use of [`SecretList::decode`] in any non-test environments is encuraged.

View File

@@ -11,7 +11,7 @@ use byteorder::{BigEndian, ByteOrder};
use std::{fmt::Display, mem::size_of};
use zerocopy::{AsBytes, U16};
/// The magic value used to identify an ['crate:AddSecretRequest']
/// The magic value used to identify an [`crate:AddSecretRequest`]
///
/// The magic value is ASCII:
/// ```rust