From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F25EC433DF for ; Thu, 13 Aug 2020 09:36:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63AA2204FD for ; Thu, 13 Aug 2020 09:36:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YO9aq/cg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63AA2204FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k69ee-0005N9-I2; Thu, 13 Aug 2020 09:36:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k69ed-0005N0-FE for xen-devel@lists.xenproject.org; Thu, 13 Aug 2020 09:36:11 +0000 X-Inumbo-ID: c252a777-880e-40f2-b715-ada8da67b2e9 Received: from mail-wm1-x335.google.com (unknown [2a00:1450:4864:20::335]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c252a777-880e-40f2-b715-ada8da67b2e9; Thu, 13 Aug 2020 09:36:10 +0000 (UTC) Received: by mail-wm1-x335.google.com with SMTP id t14so4446782wmi.3 for ; Thu, 13 Aug 2020 02:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=4F2l7CYyl2ihR31lS7c1TSIJ/BFDhHW8ufRVF7UoS+Q=; b=YO9aq/cgFlDS3KnfmCztcDR+PgT336f5AMOoqj3YS4NW0AIIppWCbT2apyKBW8O8/i yAWezoSX/GTebziZAH6Mcft5lMv9nlbe7nStUG7T0dH7yuQPLIGYUgSn9m5eXCw1jCXn btjfreBIdg8dyJf4VOoBgIrsJWPAq6bMryztZuqAaj0LpoV49Hpg3JZ7i+MA6dJUbDRX pSg9tL/w1gjtXDe3FtSrQQ8KyHDQYBpMIBPIqdwIXewOsE5OZ/vlT2dB8x1YVVxTL6W4 TtJRnKq5i5uY8yXUjJT+gRryiFVTOLovcufU0lVWVGHSjtHZ12NTwDlTC8NDLsE2sahx dP7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:to:cc:references:in-reply-to :subject:date:message-id:mime-version:content-transfer-encoding :thread-index:content-language; bh=4F2l7CYyl2ihR31lS7c1TSIJ/BFDhHW8ufRVF7UoS+Q=; b=o93eZIXW0WSIac3WUntPGFXymss2MoDo5s4NZ8FiaEaqenb/jzg42vLGeeXzo2S2LO f0CQdXfBFElofkqhf/UrOIX7T4s/iPspsygG9WdBUOtf8xAf2CAeQtH4l1On61SiyjGh MD8jexo9zNv+jx7FTvtRVndvOp4UU7IgjqRfsnv7x5vwlNzzVrmaHv77/REWcsSC9Lcd 6KMBc4ULQr4GT8SYhcOvTm4mlFn2OXAcths2mKZcKH9MXpH+lkjTOn1vVVDsd/Np5LWG xP2NTsqibkrVxEG7kswr6BXfY7pd6mz+g/iZY1S1EXbyhngUSUOXvZ4JI7Bkwt8buFDr Zl0g== X-Gm-Message-State: AOAM531Vz3cfAM1n0Qz0s5PCMgjgJltIiwluoi/+C9eU7LwWiJWaOP5u JM/RruuRukPVfg12z73zob0= X-Google-Smtp-Source: ABdhPJy3ljFEhDyVoN4gQdq8FQCv+LCjAYWBoF+egxN6Qt4nYtRz8c/G29mP+uof2h3Fyr8lPVkNew== X-Received: by 2002:a7b:c95a:: with SMTP id i26mr3760343wml.106.1597311369408; Thu, 13 Aug 2020 02:36:09 -0700 (PDT) Received: from CBGR90WXYV0 (host86-143-223-30.range86-143.btcentralplus.com. [86.143.223.30]) by smtp.gmail.com with ESMTPSA id s8sm8448033wmc.1.2020.08.13.02.36.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2020 02:36:08 -0700 (PDT) From: Paul Durrant X-Google-Original-From: "Paul Durrant" To: =?utf-8?Q?'Roger_Pau_Monn=C3=A9'?= Cc: , "'Wei Liu'" , "'Jan Beulich'" , "'Andrew Cooper'" References: <20200812124709.4165-1-roger.pau@citrix.com> <20200812124709.4165-5-roger.pau@citrix.com> <004e01d6714c$748450d0$5d8cf270$@xen.org> <20200813085732.GE975@Air-de-Roger> In-Reply-To: <20200813085732.GE975@Air-de-Roger> Subject: RE: [PATCH 4/5] x86/viridian: switch synic to use the new EOI callback Date: Thu, 13 Aug 2020 10:36:07 +0100 Message-ID: <005a01d67155$2c689aa0$8539cfe0$@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHtt6hyfd7HfGtbm1qQjI5TC+nvgAFzOaW4AfrO1F8CylicMqjVd3RQ Content-Language: en-gb X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" > -----Original Message----- > From: Roger Pau Monn=C3=A9 > Sent: 13 August 2020 09:58 > To: paul@xen.org > Cc: xen-devel@lists.xenproject.org; 'Wei Liu' ; 'Jan = Beulich' ; 'Andrew > Cooper' > Subject: Re: [PATCH 4/5] x86/viridian: switch synic to use the new EOI = callback >=20 > On Thu, Aug 13, 2020 at 09:33:43AM +0100, Paul Durrant wrote: > > > -----Original Message----- > > > From: Roger Pau Monne > > > Sent: 12 August 2020 13:47 > > > To: xen-devel@lists.xenproject.org > > > Cc: Roger Pau Monne ; Paul Durrant = ; Wei Liu ; Jan > > > Beulich ; Andrew Cooper = > > > Subject: [PATCH 4/5] x86/viridian: switch synic to use the new EOI = callback > > > > > > Switch synic interrupts to use an EOI callback in order to execute = the > > > logic tied to the end of interrupt. This allows to remove the = synic > > > call in vlapic_handle_EOI. > > > > > > Move and rename viridian_synic_ack_sint now that it can be made > > > static. > > > > > > Signed-off-by: Roger Pau Monn=C3=A9 > > > --- > > > I'm unsure about the logic in viridian_synic_deliver_timer_msg, as = it > > > seems to only set the vector in msg_pending when the message is > > > already pending? > > > > See section 11.10.3 of the TLFS (SynIC Message Flags)... > > > > "The MessagePending flag indicates whether or not there are any > > messages pending in the message queue of the synthetic interrupt > > source. If there are, then an =E2=80=9Cend of message=E2=80=9D must = be performed by > > the guest after emptying the message slot. This allows for > > opportunistic writes to the EOM MSR (only when required). Note that > > this flag may be set by the hypervisor upon message delivery or at > > any time afterwards. The flag should be tested after the message > > slot has been emptied and if set, then there are one or more pending > > messages and the =E2=80=9Cend of message=E2=80=9D should be = performed." > > > > IOW it's a bit like APIC assist in that it tries to avoid a VMEXIT > > (in this case an access to the EOM MSR) unless it is necessary. > > > > Reading the code again I think it may well be possible to get rid of > > the 'msg_pending' flag since it only appears to be an optimization > > to avoid testing 'message_type'. I'll try dropping it and see what > > breaks. >=20 Well nothing apparently broke. The EOM handler basically becomes a no-op = too, but I think this is fine because we only use the synic for = delivering timer messages at the moment. Paul