[{"id":1797767,"web_url":"http://patchwork.ozlabs.org/comment/1797767/","msgid":"<f96b7ffe-83d3-f328-cf74-e05a0acb65ec@redhat.com>","list_archive_url":null,"date":"2017-11-02T09:37:47","subject":"Re: [Qemu-devel] [PATCH] pc: restrict port92 register value to 2\n\tbits","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 02/11/2017 10:36, P J P wrote:\n> From: Prasad J Pandit <pjp@fedoraproject.org>\n> \n> Port 92 configuration register holds an 8-bit value. Of 8-bits,\n> bits 0-1 are used and 2-7 are reserved. Restrict the supplied\n> value to 2 bits.\n\nThis patch is not necessary.  \"Do nothing and just report back the value\nthat was written\" is an okay implementation of reserved bits.\n\nPaolo\n\n\n> Reported-by: Niu Guoxiang <niuguoxiang@huawei.com>\n> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>\n> ---\n>  hw/i386/pc.c | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/hw/i386/pc.c b/hw/i386/pc.c\n> index 05985d4927..883384a599 100644\n> --- a/hw/i386/pc.c\n> +++ b/hw/i386/pc.c\n> @@ -515,6 +515,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val,\n>      Port92State *s = opaque;\n>      int oldval = s->outport;\n>  \n> +    val &= 0x03;\n>      DPRINTF(\"port92: write 0x%02\" PRIx64 \"\\n\", val);\n>      s->outport = val;\n>      qemu_set_irq(s->a20_out, (val >> 1) & 1);\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3ySKpb467Fz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 20:41:11 +1100 (AEDT)","from localhost ([::1]:59383 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eABzp-00019C-Hl\n\tfor incoming@patchwork.ozlabs.org; Thu, 02 Nov 2017 05:41:09 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:57814)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1eABwe-0008Ld-Kk\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 05:37:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1eABwd-0005BG-UD\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 05:37:52 -0400","from mx1.redhat.com ([209.132.183.28]:47318)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1eABwd-0005Ac-OS\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 05:37:51 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 45301C04AC4E;\n\tThu,  2 Nov 2017 09:37:50 +0000 (UTC)","from [10.36.117.152] (ovpn-117-152.ams2.redhat.com [10.36.117.152])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 1EE426061B;\n\tThu,  2 Nov 2017 09:37:48 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 45301C04AC4E","To":"P J P <ppandit@redhat.com>, Qemu Developers <qemu-devel@nongnu.org>","References":"<20171102093625.32342-1-ppandit@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<f96b7ffe-83d3-f328-cf74-e05a0acb65ec@redhat.com>","Date":"Thu, 2 Nov 2017 10:37:47 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.4.0","MIME-Version":"1.0","In-Reply-To":"<20171102093625.32342-1-ppandit@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tThu, 02 Nov 2017 09:37:50 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] pc: restrict port92 register value to 2\n\tbits","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Prasad J Pandit <pjp@fedoraproject.org>,\n\tNiu Guoxiang <niuguoxiang@huawei.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1797878,"web_url":"http://patchwork.ozlabs.org/comment/1797878/","msgid":"<daab1313-a255-c355-004e-756504ca7eb3@amsat.org>","list_archive_url":null,"date":"2017-11-02T12:25:15","subject":"Re: [Qemu-devel] [PATCH] pc: restrict port92 register value to 2\n\tbits","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"Hi Prasad,\n\nOn 11/02/2017 06:37 AM, Paolo Bonzini wrote:\n> On 02/11/2017 10:36, P J P wrote:\n>> From: Prasad J Pandit <pjp@fedoraproject.org>\n>>\n>> Port 92 configuration register holds an 8-bit value. Of 8-bits,\n>> bits 0-1 are used and 2-7 are reserved. Restrict the supplied\n>> value to 2 bits.\n> \n> This patch is not necessary.  \"Do nothing and just report back the value\n> that was written\" is an okay implementation of reserved bits.\n> \n> Paolo\n> \n> \n>> Reported-by: Niu Guoxiang <niuguoxiang@huawei.com>\n>> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>\n>> ---\n>>  hw/i386/pc.c | 1 +\n>>  1 file changed, 1 insertion(+)\n>>\n>> diff --git a/hw/i386/pc.c b/hw/i386/pc.c\n>> index 05985d4927..883384a599 100644\n>> --- a/hw/i386/pc.c\n>> +++ b/hw/i386/pc.c\n>> @@ -515,6 +515,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val,\n>>      Port92State *s = opaque;\n>>      int oldval = s->outport;\n>>  \n>> +    val &= 0x03;\n>>      DPRINTF(\"port92: write 0x%02\" PRIx64 \"\\n\", val);\n\nYou might want to report a guest error instead:\n\n        if (val & ~3) {\n            qemu_log_mask(LOG_GUEST_ERROR,\n                \"port92: bits 2-7 are reserved \"\n                \"(wrote 0x%02\" PRIx64 \")\\n\", val);\n        }\n\n>>      s->outport = val;\n>>      qemu_set_irq(s->a20_out, (val >> 1) & 1);","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CLonKJl1\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3ySPSb1dLCz9sBW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 23:25:51 +1100 (AEDT)","from localhost ([::1]:60172 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eAEZB-0005Va-Av\n\tfor incoming@patchwork.ozlabs.org; Thu, 02 Nov 2017 08:25:49 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38016)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1eAEYn-0005VP-KS\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 08:25:31 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1eAEYi-0006ch-Nb\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 08:25:25 -0400","from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:56980)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1eAEYi-0006bS-FG\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 08:25:20 -0400","by mail-qt0-x244.google.com with SMTP id z28so5958310qtz.13\n\tfor <qemu-devel@nongnu.org>; Thu, 02 Nov 2017 05:25:20 -0700 (PDT)","from [192.168.1.240] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\ta26sm2083108qta.50.2017.11.02.05.25.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 02 Nov 2017 05:25:18 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:openpgp:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=rz5XGuWXoUKB7Kt7kT/HkLY78UrF8ZPr5qKocuRBKLg=;\n\tb=CLonKJl1Y7hvZ4gaNX3cImjM/wTTU94rb/3fe8/vxdjzWwcQlL60OfP9TdHpo3t946\n\tnCeoYNGBZJPfeCcEjk0oxh7gRktRvvjgZcbLeD7qQoxys0snCPOjBO4OWErRGFru+qbM\n\tyLsCJU5mh2EJfNeW1DpBY+s6ohnXbPWvwb42q9XdW2aZat+6w/AKwB3oJybAJqg8CoqO\n\t0SpS62YSvqnEojLARA8iJlfK07PD5cRU1owNgI4iPScuDun5IfRIuHLXz7X/RHbZMy35\n\tB5HNru8I1/zfwEtJeKeWxU27G3Xp1fgvYslCFwnMyhsQ8A2MpGKYSS5U7fczKSInBpjx\n\trdVQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:openpgp\n\t:message-id:date:user-agent:mime-version:in-reply-to\n\t:content-language:content-transfer-encoding;\n\tbh=rz5XGuWXoUKB7Kt7kT/HkLY78UrF8ZPr5qKocuRBKLg=;\n\tb=d2HgWFy8W7RyepqI0E/cPKkwD7wGzP+lNbEK6SftiaCwgrYyuGBMurzjuz5m0G1XBj\n\t9CnIjTCvNJ5gYmuyLY0RuoE85tcY8VpL+QyurwPYxRsx9u6Xei8DuWvwE6oeE29sxtVB\n\tcXuW2poucd4FSYfWBYfNtWZFErbfFjtOCbW8rlIocJbLuv7z1mnyrtQ60BndEpN513XP\n\tfg80ssn1ZcajM70TrWhZjbUOFoLDSNwxe/fOQ6SkicyIfeyfNT76Xfhmc3o5zcInHghu\n\tIrwybKrRySEkLzgD/zcLJ11WI8JqM6h7IVwgCZm2EPxCHMcQSGCG6ketW/OTYtmJz4uS\n\tIh7Q==","X-Gm-Message-State":"AMCzsaUCSS2iS9FRoaB9zSQIvIYaVVemor1GoznwLCDoVXWyWBWLdfkf\n\ta+Rbbk191hZXPU+SaoaGsCU=","X-Google-Smtp-Source":"ABhQp+R0Ya3smXo1gqU1Uz/P2p27AAyGcIxnhmGdXKCSKKrJGN9TGsEL859uPXoxQZ9xhVgMdPKuiA==","X-Received":"by 10.200.48.37 with SMTP id f34mr4769392qte.228.1509625519502; \n\tThu, 02 Nov 2017 05:25:19 -0700 (PDT)","To":"Paolo Bonzini <pbonzini@redhat.com>, P J P <ppandit@redhat.com>,\n\tQemu Developers <qemu-devel@nongnu.org>","References":"<20171102093625.32342-1-ppandit@redhat.com>\n\t<f96b7ffe-83d3-f328-cf74-e05a0acb65ec@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Openpgp":"id=FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE;\n\turl=http://pgp.mit.edu/pks/lookup?op=get&search=0xE3E32C2CDEADC0DE","Message-ID":"<daab1313-a255-c355-004e-756504ca7eb3@amsat.org>","Date":"Thu, 2 Nov 2017 09:25:15 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.4.0","MIME-Version":"1.0","In-Reply-To":"<f96b7ffe-83d3-f328-cf74-e05a0acb65ec@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::244","Subject":"Re: [Qemu-devel] [PATCH] pc: restrict port92 register value to 2\n\tbits","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Prasad J Pandit <pjp@fedoraproject.org>,\n\tNiu Guoxiang <niuguoxiang@huawei.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]