Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1322843rwl; Thu, 10 Aug 2023 09:26:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcCNp8CoOLnov/KuSu9lCagIoBFHrXSHNKap2c0+mb8095f4eTaoRI4tlBuQXuo2KBfViK X-Received: by 2002:a05:6808:24e:b0:3a4:91a:224a with SMTP id m14-20020a056808024e00b003a4091a224amr3263263oie.34.1691684805602; Thu, 10 Aug 2023 09:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691684805; cv=none; d=google.com; s=arc-20160816; b=JTP+BuOHgRdAkjlYnfChmMpyk7lQ0fOHWAGSwYm2H/NlQ+092GR26z7SyDiaBTautl vChrG2DAPpdpE/sCOEFu0YrshEPeR3zsGwSaDd3dGh28k2zqUsj9phuwtZh0E2ymiWvU 4UvQBuNR9FMHLFxMEr+z4O7Ku2XfqkUsxYFyAjm38ai0EiV8juR0IbpToHKvsxF3/p5P pXL+iBRHbY6I5VLnn3RdQ9sDtWfHuZsjSXKGxP2qTnO8k0AN80ldbAsJL8i7aTYEAynE HLsO0dvIAvHZTN5RKvKPHXPagcplhoasmM0KBynSWwDone9/eMyQ4l2PLrQ7UP+5oVbk on+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=yItIGd+VziiCMmIsL5VeGcajb1T1QATLpzjnEH/QeZs=; fh=eFi3n7O2RH5iyr/vljN+fUBk5OXQmo8WJMi/57F+QVk=; b=c5b3Fd8KBWSdHMDTsFs+HSyxILBUjYyEb+eSPSZroILxWfg821NPM30reqOTvZrxvP guvM5FQ4JOm0ihqMi7nM0Cb9ivEk1vuHclHVWIAacslMDVTnLei41cJAHQj6sl+0d+zE gV6lGunoqBMmnymCP4BnDvok5GzQ4OinQVdadYzX1MoD3KSnKbY4BdtAk49HCA+9mpp5 fgVExzIVhMDFiAS/txsbTRfvWUudjdoMUFpmNfKcknjUtKGBC5S8b89MtyGRH1kY1Tv9 v+bgThqu3myWMururWVT/mUjAgfIHEFsasxtboI3v5eQG+6okzYzpLzgHCedSvkIFhT2 ZHKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=5c5+Pp3d; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a63cc46000000b0053f265b0ef2si1779118pgi.471.2023.08.10.09.26.32; Thu, 10 Aug 2023 09:26:45 -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=@google.com header.s=20221208 header.b=5c5+Pp3d; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236156AbjHJPdx (ORCPT + 99 others); Thu, 10 Aug 2023 11:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236039AbjHJPdw (ORCPT ); Thu, 10 Aug 2023 11:33:52 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5364326B6 for ; Thu, 10 Aug 2023 08:33:52 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-55bf2bf1cdeso1825565a12.3 for ; Thu, 10 Aug 2023 08:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691681632; x=1692286432; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=yItIGd+VziiCMmIsL5VeGcajb1T1QATLpzjnEH/QeZs=; b=5c5+Pp3d7b+YdcZY1ukYNHFXTfwAdOq+c04n6t/aoc99s8WTG4K/VPMxmTbUJ92g+y pOYUpoQfh2N9ecuS5vUqE3Cpt8Qa3uSkWtWg+hEygCUDYTiXzUbiJ+SGdoYHiSVQHKcP MEYFB+2LsEAqWAJPzJVPGNQCAjb0GttzgIhVKm9uRsxtXxijPqpkTn+PCxGUn2EmD78d oOpj/dD2WGH4XtFI0D5jjxS1uH5OxtiLDLwCZZN5QfE5ITZKehl9GL8mcYsZyZZPwsXL gEh4+KpMb6C100UF8mtgp+n3d+ybXrJt/BIL1+/2c+xQ2CUkWU0kE2NX2avh4aGjOgvI zT+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691681632; x=1692286432; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yItIGd+VziiCMmIsL5VeGcajb1T1QATLpzjnEH/QeZs=; b=VcUPMJCOAg+9m/x6pXslcNhYB4qCpDz/Ixzum8z8xVMiJczNV8cXA8KPlqjQobb99n 2j1NRNjNbTQYN2Z1zNIpj/BAQJPQnAkxCbY+zk84NTFLmgZMOrVchDvCyDtCqLBxSTPM FF8qqmdwlXHbBGMXq8dYftHxBTu+DeBu5GLFGKy4dlIGu2nXtTMdRorNFozrJhY3Ebl0 al15G2lxaQfU1pHBwV/Rmh6njIfmUDOZ4CrVZfWZYPX8cLio35DX293abvnWiDVrk5/q 6qrieXOLz1WVvWZLj/mZvptoScIYtufoIJs6lEbmD7+YV8+xMle/YjAojTRHyaoHIGUJ 03vw== X-Gm-Message-State: AOJu0YxKuLnJX/4m/+90nK9R37NnBamO9yMJQzR7tOzHlFDhqTcdW1Mx CKamnz8731g379KV6apqMbpBAmuWYMg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a63:77c2:0:b0:563:8d36:5d8a with SMTP id s185-20020a6377c2000000b005638d365d8amr495418pgc.3.1691681631744; Thu, 10 Aug 2023 08:33:51 -0700 (PDT) Date: Thu, 10 Aug 2023 08:33:50 -0700 In-Reply-To: <941e45b1-49eb-fcba-20d4-71b1db8041c5@redhat.com> Mime-Version: 1.0 References: <20230808232057.2498287-1-seanjc@google.com> <941e45b1-49eb-fcba-20d4-71b1db8041c5@redhat.com> Message-ID: Subject: Re: [PATCH] KVM: x86: Remove WARN sanity check on hypervisor timer vs. UNINITIALIZED vCPU From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yikebaer Aizezi Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 On Thu, Aug 10, 2023, Paolo Bonzini wrote: > On 8/9/23 01:20, Sean Christopherson wrote: > > /* > > - * It should be impossible for the hypervisor timer to be in > > - * use before KVM has ever run the vCPU. > > + * Don't bother switching APIC timer emulation from the > > + * hypervisor timer to the software timer, the only way for the > > + * APIC timer to be active is if userspace stuffed vCPU state, > > + * i.e. put the vCPU into a nonsensical state. Only an INIT > > + * will transition the vCPU out of UNINITIALIZED (without more > > + * state stuffing from userspace), which will reset the local > > + * APIC and thus smother the timer anyways, i.e. the APIC timer > > "Cancel" is probably more understandable to non-native speakers, though > undoubtedly less poetic. I intentionally avoided "cancel" because there is no guaranteed the timer would actually be canceled (if KVM switched to the software timer). I am/was trying to call out that even if the timer expires and pends an interrupts, the interrupt will ultimately be dropped. Maybe "squashed"?