From patchwork Sat Nov 4 08:57:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: maobibo X-Patchwork-Id: 16247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1539496vqu; Sat, 4 Nov 2023 01:58:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIpeUWZ/6buOOIK10Tzu2Z0SeLM9ffsfMaUZq9wlF1ThYFV8sGqQZzPvac4QHkn9x3yqeB X-Received: by 2002:a05:6808:14cb:b0:3ae:5c48:6f41 with SMTP id f11-20020a05680814cb00b003ae5c486f41mr27805392oiw.28.1699088295140; Sat, 04 Nov 2023 01:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699088295; cv=none; d=google.com; s=arc-20160816; b=ij8m2zOWukbihRn/kDTNheGlNi3TYF6T0rYI/04XF7+iZbttwWWoiNHG68tOnr2+4D JczYh/IaX1386UvqM9F156ybVLOPR7PiqYnjM9EET0gRRtkhb0nP/V2qxHaNAyxOSl/6 6xB51K0797y/xS6G4vmkqvoBj6/p78AkSaDW0/VTm8XJUFXYcI5YVngkzx4lTszY/0vv n/gVV1zTKfG96KPdzvWKtE2Hs/+oiVb+tdF9JU3ueXUPYYN1d5YYpSL925LNcFZcY17Q MtDj78x8PL7uq36zbBHFuSJ+2mp3D8/RT7aZwkVht7OmvjtlHt541vbBamAncc6TuUis gS5w== 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; bh=BJfk7C+OKrr3kgaVl3loEITVx4dKy2hKHkettIxYENo=; fh=JOrDXAv7dX9lqUsWenmIinruxsV5NNS7FV+l4Q4onAY=; b=RD4Xb4FQc58VP5EUl2g3xX72OkDDoLin6l83ljM/5NYdVE3Y75bA97CG5BUXNCTrep +ez0qg8wGlDsifnz6IJg1Xq1ENeKXCGbXARdpjZVgpo/M0YYo3xO7IzuyvsCx9WqcPhS /s5sCTYwMHcyOljNdRqiIFfeF5dJFkQIN3TT9Q0MgoJMEXRIA9bXrELq+LL/6aBeLCHH e33E8+ljAC7sEV0o+CGAumtj77B1oC996ME9ObZjTdxj07DvcSBpO6LJOoWMqz9YWlU3 DB2mCEhFRLOsSWNCrVJnTyjOPVxtPfwR1LPkhohm2UDF4VokHIVLcB4zIvPxP62AUWUL vWsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id go11-20020a17090b03cb00b002800879f482si3461700pjb.87.2023.11.04.01.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 01:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6748E803E78A; Sat, 4 Nov 2023 01:58:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjKDI6J (ORCPT + 35 others); Sat, 4 Nov 2023 04:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjKDI6G (ORCPT ); Sat, 4 Nov 2023 04:58:06 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD7561A8; Sat, 4 Nov 2023 01:58:00 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.213]) by gateway (Coremail) with SMTP id _____8AxjuuVB0Zl0+E2AA--.39420S3; Sat, 04 Nov 2023 16:57:57 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxbS+UB0ZlmGs5AA--.59322S2; Sat, 04 Nov 2023 16:57:56 +0800 (CST) From: Bibo Mao To: Tianrui Zhao , Huacai Chen Cc: WANG Xuerui , kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v1 0/3] LoongArch: KVM: Remove SW timer switch during Date: Sat, 4 Nov 2023 16:57:52 +0800 Message-Id: <20231104085755.930439-1-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxbS+UB0ZlmGs5AA--.59322S2 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9xXoW7JF1xtr45WFWfAryDCry7CFX_yoWDKrc_WF 97A3WUGrZ7Wr98tF1qyw15Aa4rZrs7uF1rt3Z7Ar4xGF13trZxur48Xw43ZFy0gay7GFsx XrWDtryfZr1jqosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8czVUUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 04 Nov 2023 01:58:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781623208326015629 X-GMAIL-MSGID: 1781623208326015629 This patches removes SW timer switch during vcpu block stage. VM uses HW timer rather than SW PV timer on LoongArch system, it can check HW timer pending interrupt status directly, rather than switch to SW timer and check injected SW timer interrupt. When SW timer is not used in vcpu block polling status, the relative SW timer handling before entering guest can be removed also. Timer emulation is simpler than before, SW timer emuation is only used in vcpu thread context switch. Bibo Mao (3): LoongArch: KVM: Remove SW timer switch during vcpu block flow LoongArch: KVM: Allow to access HW timer CSR registers always LoongArch: KVM: Remove kvm_acquire_timer before entering guest arch/loongarch/include/asm/kvm_vcpu.h | 1 - arch/loongarch/kvm/exit.c | 11 +----- arch/loongarch/kvm/main.c | 1 - arch/loongarch/kvm/timer.c | 48 ++++++++------------------- arch/loongarch/kvm/vcpu.c | 38 +++++---------------- 5 files changed, 22 insertions(+), 77 deletions(-) base-commit: 8f6f76a6a29f36d2f3e4510d0bde5046672f6924