Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

kernel: Enable ptp_kvm for 5.4 kernel on arm64.#998

Merged
devimc merged 1 commit into
kata-containers:masterfrom
jongwu:ptp
Apr 20, 2020
Merged

kernel: Enable ptp_kvm for 5.4 kernel on arm64.#998
devimc merged 1 commit into
kata-containers:masterfrom
jongwu:ptp

Conversation

@jongwu
Copy link
Copy Markdown
Contributor

@jongwu jongwu commented Apr 3, 2020

The enablement of ptp_kvm for arm is under review, see [1].
So we have to apply private patch to enable it in 5.4 kernel.
ptp_kvm can offer the capability of time sync in kata even there
is no network available and higher precision than time sync
service depend on network.

note:
If you want to use this feature on your arm machine, the host kernel
also need apply this patch. we recommend that your host kernel version
is the 5.4, then you can apply this patch smoothly.

[1] https://patchwork.kernel.org/cover/11372743/

Fixes: #997
Signed-off-by: Jianyong Wu jianyong.wu@arm.com

@devimc @grahamwhaley @Pennyzct

@jodh-intel
Copy link
Copy Markdown

/test

@devimc
Copy link
Copy Markdown

devimc commented Apr 3, 2020

@jongwu couldn't not apply a patch

linux-5.4.15.tar.xz: OK
INFO: Applying patch /tmp/jenkins/workspace/kata-containers-packaging-ubuntu-18-04-snap-PR/go/src/github.com/kata-containers/packaging/kernel/patches//5.4.x/0001-arm-arm64-Provide-a-wrapper-for-SMCCC-1.1-calls.patch
patching file include/linux/arm-smccc.h
INFO: Applying patch /tmp/jenkins/workspace/kata-containers-packaging-ubuntu-18-04-snap-PR/go/src/github.com/kata-containers/packaging/kernel/patches//5.4.x/0003-ptp-arm64-Enable-ptp_kvm-for-arm64.patch
patching file drivers/clocksource/arm_arch_timer.c
patching file drivers/firmware/psci/psci.c
Hunk #1 FAILED at 71.
1 out of 1 hunk FAILED -- saving rejects to file drivers/firmware/psci/psci.c.rej

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 8, 2020

@devimc it's strange as it works in my machine.

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 8, 2020

@devimc I think that the order of patch applied cause that error, the patch should apply in order of 0001,0002,0003, if 0003 applied before 0002, error will occur.
So, should I squash patch serial to avoid that problem? @jodh-intel @devimc

@jodh-intel
Copy link
Copy Markdown

@jongwu, @devimc - I found the problem: #1005.

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 8, 2020

thanks @jodh-intel

@jodh-intel
Copy link
Copy Markdown

Now that #1005 has landed, let's re-run the CI...

/retest

@jongwu jongwu force-pushed the ptp branch 2 times, most recently from 0157524 to ea39591 Compare April 9, 2020 09:06
@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 9, 2020

thanks @jodh-intel , need retest as I just bump config version.

@jodh-intel
Copy link
Copy Markdown

/retest

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 10, 2020

@jodh-intel can you help retest it? thanks

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 13, 2020

hi @jodh-intel @devimc , help retest, thanks!

@devimc
Copy link
Copy Markdown

devimc commented Apr 13, 2020

/test

@devimc
Copy link
Copy Markdown

devimc commented Apr 13, 2020

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Copy Markdown

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jongwu

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 15, 2020

hi @devimc @jodh-intel , help retest obs ci to see if that's a random error, thanks.

@Pennyzct
Copy link
Copy Markdown
Contributor

/test

@grahamwhaley
Copy link
Copy Markdown
Contributor

Here is the log. I'll try to kick a rebuild...

Project home:katacontainers:ci:x86_64:packaging-PR-998 has failed packages
 kata-containers-image
 | ksm-throttler
 | | linux-container
 | | | proxy
 | | | | qemu-vanilla
 | | | | | runtime
 | | | | | | shim
 % s s s s s s  CentOS_7 x86_64 (building)
 % s s s s s s  Debian_10 x86_64 (building)
 s s % s s s s  Debian_9 x86_64 (building)
 s s % s s s s  Fedora_30 x86_64 (building)
 % s s s s s s  SLE_15_SP1 x86_64 (building)
 s s % s s s s  openSUSE_Leap_15.1 x86_64 (building)
 % s f s s s s  openSUSE_Tumbleweed x86_64 (outdated)
 % s % s s s s  xUbuntu_16.04 x86_64 (building)
 f s % s s s s  xUbuntu_18.04 x86_64 (building)

 Legend:
  . succeeded           
    disabled            
  U unresolvable        
  F failed              
  B broken              
  b blocked             
  % building            
  f finished            
  s scheduled           
  L locked              
  x excluded            
  d dispatching         

@grahamwhaley
Copy link
Copy Markdown
Contributor

/test

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 15, 2020

oh, building for linux-container all failed, is there any detail info to see why that happen? @grahamwhaley

