kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Beth Kon <eak@us.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, mtosatti@redhat.com,
	vincent@vincent-minet.net, gleb@redhat.com,
	anthony@codemonkey.ws
Subject: Re: [PATCH 1/2] Clean up MADT Table Creation
Date: Wed, 20 May 2009 12:10:36 -0400	[thread overview]
Message-ID: <4A142B7C.2070600@us.ibm.com> (raw)
In-Reply-To: <4A105A39.2080001@redhat.com>

Avi Kivity wrote:
> Beth Kon wrote:
>> This patch is based on the recent patch from Vincent Minet. I split 
>> Vincent's
>> changes into 2 patches (to separate MADT and RSDT table cleanup, as 
>> suggested by
>> Marcelo) and added a bit to them. And to give credit where it is due, 
>> this
>> cleanup is also related to the patch Marcelo provided when the HPET 
>> addition tripped over the same problem. (Thanks again Marcelo :-)
>> This patch moves all the table layout calculations to the same area of
>> acpi_bios_init. This prevents corruption problems when, in the middle of
>> filling in the tables, the MADT table size grows. The idea is to do 
>> all the layout in one section, then fill things in afterwards. It 
>> also corrects a problem where the madt table was memset to 0 before 
>> the final size of the table had been determined.
>>
>> Signed-off-by: Beth Kon <eak@us.ibm.com>
>>
>> diff --git a/kvm/bios/rombios32.c b/kvm/bios/rombios32.c
>> index cbd5f15..7f62e4f 100755
>> --- a/kvm/bios/rombios32.c
>> +++ b/kvm/bios/rombios32.c
>> @@ -1665,6 +1665,7 @@ void acpi_bios_init(void)
>>  
>>      addr = (addr + 7) & ~7;
>>      madt_addr = addr;
>> +    madt = (void *)(addr);
>>      madt_size = sizeof(*madt) +
>>          sizeof(struct madt_processor_apic) * MAX_CPUS +
>>  #ifdef BX_QEMU
>> @@ -1672,7 +1673,11 @@ void acpi_bios_init(void)
>>  #else
>>          sizeof(struct madt_io_apic);
>>  #endif
>> -    madt = (void *)(addr);
>> +    for ( i = 0; i < 16; i++ ) {
>> +        if ( PCI_ISA_IRQ_MASK & (1U << i) ) {
>> +            madt_size += sizeof(struct madt_int_override);
>> +        }
>> +    }
>>      addr += madt_size;
>>  
>>   
>
> You're just duplicating the override creation loop (with its internal 
> if); if we update it, we'll have to update this too.
Yep, that's a valid complaint. I'll resubmit shortly.
>
> Why not set madt_end = int_override and calculate madt_size = madt_end 
> - madt?
>


      reply	other threads:[~2009-05-20 16:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-16  3:16 [PATCH 1/2] Clean up MADT Table Creation Beth Kon
2009-05-16  3:16 ` [PATCH 2/2] Clean up RSDT " Beth Kon
2009-05-17 18:43   ` Avi Kivity
2009-05-17 18:40 ` [PATCH 1/2] Clean up MADT " Avi Kivity
2009-05-20 16:10   ` Beth Kon [this message]

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=4A142B7C.2070600@us.ibm.com \
    --to=eak@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=vincent@vincent-minet.net \
    /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).