From: "Jan Beulich" Subject: Re: [Patch v2 2/2] hvmloader: Allow the toolstack to choose WAET optimisations Date: Fri, 06 Dec 2013 09:43:01 +0000 Message-ID: <52A1AA35020000780010AC62@nat28.tlf.novell.com> References: <1386241748-9617-1-git-send-email-andrew.cooper3@citrix.com> <1386241748-9617-3-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vorw9-0002Aa-QP for xen-devel@lists.xenproject.org; Fri, 06 Dec 2013 09:43:06 +0000 In-Reply-To: <1386241748-9617-3-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser , Ian Jackson , Ian Campbell , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 05.12.13 at 12:09, Andrew Cooper wrote: > --- a/tools/firmware/hvmloader/acpi/acpi2_0.h > +++ b/tools/firmware/hvmloader/acpi/acpi2_0.h > @@ -303,6 +303,10 @@ struct acpi_20_waet { > struct acpi_header header; > uint32_t flags; > }; > +#define ACPI_WAET_RTC_NO_ACK (1<<0) /* RTC requires no int acknowledge */ > +#define ACPI_WAET_TIMER_ONE_READ (1<<1) /* PM timer requires only one read */ > + > +#define ACPI_WAET_DEFAULT_FLAGS (ACPI_WAET_TIMER_ONE_READ) Just like said on patch 1 - at least theoretically the safe mode (i.e. independent on whether the guest actually looks at WAET) is ACPI_WAET_RTC_NO_ACK set. Furthermore I don't see why this definition needs to be in the header file. It could easily remain in the single consuming one. > @@ -196,8 +201,22 @@ static struct acpi_20_waet *construct_waet(void) > memcpy(waet, &Waet, sizeof(*waet)); > > waet->header.length = sizeof(*waet); > + > + s = xenstore_read("platform/waet-rtc-noack", NULL); > + if ( s ) > + { > + if ( !strncmp(s, "1", 1) ) strncmp() or strcmp()? > + waet->flags |= ACPI_WAET_RTC_NO_ACK; > + else > + waet->flags &= ~ACPI_WAET_RTC_NO_ACK; > + } > + > set_checksum(waet, offsetof(struct acpi_header, checksum), sizeof(*waet)); > > + /* Inform Xen which RTC mode has been chosen */ > + p.value = !!(waet->flags & ACPI_WAET_RTC_NO_ACK); This either ought to be using the pseudo enumeration you added to the public header, or have build time checks that 0 and 1 have the expected meaning. Jan