Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2414721ybh; Fri, 24 Jul 2020 12:09:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlmLJWpkrHTgGgnS6HihM6gpvjkuO4dfdupV1v6p2fcG4LXObsZnlDupMPxFFjevcnkaUh X-Received: by 2002:a17:906:f181:: with SMTP id gs1mr10864052ejb.293.1595617768604; Fri, 24 Jul 2020 12:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595617768; cv=none; d=google.com; s=arc-20160816; b=x5xevfvi5DSbQvBf5nOi9sBk7D8GLGbljJViGNRtIoxYtZ9WJnbxvM2wk8MEbvLXIX ZXtoq9kq7yb9hpu4gM1GqE9k3P05F1c6LsyXcyuPI4RGZSSesSKI2TkA9q1Op7GaBnuh mWQZBqQeo0X/aln6dDuIrYDxDJDw32cGjkDnbItOVWIJ87NL0kLFC+z+M3fb4p7y++Yf RLwUPE1vWvkOk6SOAkGIIcMlmMhXVMpTYp6x4Zis4rFKN+ff5MmZrIXQDOzSxP7tbN1i hqa5tvvOHCigyoiIbYRoP7bxYsRoqWYWf5GQ2W8OAWfiPymDdjESa76EgQqgmBqulIc+ ut1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=HDN6+oEq+rXXE3L9eqvVhY8T2LwO0r+OvHOIHPOdeUs=; b=dXu4e1u7mv9uSf8JwvBCHlOSXfmaqth+WPwt58ujcnxHJFr/tTNWciSVNvVJp05lKp 8Wh/KkCcap3RBsTYL9rV8rfO120H462hm3PAbClymZEvXYoN+zVuU/44KJtbzKU353Ln Hel/0oASsTivGgA13xCH95v2tdD5ZVQZOnGp7O4PEJ2Z9iRc1gyOAv6a7aJ+87JPepF2 ScFMLCH+9FZjEubX+5fdT/Fq80LTsZp+5DfxutDfzrelYuKuznwEqklO7tqHW0SJN1nB Mj4vlxnjUyI5sbcqxTRgcF8NgrXKDU9UyE8Nm7oRGms9YeSjg93QPAEFENKO0Dq+tp5F OiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=el+I9+uQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=DpuwIS4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si1085288edy.494.2020.07.24.12.09.06; Fri, 24 Jul 2020 12:09:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=el+I9+uQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=DpuwIS4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbgGXTIi (ORCPT + 99 others); Fri, 24 Jul 2020 15:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgGXTIh (ORCPT ); Fri, 24 Jul 2020 15:08:37 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1CABC0619D3; Fri, 24 Jul 2020 12:08:37 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595617714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HDN6+oEq+rXXE3L9eqvVhY8T2LwO0r+OvHOIHPOdeUs=; b=el+I9+uQblelBDjYB//Cal2rLo4nU3iFXpDSaBgrTN+Gqe0m1TddgxerIJmVagiDFK0gWf CyV/KxAlDTzUt0zrDOn/2RrKXH/5oFv1dExHp8xBDLIlwaI9ATikeGvsglX2qOagUAYLMB pheHNkJHIZ1OgRKLxRjCh4f0eWjtypi+cwbpnAv24hWi9GKZ+yPNEW5SiPf+8yoZyG38JS I/p+jLZqeSHvzZBPvzuwDyW54Etmj9QdvG2NgR5gxljp7dyle1DKPlmgOMy+UCBDijfcMZ L8BRqm/ISG0fdbHksFxHZ4DdSX8GLyeMTnwt7N5mBJZMcYPN8BlQTne+/tcGvA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595617715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HDN6+oEq+rXXE3L9eqvVhY8T2LwO0r+OvHOIHPOdeUs=; b=DpuwIS4slPn8hA1LX5q05nEMp3zaBYNmq/xtwXclhxwCVdYvfh9uyeHozT6oyBGWJvZmj+ G65wLHmg2aKSxxDQ== To: Ingo Molnar Cc: LKML , x86@kernel.org, linux-arch@vger.kernel.org, Will Deacon , Arnd Bergmann , Mark Rutland , Kees Cook , Keno Fischer , Paolo Bonzini , kvm@vger.kernel.org, Gabriel Krisman Bertazi , Sean Christopherson Subject: Re: [patch V5 15/15] x86/kvm: Use generic xfer to guest work function In-Reply-To: <20200724142426.GA651711@gmail.com> References: <20200722215954.464281930@linutronix.de> <20200722220520.979724969@linutronix.de> <20200724142426.GA651711@gmail.com> Date: Fri, 24 Jul 2020 21:08:34 +0200 Message-ID: <87k0ysu3wt.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ingo Molnar writes: > * Thomas Gleixner wrote: >> /* >> - * Note, return 1 and not 0, vcpu_run() is responsible for >> - * morphing the pending signal into the proper return code. >> + * Note, return 1 and not 0, vcpu_run() will invoke >> + * xfer_to_guest_mode() which will create a proper return >> + * code. >> */ >> - if (signal_pending(current)) >> + if (__xfer_to_guest_mode_work_pending()) >> return 1; >> - >> - if (need_resched()) >> - schedule(); >> } > > AFAICS this chunk removes a conditional reschedule point from > handle_invalid_guest_state() and replaces it with > __xfer_to_guest_mode_work_pending(). > > But __xfer_to_guest_mode_work_pending() doesn't do the cond-resched of > the full xfer_to_guest_mode_work() function - so we essentially lose a > cond_resched() here. > > Is this side effect intended, was the cond_resched() superfluous? It makes the thing drop back to the outer loop for any pending work not only for signals. That avoids having yet another thing to worry about. Thanks, tglx