[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 1/3] Prevent a xenagent timeout on S3/S4 transition.


  • To: Troy Crosley <troycrosley@xxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 3 Sep 2020 15:06:44 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tBurwFKnC4uLjkzHX+MZwHI9wvf76wx6w+YjfJvnHkA=; b=fADyixZJpW5jUvTPK3Q4WYDK2ArpDvCYiRooYvKlF4QD1LabOAT30yncQUvqKf9kleJ6LCBjwcLLDPQ1hLm255NHXT+NOtvjQiknlKdYZdjZCI+EcgLlxM+jIxPBC5j1zjJ/kWId9OVmNzMBuL8IqxrFMBEl+nDseo0dCIoBerqJ72xIcXwngkpwsOljlbGU0HVXj+whzPhJj69YCHUOXlCAYMFqSJIwE4jbv0WTraSbpo3RHCLJoTBUYCLjjZUKUuseGuc8MlMzSq8qjouOHeH/CBzKv8GESFwmd7R6Udc2VOFTvismrxY8Td68aQW6aP3PY0DgNlmoXXXlkdta8A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oOKKV7MD/D+fqKImyey+PwAkE8RLBdzt4IyC93mc6ctqKMLy3SD7yXo9SDPL8LcXr9P9T8VCvBRc+XoRbj/Klu8VoyoEQRusg74IEjM7Fr7eG4YvDD2pX8zQhrsLM2KpNKPgGOLSAGG6f0P3gvMZIsn52jHgA1HLAuBRFnB8EvlDs9QX5QaexMb5abwbx1hLqjJK6vbS1aqdgZzpiRBJnUnu37PPrK1VXsUPQ1HQRa2NDYAXiBvpNlVzh70oKCIEHsL+r6xo98lDGz+t3x/9J2FKNqaA7JW/Nni7AOsKqztoOAQko+NZcZRDzRRw6+eLdFE1m285LJYUMA06E8YobA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "paul@xxxxxxx" <paul@xxxxxxx>, Ben Chalmers <ben.chalmers@xxxxxxxxxx>
  • Delivery-date: Thu, 03 Sep 2020 15:06:52 +0000
  • Ironport-sdr: eB9QKKsSPqdfHwWB3TCG06J4QXsRuUcdkQWj99uNsuno6EnpWeDmSAuraVFsOOotziD6zas0bz /0ASkOtSXdz1HFC0pnWcALWXlpftGi0LfBfEaDURmGRxfnyNzSOACXOa0MI6g7aYWRMh7GjKeB /u2BVFwg+5pqSerYAaaA9eCvztaw0WYDjwrG5iN7PiEy/FS0SsbVTkItx+SYpeIRXR7ElMmqLJ YhG3aATzbNcCM3SYqLwV1fHhToWeRFL51HRwyBQmUziOL2v4e/wlIgnUw7H/Gubm4EN/xAcwwA 68g=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Thread-index: AQHWgIVBmjpBp1FmtU6cD8M4/D8T/6lXBh+A
  • Thread-topic: [PATCH 1/3] Prevent a xenagent timeout on S3/S4 transition.


> -----Original Message-----
> From: Troy Crosley <troycrosley@xxxxxxxxx>
> Sent: 01 September 2020 18:28
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: paul@xxxxxxx; Ben Chalmers <ben.chalmers@xxxxxxxxxx>; Owen Smith
> <owen.smith@xxxxxxxxxx>; Troy Crosley <troycrosley@xxxxxxxxx>
> Subject: [PATCH 1/3] Prevent a xenagent timeout on S3/S4 transition.
> 
> [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments
> unless you have verified the sender and know the content is safe.
> 
> Prevent a xenagent timeout (and live kernel dump) on S3/S4 transition by
> changing CXenIfaceCreator::Log to use TryEnterCriticalSection.
> Otherwise, a timeout occurs when the service control handler fails to return 
> due
> to attempting to enter a critical section object that the main service thread
> already owns while responding to the control/shutdown xenstore watch.
> 
> Signed-off-by: Troy Crosley <troycrosley@xxxxxxxxx>
> ---
>  src/xenagent/service.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xenagent/service.cpp b/src/xenagent/service.cpp index
> 4d62e09..e595093 100644
> --- a/src/xenagent/service.cpp
> +++ b/src/xenagent/service.cpp
> @@ -107,9 +107,9 @@ void CXenIfaceCreator::OnPowerEvent(DWORD evt,
> LPVOID data)  void CXenIfaceCreator::Log(const char* message)  {
>      // if possible, send to xeniface to forward to logs
> -    CCritSec crit(&m_crit);
> -    if (m_device) {
> +    if (TryEnterCriticalSection(&m_crit) && m_device) {

If the TryEnterCriticalSection succeeds, but m_device is null, doesn't this 
leave the critical section held?

>          m_device->Log(message);
> +        LeaveCriticalSection(&m_crit);
>      }
>  }
> 
> --
> 2.20.1
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.