From patchwork Tue Apr 18 21:47:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 85105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3166644vqo; Tue, 18 Apr 2023 15:30:37 -0700 (PDT) X-Google-Smtp-Source: AKy350YnqbulaB0CUw3fnrpY5o+E6E9toL16pNaQIdd8C+25LIQpHDOWIsWYLNT9AfWtJUF0wG1Q X-Received: by 2002:a17:902:e543:b0:1a1:a06c:4892 with SMTP id n3-20020a170902e54300b001a1a06c4892mr4160934plf.13.1681857037494; Tue, 18 Apr 2023 15:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681857037; cv=none; d=google.com; s=arc-20160816; b=nwgCbDZ56l+Ynuevu+p8yfPZ8gPxgGJonVTBYvjrYT1ZYdwRHvoKD6J64c8/3bOi+J Tq0VGISK+9Gdzty/lNN1jox5yDCNQY12V5qAKPMN1897D6J6oZElbtwKQTvF/wcOLTlp K1EsSnX9TCUI0hSQhXxayEM+gErNpQ+/bo+ePGMFCgfjHfgdwP6vQ69i7TfzoRrdbLX1 SbdCEhhc6F7JADZ4V8zXlKh7xtsEh2/wfLQejdA7bvrcwWDBaARL4M1WecCSmraJ151V YcugCqSZhTL2HeBJncyW4L8UGCyzrr9EVAwcDS6k9OULDh3fYTulwcA9c2DBtVTZ+Zhy DXOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cZSjVGZIUlYLIpCjOhOc0/Sg4X8Jz8GjKGH9/AcwNB8=; b=scv7KlkZ7ShMEjD2P1osK+8hxg9scwgvaFx5dIQ3bAj78kwpEbFRvnkp+piPTw+tTz dZ7hdupoQ4T0IxHc0SgFoKbo/ASZvfrPf/nyRoox/C+Gv6MYZ1Nx9Z7Osp4AeRw36XZL ZuFUm46C8+596tobUcomBzSo4gEOlxdPRcix/jEwD3x+VT+O1FlM9rmurqyNFTMtcOYN 79jIigrBzijfqZXqSM9h+u1Z44/tSuYOc8JcRsxHO0Bo1fFPAnGdyFoRK5TZ5W7cjTQI tHraylFXa3LLsB0FGbWrCmDo2W7ZHKBCI1F6qaT2mxFyKbkIEZ4dAwlOTbczQpNnHuI4 4h4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orange.fr header.s=t20230301 header.b=Q6sEsKrh; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix5-20020a170902f80500b001a69eff58f9si11768515plb.235.2023.04.18.15.30.22; Tue, 18 Apr 2023 15:30:37 -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; dkim=pass header.i=@orange.fr header.s=t20230301 header.b=Q6sEsKrh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233062AbjDRVsL (ORCPT + 99 others); Tue, 18 Apr 2023 17:48:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbjDRVsJ (ORCPT ); Tue, 18 Apr 2023 17:48:09 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B257CAD13 for ; Tue, 18 Apr 2023 14:47:50 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id otAtpDm3iuZFDotAtp5a56; Tue, 18 Apr 2023 23:47:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1681854468; bh=cZSjVGZIUlYLIpCjOhOc0/Sg4X8Jz8GjKGH9/AcwNB8=; h=From:To:Cc:Subject:Date; b=Q6sEsKrhFoWuQ2stk0aG1FI8wza6+Ha+g2auGJtsu7dzre1BbLJ1BwVUEsdiO3oy8 hkFnkBWD81hqEJSpcCf/Y3FELHW2dvuqNhnVLBXIJhGCPv1tNlPHMLFh/4Oq7n5oDE 9Qou5ArgKmLeqQEbtYU4G2HEZLKNBL2GWvX8TjEQeUkcpHgiHOzRVj5ldEWdQUMjM6 yBVUKNq/3KNbqsbG2n0sayi81o6SuZ+XjpaYKr4yiyrUgA5sFgS3ZogzycHVDT2TpO MSqgqgujgmvJ5yGgz9f4CS6HMJRxRg2z6gtQvBnEkLiOfyjiQdFItvFhgOs+U4O/18 iF95AxOOP6wgA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 18 Apr 2023 23:47:48 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: [PATCH 1/2] KVM: arm64: Slightly optimize flush_context() Date: Tue, 18 Apr 2023 23:47:37 +0200 Message-Id: <97bf2743f3a302b3066aced02218b9da60690dd3.1681854412.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763554925036791863?= X-GMAIL-MSGID: =?utf-8?q?1763554925036791863?= bitmap_zero() is faster than bitmap_clear(), so use it to save a few cycles. Signed-off-by: Christophe JAILLET --- arch/arm64/kvm/vmid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/vmid.c b/arch/arm64/kvm/vmid.c index 08978d0672e7..bbf0677cfefa 100644 --- a/arch/arm64/kvm/vmid.c +++ b/arch/arm64/kvm/vmid.c @@ -47,7 +47,7 @@ static void flush_context(void) int cpu; u64 vmid; - bitmap_clear(vmid_map, 0, NUM_USER_VMIDS); + bitmap_zero(vmid_map, NUM_USER_VMIDS); for_each_possible_cpu(cpu) { vmid = atomic64_xchg_relaxed(&per_cpu(active_vmids, cpu), 0);