Qemu-devel Digest, Vol 82, Issue 324
A message that is not in the archive (sent off-list or not yet received): [email protected]
Yasin Yenidünya
AppliedHello,
I want to develop an linux os. Does anyone has a tutorial to build an operting system? Or if some one has the soruce code of linux that comes with qemu it is also enought for me..
Regards
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Friday, January 29, 2010 10:44 PM
To: [email protected]
Subject: Qemu-devel Digest, Vol 82, Issue 324
Send Qemu-devel mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.nongnu.org/mailman/listinfo/qemu-devel
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific than "Re: Contents of Qemu-devel digest..."
Today's Topics:
1. [PATCH 5/5] virtio-blk: add topology support (Christoph Hellwig)
2. Re: [PATCH] Porting TCG to alpha platform (Richard Henderson)
3. [PATCH] doc: Update mingw cross compile instructions (Scott Tsai)
4. [RFC] wiki.qemu.org (Anthony Liguori)
5. Re: [RFC] wiki.qemu.org (Scott Tsai)
6. Re: [RFC] wiki.qemu.org (Andreas F?rber)
7. Re: [PATCH 1/3] virtio_blk: Factor virtio_blk_handle_request
out (Anthony Liguori)
----------------------------------------------------------------------
Message: 1
Date: Fri, 29 Jan 2010 20:05:31 +0100
From: Christoph Hellwig <[email protected]>
Subject: [Qemu-devel] [PATCH 5/5] virtio-blk: add topology support
To: [email protected]
Cc: "Martin K. Petersen" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Export all topology information in the block config structure, guarded by a new VIRTIO_BLK_F_TOPOLOGY config flag.
Note that there is no savevm support for the new information yet, as it would be a pain without the table driven savevm format. Juan has promised to send out a new version of the table driven vmstate patches for virto next week.
hw/virtio-blk.c +5 -0
@@ -380,6 +380,10 @@ static void virtio_blk_update_config(Vir blkcfg.heads = heads; blkcfg.sectors = secs; blkcfg.size_max =0 ; + blkcfg.physical_block_exp =bdrv_get_physical_block_exp (s->bs); + blkcfg.alignment_offset =0 ; + blkcfg.min_io_size =bdrv_get_min_io_size (s->bs); + blkcfg.opt_io_size =bdrv_get_opt_io_size (s->bs);memcpy (config, &blkcfg,sizeof (struct virtio_blk_config )); }
@@ -389,6 +393,7 @@ static uint32_t virtio_blk_get_features( features |= (1 <<VIRTIO_BLK_F_SEG_MAX ); features |= (1 <<VIRTIO_BLK_F_GEOMETRY ); + features |= (1 <<VIRTIO_BLK_F_TOPOLOGY );if (bdrv_enable_write_cache (s->bs)) features |= (1 <<VIRTIO_BLK_F_WCACHE );
hw/virtio-blk.h +0 -0
@@ -32,6 +32,7 @@#define VIRTIO_BLK_F_SCSI 7/* Supports scsi command passthru
*/
/* #define VIRTIO_BLK_F_IDENTIFY 8 ATA IDENTIFY supported,
DEPRECATED */
#define VIRTIO_BLK_F_WCACHE 9 /* write cache enabled */ +#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is
available */
struct virtio_blk_config
{
@@ -42,6 +43,10 @@ struct virtio_blk_config
uint8_t heads;
uint8_t sectors;
uint32_t _blk_size; /* structure pad, currently unused */
+ uint8_t physical_block_exp;
+ uint8_t alignment_offset;
+ uint16_t min_io_size;
+ uint32_t opt_io_size;} __attribute__((packed));
/* These two define direction. */
------------------------------
Message: 2
Date: Fri, 29 Jan 2010 11:19:20 -0800
From: Richard Henderson <[email protected]>
Subject: Re: [Qemu-devel] [PATCH] Porting TCG to alpha platform
To: identifier scorpio <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Review
Quoted 3 lines
(quoted diff) +3
-0+ } else if (cond == TCG_COND_EQ || cond == TCG_COND_NE) { + tcg_out_mem_long(s, INSN_LDA, TMP_REG1, arg1, -arg2); + opc = (cond == TCG_COND_EQ ? INSN_BEQ : INSN_BNE);
Bug here. What was intended was to add "arg1 = TMP_REG1". But since the constraints use "I" for uint8_t input constants, we might as well remove this hunk entirely.
Also, let's future-proof this routine against changes to the layout of the TCGCond enumeration.
r~
-------------- next part --------------
commit 9d787576342c193f13e2531953fc81442458de7e
Author: Richard Henderson <[email protected]> Date: Fri Jan 29 11:14:20 2010 -0800
tcg-alpha: Fix EQ/NE with a constant.
There was start of code to handle EQ and NE with arbitrary constants, but it wasn't completed. Remove the half-done code and add a comment for future enhancements.
Also, don't rely on the current layout of TCGCond; instead encode the need for inversion of the compare insn result by means of a low bit set in the cmp_opc table. Reduce the element size of cmp_opc.
tcg/alpha/tcg-target.c +0 -0
@@ -540,9 +540,11 @@ static void tcg_out_br(TCGContext *s, int opc, int ra,
int label_index)
tcg_out_fmt_br(s, opc, ra, value);
}
-static void tcg_out_brcond(TCGContext *s, int cond, TCGArg arg1, +static void tcg_out_brcond(TCGContext *s, TCGCond cond, TCGArg arg1,
TCGArg arg2, int const_arg2, int label_index)
{
+ /* Note that unsigned comparisons are not present here, which means
+ that their entries will contain zeros. */
static const int br_opc[10] = {
[TCG_COND_EQ] = INSN_BEQ,
[TCG_COND_NE] = INSN_BNE,@@ -552,38 +554,56 @@ static void tcg_out_brcond(TCGContext *s, int cond, TCGArg arg1,
[TCG_COND_GT] = INSN_BGT
};
- static const uint64_t cmp_opc[10] = {
+ /* The low bit of these entries indicates that the result of
+ the comparison must be inverted. This bit should not be
+ output with the rest of the instruction. */
+ static const int cmp_opc[10] = {
[TCG_COND_EQ] = INSN_CMPEQ,
- [TCG_COND_NE] = INSN_CMPEQ,
+ [TCG_COND_NE] = INSN_CMPEQ | 1,
[TCG_COND_LT] = INSN_CMPLT,
- [TCG_COND_GE] = INSN_CMPLT,
+ [TCG_COND_GE] = INSN_CMPLT | 1,
[TCG_COND_LE] = INSN_CMPLE,- [TCG_COND_GT] = INSN_CMPLE,
+ [TCG_COND_GT] = INSN_CMPLE | 1,
[TCG_COND_LTU] = INSN_CMPULT,
- [TCG_COND_GEU] = INSN_CMPULT,
+ [TCG_COND_GEU] = INSN_CMPULT | 1,
[TCG_COND_LEU] = INSN_CMPULE,
- [TCG_COND_GTU] = INSN_CMPULE
+ [TCG_COND_GTU] = INSN_CMPULE | 1
};
int opc = 0;- if (const_arg2) {
- if (arg2 == 0) {
- opc = br_opc[cond];
- } else if (cond == TCG_COND_EQ || cond == TCG_COND_NE) {
- tcg_out_mem_long(s, INSN_LDA, TMP_REG1, arg1, -arg2);
- opc = (cond == TCG_COND_EQ ? INSN_BEQ : INSN_BNE);
- }
+ /* Possible improvements:
+ (1) Notice arg1 == $31 and !const_arg2. In this case, swap the + two operands and swap the sense of the comparison to allow the + use of the direct branches.
+
+ (2) Allow arbitrary constants. We can, on occasion, generate one
+ less instruction if we compute
+ TMP = ARG1 - CONST
+ instead of
+ TMP = ARG1 cmp TMP2
+ where TMP2 is the constant loaded into a register by generic code. + Note that for 64-bit operands this works only for EQ and NE. For + 32-bit operands, we would need to either limit this to signed + comparisons or properly zero-extend unsigned inputs. The payoff + here isn't great though; much less than(1). */
+
+ /* Notice signed comparisons vs zero. These are handled by the
+ branch instructions directly. */
+ if (const_arg2 && arg2 == 0) {
+ opc = br_opc[cond];
}+ /* Otherwise, generate a comparison into a temporary. */
if (opc == 0) {
- opc = cmp_opc[cond];
+ opc = cmp_opc[cond] & ~1;
if (const_arg2) {
tcg_out_fmt_opi(s, opc, arg1, arg2, TMP_REG1);
} else {
tcg_out_fmt_opr(s, opc, arg1, arg2, TMP_REG1);
}
- opc = (cond & 1) ? INSN_BEQ : INSN_BNE;
+
+ opc = (cmp_opc[cond] & 1 ? INSN_BEQ : INSN_BNE);
arg1 = TMP_REG1;
}------------------------------
Message: 3
Date: Sat, 30 Jan 2010 03:28:58 +0800
From: Scott Tsai <[email protected]>
Subject: [Qemu-devel] [PATCH] doc: Update mingw cross compile
instructions
To: [email protected]
Cc: Scott Tsai <[email protected]>
Message-ID: <[email protected]>
The "Cross compilation for Windows with Linux" section of qemu-doc.texi still instructs the user to use 'configure --enable-mingw32' even after the option was removed in Aug 2008:
http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=cd01b4a312248dd4e12c3d389d1a349cea4015d8
This documentation only change updates the instructions to:
* Remove use of '--enable-mingw32' in the configure example
* Correct the 'sdl-config' script name
* Remove references to i386-mingw32msvc.tar.gz which no longer exists in recent SDL releases
* Document the zlib dependency
--- qemu-doc.texi | 45 +++++++++++++++++++++++++++++++-------------- 1 files changed, 31 insertions(+), 14 deletions(-)
qemu-doc.texi +20 -9
@@ -2313,11 +2313,14 @@ instructions in the download section and the FAQ. @item Download the MinGW development library of SDL 1.2.x (@file{SDL-devel-1.2.x-@/mingw32.tar.gz}) from -@url{http://www.libsdl.org}. Unpack it in a temporary place, and -unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool -directory. Edit the @file{sdl-config} script so that it gives the +@url{http://www.libsdl.org}. Unpack it in a temporary place and +edit the @file{sdl-config} script so that it gives the correct SDL directory when invoked. +@item Install the MinGW version of zlib and make sure +@file{zlib.h} and @file{libz.dll.a} are in +MingGW's default header and linker search paths. + @item Extract the current version of QEMU. @item Start the MSYS shell (file @file{msys.bat}).
@@ -2340,29 +2343,43 @@ correct SDL directory when invoked. Install the MinGW cross compilation tools available at @url{http://www.mingw.org/}. -@item -Install the Win32 version of SDL (@url{http://www.libsdl.org}) by -unpacking @file{i386-mingw32msvc.tar.gz}. Set up the PATH environment -variable so that @file{i386-mingw32msvc-sdl-config} can be launched by +@item Download +the MinGW development library of SDL 1.2.x +(@file{SDL-devel-1.2.x-@/mingw32.tar.gz}) from +@url{http://www.libsdl.org}. Unpack it in a temporary place and +edit the @file{sdl-config} script so that it gives the +correct SDL directory when invoked. Set up the @code{PATH} environment +variable so that @file{sdl-config} can be launched by the QEMU configuration script. +@item Install the MinGW version of zlib and make sure +@file{zlib.h} and @file{libz.dll.a} are in +MingGW's default header and linker search paths. + @item Configure QEMU for Windows cross compilation: @example -./configure --enable-mingw32 +PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin:$PATH ./configure --cross-prefix='i686-pc-mingw32-' +@end example +The example assumes @file{sdl-config} is installed under
@file{/usr/i686-pc-mingw32/sys-root/mingw/bin} and
+MinGW cross compilation tools have names like @file{i686-pc-mingw32-gcc} and @file{i686-pc-mingw32-strip}.
+We set the @code{PATH} environment variable to ensure the MingW version of @file{sdl-config} is used and
+use --cross-prefix to specify the name of the cross compiler. +You can also use --prefix to set the Win32 install path which defaults to @file{c:/Program Files/Qemu}.
+
+Under Fedora Linux, you can run:
+@example
+yum -y install mingw32-gcc mingw32-SDL mingw32-zlib
@end example
-If necessary, you can change the cross-prefix according to the prefix -chosen for the MinGW tools with --cross-prefix. You can also use ---prefix to set the Win32 install path.
+to get a suitable cross compilation environment.
@item You can install QEMU in the installation directory by typing
-@file{make install}. Don't forget to copy @file{SDL.dll} in the +@code{make install}. Don't forget to copy @file{SDL.dll} and @file{zlib1.dll} into the
installation directory.
@end itemize
-Note: Currently, Wine does not seem able to launch
-QEMU for Win32.
+Wine can be used to launch the resulting qemu.exe compiled for Win32.
@node Mac OS X
@section Mac OS X
Signature · 54 lines
1.6.6 ------------------------------ Message: 4 Date: Fri, 29 Jan 2010 13:44:00 -0600 From: Anthony Liguori <[email protected]> Subject: [Qemu-devel] [RFC] wiki.qemu.org To: qemu-devel <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, I've been (slowly) working to convert qemu.org to a wiki in order to allow more community participation in the website. I've finally got a site setup and to my liking with all of the www.qemu.org content migrated. Before doing the switch, I need to figure out what to do with the current texi documentation. I think it makes sense to move qemu-doc.texi to a wiki page and remove it from the source repository. The other option would be to link to it as an external page and keep it within revision control. Does anyone have strong opinions one way or another? BTW: you can take a look at the current content at http://wiki.qemu.org. Once we decide what to do with the texi documentation, it will be reachable via http://www.qemu.org/ Regards, Anthony Liguori ------------------------------ Message: 5 Date: Sat, 30 Jan 2010 04:23:20 +0800 From: Scott Tsai <[email protected]> Subject: Re: [Qemu-devel] [RFC] wiki.qemu.org To: Anthony Liguori <[email protected]> Cc: qemu-devel <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=UTF-8 On Sat, Jan 30, 2010 at 3:44 AM, Anthony Liguori <[email protected]>
Quoted 4 lines · wrote:
Hi,
I've been (slowly) working to convert qemu.org to a wiki in order to allow more community participation in the website. B I've finally got a site
setup
Quoted 4 lines
and to my liking with all of the www.qemu.org content migrated.
Before doing the switch, I need to figure out what to do with the current texi documentation. B I think it makes sense to move qemu-doc.texi to a
wiki
Quoted 1 line
page and remove it from the source repository. B The other option would be
to
Quoted 3 lines
link to it as an external page and keep it within revision control.
Does anyone have strong opinions one way or another?
To keep the code and documentation in sync, I suggest keeping the portion generated from
qemu-img-cmds.hx, qemu-monitor.hx and qemu-options.hx in texinfo format under revision control.
This encourages updating the documentation in the same patch that adds new options and monitor commands.
The "QEMU System emulator for non PC targets" section in qemu-doc.texi seems rather qemu version dependent as well? If true, moving this information to a wiki risks the documentation not matching the qemu version installed on users' machines.
------------------------------
Message: 6
Date: Fri, 29 Jan 2010 21:29:11 +0100
From: Andreas F?rber <[email protected]>
Subject: Re: [Qemu-devel] [RFC] wiki.qemu.org
To: Anthony Liguori <[email protected]>
Cc: qemu-devel <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Hi,
Am 29.01.2010 um 20:44 schrieb Anthony Liguori:
Quoted 5 lines
I need to figure out what to do with the current texi documentation. I think it makes sense to move qemu-doc.texi to a wiki page and remove it from the source repository. The other option would be to link to it as an external page and keep it within revision control.
The latter allows to have a stable version on the website and a development version inside the repository.
Otherwise we would either document unavailable options or, if we don't, probably forget adding Wiki documentation after a release. Also, would you want to ship a snapshot of the Wiki page with the source tarballs?
The Wiki looks more pretty though. :)
Regards,
Andreas
------------------------------
Message: 7
Date: Fri, 29 Jan 2010 14:43:20 -0600
From: Anthony Liguori <[email protected]>
Subject: Re: [Qemu-devel] [PATCH 1/3] virtio_blk: Factor
virtio_blk_handle_request out
To: Kevin Wolf <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Quoted 1 line · Kevin Wolf
We need a function that handles a single request. Create one by splitting
out
Quoted 4 lines
code from
virtio_blk_handle_output.Signed-off-by Kevin Wolf<[email protected]>
Applied all. Thanks.
Regards,
Anthony Liguori
Quoted 2 lines
--- hw/virtio-blk.c | 78
++++++++++++++++++++++++++++++++----------------------
hw/virtio-blk.c static void virtio_blk_handle_read(VirtIOBlockReq
Quoted 7 lines
1 files changed, 46 insertions(+), 32 deletions(-)hw/virtio-blk.c +0
-0@@ -317,46 +317,60 @@ static void virtio_blk_handle_read(VirtIOBlockReq
*req)
Quoted 9 lines
hw/virtio-blk.c +6
-0} } +typedef struct MultiReqBuffer { +BlockRequest blkreq[32 ]; +int num_writes; +BlockDriverState *old_bs; +}MultiReqBuffer ; +
hw/virtio-blk.c static void virtio_blk_handle_read(VirtIOBlockReq · line 335
Quoted 10 lines
hw/virtio-blk.c +10
-0+static void virtio_blk_handle_request (VirtIOBlockReq *req, +MultiReqBuffer *mrb) +{ +if (req->elem.out_num<1 || req->elem.in_num<1 ) { +fprintf (stderr,"virtio-blk missing headers\n" ); +exit (1 ); + } + +if (req->elem.out_sg[0 ].iov_len<sizeof (*req->out) || + req->elem.in_sg[req->elem.in_num -1 ].iov_len<sizeof (*req->in))
{
Quoted 33 lines
hw/virtio-blk.c +26
-3+fprintf (stderr,"virtio-blk header not in correct element\n" ); +exit (1 ); + } + + req->out = (void *)req->elem.out_sg[0 ].iov_base; + req->in = (void *)req->elem.in_sg[req->elem.in_num -1 ].iov_base; + +if (req->out->type&VIRTIO_BLK_T_FLUSH ) { +virtio_blk_handle_flush (req); + }else if (req->out->type&VIRTIO_BLK_T_SCSI_CMD ) { +virtio_blk_handle_scsi (req); + }else if (req->out->type&VIRTIO_BLK_T_OUT ) { +qemu_iovec_init_external (&req->qiov,&req->elem.out_sg[1 ], + req->elem.out_num -1 ); +virtio_blk_handle_write (mrb->blkreq,&mrb->num_writes, + req,&mrb->old_bs); + }else { +qemu_iovec_init_external (&req->qiov,&req->elem.in_sg[0 ], + req->elem.in_num -1 ); +virtio_blk_handle_read (req); + } +} +static void virtio_blk_handle_output (VirtIODevice *vdev,VirtQueue *vq) {VirtIOBlock *s =to_virtio_blk (vdev);VirtIOBlockReq *req; -BlockRequest blkreq[32 ]; -int num_writes =0 ; -BlockDriverState *old_bs =NULL ; +MultiReqBuffer mrb = { + .num_writes =0 , + .old_bs =NULL ,
hw/virtio-blk.c static void virtio_blk_handle_read(VirtIOBlockReq · line 335
Quoted 10 lines
hw/virtio-blk.c +1
-7+ };while ((req =virtio_blk_get_request (s))) { - if (req->elem.out_num< 1 || req->elem.in_num< 1) { - fprintf(stderr, "virtio-blk missing headers\n"); - exit(1); - } - - if (req->elem.out_sg[0].iov_len< sizeof(*req->out) || - req->elem.in_sg[req->elem.in_num - 1].iov_len<
sizeof(*req->in)) {
hw/virtio-blk.c static void virtio_blk_handle_read(VirtIOBlockReq · line 336
Quoted 1 line
hw/virtio-blk.c +0
-1- fprintf(stderr, "virtio-blk header not in correct
element\n");
Quoted 20 lines
hw/virtio-blk.c +0
-19-exit (1 ); - } - - req->out = (void *)req->elem.out_sg[0 ].iov_base; - req->in = (void *)req->elem.in_sg[req->elem.in_num -1 ].iov_base; - -if (req->out->type&VIRTIO_BLK_T_FLUSH ) { -virtio_blk_handle_flush (req); - }else if (req->out->type&VIRTIO_BLK_T_SCSI_CMD ) { -virtio_blk_handle_scsi (req); - }else if (req->out->type&VIRTIO_BLK_T_OUT ) { -qemu_iovec_init_external (&req->qiov,&req->elem.out_sg[1 ], - req->elem.out_num -1 ); -virtio_blk_handle_write (blkreq,&num_writes, req,&old_bs); - }else { -qemu_iovec_init_external (&req->qiov,&req->elem.in_sg[0 ], - req->elem.in_num -1 ); -virtio_blk_handle_read (req); - }
hw/virtio-blk.c static void virtio_blk_handle_read(VirtIOBlockReq · line 376
Quoted 10 lines
hw/virtio-blk.c +3
-2+virtio_blk_handle_request (req,&mrb); } -if (num_writes>0 ) { -do_multiwrite (old_bs, blkreq, num_writes); +if (mrb.num_writes>0 ) { +do_multiwrite (mrb.old_bs, mrb.blkreq, mrb.num_writes); }/*
------------------------------
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
End of Qemu-devel Digest, Vol 82, Issue 324
*******************************************
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4818 (20100129) __________
The message was checked by ESET NOD32 Antivirus.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4818 (20100129) __________
The message was checked by ESET NOD32 Antivirus.
2010/1/30 Yasin Yenidünya <[email protected]>:
Quoted 5 lines
Hello,
I want to develop an linux os. Does anyone has a tutorial to build an operting system? Or if some one has the soruce code of linux that comes with qemu it is also enought for me..
You wanna develop from scratch? or extend the existing one like Linux kernel?
Anyway, maybe you'll find this URL interesting: www.kernelnewbies.org
Signature · 7 lines
regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com