From patchwork Wed Jun 1 15:10:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 840582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p51FBWIt025415 for ; Wed, 1 Jun 2011 15:11:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757607Ab1FAPLa (ORCPT ); Wed, 1 Jun 2011 11:11:30 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:34603 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752637Ab1FAPL2 (ORCPT ); Wed, 1 Jun 2011 11:11:28 -0400 Received: by wwa36 with SMTP id 36so6152039wwa.1 for ; Wed, 01 Jun 2011 08:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=z9b8fER96OAIexK4zjHUOTqQWMi1LmIHPWzeYevNZp8=; b=AdvJjWJBoOp2G9pUiTWbGdLsfDkQJ5KVUHjuM99WgEmkXkbIdvsmE6l3NoZJJvwDZ7 6LPDL9gVNl8IEpVVXoarwUnoHZWf1I/NymOFjAvUzjYAUN390Zcp7wyPJc6TFg8OiPOg +9bYhpme6Ix3n4TgCKo4aBV7BZ2n/TNL3s5W8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=QKCURYpgDa96KV18XvsD++nK4F43lMNnEuh+5NJbTzNet4b2eZKIt9NWaU95dWyTpT f7zlarZmXs+woSwI67Se9r1fQ/kZt3+xaA8x+FFkkiJEtQec7sUbRkKVaEw56zYJzEML WMwBR6sZeL2/qBtSTtjpJvpPja+hTs1lehhBw= Received: by 10.227.100.212 with SMTP id z20mr7304255wbn.27.1306941087230; Wed, 01 Jun 2011 08:11:27 -0700 (PDT) Received: from localhost.localdomain (bzq-79-180-200-180.red.bezeqint.net [79.180.200.180]) by mx.google.com with ESMTPS id en1sm807019wbb.52.2011.06.01.08.11.25 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2011 08:11:26 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin Subject: [PATCH] kvm tools: Use vesa reserved space for strings and modes Date: Wed, 1 Jun 2011 18:10:42 +0300 Message-Id: <1306941042-18606-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 15:11:33 +0000 (UTC) As defined in the spec, the reserved space in struct vesa_general_info should be used to store vesa oem string an a list of possible modes. Signed-off-by: Sasha Levin --- tools/kvm/bios/int10.c | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/kvm/bios/int10.c b/tools/kvm/bios/int10.c index 48abe10..57647a1 100644 --- a/tools/kvm/bios/int10.c +++ b/tools/kvm/bios/int10.c @@ -20,14 +20,16 @@ struct int10_args { /* VESA General Information table */ struct vesa_general_info { - u32 signature; /* 0 Magic number = "VESA" */ - u16 version; /* 4 */ - void *vendor_string; /* 6 */ - u32 capabilities; /* 10 */ - void *video_mode_ptr; /* 14 */ - u16 total_memory; /* 18 */ - - u8 reserved[236]; /* 20 */ + u32 signature; /* 0 Magic number = "VESA" */ + u16 version; /* 4 */ + void *vendor_string; /* 6 */ + u32 capabilities; /* 10 */ + void *video_mode_ptr; /* 14 */ + u16 total_memory; /* 18 */ + u16 modes[2]; /* 20 */ + char oem_string[11]; /* 24 */ + + u8 reserved[223]; /* 35 */ } __attribute__ ((packed)); @@ -69,9 +71,6 @@ struct vminfo { u8 reserved[206]; /* 50 */ }; -char oemstring[11] = "KVM VESA"; -u16 modes[2] = { 0x0112, 0xffff }; - static inline void outb(unsigned short port, unsigned char val) { asm volatile("outb %0, %1" : : "a"(val), "Nd"(port)); @@ -104,10 +103,12 @@ static void int10_vesa(struct int10_args *args) *destination = (struct vesa_general_info) { .signature = VESA_MAGIC, .version = 0x102, - .vendor_string = oemstring, + .vendor_string = &destination->oem_string, .capabilities = 0x10, - .video_mode_ptr = modes, + .video_mode_ptr = &destination->modes, .total_memory = (4*VESA_WIDTH * VESA_HEIGHT) / 0x10000, + .oem_string = "KVM VESA", + .modes = { 0x0112, 0xffff }, }; break;