[v3,03/14] virt: sev-guest: Replace pr_debug with dev_dbg

Message ID 20230722111909.15166-4-nikunj@amd.com
State New
Headers
Series Add Secure TSC support for SNP guests |

Commit Message

Nikunj A. Dadhania July 22, 2023, 11:18 a.m. UTC
  In preparation of moving code to arch/x86/kernel/sev.c,
replace dev_dbg with pr_debug.

Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
---
 drivers/virt/coco/sev-guest/sev-guest.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Tom Lendacky Aug. 1, 2023, 3:34 p.m. UTC | #1
On 7/22/23 06:18, Nikunj A Dadhania wrote:
> In preparation of moving code to arch/x86/kernel/sev.c,
> replace dev_dbg with pr_debug.
> 
> Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>

The subject is backwards, you're replacing dev_dbg with pr_debug. With that:

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>

> ---
>   drivers/virt/coco/sev-guest/sev-guest.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
> index 8ba624088d73..538c42e64baa 100644
> --- a/drivers/virt/coco/sev-guest/sev-guest.c
> +++ b/drivers/virt/coco/sev-guest/sev-guest.c
> @@ -206,8 +206,9 @@ static int verify_and_dec_payload(struct snp_guest_dev *snp_dev, void *payload,
>   	struct snp_guest_msg_hdr *resp_hdr = &resp->hdr;
>   	struct aesgcm_ctx *ctx = snp_dev->ctx;
>   
> -	dev_dbg(snp_dev->dev, "response [seqno %lld type %d version %d sz %d]\n",
> -		resp_hdr->msg_seqno, resp_hdr->msg_type, resp_hdr->msg_version, resp_hdr->msg_sz);
> +	pr_debug("response [seqno %lld type %d version %d sz %d]\n",
> +		 resp_hdr->msg_seqno, resp_hdr->msg_type, resp_hdr->msg_version,
> +		 resp_hdr->msg_sz);
>   
>   	/* Copy response from shared memory to encrypted memory. */
>   	memcpy(resp, snp_dev->response, sizeof(*resp));
> @@ -253,8 +254,8 @@ static int enc_payload(struct snp_guest_dev *snp_dev, u64 seqno, int version, u8
>   	if (!hdr->msg_seqno)
>   		return -ENOSR;
>   
> -	dev_dbg(snp_dev->dev, "request [seqno %lld type %d version %d sz %d]\n",
> -		hdr->msg_seqno, hdr->msg_type, hdr->msg_version, hdr->msg_sz);
> +	pr_debug("request [seqno %lld type %d version %d sz %d]\n",
> +		 hdr->msg_seqno, hdr->msg_type, hdr->msg_version, hdr->msg_sz);
>   
>   	return __enc_payload(snp_dev->ctx, req, payload, sz);
>   }
  
Nikunj A. Dadhania Aug. 2, 2023, 4:08 a.m. UTC | #2
On 8/1/2023 9:04 PM, Tom Lendacky wrote:
>> In preparation of moving code to arch/x86/kernel/sev.c,
>> replace dev_dbg with pr_debug.
>>
>> Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
> 
> The subject is backwards, you're replacing dev_dbg with pr_debug. With that:

Sure, will fix the subject.

> 
> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>

Thanks,
Nikunj
  

Patch

diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
index 8ba624088d73..538c42e64baa 100644
--- a/drivers/virt/coco/sev-guest/sev-guest.c
+++ b/drivers/virt/coco/sev-guest/sev-guest.c
@@ -206,8 +206,9 @@  static int verify_and_dec_payload(struct snp_guest_dev *snp_dev, void *payload,
 	struct snp_guest_msg_hdr *resp_hdr = &resp->hdr;
 	struct aesgcm_ctx *ctx = snp_dev->ctx;
 
-	dev_dbg(snp_dev->dev, "response [seqno %lld type %d version %d sz %d]\n",
-		resp_hdr->msg_seqno, resp_hdr->msg_type, resp_hdr->msg_version, resp_hdr->msg_sz);
+	pr_debug("response [seqno %lld type %d version %d sz %d]\n",
+		 resp_hdr->msg_seqno, resp_hdr->msg_type, resp_hdr->msg_version,
+		 resp_hdr->msg_sz);
 
 	/* Copy response from shared memory to encrypted memory. */
 	memcpy(resp, snp_dev->response, sizeof(*resp));
@@ -253,8 +254,8 @@  static int enc_payload(struct snp_guest_dev *snp_dev, u64 seqno, int version, u8
 	if (!hdr->msg_seqno)
 		return -ENOSR;
 
-	dev_dbg(snp_dev->dev, "request [seqno %lld type %d version %d sz %d]\n",
-		hdr->msg_seqno, hdr->msg_type, hdr->msg_version, hdr->msg_sz);
+	pr_debug("request [seqno %lld type %d version %d sz %d]\n",
+		 hdr->msg_seqno, hdr->msg_type, hdr->msg_version, hdr->msg_sz);
 
 	return __enc_payload(snp_dev->ctx, req, payload, sz);
 }