From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdxCo-0002ue-5h for qemu-devel@nongnu.org; Mon, 11 Jun 2012 01:30:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SdxCm-0003oP-27 for qemu-devel@nongnu.org; Mon, 11 Jun 2012 01:30:21 -0400 Received: from thoth.sbs.de ([192.35.17.2]:17376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdxCl-0003o5-OY for qemu-devel@nongnu.org; Mon, 11 Jun 2012 01:30:19 -0400 Message-ID: <4FD5824E.1030602@siemens.com> Date: Mon, 11 Jun 2012 07:29:50 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1336666788-30233-1-git-send-email-jim@meyering.net> <1336666788-30233-2-git-send-email-jim@meyering.net> <4FABFAA1.5070307@siemens.com> <4FBBF762.3070009@weilnetz.de> <4FBCBCE6.3060000@siemens.com> <4FD503A4.8000306@weilnetz.de> In-Reply-To: <4FD503A4.8000306@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1 1/2] kvm/apic: correct short memset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity , Marcelo Tosatti Cc: Anthony Liguori , Jim Meyering , Stefan Weil , "qemu-devel@nongnu.org" , Blue Swirl , =?ISO-8859-1?Q?Andreas_F=E4rber?= On 2012-06-10 22:29, Stefan Weil wrote: > Am 23.05.2012 12:33, schrieb Jan Kiszka: >> On 2012-05-22 17:30, Stefan Weil wrote: >>> Am 10.05.2012 19:28, schrieb Jan Kiszka: >>>> On 2012-05-10 13:19, Jim Meyering wrote: >>>> >>>>> From: Jim Meyering >>>>> >>>>> kvm_put_apic_state's attempt to clear *kapic before setting its >>>>> bits cleared sizeof(void*) bytes (no more than 8) rather than the >>>>> intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity. >>>>> >>>>> Signed-off-by: Jim Meyering >>>>> --- >>>>> hw/kvm/apic.c | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c >>>>> index ffe7a52..a0ab503 100644 >>>>> --- a/hw/kvm/apic.c >>>>> +++ b/hw/kvm/apic.c >>>>> @@ -29,7 +29,7 @@ void kvm_put_apic_state(DeviceState *d, struct kvm_lapic_state *kapic) >>>>> APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d); >>>>> int i; >>>>> >>>>> - memset(kapic, 0, sizeof(kapic)); >>>>> + memset(kapic, 0, sizeof(*kapic)); >>>>> kvm_apic_set_reg(kapic, 0x2, s->id<< 24); >>>>> kvm_apic_set_reg(kapic, 0x8, s->tpr); >>>>> kvm_apic_set_reg(kapic, 0xd, s->log_dest<< 24); >>>>> >>>> Yep, that's what I actually meant... >>>> >>>> Thanks, >>>> Jan >>>> >>>> >>> >>> Reviewed-by: Stefan Weil >>> >>> Hello Anthony, >>> >>> this patch should be committed to QEMU 1.1. >>> I had sent a patch with the same fix 6 days later. >> >> Thanks for reminding. Yes, please merge! >> >> Jan > > > Ping? > > This is one of the bug fixes which is missing in QEMU 1.1, > and it is also missing in latest QEMU git master. > > What can be done to get it committed? Avi or Marcelo, please queue in uq/master and send a pull soon! That reminds me that [1] is still awaiting comments (and further testing). Critical for qemu-kvm 1.1 and qemu 1.1.1 as well. Jan [1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/92036 -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux