Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3025293rdb; Wed, 15 Nov 2023 19:28:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4miBydptVEpeW9hWqjrW8ia2FMJs6Wcs5bKPQmFbj53MFDa9zygUdeuw6D9UPKQjFqWTN X-Received: by 2002:a17:902:ee95:b0:1cc:4cbb:c564 with SMTP id a21-20020a170902ee9500b001cc4cbbc564mr7516724pld.69.1700105328830; Wed, 15 Nov 2023 19:28:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700105328; cv=none; d=google.com; s=arc-20160816; b=QhbvbM8dHQFudQrqjH7kD6TVQKYNw7UwjJiTrogq8Ow5R9wL9lUqrtXxZdHIAoXKL9 2KTR2nPjU/KaS1q58oNSMYq8TP3udymChDOJdbEyws0/fMQ8KvLnxAQFRzb58Fg/p4Li zmOgITFA/AoSvftW3DkORF/Yh9vJvc/iL5vKgj0oJ7E/d8Iyj/t6nnMKbGhmjQ8QZJdh McIzWjUEXdhQW8pt8ij5RcWFzFxFRxC6VDBXRZhrr/Y85TRw7XlPez4U1PRT3NyL5AZC AF5qh8DiJZ0mEQ67twU6SNadIQ/fEVRLMAWjvIWCr+0Ry+r2e0W0VJbbSoIOj5z1LQVB 0m+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=0wIBrlLTsFOermJso8suj4cFE8UqJ7WgQ+C2D/AbJsw=; fh=Xm5knk1uOrf30n7LCBrW1uDLVy9tXFQsLOzHBkJX6Og=; b=KcK8gpZfCAuhjQzfxNNw1nov9al0zpSv/aBxtRv2y/TYrccM7mfQeo9vtSHWSxyta/ Aq0nw/rDFBQ1Pbk6i0OrWsc3Owfrp8jmhbsBFZLrFxIX695/NdZLzyC9VR2fPfbH8RRs ftChtO/FTd/+m5cskkLLlkaqMpyHAqlvribyIF63sNTSjiAIaqrRMUGudOmPLc3xid72 7E1DHND1kl6zXh4d90+xYfwFBXxPQIODYbes95/XgWtcEWFHDvGOHz3x1HtySW+eG1Xg oQZZ/h6HWw6OAQAycBU9Sgr9Z8RBSsgnIsOYpObaMwhwH397cL8M28gwgdm3YbtsNSgM xa9g== 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z18-20020a170902ccd200b001cc4770b98asi11704716ple.357.2023.11.15.19.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 19:28:48 -0800 (PST) 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 8D2EF807C7FA; Wed, 15 Nov 2023 19:26:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235695AbjKPD0q (ORCPT + 99 others); Wed, 15 Nov 2023 22:26:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235689AbjKPD0o (ORCPT ); Wed, 15 Nov 2023 22:26:44 -0500 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06896189; Wed, 15 Nov 2023 19:26:39 -0800 (PST) Received: from loongson.cn (unknown [10.20.42.173]) by gateway (Coremail) with SMTP id _____8Cx5_Hui1VlznI6AA--.49344S3; Thu, 16 Nov 2023 11:26:38 +0800 (CST) Received: from [10.20.42.173] (unknown [10.20.42.173]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxO9zqi1VlAaxDAA--.16678S3; Thu, 16 Nov 2023 11:26:37 +0800 (CST) Subject: Re: [PATCH v4 0/3] LoongArch: KVM: Remove SW timer switch when vcpu is halt polling To: Huacai Chen Cc: Tianrui Zhao , WANG Xuerui , kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org References: <20231116023036.2324371-1-maobibo@loongson.cn> From: maobibo Message-ID: <06908fb4-cbd8-74a1-2e6f-3da016bd3280@loongson.cn> Date: Thu, 16 Nov 2023 11:26:36 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8CxO9zqi1VlAaxDAA--.16678S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoW7tF1UuFWUAF48WFy3Wry7XFc_yoW8KFWkpF ZIkFnIqr4kKr4kK3Zaqa1DXr9Fq3yIqF1xXrn3tryrArsIyF1YqF18KrWF9F9xu393AFyI vryrt3Z8Za4UA3cCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUv2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_Jw1lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1c AE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8C rVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtw CIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x02 67AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr 0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU82g 43UUUUU== X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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]); Wed, 15 Nov 2023 19:26:51 -0800 (PST) On 2023/11/16 上午10:54, Huacai Chen wrote: > Hi, Bibo, > > I suggest submitting this series to the internal repo, too. Because we > don't have enough resources to test the stability for the upstream > version, while this is a fundamental change. On the other hand, the > patch "LoongArch:LSVZ: set timer offset at first time once" can be > submitted first because it is already in the internal repo. We ever consider to keep the same between internal repo and upstream, only that there are many differences since kernel version is different. We are preparing to setup test environment for upstream kvm module, the stability for the upstream is very important for us -:) Regards Bibo Mao > > Huacai > > On Thu, Nov 16, 2023 at 10:33 AM Bibo Mao wrote: >> >> 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 pending >> HW timer interrupt status directly, rather than switch to SW timer and >> check injected SW timer interrupt. >> >> When SW timer is not used in vcpu halt-polling mode, 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. >> --- >> Changes in v4: >> If vcpu is scheduled out since there is no pending event, and timer is >> fired during sched-out period. SW hrtimer is used to wake up vcpu thread >> in time, rather than inject pending timer irq. >> >> Changes in v3: >> Add kvm_arch_vcpu_runnable checking before kvm_vcpu_halt. >> >> Changes in v2: >> Add halt polling support for idle instruction emulation, using api >> kvm_vcpu_halt rather than kvm_vcpu_block in function kvm_emu_idle. >> >> --- >> Bibo Mao (3): >> LoongArch: KVM: Remove SW timer switch when vcpu is halt polling >> 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 | 13 +----- >> arch/loongarch/kvm/main.c | 1 - >> arch/loongarch/kvm/timer.c | 62 ++++++++++----------------- >> arch/loongarch/kvm/vcpu.c | 38 ++++------------ >> 5 files changed, 32 insertions(+), 83 deletions(-) >> >> >> base-commit: c42d9eeef8e5ba9292eda36fd8e3c11f35ee065c >> -- >> 2.39.3 >>