Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7634913ybc; Thu, 28 Nov 2019 22:01:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxm+1XyD5lU2qKxqVFX+4ta80/Mz1ZrpUGXbkMq6FWjpot/VRChZio4EV1OCIVieMiuTvOu X-Received: by 2002:aa7:d6cf:: with SMTP id x15mr42606811edr.202.1575007286044; Thu, 28 Nov 2019 22:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575007286; cv=none; d=google.com; s=arc-20160816; b=hp6TtZVMuE94Hqs6CMfmnMOmEbZBH5eC3nhG364vIZgw9KKLWf2zIr4lUlvZF1Hpah HE+l51roboi/qavnNRJe64ZrBrOjFP2Y1UYKNyase3hYhTHt/fo1w0u+0zb7o5H/Myvd QE2BwHWw0tuP2sFqExk7JCEzORRddiP8gb8XxkK1IcxiQDmmJu3hju2Dp9O7XF19N2+q CXdKKYDkRrRuT8MLTngq6Er3TY3RxqFELSpfiwwLYNoEjHMNJwhnhTtRQvrClDrxDDHh fvBH3yF5hA4/hJ4w9IjZHkZVul2lWYvd/ScQV0XzAl06DJkyuoPF+XG1Nhfg0QUGN4Jy YnKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=w4A+B5PJFQry/vBdQ/SlNDujzmtsJiMkovJ5klZ1MdQ=; b=POLRSrRVIfJHvbYPnMsXZbPxiiBPpct1Jl3I/FU0ldMYotYok3QV0F372uS8+9o9QN bOX2sHVk/zZE6ZINWGqJTVso7riwtopEmq9VTQa8fHUGrkkar0Fh0KLXLycGvfaasPAt hdHJiwN/U5ZEtohFMkkHkievOIdYAou/BgbULhClDfev46XbajdGdNF7uerb/opDXA1n jPQIS8+uBiM4orE1K8i3Swi9utZp51y96YGqBxwFPMBf0sK1KoZJWB4OPpUKg7wCSSvu 4tDy1K5S1FtW0tehFIo3GG3NrNuL3CEtnIvnBaZd4xbVpvIxy6IxLBZWe7Qabtktwoc3 vy0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si12699714eji.269.2019.11.28.22.01.01; Thu, 28 Nov 2019 22:01:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbfK2F7Q (ORCPT + 99 others); Fri, 29 Nov 2019 00:59:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:40140 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725860AbfK2F7P (ORCPT ); Fri, 29 Nov 2019 00:59:15 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 29988ACE0; Fri, 29 Nov 2019 05:59:14 +0000 (UTC) Subject: Re: [PATCH v2] xen/events: remove event handling recursion detection To: Boris Ostrovsky , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Stefano Stabellini References: <20191128084545.13831-1-jgross@suse.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: <6483de2d-963c-3b5e-150a-641e070e3d0e@suse.com> Date: Fri, 29 Nov 2019 06:59:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.11.19 22:37, Boris Ostrovsky wrote: > On 11/28/19 3:45 AM, Juergen Gross wrote: >> - >> static void __xen_evtchn_do_upcall(void) >> { >> struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); >> - int cpu = get_cpu(); >> - unsigned count; >> + int cpu = smp_processor_id(); >> >> do { >> vcpu_info->evtchn_upcall_pending = 0; >> >> - if (__this_cpu_inc_return(xed_nesting_count) - 1) >> - goto out; >> - >> xen_evtchn_handle_events(cpu); >> >> BUG_ON(!irqs_disabled()); >> >> - count = __this_cpu_read(xed_nesting_count); >> - __this_cpu_write(xed_nesting_count, 0); >> - } while (count != 1 || vcpu_info->evtchn_upcall_pending); >> - >> -out: >> + rmb(); /* Hypervisor can set upcall pending. */ > > virt_rmb() perhaps then? Yes, that's better. Juergen