diff mbox

[v2,09/23] acpi/hvmloader: Build WAET optionally

Message ID 1470344811-14225-10-git-send-email-boris.ostrovsky@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris Ostrovsky Aug. 4, 2016, 9:06 p.m. UTC
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v2:
* Note: didn't break "if ( !waet ) return -1" line since that's the style
  of the file.

 tools/firmware/hvmloader/acpi/build.c   | 9 ++++++---
 tools/firmware/hvmloader/acpi/libacpi.h | 1 +
 tools/firmware/hvmloader/util.c         | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

Comments

Jan Beulich Aug. 9, 2016, 1:29 p.m. UTC | #1
>>> On 04.08.16 at 23:06, <boris.ostrovsky@oracle.com> wrote:
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2:
> * Note: didn't break "if ( !waet ) return -1" line since that's the style
>   of the file.

Style of the file? At best there's a mix in the file, and hence correcting
it here is rather desirable.

Jan
Boris Ostrovsky Aug. 9, 2016, 1:51 p.m. UTC | #2
On 08/09/2016 09:29 AM, Jan Beulich wrote:
>>>> On 04.08.16 at 23:06, <boris.ostrovsky@oracle.com> wrote:
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> v2:
>> * Note: didn't break "if ( !waet ) return -1" line since that's the style
>>   of the file.
> Style of the file? At best there's a mix in the file, and hence correcting
> it here is rather desirable.

Style of construct_secondary_tables(), not the whole file, sorry.

-boris
Jan Beulich Aug. 9, 2016, 2:48 p.m. UTC | #3
>>> On 09.08.16 at 15:51, <boris.ostrovsky@oracle.com> wrote:
> On 08/09/2016 09:29 AM, Jan Beulich wrote:
>>>>> On 04.08.16 at 23:06, <boris.ostrovsky@oracle.com> wrote:
>>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> v2:
>>> * Note: didn't break "if ( !waet ) return -1" line since that's the style
>>>   of the file.
>> Style of the file? At best there's a mix in the file, and hence correcting
>> it here is rather desirable.
> 
> Style of construct_secondary_tables(), not the whole file, sorry.

Anyway, if you're not going to make the adjustment, and if I end
up committing the patches (and remember at that time), I will
make it nevertheless.

Jan
Boris Ostrovsky Aug. 9, 2016, 3:13 p.m. UTC | #4
On 08/09/2016 10:48 AM, Jan Beulich wrote:
>>>> On 09.08.16 at 15:51, <boris.ostrovsky@oracle.com> wrote:
>> On 08/09/2016 09:29 AM, Jan Beulich wrote:
>>>>>> On 04.08.16 at 23:06, <boris.ostrovsky@oracle.com> wrote:
>>>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>>> ---
>>>> v2:
>>>> * Note: didn't break "if ( !waet ) return -1" line since that's the style
>>>>   of the file.
>>> Style of the file? At best there's a mix in the file, and hence correcting
>>> it here is rather desirable.
>> Style of construct_secondary_tables(), not the whole file, sorry.
> Anyway, if you're not going to make the adjustment, and if I end
> up committing the patches (and remember at that time), I will
> make it nevertheless.

If you decide to go ahead with committing --- sure. Otherwise I can do
this in the next submission.

(I actually backed out this change at the last moment before sending the
series when I noticed routine style)

-boris
Jan Beulich Aug. 9, 2016, 3:17 p.m. UTC | #5
>>> On 09.08.16 at 17:13, <boris.ostrovsky@oracle.com> wrote:
> On 08/09/2016 10:48 AM, Jan Beulich wrote:
>>>>> On 09.08.16 at 15:51, <boris.ostrovsky@oracle.com> wrote:
>>> On 08/09/2016 09:29 AM, Jan Beulich wrote:
>>>>>>> On 04.08.16 at 23:06, <boris.ostrovsky@oracle.com> wrote:
>>>>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>>>> ---
>>>>> v2:
>>>>> * Note: didn't break "if ( !waet ) return -1" line since that's the style
>>>>>   of the file.
>>>> Style of the file? At best there's a mix in the file, and hence correcting
>>>> it here is rather desirable.
>>> Style of construct_secondary_tables(), not the whole file, sorry.
>> Anyway, if you're not going to make the adjustment, and if I end
>> up committing the patches (and remember at that time), I will
>> make it nevertheless.
> 
> If you decide to go ahead with committing --- sure. Otherwise I can do
> this in the next submission.

Well, it's only going to be the first 2 or 3 patches that I can commit,
as subsequent ones have pending adjustment requests.

Jan
diff mbox

Patch

diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c
index 6ec8739..e362ccd 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -358,9 +358,12 @@  static int construct_secondary_tables(unsigned long *table_ptrs,
     }
 
     /* WAET. */
-    waet = construct_waet();
-    if (!waet) return -1;
-    table_ptrs[nr_tables++] = (unsigned long)waet;
+    if ( config->table_flags & ACPI_HAS_WAET )
+    {
+        waet = construct_waet();
+        if ( !waet ) return -1;
+        table_ptrs[nr_tables++] = (unsigned long)waet;
+    }
 
     if ( config->table_flags & ACPI_HAS_SSDT_PM )
     {
diff --git a/tools/firmware/hvmloader/acpi/libacpi.h b/tools/firmware/hvmloader/acpi/libacpi.h
index e15abf7..a251d7c 100644
--- a/tools/firmware/hvmloader/acpi/libacpi.h
+++ b/tools/firmware/hvmloader/acpi/libacpi.h
@@ -31,6 +31,7 @@ 
 #define ACPI_HAS_SSDT_S4     (1<<6)
 #define ACPI_HAS_TCPA        (1<<7)
 #define ACPI_HAS_IOAPIC      (1<<8)
+#define ACPI_HAS_WAET        (1<<9)
 
 
 struct acpi_numa {
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 325c0a2..61018ea 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -919,7 +919,7 @@  void hvmloader_acpi_build_tables(struct acpi_config *config,
     if ( !strncmp(xenstore_read("platform/acpi_s4", "1"), "1", 1)  )
         config->table_flags |= ACPI_HAS_SSDT_S4;
 
-    config->table_flags |= (ACPI_HAS_TCPA | ACPI_HAS_IOAPIC);
+    config->table_flags |= (ACPI_HAS_TCPA | ACPI_HAS_IOAPIC | ACPI_HAS_WAET);
 
     config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;