Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1216046pxb; Fri, 13 Nov 2020 07:09:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUDpRCeMNjfxr+wOJtpW2muqBGLBjClsMt0vm5BJC/B9UFc5x6NxdOXIU40HBwdMFIgkJI X-Received: by 2002:a05:6402:54c:: with SMTP id i12mr3014053edx.9.1605280169276; Fri, 13 Nov 2020 07:09:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605280169; cv=none; d=google.com; s=arc-20160816; b=X5Ul2g+tDYbX9YhByUSOdosWxIgqEi48RJcxHdgge6S3AyiUYqg1Tl0pmY1Vg227WC DF6V/uwVJic72svmV9ccftFEMnH23WUINuumDY1aObmBpv6PdkfZ9zn+IEz4OJ2u19bL cT6H7RnnK/ueg/Jn7eX3zfKPDBuz8ZMZQWZWi4dJ4xFlDuZvFK6di2j6qGNoAYZbMPeF bF5uqPsKoFS2WZgiKfTV8XXQmWb7W01h0Z1ElD3Xp3KqBC2s4R24e37L7ZrLymgU4yvn s+A4/J3/RkHldTRDRyzOTyacevKq0JjrcTo0gb85VdM/4PrLHUNhGhME9LygDpgYriTg x/aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=bVaU10leUNBpSZ8QLekWuqLmBxn7RuMG1m+hwrLuz6g=; b=TaA42fYVmNQC2wTGBYvxD0UOy7CkBDvOY5subFxY5De4hyaEAiqyB558stVwqVFnRq VKWOdHRRRpI2Spc00xa+iCXSWnksdm/pmdP9lJ2WIu2s9Dc9VebNVbdcVHBHXvPPodtb GrCj73nqgp5gtD23w0l0eyBC86+3e9XCMsgj+JSPhScRvzWLc0C6LTOZRdhk80Ce05E0 EZ4NLb8XS3RA/GeWYHB5sHaxrOrHP+1fYt0inladJPCCetykYiBp6fODWQZqnBYKPtHY u+vZukdDZUwffaZ5xOnudeXYGnhpra47kSh/j2i24p1+7UNRmOCyW/bQ18ZxLqLx9H+I t6Yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si6584261edv.3.2020.11.13.07.09.06; Fri, 13 Nov 2020 07:09:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbgKMPFs (ORCPT + 99 others); Fri, 13 Nov 2020 10:05:48 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40943 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726560AbgKMPFs (ORCPT ); Fri, 13 Nov 2020 10:05:48 -0500 Received: by mail-wm1-f66.google.com with SMTP id a3so8751627wmb.5; Fri, 13 Nov 2020 07:05:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bVaU10leUNBpSZ8QLekWuqLmBxn7RuMG1m+hwrLuz6g=; b=orWZs6ro18hpOjpeQeq74jyJDjhRWpehrf9Y5a0oNqXW23q4EFC8E4IQCxP0M3ndFw P8JOrKsQEdnkt6blk6TN72nqPJKI1FyzdR/nVm5nIJxgRcVxBpk2fphLrKaVDmqJ6p/h x7vzCD4HlSqxea8BivJ37LEj6cfX8WosY+tuTgKhwIg3PFvCGTdCyqANi81F0uJdLDUA 39Bw2locTn2YlpESC1cHoW0nmISdMND0MeJFqr9JMUxKLkR9Zzp+IDnTh0lnC2CFZ8iv MaV7VYjr58xmB8e33etf/SM0S2KB7nT+3oxlYB5FOUBN0qnHrvoB9gRdMmBRprT9OkV2 tU9A== X-Gm-Message-State: AOAM533IhOohGzUw7YVB7uc5RoRLy9AiZHBqvBGSCigi1S6El8o/YXfK EPoWRo5/9Qwuu+DxiG+JwWw= X-Received: by 2002:a1c:7e8e:: with SMTP id z136mr3108670wmc.46.1605279946339; Fri, 13 Nov 2020 07:05:46 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id q12sm9984512wrx.86.2020.11.13.07.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 07:05:45 -0800 (PST) Date: Fri, 13 Nov 2020 15:05:44 +0000 From: Wei Liu To: Vitaly Kuznetsov Cc: Wei Liu , Linux on Hyper-V List , virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Lillian Grassin-Drake , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" Subject: Re: [PATCH v2 06/17] x86/hyperv: allocate output arg pages if required Message-ID: <20201113150544.drm4qk4jlchewukg@liuwe-devbox-debian-v2> References: <20201105165814.29233-1-wei.liu@kernel.org> <20201105165814.29233-7-wei.liu@kernel.org> <87a6vmy4dn.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6vmy4dn.fsf@vitty.brq.redhat.com> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 04:35:48PM +0100, Vitaly Kuznetsov wrote: > Wei Liu writes: [...] > > @@ -209,14 +219,23 @@ static int hv_cpu_die(unsigned int cpu) > > unsigned int new_cpu; > > unsigned long flags; > > void **input_arg; > > - void *input_pg = NULL; > > + void *pg; > > > > local_irq_save(flags); > > input_arg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg); > > - input_pg = *input_arg; > > + pg = *input_arg; > > *input_arg = NULL; > > + > > + if (hv_root_partition) { > > + void **output_arg; > > + > > + output_arg = (void **)this_cpu_ptr(hyperv_pcpu_output_arg); > > + *output_arg = NULL; > > + } > > + > > local_irq_restore(flags); > > - free_page((unsigned long)input_pg); > > + > > + free_page((unsigned long)pg); > > > > Hm, but in case we've allocated output_arg, don't we need to do > free_pages((unsigned long)pg, 1); > > instead? Indeed. This has been fixed with: free_pages((unsigned long)pg, hv_root_partition ? 1 : 0); Wei.