mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinank Jain <jinankjain@linux.microsoft.com>
To: Nuno Das Neves <nunodasneves@linux.microsoft.com>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: mikelley@microsoft.com, kys@microsoft.com, wei.liu@kernel.org,
	haiyangz@microsoft.com, decui@microsoft.com
Subject: Re: [PATCH] Drivers: hv: Do not free synic pages when they were not allocated
Date: Tue, 4 Apr 2023 16:09:12 +0530	[thread overview]
Message-ID: <03f62671-7f01-eeb3-4326-cbf0c2250c30@linux.microsoft.com> (raw)
In-Reply-To: <1680564122-30819-1-git-send-email-nunodasneves@linux.microsoft.com>

Reviewed-by: Jinank Jain <jinankjain@linux.microsoft.com>

On 4/4/2023 4:52 AM, Nuno Das Neves wrote:
> In case of root partition or snp, the synic pages are allocated by the
> hypervisor instead of the kernel, so they should not be freed.
>
> Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
> ---
>   drivers/hv/hv.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
> index c7f7652932ca..a10cf642c9ad 100644
> --- a/drivers/hv/hv.c
> +++ b/drivers/hv/hv.c
> @@ -193,8 +193,10 @@ void hv_synic_free(void)
>   		struct hv_per_cpu_context *hv_cpu
>   			= per_cpu_ptr(hv_context.cpu_context, cpu);
>   
> -		free_page((unsigned long)hv_cpu->synic_event_page);
> -		free_page((unsigned long)hv_cpu->synic_message_page);
> +		if (!hv_isolation_type_snp() && !hv_root_partition) {
> +			free_page((unsigned long)hv_cpu->synic_event_page);
> +			free_page((unsigned long)hv_cpu->synic_message_page);
> +		}
>   		free_page((unsigned long)hv_cpu->post_msg_page);
>   	}
>   

  reply	other threads:[~2023-04-04 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 23:22 Nuno Das Neves
2023-04-04 10:39 ` Jinank Jain [this message]
2023-04-07 15:22 ` Michael Kelley (LINUX)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03f62671-7f01-eeb3-4326-cbf0c2250c30@linux.microsoft.com \
    --to=jinankjain@linux.microsoft.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=nunodasneves@linux.microsoft.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®