qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Christensson <mch@virtutech.com>
To: Kevin O'Connor <kevin@koconnor.net>
Cc: seabios@seabios.org, qemu-devel@nongnu.org,
	Gleb Natapov <gleb@redhat.com>
Subject: [Qemu-devel] Re: [PATCH] Seabios: Fix PkgLength calculation for the SSDT.
Date: Tue, 12 Jan 2010 10:10:41 +0100	[thread overview]
Message-ID: <4B4C3C91.8090606@virtutech.com> (raw)
In-Reply-To: <20091224002906.GB6273@morn.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

On 12/24/2009 01:29 AM, Kevin O'Connor wrote:
> On Mon, Dec 14, 2009 at 10:25:14AM +0100, Magnus Christensson wrote:
>    
>>>> --- a/src/acpi.c
>>>> +++ b/src/acpi.c
>>>> @@ -464,10 +464,12 @@ build_ssdt(void)
>>>>        // build processor scope header
>>>>        *(ssdt_ptr++) = 0x10; // ScopeOp
>>>>        if (cpu_length<= 0x3e) {
>>>> +        /* Handle 1-4 CPUs with one byte encoding */
>>>>            *(ssdt_ptr++) = cpu_length + 1;
>>>>        } else {
>>>> -        *(ssdt_ptr++) = 0x7F;
>>>> -        *(ssdt_ptr++) = (cpu_length + 2)>>   6;
>>>> +        /* Handle 5-314 CPUs with two byte encoding */
>>>> +        *(ssdt_ptr++) = 0x40 | ((cpu_length + 1)&   0xf);
>>>> +        *(ssdt_ptr++) = (cpu_length + 1)>>   4;
>>>>
>>>>          
>>> Should be cpu_length + 2 as far as I can tell. The current code is
>>> definitely broken.
>>>
>>>        
>> Right. That should be cpu_length +2 in the else-part.
>>      
> Can you resend the patch with the change?
>    
Attached (sorry for the delay).

M.


[-- Attachment #2: 0001-Fix-PkgLength-calculation-for-the-SSDT.patch --]
[-- Type: text/x-patch, Size: 1026 bytes --]

>From 183a34ee3a218bf64cb440e456628d361af98bfc Mon Sep 17 00:00:00 2001
From: Magnus Christensson <mch@virtutech.com>
Date: Wed, 25 Nov 2009 16:26:58 +0100
Subject: [PATCH] Fix PkgLength calculation for the SSDT.

Signed-off-by: Magnus Christensson <mch@virtutech.com>
---
 src/acpi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/acpi.c b/src/acpi.c
index f613b03..244536a 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -429,10 +429,12 @@ build_ssdt(void)
     // build processor scope header
     *(ssdt_ptr++) = 0x10; // ScopeOp
     if (cpu_length <= 0x3e) {
+        /* Handle 1-4 CPUs with one byte encoding */
         *(ssdt_ptr++) = cpu_length + 1;
     } else {
-        *(ssdt_ptr++) = 0x7F;
-        *(ssdt_ptr++) = (cpu_length + 2) >> 6;
+        /* Handle 5-314 CPUs with two byte encoding */
+        *(ssdt_ptr++) = 0x40 | ((cpu_length + 2) & 0xf);
+        *(ssdt_ptr++) = (cpu_length + 2) >> 4;
     }
     *(ssdt_ptr++) = '_'; // Name
     *(ssdt_ptr++) = 'P';
-- 
1.6.2.5


  parent reply	other threads:[~2010-01-12  9:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 15:14 [Qemu-devel] [PATCH] Seabios: Fix PkgLength calculation for the SSDT Kevin O'Connor
2009-12-14  9:25 ` [Qemu-devel] " Magnus Christensson
2009-12-14  9:50   ` Gleb Natapov
     [not found]   ` <20091224002906.GB6273@morn.localdomain>
2010-01-12  9:10     ` Magnus Christensson [this message]
2010-01-12 13:36       ` Kevin O'Connor
2010-02-08 10:19         ` [Qemu-devel] Re: [SeaBIOS] " Avi Kivity
2010-02-08 17:15           ` Anthony Liguori
2010-02-09  0:38             ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B4C3C91.8090606@virtutech.com \
    --to=mch@virtutech.com \
    --cc=gleb@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).