// Copyright (c) 2020, Intel Corporation.
// SPDX-License-Identifier: BSD-3-Clause

ifdef::manpage[]
ipmctl-delete-pcd(1)
====================
endif::manpage[]

NAME
----
ipmctl-delete-pcd - Clears select partition data from the PCD

SYNOPSIS
--------
[listing]
ifndef::os_build[]
ipmctl delete [OPTIONS] -pcd [TARGETS]
endif::os_build[]
ifdef::os_build[]
ipmctl delete [OPTIONS] -pcd [TARGETS]
endif::os_build[]

DESCRIPTION
-----------
ifndef::os_build[]
When LSA is specified, the namespace label storage area partition in the platform configuration
data from one or more PMem modules are cleared. This is a destructive operation which will clear
the entire namespace label storage area including all namespaces labels and the
namespace label index block in order to re-purpose the PMem modules for use in a
different operating system. All data on any deleted namespaces becomes
inaccessible.

NOTE: Deleting PCD LSA partition data removes any logical OS namespace mapping
to the persistent memory data, but does not explicitly delete or modify user
data found in persistent memory.
endif::os_build[]

When Config is specified, the Current, Input, and Output Data Size and Start Offset values in
the Configuration header are set to zero, making those tables invalid.

NOTE: When Config is specified, only PCD partition 1 is modified. If the platform is rebooted
prior to creating a new goal on any targeted PMem modules, UEFI platform firmware will detect the
missing tables and, if possible, restore previous config using the PCD partition 0 tables.

NOTE: This action can be useful when moving PMem modules from one system to another, as goal creation
rules may restrict provisioning PMem modules with an existing configuration. Deleting the PCD can be
used as a way to prepare a PMem module for provisioning with the create -goal or load -goal commands
by clearing existing configuration metadata. This allows the PMem module to be provisioned in
isolation using the create-goal command with the -dimm option. Once the PCD has been deleted
the desired goal should be created before rebooting.

WARNING: *This command may result in data loss. Data should be backed up
to other storage before executing this command. Because of data dependencies, other commands
may be affected until the system has been rebooted*.

OPTIONS
-------
-f::
-force::
  Deleting the PCD data is a destructive operation which
  requires confirmation from the user for each PMem module. This option suppresses the
  confirmation.

-h::
-help::
  Displays help for the command.

-ddrt::
  Used to specify DDRT as the desired transport protocol for the current invocation of ipmctl.

-smbus::
  Used to specify SMBUS as the desired transport protocol for the current invocation of ipmctl.

NOTE: The -ddrt and -smbus options are mutually exclusive and may not be used together.

-lpmb::
  Used to specify large transport payload size for the current invocation of ipmctl.

-spmb::
  Used to specify small transport payload size for the current invocation of ipmctl.

NOTE: The -lpmb and -spmb options are mutually exclusive and may not be used together.

ifdef::os_build[]
-o (text|nvmxml)::
-output (text|nvmxml)::
  Changes the output format. One of: "text" (default) or "nvmxml".
endif::os_build[]

TARGETS
-------
-dimm [DimmIDs]::
  Deletes the PCD data on specific PMem modules by supplying one
  or more comma-separated PMem module identifiers. The default is to delete the
  PCD data for all manageable PMem modules.
ifndef::os_build[]
-pcd [Config|LSA]::
  Restricts clearing select partition data in the platform
  configuration data area.
  The default is to clear both. One of:
  - Config - Configuration management information
  - LSA - Namespace label storage area
endif::os_build[]
ifdef::os_build[]
-pcd [Config]::
  Clears the configuration management information.
endif::os_build[]

EXAMPLES
--------
ifndef::os_build[]
Clears the namespace label storage area from all manageable PMem modules
[listing]
delete -dimm -pcd LSA
endif::os_build[]

Clears the Cin, Cout, Ccur tables from all manageable PMem modules
[listing]
delete -dimm -pcd Config

LIMITATIONS
-----------
The specified PMem modules must be manageable by the host software, and if
data-at-rest security is enabled, the PMem modules must be unlocked. Any existing
namespaces associated with the requested PMem modules should be deleted before
running this command.

RETURN DATA
-----------
For each PMem module, the CLI will indicate the status of the operation. If a failure occurs
when deleting the platform configuration data from multiple PMem modules, the process will
continue deleting the remaining PMem modules.
