Glauber Costa | 1 Aug 2009 01:39
Picon
Favicon

Re: [PATCH] unbreak booting with virtio

On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
>
> On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
>
>> Since commit 89e671e3, extboot is broken due to wrong checksum
>>
>> The problem is that printf "\\$sum" syntax will require an octal
>> representation, so the fix I'm proposing is to convert it first.
>
> Is there no easy way to tell printf we're on decimal? I don't have a  
> Linux system handy atm, but I thought \90 was in fact a 90.
>
> Either way, my only complaint would be to introduce a dependency on bc.
Not that I'm aware of.
But would be happy to know, too.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

SourceForge.net | 1 Aug 2009 04:20
Picon
Favicon

[ kvm-Bugs-2823323 ] depmod reports loop in kvm.ko

Bugs item #2823323, was opened at 2009-07-17 21:33
Message generated for change (Comment added) made by sf-robot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2823323&group_id=180599

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Azimandius (azimandius)
Assigned to: Nobody/Anonymous (nobody)
Summary: depmod reports loop in kvm.ko 

Initial Comment:
I am using slackware64-current with 2.6.30.1 kernel.  I compiled this kernel to get the latest ath9k,
anyway depmod reports as follows: 

DEPMOD  2.6.30.1
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_msi_set_irq
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_mmu_pagetable_walk
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_mmu_set_dirty_bit
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_mmu_get_page
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_mmu_walker_error
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_ack_irq
WARNING: /lib/modules/2.6.30.1/extra/kvm.ko needs unknown symbol __tracepoint_kvm_apic_ipi
(Continue reading)

