Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp621683imm; Wed, 1 Aug 2018 02:28:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcisOH8a2OaW0wh1bu0fPb2r32i6oZWVXFPCSlqNftFBbhzZ7qXImKt45CQOareJGGZYS9x X-Received: by 2002:a62:98d6:: with SMTP id d83-v6mr26267844pfk.186.1533115694852; Wed, 01 Aug 2018 02:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533115694; cv=none; d=google.com; s=arc-20160816; b=X3IrzXBPmIRYsrL/NvxHCPiiL45Pnk9Iu3LDRoU7zPF4kH/SXV5ExciHcij6DPFKml E6/QszS78CBjtyLFMDVNMqfGeef2rWN8u2rN0DA40aeAaMxq/6qt2ezeQGIRePrWgin6 C9xaqKk+UcGHPNRzhH1NUNoy1wQjGrqnMEnQEV1LQ0NnXu3xaxpGdkzSdSMz6k6WugHz JQD9lLQBNtvnDdJDhW4fyaOJWrvSjeMiBt3THzlwiVIRKoku82X4NXDYCr1KL7RIcTZ2 LwZpvjpdqXQSF2olvcZjTxER8DCLvxOpjqVYlHpWXhMRY5w0n8PfFP0RaAcpN+mmNiMC 9zAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=azlRKhGe1w9T7DC14EZj9YcgWhx/PO6pJ4XvSXqbDpo=; b=kMe6DzblsjGAJtiO4Z/C5LsNKmZoeXqqrdsHVM7tGNmVhNAbUcc2S0YGbQVewVo0B5 2+S9K1pGzZARuqd7PLWlrWLqo41aryded8ceW+4bdJPmD5gzjuIptCoMWLdbJn/KanNb w+U7bHjUdR/tB1zIsiXCnqWRefHLvfE7YgeIyV7F9Gi7/rtYhNUenHdWBhTpRLPmxeGb SZqeoEqSU85lXW6pu41XAvkDNdLA3wth2ytbSr7p0XRKz0uclCmB0OZ+SnGXtx6Sb5Z2 8++bgVET3JH1U3mmyNodIWrNxXJIR1S3dzU95g5jF32G/yp5+NdxRJOfl8X+Ho1aV49O CarA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9-v6si10746247pgj.70.2018.08.01.02.28.00; Wed, 01 Aug 2018 02:28:14 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388925AbeHALLH (ORCPT + 99 others); Wed, 1 Aug 2018 07:11:07 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37132 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388622AbeHALLH (ORCPT ); Wed, 1 Aug 2018 07:11:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C05D287A7B; Wed, 1 Aug 2018 09:26:16 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F4832142F20; Wed, 1 Aug 2018 09:26:14 +0000 (UTC) From: Vitaly Kuznetsov To: "Michael Kelley \(EOSG\)" Cc: "mhkelley58\@gmail.com" , "gregkh\@linuxfoundation.org" , "linux-kernel\@vger.kernel.org" , "devel\@linuxdriverproject.org" , "olaf\@aepfle.de" , "apw\@canonical.com" , "jasowang\@redhat.com" , "marcelo.cerri\@canonical.com" , Stephen Hemminger , KY Srinivasan Subject: Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Make synic_initialized flag per-cpu References: <1533004484-3937-1-git-send-email-mikelley@microsoft.com> <87ftzzodnv.fsf@vitty.brq.redhat.com> Date: Wed, 01 Aug 2018 11:26:13 +0200 In-Reply-To: (Michael Kelley's message of "Wed, 1 Aug 2018 05:47:08 +0000") Message-ID: <8736vyo2tm.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 01 Aug 2018 09:26:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 01 Aug 2018 09:26:16 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Michael Kelley (EOSG)" writes: > From: Vitaly Kuznetsov Sent: Tuesday, July 31, 2018 4:20 AM >> >> Alternatively, we can get rid of synic_initialized flag altogether: >> hv_synic_init() never fails in the first place but we can always >> implement something like: >> >> int hv_synic_is_initialized(void) { >> union hv_synic_scontrol sctrl; >> >> hv_get_synic_state(sctrl.as_uint64); >> >> return sctrl.enable; >> } >> >> as it doesn't seem that we need to check synic state on _other_ CPUs. >> > > I was trying to decide if there are any arguments in favor of one > approach vs. the other: a per-cpu flag in memory or checking > the synic_control "enable" bit. Seems like a wash to me, in which > case I have a slight preference for the per-cpu flag in memory vs. > creating another function to return sctrl.enable. But I'm completely > open to reasons why checking sctrl.enable is better. Just a few thoughts: reading MSR is definitely slower but we avoid 'shadowing' the state, the reading is always correct. In case there's a chance the SynIC will get disabled from host side we can only find this out by doing MSR read. This is a purely theoretical possibility, I believe, we can go ahead with this patch. -- Vitaly