Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp193614rdb; Thu, 30 Nov 2023 02:07:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWK0K7cGG00JlXMcbvWILv1ftKoYZFnMx86VS4AZ1pbSoX0CcJJhtQPzaoD0dGIUsaq7ck X-Received: by 2002:a17:902:db07:b0:1cf:ca67:4314 with SMTP id m7-20020a170902db0700b001cfca674314mr16024689plx.37.1701338828241; Thu, 30 Nov 2023 02:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701338828; cv=none; d=google.com; s=arc-20160816; b=FfdRiPMjbs27F5zZq1G3+ETTfem8Ey2jT+rRMH3uaIL5Ab0wxk2fDrAtug34A+uYKo 33xOmP/qAr38aB5vDtwMcvMhy9wjcbivNI+O9rluZWqkF+E/NEESQiG7xdmwWur+uxWh 5bS4iEotyPBXgUpEtDCMJwnpeP0b8OTQDX84gdRDu8pi0cTkJGJR8to01blE+IoS/rum JHIORIEF5VQrEhrxMzjB1v39T3RYQNp7WCo9+5RNLssO5JL+I4m35meEYzUDU7mHIJPp LDwq1cPx6itfRECJwUbJXBvitzlvi78IWT7+/PkIYLdEJwTRgLLXDckIkSAlOAnuidHt JMQA== 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:references:cc :to:from:subject; bh=bbgeqt/Q2N3We/p5obuBGkOOlm0/S06ywlunSE94Mpw=; fh=JOrDXAv7dX9lqUsWenmIinruxsV5NNS7FV+l4Q4onAY=; b=m9CiD+/LTeH/AvrF6SIFNJZke1i9HemFxfzdQltV9yUbTHxBOB8izEi5JeEg/6UPms OxHpKWL7SimNBQaRMwLlrEGq80Wd6+mqVdveyyOB6wFJR11PbkJI2i0Qv4ywpC/KzZJd JDmQe7mR3QXimes+fdAqmwX4FtxfymYfvKh+yWCOdpWprhFehl4XlNc3pp9a5PRVkmfF DF7zJA7gHGUDLBF98HBxEoFP9a3jmb2MEEbrBQ/jASVrD7BRplin/Ks2CtIqd4nRb4uW 5AfIxQycEcNOgqRZMOxTcQmllBifuw9xZF16YWsaC7aEvT2svD/r0Z1GTZfw0nPtw25h FNHw== 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:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id p5-20020a170902e74500b001cfaf9bf847si962165plf.352.2023.11.30.02.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 02:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 629D781FEC45; Thu, 30 Nov 2023 02:07:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235127AbjK3KGr (ORCPT + 99 others); Thu, 30 Nov 2023 05:06:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjK3KGq (ORCPT ); Thu, 30 Nov 2023 05:06:46 -0500 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 078E110C2; Thu, 30 Nov 2023 02:06:49 -0800 (PST) Received: from loongson.cn (unknown [10.20.42.173]) by gateway (Coremail) with SMTP id _____8DxPOu2XmhlHuQ9AA--.52040S3; Thu, 30 Nov 2023 18:06:47 +0800 (CST) Received: from [10.20.42.173] (unknown [10.20.42.173]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y+0XmhlO6pQAA--.47164S3; Thu, 30 Nov 2023 18:06:46 +0800 (CST) Subject: Re: [PATCH v4 0/3] LoongArch: KVM: Remove SW timer switch when vcpu is halt polling From: maobibo To: Tianrui Zhao , Huacai Chen Cc: WANG Xuerui , kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org References: <20231116023036.2324371-1-maobibo@loongson.cn> Message-ID: <4d9e1a2d-2e37-a82f-7133-2b28b9c980c2@loongson.cn> Date: Thu, 30 Nov 2023 18:06:38 +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: <20231116023036.2324371-1-maobibo@loongson.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Cx7y+0XmhlO6pQAA--.47164S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoW7KrW5GrWfCr1xXF4rCr1xJFc_yoW8WrW3pr ZIk3ZxXr40kr4Fg3ZIqa1DWr9xWw4FgF4IqwnIkFyrArnFyFyYqFW8Kr95ZFy3Xa93AryI vryrt3W3ua4UA3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUBFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2kKe7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07 AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWU XVWUAwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI4 8JMxk0xIA0c2IEe2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_ Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0 cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8V AvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E 14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07je0PfUUUUU= X-Spam-Status: No, score=-2.9 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 02:07:05 -0800 (PST) slightly ping... On 2023/11/16 上午10:30, 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 >