Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp890757rwi; Wed, 26 Oct 2022 08:23:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7mlRDcdtBvR7LUVe/l0LbfDBD7zXXFVoycv75GXkhNoWpr9tlpn1pPq1ZBzmrIgAvtJdDt X-Received: by 2002:aa7:c7d1:0:b0:461:2a82:497e with SMTP id o17-20020aa7c7d1000000b004612a82497emr29954807eds.267.1666797816529; Wed, 26 Oct 2022 08:23:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666797816; cv=none; d=google.com; s=arc-20160816; b=LqqlBK4q+l8ZvhUlxFUm/PwkAgjUAoJ9C/YDG6dwdrPrA7tEHIzH3i1Zgphxd2WVvD UrsaGY6j0rs8X1LBKQjCkFSG0q8UPOMgFrTrkZPzhwnJWiGqE6WAq9/oOMcdKFoQgQmQ VGfxBzlvYnelTtkoGC+rBz8I20PCyBUUhpEL79aow3DS5cSlHSgtZzngxMcw1fXhp8Ij LmQUc5LaJSAkAAHjHn1feKk+sL/lvMkuNL0w5S/noM7zqIamIndLAzC8nH4sZ/izpdfa hzc0UsMR4aUzK+4PG12QuSR5MBz43Ruo6OLAkhdCWCsQZ4OtwyvNCy2m96dJJ6OGIjFa 6o9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1Msz1Hi1rkqv/MvBfwUlMMaceK8tAszlcvr0acT4kho=; b=R/LZ5dAbLvCxDD9tXvD+JZx5bPeKiJWV5f0Mjkq5EMjOhnNMySZ2YjLjvIJ9CNCwLC CtC5bwxSivdPM/LejPDUzBM3a0LlwY2S7kBZKsRSO/XdZpUuPL3jfCjMlzbmiBko2ctC lUSn+ZIZldtj65X+xmfBO3NnCLc2M/6+aiJGao1pq+LciP0KptQRaYt1bGqs0DQbLEz/ MjDgSMSvvDroevBcZQyapY5uWQh+6g25LqH/iEPTgRCIoq3viZV5CzGA2PHKIG9uv4hz MaUyHL8Bnq+B5I0K6ANT7mL3sA9S9qqLQ5ifE33Jj84fWWuNe2VjOZs6x4ghaZkmkYAP Xo4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a170906580d00b0079d5da30399si5176889ejq.427.2022.10.26.08.22.50; Wed, 26 Oct 2022 08:23:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234458AbiJZPRY (ORCPT + 99 others); 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-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> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.