Gleb Natapov | 5 Jan 2011 12:10
Picon
Favicon

Re: seabios: acpi: add _RMV control method for PCI devices

On Wed, Dec 08, 2010 at 03:08:59PM -0200, Marcelo Tosatti wrote:
> Use _RMV method to indicate whether device can be removed.
> 
> Data is retrieved from QEMU via I/O port 0xae0c.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti <at> redhat.com>
> 
Acked-by: Gleb Natapov <gleb <at> redhat.com>

> Index: seabios/src/acpi-dsdt.dsl
> ===================================================================
> --- seabios.orig/src/acpi-dsdt.dsl
> +++ seabios/src/acpi-dsdt.dsl
>  <at>  <at>  -122,6 +122,12  <at>  <at>  DefinitionBlock (
>                  B0EJ, 32,
>              }
>  
> +            OperationRegion(RMVC, SystemIO, 0xae0c, 0x04)
> +            Field(RMVC, DWordAcc, NoLock, WriteAsZeros)
> +            {
> +                PCRM, 32,
> +            }
> +
>  #define hotplug_slot(name, nr) \
>              Device (S##name) {                    \
>                 Name (_ADR, nr##0000)              \
>  <at>  <at>  -245,11 +251,14  <at>  <at>  DefinitionBlock (
>                   {
>                           Return (0x00)
>                   }
(Continue reading)

Gleb Natapov | 5 Jan 2011 16:18
Picon
Favicon

[PATCH] support T13 EDD3.0 spec

Some guests (such as Linux) expect BIOS to behave according to T13
EDD3.0 spec. T13 spec is much better then Phoenix since it provides
more information about interface and device paths. This patch adds
support for the spec. If guest provides buffer with enough space for
T13 EDD info return EDD according to T13 spec otherwise use Phoenix
one.

Signed-off-by: Gleb Natapov <gleb <at> redhat.com>
diff --git a/src/disk.c b/src/disk.c
index f7bfe9c..fb7833a 100644
--- a/src/disk.c
+++ b/src/disk.c
 <at>  <at>  -503,6 +503,7  <at>  <at>  static void
 disk_1348(struct bregs *regs, struct drive_s *drive_g)
 {
     u16 size = GET_INT13DPT(regs, size);
+    u16 t13 = size == 74;

     // Buffer is too small
     if (size < 26) {
 <at>  <at>  -553,8 +554,9  <at>  <at>  disk_1348(struct bregs *regs, struct drive_s *drive_g)
     // EDD 2.x

     int bdf;
-    u16 iobase1;
-    u64 device_path;
+    u16 iobase1 = 0;
+    u64 device_path = 0;
+    u8 channel = 0;
     SET_INT13DPT(regs, size, 30);
(Continue reading)

Gleb Natapov | 5 Jan 2011 16:19
Picon
Favicon

Re: [PATCH 0/9] Misc boot related cleanups

On Thu, Dec 30, 2010 at 07:02:34PM -0500, Kevin O'Connor wrote:
> On Thu, Dec 30, 2010 at 09:31:56PM +0200, Gleb Natapov wrote:
> > On Thu, Dec 30, 2010 at 01:56:28PM -0500, Kevin O'Connor wrote:
> > > Assuming each bridge takes 15 bytes to describe, one would need around
> > > 12 layers of bridges before this was an issue.  I don't think that's
> > > realistic.
> > > 
> > Each node consist of name <at> address. IIRC name can be max 32 bytes.
> > Address is unlimited but the longest address I can think of is 64bit
> > integer written in hex, this is 16 bites more. On a PC we have very
> > limited number of possible devices and none with such long names and
> > deep nesting, so probably this is not the big issue.
> 
> Well, it was pointless for my patch to store the pci path on the stack
> twice, so I redid that.  As you say, though, it's unlikely to be an
> issue - the size can always be increased if it does become an issue.
> 
Works in my testing. Are you going to commit it?

> -Kevin
> 
> 
> diff --git a/src/boot.c b/src/boot.c
> index e83dcdc..dd719f3 100644
> --- a/src/boot.c
> +++ b/src/boot.c
>  <at>  <at>  -13,6 +13,7  <at>  <at> 
>  #include "boot.h" // func defs
>  #include "cmos.h" // inb_cmos
>  #include "paravirt.h" // romfile_loadfile
(Continue reading)

Kevin O'Connor | 6 Jan 2011 03:20

Re: [PATCH 0/9] Misc boot related cleanups

On Wed, Jan 05, 2011 at 05:19:21PM +0200, Gleb Natapov wrote:
> On Thu, Dec 30, 2010 at 07:02:34PM -0500, Kevin O'Connor wrote:
> > Well, it was pointless for my patch to store the pci path on the stack
> > twice, so I redid that.  As you say, though, it's unlikely to be an
> > issue - the size can always be increased if it does become an issue.
> > 
> Works in my testing. Are you going to commit it?

I pushed my latest tree.

-Kevin
Kevin O'Connor | 6 Jan 2011 03:27

Re: seabios: acpi: add _RMV control method for PCI devices

On Wed, Jan 05, 2011 at 01:10:08PM +0200, Gleb Natapov wrote:
> On Wed, Dec 08, 2010 at 03:08:59PM -0200, Marcelo Tosatti wrote:
> > Use _RMV method to indicate whether device can be removed.
> > 
> > Data is retrieved from QEMU via I/O port 0xae0c.
> > 
> > Signed-off-by: Marcelo Tosatti <mtosatti <at> redhat.com>
> > 
> Acked-by: Gleb Natapov <gleb <at> redhat.com>

Thanks.  I committed this.

-Kevin
Kevin O'Connor | 6 Jan 2011 03:32

Re: [PATCH] support T13 EDD3.0 spec

On Wed, Jan 05, 2011 at 05:18:38PM +0200, Gleb Natapov wrote:
> Some guests (such as Linux) expect BIOS to behave according to T13
> EDD3.0 spec. T13 spec is much better then Phoenix since it provides
> more information about interface and device paths. This patch adds
> support for the spec. If guest provides buffer with enough space for
> T13 EDD info return EDD according to T13 spec otherwise use Phoenix
> one.

I think Sebastian has looked at this as well.

> Signed-off-by: Gleb Natapov <gleb <at> redhat.com>
> diff --git a/src/disk.c b/src/disk.c
> index f7bfe9c..fb7833a 100644
> --- a/src/disk.c
> +++ b/src/disk.c
>  <at>  <at>  -503,6 +503,7  <at>  <at>  static void
>  disk_1348(struct bregs *regs, struct drive_s *drive_g)
>  {
>      u16 size = GET_INT13DPT(regs, size);
> +    u16 t13 = size == 74;
>  
>      // Buffer is too small
>      if (size < 26) {
>  <at>  <at>  -553,8 +554,9  <at>  <at>  disk_1348(struct bregs *regs, struct drive_s *drive_g)
>      // EDD 2.x
>  
>      int bdf;
> -    u16 iobase1;
> -    u64 device_path;
> +    u16 iobase1 = 0;
(Continue reading)

Kevin O'Connor | 6 Jan 2011 03:41

PCI device path?

Hi Gleb,

Did you have any thoughts on how to build the PCI device path for the
bootprio_find_X functions?

I suppose we could keep an "int parentbus[256]" and fill it with info
on the parent info of every PCI bus.  Then the build_pci_path()
function could reconstruct the path of buses back to the root.

As I understand it there could be three types of PCI buses we could
run into - the root bus 0, a pci-to-pci bridge, or a non bus 0 root
bus.

-Kevin
Gleb Natapov | 6 Jan 2011 06:09
Picon
Favicon

Re: [PATCH] support T13 EDD3.0 spec

On Wed, Jan 05, 2011 at 09:32:33PM -0500, Kevin O'Connor wrote:
> On Wed, Jan 05, 2011 at 05:18:38PM +0200, Gleb Natapov wrote:
> > Some guests (such as Linux) expect BIOS to behave according to T13
> > EDD3.0 spec. T13 spec is much better then Phoenix since it provides
> > more information about interface and device paths. This patch adds
> > support for the spec. If guest provides buffer with enough space for
> > T13 EDD info return EDD according to T13 spec otherwise use Phoenix
> > one.
> 
> I think Sebastian has looked at this as well.
> 
Yes, I saw the thread. You suggested there to handle both specs
simultaneously and this is what I did here.

> > Signed-off-by: Gleb Natapov <gleb <at> redhat.com>
> > diff --git a/src/disk.c b/src/disk.c
> > index f7bfe9c..fb7833a 100644
> > --- a/src/disk.c
> > +++ b/src/disk.c
> >  <at>  <at>  -503,6 +503,7  <at>  <at>  static void
> >  disk_1348(struct bregs *regs, struct drive_s *drive_g)
> >  {
> >      u16 size = GET_INT13DPT(regs, size);
> > +    u16 t13 = size == 74;
> >  
> >      // Buffer is too small
> >      if (size < 26) {
> >  <at>  <at>  -553,8 +554,9  <at>  <at>  disk_1348(struct bregs *regs, struct drive_s *drive_g)
> >      // EDD 2.x
> >  
(Continue reading)

Gleb Natapov | 6 Jan 2011 11:01
Picon
Favicon

[PATCHv2] support T13 EDD3.0 spec

Some guests (such as Linux) expect BIOS to behave according to T13
EDD3.0 spec. T13 spec is much better then Phoenix since it provides
more information about interface and device paths. This patch adds
support for the spec. If guest provides buffer with enough space for
T13 EDD info return EDD according to T13 spec otherwise use Phoenix
one.

Signed-off-by: Gleb Natapov <gleb <at> redhat.com>
diff --git a/src/disk.c b/src/disk.c
index f7bfe9c..5ac69fd 100644
--- a/src/disk.c
+++ b/src/disk.c
 <at>  <at>  -503,6 +503,7  <at>  <at>  static void
 disk_1348(struct bregs *regs, struct drive_s *drive_g)
 {
     u16 size = GET_INT13DPT(regs, size);
+    u16 t13 = size == 74;

     // Buffer is too small
     if (size < 26) {
 <at>  <at>  -553,8 +554,9  <at>  <at>  disk_1348(struct bregs *regs, struct drive_s *drive_g)
     // EDD 2.x

     int bdf;
-    u16 iobase1;
-    u64 device_path;
+    u16 iobase1 = 0;
+    u64 device_path = 0;
+    u8 channel = 0;
     SET_INT13DPT(regs, size, 30);
(Continue reading)

Kevin O'Connor | 6 Jan 2011 14:41

Re: [PATCH] support T13 EDD3.0 spec

On Thu, Jan 06, 2011 at 07:09:27AM +0200, Gleb Natapov wrote:
> On Wed, Jan 05, 2011 at 09:32:33PM -0500, Kevin O'Connor wrote:
> > > -        SET_INT13DPT(regs, host_bus[3], 0);
> > > +        SET_INT13DPT(regs, host_bus[3], ' ');
> > 
> > What if we're not in t13 mode?  Should this be:
> >   u8 fillchar = t13 ? ' ' : 0;
> >   SET_INT13DPT(regs, host_bus[3], fillchar);
> > 
> Phoenix does not specify padding. Are you sure phoenix has to have zero
> padding?

I think RBIL documented 0s.  It may not be important.

-Kevin

Gmane