Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp980104rdf; Sat, 4 Nov 2023 01:58:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXlfeUl558EpSOpmdw1+GQXy7bvnIG61mrOuK08E1wXP3XU3NRWhQORBm+M3Bgse1WkvYg X-Received: by 2002:a05:6808:4196:b0:3b2:e649:b5fb with SMTP id dj22-20020a056808419600b003b2e649b5fbmr26066152oib.15.1699088293603; Sat, 04 Nov 2023 01:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699088293; cv=none; d=google.com; s=arc-20160816; b=exj7PhXrIFmw3J4HdXZrmJXWYwYME5xxLj9uovVtvnBB72vbvHDTrcOVg6orUhxTsy 5+gD7BewRhk8C29bXuuOKm4wKWal+YnNPbzcoKYwnvrNxGZn272iyW5O+lsfafFWJ3GJ l0ccyk30IybuytShoft6hG7zoc1+13MuBdGWp4AOiYmHf4fb/2Ylp/J2uva+V0IJitKI yt5TDT+pis5aHAvjnCl36lFLiWzbyRORP1stT2gKpdSlI0UvWKTac0Ck4KllCd/2cGAQ KIpQW5nm2a5/48nTZdUUdkS+eAxq7/hs1NC9CipD72b+ETvqp+5o4H4/30NbkW/arlYQ GmFA== 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 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b005859e8c7c22si3354129pgv.658.2023.11.04.01.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 01:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 A43FD803E7AB; Sat, 4 Nov 2023 01:58:12 -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 S230050AbjKDI6J (ORCPT + 99 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 Content-Transfer-Encoding: 8bit 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:12 -0700 (PDT) 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 -- 2.39.3