@grahamwhaley
Copy link
Copy Markdown
Contributor

I can't see anything on the Action/azure page - I think it will come down to some OBS stuff - we need to ask @jcvenegas for help I think.
It could be spurious, but let's check this failure first before we try a rebuild.

I'm also not sure why the ubuntu builds don't seem to be triggering....

@devimc
Copy link
Copy Markdown

devimc commented Apr 15, 2020

@jongwu

https://build.opensuse.org/package/show/home:katacontainers:ci:x86_64:packaging-PR-998/linux-container

[  119s] + echo 'Patch #1 (0001-arm-arm64-Provide-a-wrapper-for-SMCCC-1.1-calls.patch):'
[  119s] Patch #1 (0001-arm-arm64-Provide-a-wrapper-for-SMCCC-1.1-calls.patch):
[  119s] + /usr/bin/cat /home/abuild/rpmbuild/SOURCES/0001-arm-arm64-Provide-a-wrapper-for-SMCCC-1.1-calls.patch
[  119s] + /usr/bin/patch -p1 --fuzz=0
[  119s] patching file include/linux/arm-smccc.h
[  119s] + echo 'Patch #2 (0003-ptp-arm64-Enable-ptp_kvm-for-arm64.patch):'
[  119s] Patch #2 (0003-ptp-arm64-Enable-ptp_kvm-for-arm64.patch):
[  119s] + /usr/bin/cat /home/abuild/rpmbuild/SOURCES/0003-ptp-arm64-Enable-ptp_kvm-for-arm64.patch
[  119s] + /usr/bin/patch -p1 --fuzz=0
[  119s] patching file drivers/clocksource/arm_arch_timer.c
[  119s] patching file drivers/firmware/psci/psci.c
[  119s] Hunk #1 FAILED at 71.
[  119s] 1 out of 1 hunk FAILED -- saving rejects to file drivers/firmware/psci/psci.c.rej
[  119s] patching file drivers/ptp/Kconfig
[  119s] patching file drivers/ptp/Makefile
[  119s] patching file drivers/ptp/ptp_kvm.h
[  119s] patching file drivers/ptp/ptp_kvm_arm64.c
[  119s] patching file drivers/ptp/ptp_kvm_common.c (renamed from drivers/ptp/ptp_kvm.c)
[  119s] patching file drivers/ptp/ptp_kvm_x86.c
[  119s] patching file include/linux/arm-smccc.h
[  119s] patching file include/linux/clocksource.h
[  119s] patching file include/linux/clocksource_ids.h
[  119s] patching file include/linux/timekeeping.h
[  119s] patching file include/uapi/linux/kvm.h
[  119s] patching file kernel/time/clocksource.c
[  119s] patching file kernel/time/timekeeping.c
[  119s] patching file virt/kvm/arm/arm.c
[  119s] patching file virt/kvm/arm/psci.c
[  119s] error: Bad exit status from /var/tmp/rpm-tmp.UvOSAI (%prep)

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 16, 2020

@devimc @grahamwhaley this patch set should be applied in order. how to avoid that failure, should I squeezing these patch set?

@jodh-intel
Copy link
Copy Markdown

This PR is effectively blocked on #1016.

@devimc
Copy link
Copy Markdown

devimc commented Apr 17, 2020

@jongwu this PR may need a rebase 😄

The enablement of ptp_kvm for arm is under review, see [1].
So we have to apply private patch to enable it in 5.4 kernel.
ptp_kvm can offer the capability of time sync in kata even there
is no network available and higher precision than time sync
service depend on network.

note:
If you want to use this feature on your arm machine, the host kernel
also need apply this patch. we recommend that your host kernel version
is the 5.4, then you can apply this patch smoothly.

[1] https://patchwork.kernel.org/cover/11372743/

Fixes: kata-containers#997
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 17, 2020

thanks @devimc

@devimc
Copy link
Copy Markdown

devimc commented Apr 17, 2020

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@jongwu
Copy link
Copy Markdown
Contributor Author

jongwu commented Apr 20, 2020

hi @devimc @jodh-intel, help trigger snap ci, thanks!

@jodh-intel
Copy link
Copy Markdown

/test-ubuntu

@devimc
Copy link
Copy Markdown

devimc commented Apr 20, 2020

/test-snap

@devimc devimc merged commit fc8c3a0 into kata-containers:master Apr 20, 2020
Pennyzct added a commit to Pennyzct/packaging that referenced this pull request Apr 21, 2020
kvm-ptp is critical for mitigating time drift between host and guest.
This implementation in kernel side is still one experimental feature on
aarch64, and see kata-containers#998
for detailed instructions.

Fixes: kata-containers#1004

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Pennyzct added a commit to Pennyzct/packaging that referenced this pull request Apr 21, 2020
kvm-ptp is critical for mitigating time drift between host and guest.
This implementation in kernel side is still one experimental feature on
aarch64, and see kata-containers#998
for detailed instructions.

Fixes: kata-containers#1004

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ptp_kvm enablement for arm64

5 participants