From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE275C38A2D for ; Wed, 26 Oct 2022 15:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234456AbiJZPRY (ORCPT ); Wed, 26 Oct 2022 11:17:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234500AbiJZPRX (ORCPT ); Wed, 26 Oct 2022 11:17:23 -0400 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20DDED73DE; Wed, 26 Oct 2022 08:17:22 -0700 (PDT) Received: by mail-wm1-f52.google.com with SMTP id t4so10411056wmj.5; Wed, 26 Oct 2022 08:17:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1Msz1Hi1rkqv/MvBfwUlMMaceK8tAszlcvr0acT4kho=; b=gmEaH0UJJpT416EJu1+DjALxolSDRIp85kCN0bDM4tRhF5f/F1V17q/dSivqjpv7Z1 SA5ffcvVr786dPJpRt1UxQEFBFCOuRHC3zuhh3mRRCzuT/3L8kmmm150y021LaAUghYM TtxXKyeaee5q03C8TlLPTJILaWRxE2u1HM0BhH1I+IU06vLXsc4+SmB5sNqQyqevVfdD XP229ub8VUjmLoQhh3CIEb45ay91a/2CJtUbL6/Cogt7zdww2yod/3pQp9ra3SjUybFX QyPxs+r5NWnv+DN3tE3cUTZfzU/QxJd+6yhVKO0zTw0+q08yKnPNw3PRdteHn01vu46n 6V3w== X-Gm-Message-State: ACrzQf0AS2JFFFZcU85ld8tZYeDDDNlZzfU4oci2o0ExmRxH2JYVTxhW WaVSR2hsX6Ze4xvaE6Ln8n4= X-Google-Smtp-Source: AMsMyM5E4QofG55+k8sHt/sTfY3vGTyn0y7u2UAQ/U4Bxq84KgQJzPPLu9oKoQ7zPN117pwnv57/GA== X-Received: by 2002:a05:600c:35c8:b0:3c8:33dc:c262 with SMTP id r8-20020a05600c35c800b003c833dcc262mr2807585wmq.206.1666797440607; Wed, 26 Oct 2022 08:17:20 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id n9-20020a05600c4f8900b003a5537bb2besm2164405wmq.25.2022.10.26.08.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 08:17:20 -0700 (PDT) Date: Wed, 26 Oct 2022 15:17:18 +0000 From: Wei Liu To: Zhao Liu Cc: "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny , "Fabio M . De Francesco" , Zhenyu Wang , Zhao Liu Subject: Re: [PATCH v2] x86/hyperv: Remove BUG_ON() for kmap_local_page() Message-ID: References: <20221020083820.2341088-1-zhao1.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221020083820.2341088-1-zhao1.liu@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On Thu, Oct 20, 2022 at 04:38:20PM +0800, Zhao Liu wrote: > From: Zhao Liu > > The commit 154fb14df7a3c ("x86/hyperv: Replace kmap() with > kmap_local_page()") keeps the BUG_ON() to check if kmap_local_page() > fails. > > But in fact, kmap_local_page() always returns a valid kernel address > and won't return NULL here. It will BUG on its own if it fails. [1] > > So directly use memcpy_to_page() which creates local mapping to copy. > > [1]: https://lore.kernel.org/lkml/YztFEyUA48et0yTt@iweiny-mobl/ > > Suggested-by: Fabio M. De Francesco > Suggested-by: Ira Weiny > Reviewed-by: Ira Weiny > Signed-off-by: Zhao Liu Applied to hyperv-fixes. Thanks.