Ján ONDREJ (SAL | 1 Aug 2009 09:04
Picon
Favicon

Re: [PATCH] unbreak booting with virtio

On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
>
> On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
>
>> Since commit 89e671e3, extboot is broken due to wrong checksum
>>
>> The problem is that printf "\\$sum" syntax will require an octal
>> representation, so the fix I'm proposing is to convert it first.
>
> Is there no easy way to tell printf we're on decimal? I don't have a  
> Linux system handy atm, but I thought \90 was in fact a 90.
>
> Either way, my only complaint would be to introduce a dependency on bc.

>> cp "$1" "$2"
>> +sum=$(echo "obase=8; $sum" | bc)
>> printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/ 
>> dev/null

May be it's better to use awk:

echo $sum | awk '{ printf("%c", $1) }' \
  | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null

This version accepts decimal $sum, does not need conversion to octal.

			SAL
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Ján ONDREJ (SAL | 1 Aug 2009 10:01
Picon
Favicon

Re: [PATCH] unbreak booting with virtio

On Sat, Aug 01, 2009 at 09:04:55AM +0200, Ján ONDREJ (SAL) wrote:
> On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
> >
> > On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
> >
> >> cp "$1" "$2"
> >> +sum=$(echo "obase=8; $sum" | bc)
> >> printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/ 
> >> dev/null
> 
> May be it's better to use awk:
> 
> echo $sum | awk '{ printf("%c", $1) }' \
>   | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
> 
> This version accepts decimal $sum, does not need conversion to octal.

Ane may be it's better to write whole checksum in awk, it's faster and
cleaner. See attached patch (I am sorry, I don't know how to use git-email).

		SAL
diff --git a/pc-bios/optionrom/signrom.sh b/pc-bios/optionrom/signrom.sh
index 4273d1f..065b6a9 100755
--- a/pc-bios/optionrom/signrom.sh
+++ b/pc-bios/optionrom/signrom.sh
 <at>  <at>  -18,28 +18,31  <at>  <at> 
 #
 # Copyright Novell Inc, 2009
(Continue reading)

Alexander Graf | 1 Aug 2009 10:19
Picon

Re: [PATCH] unbreak booting with virtio


On 01.08.2009, at 10:01, Ján ONDREJ (SAL) wrote:

> On Sat, Aug 01, 2009 at 09:04:55AM +0200, Ján ONDREJ (SAL) wrote:
>> On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
>>>
>>> On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
>>>
>>>> cp "$1" "$2"
>>>> +sum=$(echo "obase=8; $sum" | bc)
>>>> printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc  
>>>> 2>/
>>>> dev/null
>>
>> May be it's better to use awk:
>>
>> echo $sum | awk '{ printf("%c", $1) }' \
>>  | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
>>
>> This version accepts decimal $sum, does not need conversion to octal.
>
> Ane may be it's better to write whole checksum in awk, it's faster and
> cleaner. See attached patch (I am sorry, I don't know how to use git- 
> email).

My awk magic is pretty bad, but I think this version is missing the  
padding, right?

Alex

(Continue reading)

Paolo Bonzini | 1 Aug 2009 10:20
Picon
Gravatar

Re: [PATCH] unbreak booting with virtio

On 07/31/2009 09:55 PM, Alexander Graf wrote:
>
> On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
>
>> Since commit 89e671e3, extboot is broken due to wrong checksum
>>
>> The problem is that printf "\\$sum" syntax will require an octal
>> representation, so the fix I'm proposing is to convert it first.
>
> Is there no easy way to tell printf we're on decimal? I don't have a
> Linux system handy atm, but I thought \90 was in fact a 90.
>
> Either way, my only complaint would be to introduce a dependency on bc.

printf `printf '\\%o' $sum`

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Alexander Graf | 1 Aug 2009 10:23
Picon

Re: [PATCH] unbreak booting with virtio


On 01.08.2009, at 01:39, Glauber Costa wrote:

> On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
>>
>> On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
>>
>>> Since commit 89e671e3, extboot is broken due to wrong checksum
>>>
>>> The problem is that printf "\\$sum" syntax will require an octal
>>> representation, so the fix I'm proposing is to convert it first.
>>
>> Is there no easy way to tell printf we're on decimal? I don't have a
>> Linux system handy atm, but I thought \90 was in fact a 90.
>>
>> Either way, my only complaint would be to introduce a dependency on  
>> bc.
> Not that I'm aware of.
> But would be happy to know, too.

Hum, reading the documentation again it in fact needs an octal number.
But we could use printf for the conversion as well!

$ printf "%o" 65
101

That wouldn't introduce a new dependency that might be missing on  
random OSs and looks rather clean to me.

Alex
(Continue reading)

Ján ONDREJ (SAL | 1 Aug 2009 10:47
Picon
Favicon

Re: [PATCH] unbreak booting with virtio

On Sat, Aug 01, 2009 at 10:19:20AM +0200, Alexander Graf wrote:
>
> On 01.08.2009, at 10:01, Ján ONDREJ (SAL) wrote:
>
>> On Sat, Aug 01, 2009 at 09:04:55AM +0200, Ján ONDREJ (SAL) wrote:
>>> On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote:
>>>>
>>>> On 31.07.2009, at 20:19, Glauber Costa <glommer <at> redhat.com> wrote:
>>>>
>>>>> cp "$1" "$2"
>>>>> +sum=$(echo "obase=8; $sum" | bc)
>>>>> printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 
>>>>> 2>/
>>>>> dev/null
>>>
>>> May be it's better to use awk:
>>>
>>> echo $sum | awk '{ printf("%c", $1) }' \
>>>  | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null
>>>
>>> This version accepts decimal $sum, does not need conversion to octal.
>>
>> Ane may be it's better to write whole checksum in awk, it's faster and
>> cleaner. See attached patch (I am sorry, I don't know how to use git- 
>> email).
>
> My awk magic is pretty bad, but I think this version is missing the  
> padding, right?

Right. If you prefer this version agains Paolos double printf, I can
(Continue reading)

Jiaqing Du | 1 Aug 2009 17:36
Picon
Gravatar

Re: NMI Injection to Guest

Hi Gleb,

Another problem on AMD processors.

After each vm-exit, I need to check if this vm-exit is due to NMI. For
vmx.c, I add the check in vmx_complete_interrupts().

The code snippet is:

3539         if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) ==
INTR_TYPE_NMI_INTR &&
3540             (exit_intr_info & INTR_INFO_VALID_MASK)) {
3541
3542                 printk(KERN_INFO "kvm-oprofile: vm exit due to NMI.\n");
3543
3544                 /* indicate vm-exit due to conter overflow */
3545                 vcpu->vm_exit_on_cntr_overflow = 1;
3546         }

This works on Intel chips.

I did the similar check in svm_complete_interrupts().

2501 static void svm_complete_interrupts(struct vcpu_svm *svm)
2502 {
2503         u8 vector;
2504         int type;
2505         u32 exitintinfo = svm->vmcb->control.exit_int_info;
2506         struct kvm_vcpu *vcpu = &svm->vcpu;
2507
(Continue reading)

Gleb Natapov | 2 Aug 2009 11:15
Picon
Favicon

Re: NMI Injection to Guest

On Sat, Aug 01, 2009 at 05:36:16PM +0200, Jiaqing Du wrote:
> Hi Gleb,
> 
> Another problem on AMD processors.
> 
> After each vm-exit, I need to check if this vm-exit is due to NMI. For
> vmx.c, I add the check in vmx_complete_interrupts().
> 
> The code snippet is:
> 
> 3539         if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) ==
> INTR_TYPE_NMI_INTR &&
> 3540             (exit_intr_info & INTR_INFO_VALID_MASK)) {
> 3541
> 3542                 printk(KERN_INFO "kvm-oprofile: vm exit due to NMI.\n");
> 3543
> 3544                 /* indicate vm-exit due to conter overflow */
> 3545                 vcpu->vm_exit_on_cntr_overflow = 1;
> 3546         }
> 
> This works on Intel chips.
> 
> I did the similar check in svm_complete_interrupts().
> 
> 2501 static void svm_complete_interrupts(struct vcpu_svm *svm)
> 2502 {
> 2503         u8 vector;
> 2504         int type;
> 2505         u32 exitintinfo = svm->vmcb->control.exit_int_info;
> 2506         struct kvm_vcpu *vcpu = &svm->vcpu;
(Continue reading)


Gmane